From c76403077fcfdab58714f987d06c2cd583f42834 Mon Sep 17 00:00:00 2001 From: Stephan Date: Thu, 20 Jul 2017 11:21:28 +0200 Subject: [PATCH] Normalize cr/lf/tab --- src/SolutionInfo.cs | 2 +- .../Core/ApplicationContext.cs | 2 +- .../Core/ApplicationEventHandler.cs | 2 +- .../Core/Cache/CacheRefreshersResolver.cs | 2 +- .../Core/IApplicationEventHandler.cs | 8 +- src/Umbraco.Compat7/Core/Logging/LogHelper.cs | 2 +- .../ManyObjectsResolverBase.cs | 2 +- .../PropertyValueConvertersResolver.cs | 2 +- .../Strings/UrlSegmentProviderResolver.cs | 4 +- .../Properties/AssemblyInfo.cs | 6 +- .../Web/HealthCheck/HealthCheckResolver.cs | 2 +- src/Umbraco.Compat7/Web/Models/RenderModel.cs | 2 +- .../FilteredControllerFactoriesResolver.cs | 2 +- .../Web/Mvc/UmbracoTemplatePage.cs | 2 +- .../Web/Routing/ContentFinderResolver.cs | 2 +- .../Web/Routing/UrlProviderResolver.cs | 2 +- src/Umbraco.Core/ActivatorHelper.cs | 34 +- src/Umbraco.Core/ActivatorServiceProvider.cs | 4 +- src/Umbraco.Core/AssemblyExtensions.cs | 64 +- src/Umbraco.Core/AsyncLock.cs | 12 +- src/Umbraco.Core/Attempt.cs | 4 +- src/Umbraco.Core/AttemptOfTResult.cs | 10 +- src/Umbraco.Core/BindingRedirects.cs | 12 +- src/Umbraco.Core/Cache/CacheHelper.cs | 132 +-- src/Umbraco.Core/Cache/CacheKeys.cs | 6 +- .../Cache/CacheProviderExtensions.cs | 2 +- src/Umbraco.Core/Cache/CacheRefresherBase.cs | 2 +- .../Cache/CacheRefresherEventArgs.cs | 2 +- .../Cache/DeepCloneRuntimeCacheProvider.cs | 12 +- .../Cache/DefaultRepositoryCachePolicy.cs | 4 +- .../Cache/DictionaryCacheProviderBase.cs | 2 +- .../Cache/FullDataSetRepositoryCachePolicy.cs | 4 +- .../Cache/HttpRequestCacheProvider.cs | 6 +- .../Cache/HttpRuntimeCacheProvider.cs | 4 +- src/Umbraco.Core/Cache/ICacheProvider.cs | 2 +- src/Umbraco.Core/Cache/ICacheRefresher.cs | 6 +- src/Umbraco.Core/Cache/IJsonCacheRefresher.cs | 2 +- .../Cache/IRepositoryCachePolicy.cs | 2 +- .../Cache/IRuntimeCacheProvider.cs | 4 +- .../Cache/IsolatedRuntimeCache.cs | 10 +- .../Cache/JsonCacheRefresherBase.cs | 4 +- src/Umbraco.Core/Cache/NullCacheProvider.cs | 2 +- .../Cache/ObjectCacheRuntimeCacheProvider.cs | 2 +- .../Cache/RepositoryCachePolicyBase.cs | 4 +- .../Cache/RepositoryCachePolicyOptions.cs | 8 +- .../SingleItemsOnlyRepositoryCachePolicy.cs | 4 +- src/Umbraco.Core/Cache/StaticCacheProvider.cs | 8 +- .../Cache/TypedCacheRefresherBase.cs | 2 +- .../CodeAnnotations/FriendlyNameAttribute.cs | 2 +- .../UmbracoExperimentalFeatureAttribute.cs | 60 +- .../UmbracoObjectTypeAttribute.cs | 2 +- .../UmbracoProposedPublicAttribute.cs | 62 +- .../UmbracoUdiTypeAttribute.cs | 4 +- .../UmbracoWillObsoleteAttribute.cs | 54 +- .../Collections/ConcurrentHashSet.cs | 8 +- .../Collections/DeepCloneableList.cs | 4 +- .../Collections/ListCloneBehavior.cs | 4 +- .../Collections/ObservableDictionary.cs | 4 +- src/Umbraco.Core/Components/Composition.cs | 2 +- .../Components/CompositionExtensions.cs | 2 +- .../Components/RequireComponentAttribute.cs | 6 +- .../Components/RequiredComponentAttribute.cs | 8 +- .../Composing/BuilderCollectionBase.cs | 4 +- .../Composing/CollectionBuilderBase.cs | 4 +- .../ConfigurationCompositionRoot.cs | 4 +- .../CoreMappingProfilesCompositionRoot.cs | 4 +- .../RepositoryCompositionRoot.cs | 4 +- .../ServicesCompositionRoot.cs | 4 +- .../Composing/HideFromTypeFinderAttribute.cs | 4 +- .../Composing/ICollectionBuilder.cs | 4 +- .../Composing/LazyCollectionBuilderBase.cs | 2 +- src/Umbraco.Core/Composing/TypeFinder.cs | 6 +- src/Umbraco.Core/Composing/TypeHelper.cs | 324 +++--- src/Umbraco.Core/Composing/TypeLoader.cs | 16 +- .../Composing/TypeLoaderExtensions.cs | 4 +- src/Umbraco.Core/Composing/WeightAttribute.cs | 2 +- .../WeightedCollectionBuilderBase.cs | 4 +- .../ClientDependencyConfiguration.cs | 2 +- .../CommaDelimitedConfigurationElement.cs | 8 +- .../Configuration/ContentXmlStorage.cs | 4 +- .../Configuration/Dashboard/AccessElement.cs | 4 +- .../Configuration/Dashboard/AccessItem.cs | 4 +- .../Configuration/Dashboard/AccessType.cs | 2 +- .../Configuration/Dashboard/AreaCollection.cs | 2 +- .../Configuration/Dashboard/AreaElement.cs | 2 +- .../Configuration/Dashboard/AreasElement.cs | 2 +- .../Dashboard/ControlCollection.cs | 2 +- .../Configuration/Dashboard/ControlElement.cs | 8 +- .../Configuration/Dashboard/IAccess.cs | 2 +- .../Configuration/Dashboard/IAccessItem.cs | 2 +- .../Configuration/Dashboard/IArea.cs | 2 +- .../Dashboard/IDashboardControl.cs | 2 +- .../Dashboard/IDashboardSection.cs | 2 +- .../Configuration/Dashboard/IDashboardTab.cs | 2 +- .../Configuration/Dashboard/ISection.cs | 2 +- .../Dashboard/SectionCollection.cs | 2 +- .../Configuration/Dashboard/SectionElement.cs | 6 +- .../Configuration/Dashboard/TabCollection.cs | 2 +- .../Configuration/Dashboard/TabElement.cs | 8 +- .../FileSystemProviderElementCollection.cs | 2 +- .../Configuration/GlobalSettings.cs | 14 +- .../Configuration/Grid/GridConfig.cs | 4 +- .../Configuration/Grid/GridEditorsConfig.cs | 8 +- .../Configuration/Grid/IGridEditorConfig.cs | 2 +- .../Configuration/Grid/IGridEditorsConfig.cs | 2 +- .../InnerTextConfigurationElement.cs | 4 +- ...ionalCommaDelimitedConfigurationElement.cs | 6 +- .../OptionalInnerTextConfigurationElement.cs | 4 +- .../RawXmlConfigurationElement.cs | 6 +- .../Configuration/UmbracoConfig.cs | 10 +- .../UmbracoConfigurationSection.cs | 2 +- .../AppCodeFileExtensionsCollection.cs | 2 +- .../AppCodeFileExtensionsElement.cs | 2 +- .../UmbracoSettings/CharCollection.cs | 2 +- .../UmbracoSettings/CharElement.cs | 6 +- .../UmbracoSettings/ContentElement.cs | 14 +- .../ContentError404Collection.cs | 2 +- .../ContentErrorPageElement.cs | 4 +- .../UmbracoSettings/ContentErrorsElement.cs | 8 +- .../UmbracoSettings/ContentImagingElement.cs | 6 +- .../ContentScriptEditorElement.cs | 2 +- .../ContentSectionExtensions.cs | 2 +- .../UmbracoSettings/DeveloperElement.cs | 2 +- .../DisabledLogTypesCollection.cs | 2 +- .../UmbracoSettings/DistributedCallElement.cs | 2 +- .../UmbracoSettings/ExternalLoggerElement.cs | 2 +- .../UmbracoSettings/FileExtensionElement.cs | 4 +- .../Configuration/UmbracoSettings/IChar.cs | 2 +- .../UmbracoSettings/IContentErrorPage.cs | 2 +- .../UmbracoSettings/IContentSection.cs | 2 +- .../UmbracoSettings/IDeveloperSection.cs | 2 +- .../IDistributedCallSection.cs | 2 +- .../UmbracoSettings/IFileExtension.cs | 2 +- .../IImagingAutoFillUploadField.cs | 2 +- .../Configuration/UmbracoSettings/ILink.cs | 2 +- .../Configuration/UmbracoSettings/ILogType.cs | 2 +- .../UmbracoSettings/ILoggingSection.cs | 4 +- .../UmbracoSettings/IProvidersSection.cs | 4 +- .../UmbracoSettings/IRepositoriesSection.cs | 2 +- .../UmbracoSettings/IRepository.cs | 4 +- .../UmbracoSettings/IRequestHandlerSection.cs | 2 +- .../UmbracoSettings/IScheduledTask.cs | 2 +- .../UmbracoSettings/IScheduledTasksSection.cs | 2 +- .../UmbracoSettings/ISecuritySection.cs | 2 +- .../Configuration/UmbracoSettings/IServer.cs | 2 +- .../UmbracoSettings/ITemplatesSection.cs | 2 +- .../IUmbracoSettingsSection.cs | 4 +- .../UmbracoSettings/IWebRoutingSection.cs | 4 +- .../ImagingAutoFillPropertiesCollection.cs | 4 +- .../ImagingAutoFillUploadFieldElement.cs | 4 +- .../UmbracoSettings/LogTypeElement.cs | 2 +- .../UmbracoSettings/LoggingElement.cs | 8 +- .../UmbracoSettings/NotificationsElement.cs | 2 +- .../UmbracoSettings/ProvidersElement.cs | 2 +- .../UmbracoSettings/RepositoriesCollection.cs | 2 +- .../UmbracoSettings/RepositoriesElement.cs | 2 +- .../RepositoryConfigExtensions.cs | 4 +- .../UmbracoSettings/RepositoryElement.cs | 6 +- .../UmbracoSettings/RequestHandlerElement.cs | 8 +- .../UmbracoSettings/ScheduledTaskElement.cs | 2 +- .../ScheduledTasksCollection.cs | 2 +- .../UmbracoSettings/ScheduledTasksElement.cs | 2 +- .../UmbracoSettings/SecurityElement.cs | 2 +- .../UmbracoSettings/ServerCollection.cs | 2 +- .../UmbracoSettings/ServerElement.cs | 4 +- .../UmbracoSettings/TemplatesElement.cs | 2 +- .../UmbracoConfigurationElement.cs | 4 +- .../UmbracoSettings/UmbracoSettingsSection.cs | 4 +- .../UmbracoSettings/UrlReplacingElement.cs | 4 +- .../UmbracoSettings/UserProviderElement.cs | 4 +- .../UmbracoSettings/WebRoutingElement.cs | 2 +- .../Configuration/UmbracoVersion.cs | 2 +- src/Umbraco.Core/Constants-Applications.cs | 88 +- src/Umbraco.Core/Constants-Conventions.cs | 410 ++++---- src/Umbraco.Core/Constants-DataTypes.cs | 2 +- .../Constants-DatabaseProviders.cs | 2 +- src/Umbraco.Core/Constants-DeploySelector.cs | 4 +- src/Umbraco.Core/Constants-Icons.cs | 2 +- src/Umbraco.Core/Constants-ObjectTypes.cs | 2 +- src/Umbraco.Core/Constants-Packaging.cs | 2 +- src/Umbraco.Core/Constants-PropertyEditors.cs | 6 +- .../Constants-PropertyTypeGroups.cs | 2 +- src/Umbraco.Core/Constants-Security.cs | 4 +- src/Umbraco.Core/Constants-System.cs | 4 +- src/Umbraco.Core/Constants-Web.cs | 8 +- src/Umbraco.Core/Constants.cs | 14 +- .../CustomBooleanTypeConverter.cs | 52 +- src/Umbraco.Core/DataTableExtensions.cs | 198 ++-- src/Umbraco.Core/DatabaseBuilder.cs | 2 +- src/Umbraco.Core/DecimalExtensions.cs | 2 +- src/Umbraco.Core/DelegateEqualityComparer.cs | 4 +- src/Umbraco.Core/DelegateExtensions.cs | 4 +- src/Umbraco.Core/Deploy/ArtifactBase.cs | 4 +- src/Umbraco.Core/Deploy/ArtifactDependency.cs | 4 +- .../Deploy/ArtifactDependencyCollection.cs | 4 +- .../Deploy/ArtifactDependencyMode.cs | 4 +- .../Deploy/ArtifactDeployState.cs | 4 +- .../ArtifactDeployStateOfTArtifactTEntity.cs | 2 +- src/Umbraco.Core/Deploy/ArtifactSignature.cs | 4 +- src/Umbraco.Core/Deploy/Difference.cs | 4 +- src/Umbraco.Core/Deploy/Direction.cs | 4 +- src/Umbraco.Core/Deploy/IArtifact.cs | 4 +- src/Umbraco.Core/Deploy/IArtifactSignature.cs | 4 +- src/Umbraco.Core/Deploy/IDeployContext.cs | 4 +- src/Umbraco.Core/Deploy/IFileSource.cs | 2 +- .../Deploy/IGridCellValueConnector.cs | 4 +- src/Umbraco.Core/Deploy/IImageSourceParser.cs | 4 +- src/Umbraco.Core/Deploy/ILocalLinkParser.cs | 4 +- src/Umbraco.Core/Deploy/IMacroParser.cs | 4 +- src/Umbraco.Core/Deploy/IPreValueConnector.cs | 4 +- src/Umbraco.Core/Deploy/IValueConnector.cs | 4 +- .../Dictionary/ICultureDictionary.cs | 38 +- .../Dictionary/ICultureDictionaryFactory.cs | 12 +- src/Umbraco.Core/DictionaryExtensions.cs | 368 +++---- src/Umbraco.Core/DisposableObject.cs | 68 +- src/Umbraco.Core/DisposableTimer.cs | 66 +- src/Umbraco.Core/Enum.cs | 166 +-- .../Events/CancellableEventArgs.cs | 130 +-- .../Events/CancellableObjectEventArgs.cs | 4 +- .../Events/ContentCacheEventArgs.cs | 6 +- src/Umbraco.Core/Events/CopyEventArgs.cs | 4 +- .../Events/DatabaseCreationEventArgs.cs | 4 +- src/Umbraco.Core/Events/DeleteEventArgs.cs | 268 ++--- .../Events/DeleteRevisionsEventArgs.cs | 124 +-- src/Umbraco.Core/Events/EventDefinition.cs | 6 +- .../Events/EventDefinitionBase.cs | 6 +- .../Events/EventDefinitionFilter.cs | 2 +- src/Umbraco.Core/Events/EventExtensions.cs | 22 +- src/Umbraco.Core/Events/EventMessage.cs | 6 +- src/Umbraco.Core/Events/EventMessageType.cs | 6 +- src/Umbraco.Core/Events/EventMessages.cs | 4 +- src/Umbraco.Core/Events/EventNameExtractor.cs | 16 +- .../Events/EventNameExtractorError.cs | 4 +- .../Events/EventNameExtractorResult.cs | 4 +- src/Umbraco.Core/Events/ExportEventArgs.cs | 4 +- .../Events/IDeletingMediaFilesEventArgs.cs | 4 +- src/Umbraco.Core/Events/IEventDefinition.cs | 2 +- src/Umbraco.Core/Events/IEventDispatcher.cs | 2 +- .../Events/IEventMessagesFactory.cs | 4 +- src/Umbraco.Core/Events/ImportEventArgs.cs | 2 +- .../Events/ImportPackageEventArgs.cs | 8 +- src/Umbraco.Core/Events/MigrationEventArgs.cs | 20 +- src/Umbraco.Core/Events/MoveEventArgs.cs | 4 +- src/Umbraco.Core/Events/MoveEventInfo.cs | 4 +- src/Umbraco.Core/Events/NewEventArgs.cs | 124 +-- .../Events/PassThroughEventDispatcher.cs | 4 +- src/Umbraco.Core/Events/PublishEventArgs.cs | 40 +- .../Events/QueuingEventDispatcher.cs | 4 +- .../Events/QueuingEventDispatcherBase.cs | 4 +- .../Events/RecycleBinEventArgs.cs | 8 +- .../Events/RefreshContentEventArgs.cs | 6 +- src/Umbraco.Core/Events/RollbackEventArgs.cs | 36 +- src/Umbraco.Core/Events/SaveEventArgs.cs | 126 +-- .../Events/SendToPublishEventArgs.cs | 36 +- .../Events/SupersedeEventAttribute.cs | 6 +- .../Events/TransientEventMessagesFactory.cs | 4 +- src/Umbraco.Core/Events/TypedEventHandler.cs | 8 +- .../Events/UninstallPackageEventArgs.cs | 2 +- .../Exceptions/BootFailedException.cs | 2 +- .../Exceptions/ConnectionException.cs | 6 +- .../Exceptions/DataOperationException.cs | 2 +- .../Exceptions/InvalidCompositionException.cs | 2 +- src/Umbraco.Core/ExpressionExtensions.cs | 42 +- src/Umbraco.Core/ExpressionHelper.cs | 532 +++++----- .../FileResources/Files.Designer.cs | 18 +- src/Umbraco.Core/GuidUdi.cs | 4 +- src/Umbraco.Core/HashCodeCombiner.cs | 144 +-- src/Umbraco.Core/HashCodeHelper.cs | 6 +- src/Umbraco.Core/HttpContextExtensions.cs | 2 +- src/Umbraco.Core/IO/FileSecurityException.cs | 4 +- .../IO/FileSystemProviderAttribute.cs | 2 +- src/Umbraco.Core/IO/FileSystemWrapper.cs | 184 ++-- src/Umbraco.Core/IO/FileSystems.cs | 12 +- src/Umbraco.Core/IO/IOHelper.cs | 74 +- src/Umbraco.Core/IO/MasterPageHelper.cs | 18 +- src/Umbraco.Core/IO/MediaFileSystem.cs | 104 +- src/Umbraco.Core/IO/PhysicalFileSystem.cs | 8 +- src/Umbraco.Core/IO/ShadowWrapper.cs | 2 +- src/Umbraco.Core/IO/SystemDirectories.cs | 48 +- src/Umbraco.Core/IO/SystemFiles.cs | 2 +- src/Umbraco.Core/IO/ViewHelper.cs | 10 +- src/Umbraco.Core/IRuntime.cs | 18 +- src/Umbraco.Core/IRuntimeState.cs | 4 +- src/Umbraco.Core/IntExtensions.cs | 34 +- src/Umbraco.Core/LambdaExpressionCacheKey.cs | 138 +-- .../Logging/AsyncForwardingAppenderBase.cs | 4 +- .../AsynchronousRollingFileAppender.cs | 16 +- .../Logging/DebugDiagnosticsLogger.cs | 4 +- src/Umbraco.Core/Logging/ILogger.cs | 4 +- src/Umbraco.Core/Logging/IProfiler.cs | 4 +- src/Umbraco.Core/Logging/IQueue.cs | 4 +- .../Logging/ImageProcessorLogger.cs | 4 +- src/Umbraco.Core/Logging/LogProfiler.cs | 2 +- src/Umbraco.Core/Logging/Logger.cs | 92 +- src/Umbraco.Core/Logging/LoggerExtensions.cs | 4 +- .../Logging/LoggingEventContext.cs | 4 +- .../Logging/LoggingEventHelper.cs | 4 +- .../Logging/LoggingTaskExtension.cs | 76 +- src/Umbraco.Core/Logging/OwinLogger.cs | 4 +- .../Logging/ParallelForwardingAppender.cs | 4 +- .../Logging/ProfilerExtensions.cs | 2 +- src/Umbraco.Core/Logging/ProfilingLogger.cs | 4 +- src/Umbraco.Core/Logging/RingBuffer.cs | 4 +- src/Umbraco.Core/Logging/WebProfiler.cs | 2 +- .../Logging/WebProfilerComponent.cs | 4 +- src/Umbraco.Core/Macros/MacroTagParser.cs | 200 ++-- src/Umbraco.Core/Macros/XsltExtension.cs | 2 +- .../Macros/XsltExtensionAttribute.cs | 2 +- .../Macros/XsltExtensionCollection.cs | 2 +- .../Macros/XsltExtensionCollectionBuilder.cs | 2 +- .../Manifest/GridEditorConverter.cs | 4 +- src/Umbraco.Core/Manifest/ManifestBuilder.cs | 10 +- src/Umbraco.Core/Manifest/ManifestParser.cs | 20 +- .../Manifest/ManifestValidatorConverter.cs | 2 +- src/Umbraco.Core/Manifest/ManifestWatcher.cs | 6 +- src/Umbraco.Core/Manifest/PackageManifest.cs | 2 +- .../Manifest/ParameterEditorConverter.cs | 2 +- .../Manifest/PreValueFieldConverter.cs | 2 +- .../Manifest/PropertyEditorConverter.cs | 8 +- src/Umbraco.Core/Media/Exif/BitConverterEx.cs | 2 +- .../Media/Exif/ExifBitConverter.cs | 14 +- src/Umbraco.Core/Media/Exif/ExifExceptions.cs | 4 +- .../Media/Exif/ExifExtendedProperty.cs | 10 +- src/Umbraco.Core/Media/Exif/ExifProperty.cs | 16 +- .../Media/Exif/ExifPropertyCollection.cs | 732 ++++++------- .../Media/Exif/ExifPropertyFactory.cs | 2 +- src/Umbraco.Core/Media/Exif/ExifTag.cs | 2 +- src/Umbraco.Core/Media/Exif/ExifTagFactory.cs | 2 +- src/Umbraco.Core/Media/Exif/ImageFile.cs | 196 ++-- .../Media/Exif/JFIFExtendedProperty.cs | 4 +- src/Umbraco.Core/Media/Exif/JPEGFile.cs | 6 +- src/Umbraco.Core/Media/Exif/JPEGSection.cs | 2 +- src/Umbraco.Core/Media/Exif/MathEx.cs | 44 +- src/Umbraco.Core/Media/Exif/TIFFHeader.cs | 4 +- src/Umbraco.Core/Media/IEmbedProvider.cs | 2 +- .../Media/IEmbedSettingProvider.cs | 4 +- src/Umbraco.Core/Media/IImageUrlProvider.cs | 2 +- src/Umbraco.Core/Media/IThumbnailProvider.cs | 2 +- src/Umbraco.Core/Media/ProviderSetting.cs | 2 +- src/Umbraco.Core/Media/Result.cs | 2 +- src/Umbraco.Core/Media/Status.cs | 2 +- src/Umbraco.Core/Models/ApplicationTree.cs | 2 +- src/Umbraco.Core/Models/AuditItem.cs | 2 +- src/Umbraco.Core/Models/AuditType.cs | 2 +- src/Umbraco.Core/Models/Content.cs | 22 +- src/Umbraco.Core/Models/ContentBase.cs | 30 +- src/Umbraco.Core/Models/ContentExtensions.cs | 2 +- .../Models/ContentPreviewEntity.cs | 4 +- src/Umbraco.Core/Models/ContentStatus.cs | 2 +- src/Umbraco.Core/Models/ContentType.cs | 6 +- .../ContentTypeAvailableCompositionsResult.cs | 4 +- ...ContentTypeAvailableCompositionsResults.cs | 4 +- src/Umbraco.Core/Models/ContentTypeBase.cs | 38 +- .../Models/ContentTypeCompositionBase.cs | 6 +- src/Umbraco.Core/Models/ContentTypeSort.cs | 4 +- src/Umbraco.Core/Models/ContentXmlEntity.cs | 12 +- .../Models/DataTypeDatabaseType.cs | 4 +- src/Umbraco.Core/Models/DataTypeDefinition.cs | 8 +- src/Umbraco.Core/Models/DeepCloneHelper.cs | 12 +- src/Umbraco.Core/Models/DictionaryItem.cs | 4 +- .../Models/DictionaryItemExtensions.cs | 2 +- .../Models/DictionaryTranslation.cs | 14 +- .../Models/DoNotCloneAttribute.cs | 12 +- src/Umbraco.Core/Models/EntityBase/Entity.cs | 6 +- .../Models/EntityBase/IAggregateRoot.cs | 2 +- .../Models/EntityBase/ICanBeDirty.cs | 2 +- .../Models/EntityBase/IDeletableEntity.cs | 2 +- src/Umbraco.Core/Models/EntityBase/IEntity.cs | 4 +- .../Models/EntityBase/IRememberBeingDirty.cs | 2 +- .../Models/EntityBase/IUmbracoEntity.cs | 2 +- .../Models/EntityBase/IValueObject.cs | 4 +- .../EntityBase/TracksChangesEntityBase.cs | 2 +- src/Umbraco.Core/Models/EntityContainer.cs | 2 +- src/Umbraco.Core/Models/EntityExtensions.cs | 2 +- src/Umbraco.Core/Models/File.cs | 8 +- src/Umbraco.Core/Models/Folder.cs | 2 +- src/Umbraco.Core/Models/GridValue.cs | 4 +- src/Umbraco.Core/Models/IContent.cs | 6 +- src/Umbraco.Core/Models/IContentBase.cs | 2 +- src/Umbraco.Core/Models/IContentType.cs | 4 +- src/Umbraco.Core/Models/IContentTypeBase.cs | 2 +- .../Models/IContentTypeComposition.cs | 8 +- .../Models/IDataTypeDefinition.cs | 4 +- src/Umbraco.Core/Models/IDeepCloneable.cs | 4 +- src/Umbraco.Core/Models/IDictionaryItem.cs | 4 +- .../Models/IDictionaryTranslation.cs | 4 +- src/Umbraco.Core/Models/IDomain.cs | 4 +- src/Umbraco.Core/Models/IFile.cs | 2 +- src/Umbraco.Core/Models/ILanguage.cs | 4 +- src/Umbraco.Core/Models/IMacro.cs | 4 +- src/Umbraco.Core/Models/IMacroProperty.cs | 6 +- src/Umbraco.Core/Models/IMedia.cs | 2 +- src/Umbraco.Core/Models/IMediaType.cs | 2 +- src/Umbraco.Core/Models/IMember.cs | 2 +- src/Umbraco.Core/Models/IMemberGroup.cs | 2 +- src/Umbraco.Core/Models/IMemberType.cs | 2 +- src/Umbraco.Core/Models/IMigrationEntry.cs | 2 +- src/Umbraco.Core/Models/IPartialView.cs | 2 +- src/Umbraco.Core/Models/IRelation.cs | 2 +- src/Umbraco.Core/Models/IRelationType.cs | 4 +- .../Models/IServerRegistration.cs | 4 +- src/Umbraco.Core/Models/ITag.cs | 4 +- src/Umbraco.Core/Models/ITemplate.cs | 4 +- src/Umbraco.Core/Models/IXsltFile.cs | 4 +- .../Models/Identity/BackOfficeIdentityUser.cs | 8 +- .../Models/Identity/IIdentityUserLogin.cs | 10 +- .../Models/Identity/IdentityProfile.cs | 4 +- .../Models/Identity/IdentityUser.cs | 4 +- .../Models/Identity/IdentityUserClaim.cs | 12 +- .../Models/Identity/IdentityUserLogin.cs | 12 +- .../Models/Identity/IdentityUserRole.cs | 10 +- src/Umbraco.Core/Models/Language.cs | 2 +- src/Umbraco.Core/Models/Macro.cs | 6 +- src/Umbraco.Core/Models/MacroProperty.cs | 6 +- .../Models/MacroPropertyCollection.cs | 8 +- src/Umbraco.Core/Models/MacroTypes.cs | 2 +- src/Umbraco.Core/Models/Media.cs | 18 +- src/Umbraco.Core/Models/MediaExtensions.cs | 4 +- src/Umbraco.Core/Models/MediaType.cs | 10 +- src/Umbraco.Core/Models/Member.cs | 2 +- src/Umbraco.Core/Models/MemberGroup.cs | 6 +- src/Umbraco.Core/Models/MemberType.cs | 2 +- .../Models/MemberTypePropertyProfileAccess.cs | 4 +- .../Models/Membership/EntityPermission.cs | 2 +- .../Models/Membership/EntityPermissionSet.cs | 2 +- .../Models/Membership/IMembershipUser.cs | 10 +- .../Models/Membership/IProfile.cs | 4 +- src/Umbraco.Core/Models/Membership/IUser.cs | 6 +- .../Models/Membership/IUserType.cs | 4 +- .../Models/Membership/MemberCountType.cs | 2 +- .../Models/Membership/MembershipScenario.cs | 2 +- .../Membership/MembershipUserExtensions.cs | 2 +- .../Membership/UmbracoMembershipMember.cs | 4 +- src/Umbraco.Core/Models/Membership/User.cs | 22 +- .../Models/Membership/UserType.cs | 10 +- src/Umbraco.Core/Models/MigrationEntry.cs | 2 +- .../Models/Packaging/InstallationSummary.cs | 4 +- src/Umbraco.Core/Models/Packaging/MetaData.cs | 2 +- .../Models/Packaging/PackageAction.cs | 4 +- .../Models/Packaging/PreInstallWarnings.cs | 4 +- src/Umbraco.Core/Models/PagedResult.cs | 2 +- src/Umbraco.Core/Models/PartialView.cs | 2 +- src/Umbraco.Core/Models/PreValue.cs | 10 +- src/Umbraco.Core/Models/PreValueCollection.cs | 10 +- src/Umbraco.Core/Models/Property.cs | 16 +- src/Umbraco.Core/Models/PropertyCollection.cs | 4 +- src/Umbraco.Core/Models/PropertyExtensions.cs | 2 +- src/Umbraco.Core/Models/PropertyGroup.cs | 12 +- .../Models/PropertyGroupCollection.cs | 10 +- .../Models/PropertyTagBehavior.cs | 2 +- src/Umbraco.Core/Models/PropertyTags.cs | 8 +- src/Umbraco.Core/Models/PropertyType.cs | 4 +- .../Models/PropertyTypeCollection.cs | 6 +- src/Umbraco.Core/Models/PublicAccessEntry.cs | 4 +- src/Umbraco.Core/Models/PublicAccessRule.cs | 8 +- .../PublishedContent/IPublishedContent.cs | 50 +- .../IPublishedContentModelFactory.cs | 2 +- .../PublishedContent/IPublishedProperty.cs | 12 +- .../Models/PublishedContent/PropertyResult.cs | 18 +- .../PublishedContent/PropertyResultType.cs | 22 +- .../PublishedContentTypeConverter.cs | 2 +- .../PublishedContent/PublishedItemType.cs | 18 +- src/Umbraco.Core/Models/PublishedState.cs | 2 +- src/Umbraco.Core/Models/Range.cs | 2 +- src/Umbraco.Core/Models/Rdbms/AccessDto.cs | 2 +- .../Models/Rdbms/AccessRuleDto.cs | 4 +- .../Models/Rdbms/CacheInstructionDto.cs | 2 +- src/Umbraco.Core/Models/Rdbms/ContentDto.cs | 2 +- .../Rdbms/ContentType2ContentTypeDto.cs | 2 +- .../Rdbms/ContentTypeAllowedContentTypeDto.cs | 2 +- .../Models/Rdbms/ContentTypeDto.cs | 2 +- .../Models/Rdbms/ContentTypeTemplateDto.cs | 2 +- .../Models/Rdbms/ContentVersionDto.cs | 2 +- .../Models/Rdbms/ContentXmlDto.cs | 2 +- src/Umbraco.Core/Models/Rdbms/DataTypeDto.cs | 2 +- .../Models/Rdbms/DataTypePreValueDto.cs | 2 +- .../Models/Rdbms/DictionaryDto.cs | 2 +- src/Umbraco.Core/Models/Rdbms/DocumentDto.cs | 2 +- .../Rdbms/DocumentPublishedReadOnlyDto.cs | 2 +- src/Umbraco.Core/Models/Rdbms/DomainDto.cs | 2 +- .../Models/Rdbms/ExternalLoginDto.cs | 4 +- src/Umbraco.Core/Models/Rdbms/LanguageDto.cs | 2 +- .../Models/Rdbms/LanguageTextDto.cs | 2 +- src/Umbraco.Core/Models/Rdbms/LockDto.cs | 2 +- src/Umbraco.Core/Models/Rdbms/LogDto.cs | 2 +- src/Umbraco.Core/Models/Rdbms/MacroDto.cs | 2 +- .../Models/Rdbms/MacroPropertyDto.cs | 2 +- .../Models/Rdbms/Member2MemberGroupDto.cs | 2 +- src/Umbraco.Core/Models/Rdbms/MemberDto.cs | 2 +- .../Models/Rdbms/MemberTypeDto.cs | 2 +- .../Models/Rdbms/MemberTypeReadOnlyDto.cs | 2 +- src/Umbraco.Core/Models/Rdbms/MigrationDto.cs | 4 +- src/Umbraco.Core/Models/Rdbms/NodeDto.cs | 2 +- .../Models/Rdbms/PreviewXmlDto.cs | 2 +- .../Models/Rdbms/PropertyDataDto.cs | 2 +- .../Models/Rdbms/PropertyTypeDto.cs | 2 +- .../Models/Rdbms/PropertyTypeGroupDto.cs | 2 +- .../Rdbms/PropertyTypeGroupReadOnlyDto.cs | 2 +- .../Models/Rdbms/PropertyTypeReadOnlyDto.cs | 4 +- src/Umbraco.Core/Models/Rdbms/RelationDto.cs | 2 +- .../Models/Rdbms/RelationTypeDto.cs | 2 +- .../Models/Rdbms/ServerRegistrationDto.cs | 2 +- .../Models/Rdbms/StylesheetDto.cs | 2 +- .../Models/Rdbms/StylesheetPropertyDto.cs | 2 +- src/Umbraco.Core/Models/Rdbms/TagDto.cs | 4 +- .../Models/Rdbms/TagRelationshipDto.cs | 2 +- src/Umbraco.Core/Models/Rdbms/TaskDto.cs | 2 +- src/Umbraco.Core/Models/Rdbms/TaskTypeDto.cs | 2 +- src/Umbraco.Core/Models/Rdbms/TemplateDto.cs | 4 +- src/Umbraco.Core/Models/Rdbms/User2AppDto.cs | 2 +- .../Models/Rdbms/User2NodeNotifyDto.cs | 2 +- .../Models/Rdbms/User2NodePermissionDto.cs | 2 +- src/Umbraco.Core/Models/Rdbms/UserDto.cs | 6 +- src/Umbraco.Core/Models/Rdbms/UserTypeDto.cs | 2 +- src/Umbraco.Core/Models/RedirectUrl.cs | 2 +- src/Umbraco.Core/Models/Relation.cs | 2 +- src/Umbraco.Core/Models/RelationType.cs | 4 +- src/Umbraco.Core/Models/Script.cs | 4 +- src/Umbraco.Core/Models/Section.cs | 4 +- src/Umbraco.Core/Models/ServerRegistration.cs | 2 +- src/Umbraco.Core/Models/Stylesheet.cs | 14 +- src/Umbraco.Core/Models/StylesheetProperty.cs | 2 +- src/Umbraco.Core/Models/Tag.cs | 6 +- .../Models/TagCacheStorageType.cs | 2 +- .../Models/TaggableObjectTypes.cs | 2 +- src/Umbraco.Core/Models/TaggedEntity.cs | 4 +- src/Umbraco.Core/Models/TaggedProperty.cs | 2 +- src/Umbraco.Core/Models/Task.cs | 2 +- src/Umbraco.Core/Models/TaskType.cs | 2 +- src/Umbraco.Core/Models/Template.cs | 4 +- src/Umbraco.Core/Models/TemplateNode.cs | 4 +- src/Umbraco.Core/Models/UmbracoDomain.cs | 4 +- src/Umbraco.Core/Models/UmbracoEntity.cs | 14 +- .../Models/UmbracoEntityExtensions.cs | 8 +- src/Umbraco.Core/Models/UmbracoObjectTypes.cs | 6 +- .../Models/UmbracoObjectTypesExtensions.cs | 2 +- src/Umbraco.Core/Models/UserExtensions.cs | 8 +- .../RequiredForPersistenceAttribute.cs | 2 +- src/Umbraco.Core/Models/XsltFile.cs | 2 +- .../NameValueCollectionExtensions.cs | 16 +- src/Umbraco.Core/NamedUdiRange.cs | 4 +- src/Umbraco.Core/NetworkHelper.cs | 2 +- src/Umbraco.Core/ObjectExtensions.cs | 990 +++++++++--------- src/Umbraco.Core/OrderedHashSet.cs | 10 +- .../Packaging/ConflictingPackageData.cs | 6 +- .../Packaging/DefaultPackageContext.cs | 2 +- .../Packaging/IConflictingPackageData.cs | 2 +- src/Umbraco.Core/Packaging/IPackageContext.cs | 4 +- .../Packaging/IPackageExtraction.cs | 2 +- .../Packaging/IPackageInstallation.cs | 2 +- .../Packaging/Models/UninstallationSummary.cs | 4 +- .../Packaging/PackageExtraction.cs | 6 +- .../Packaging/PackageInstallation.cs | 36 +- .../Persistence/BulkDataReader.cs | 8 +- .../ConstraintAttribute.cs | 2 +- .../ForeignKeyAttribute.cs | 2 +- .../DatabaseAnnotations/IndexAttribute.cs | 6 +- .../DatabaseAnnotations/IndexTypes.cs | 2 +- .../DatabaseAnnotations/LengthAttribute.cs | 2 +- .../NullSettingAttribute.cs | 2 +- .../DatabaseAnnotations/NullSettings.cs | 2 +- .../PrimaryKeyColumnAttribute.cs | 4 +- .../ReferencesAttribute.cs | 2 +- .../SpecialDbTypeAttribute.cs | 2 +- .../DatabaseAnnotations/SpecialDbTypes.cs | 2 +- .../ColumnDefinition.cs | 4 +- .../ConstraintDefinition.cs | 4 +- .../ConstraintType.cs | 4 +- .../DbIndexDefinition.cs | 4 +- .../DefinitionFactory.cs | 2 +- .../DeletionDataDefinition.cs | 6 +- .../DatabaseModelDefinitions/Direction.cs | 4 +- .../ForeignKeyDefinition.cs | 4 +- .../IndexColumnDefinition.cs | 4 +- .../IndexDefinition.cs | 4 +- .../InsertionDataDefinition.cs | 6 +- .../ModificationType.cs | 4 +- .../DatabaseModelDefinitions/SystemMethods.cs | 4 +- .../TableDefinition.cs | 4 +- .../Persistence/DatabaseSchemaHelper.cs | 4 +- .../Persistence/DatabasenodeLockExtensions.cs | 2 +- .../Persistence/EntityNotFoundException.cs | 2 +- .../Persistence/Factories/ContentFactory.cs | 6 +- .../Factories/ContentTypeFactory.cs | 4 +- .../Factories/DataTypeDefinitionFactory.cs | 2 +- .../Factories/DictionaryItemFactory.cs | 4 +- .../Factories/DictionaryTranslationFactory.cs | 4 +- .../Factories/ExternalLoginFactory.cs | 6 +- .../Persistence/Factories/LanguageFactory.cs | 4 +- .../Persistence/Factories/MacroFactory.cs | 2 +- .../Persistence/Factories/MediaFactory.cs | 4 +- .../Persistence/Factories/MemberFactory.cs | 2 +- .../Factories/MemberGroupFactory.cs | 8 +- .../Factories/MemberTypeReadOnlyFactory.cs | 12 +- .../Factories/MigrationEntryFactory.cs | 2 +- .../Factories/ModelFactoryConfiguration.cs | 4 +- .../Persistence/Factories/PropertyFactory.cs | 2 +- .../Factories/PropertyGroupFactory.cs | 4 +- .../Factories/PublicAccessEntryFactory.cs | 6 +- .../Persistence/Factories/RelationFactory.cs | 4 +- .../Factories/RelationTypeFactory.cs | 4 +- .../Factories/ServerRegistrationFactory.cs | 4 +- .../Persistence/Factories/TagFactory.cs | 6 +- .../Persistence/Factories/TaskFactory.cs | 6 +- .../Persistence/Factories/TaskTypeFactory.cs | 4 +- .../Persistence/Factories/TemplateFactory.cs | 4 +- .../Factories/UmbracoEntityFactory.cs | 10 +- .../Persistence/Factories/UserFactory.cs | 4 +- .../Persistence/Factories/UserTypeFactory.cs | 2 +- .../ITransientErrorDetectionStrategy.cs | 2 +- .../RetryLimitExceededException.cs | 2 +- .../Persistence/FaultHandling/RetryPolicy.cs | 6 +- .../FaultHandling/RetryPolicyFactory.cs | 2 +- .../FaultHandling/RetryStrategy.cs | 4 +- .../FaultHandling/RetryingEventArgs.cs | 2 +- .../Strategies/ExponentialBackoff.cs | 12 +- .../FaultHandling/Strategies/FixedInterval.cs | 12 +- .../FaultHandling/Strategies/Incremental.cs | 10 +- ...tworkConnectivityErrorDetectionStrategy.cs | 6 +- ...SqlAzureTransientErrorDetectionStrategy.cs | 24 +- .../FaultHandling/ThrottlingCondition.cs | 6 +- .../Persistence/IDatabaseContext.cs | 4 +- .../Persistence/IUmbracoDatabase.cs | 2 +- .../Persistence/IUmbracoDatabaseFactory.cs | 16 +- .../Persistence/Mappers/AccessMapper.cs | 2 +- .../Persistence/Mappers/AuditItemMapper.cs | 6 +- .../Persistence/Mappers/BaseMapper.cs | 2 +- .../Persistence/Mappers/ContentMapper.cs | 4 +- .../Persistence/Mappers/ContentTypeMapper.cs | 4 +- .../Mappers/DataTypeDefinitionMapper.cs | 4 +- .../Persistence/Mappers/DictionaryMapper.cs | 4 +- .../Mappers/DictionaryTranslationMapper.cs | 4 +- .../Persistence/Mappers/DomainMapper.cs | 2 +- .../Persistence/Mappers/DtoMapModel.cs | 2 +- .../Persistence/Mappers/LanguageMapper.cs | 4 +- .../Persistence/Mappers/MacroMapper.cs | 2 +- .../Persistence/Mappers/MapperCollection.cs | 2 +- .../Mappers/MapperCollectionBuilder.cs | 2 +- .../Persistence/Mappers/MapperForAttribute.cs | 2 +- .../Persistence/Mappers/MediaMapper.cs | 4 +- .../Persistence/Mappers/MediaTypeMapper.cs | 4 +- .../Persistence/Mappers/MemberGroupMapper.cs | 4 +- .../Persistence/Mappers/MemberMapper.cs | 4 +- .../Persistence/Mappers/MemberTypeMapper.cs | 4 +- .../Mappers/MigrationEntryMapper.cs | 6 +- .../Persistence/Mappers/PocoMapper.cs | 2 +- .../Mappers/PropertyGroupMapper.cs | 4 +- .../Persistence/Mappers/PropertyMapper.cs | 2 +- .../Persistence/Mappers/PropertyTypeMapper.cs | 4 +- .../Persistence/Mappers/RelationMapper.cs | 4 +- .../Persistence/Mappers/RelationTypeMapper.cs | 4 +- .../Mappers/ServerRegistrationMapper.cs | 2 +- .../Persistence/Mappers/TagMapper.cs | 2 +- .../Persistence/Mappers/TaskTypeMapper.cs | 4 +- .../Persistence/Mappers/TemplateMapper.cs | 2 +- .../Mappers/UmbracoEntityMapper.cs | 2 +- .../Persistence/Mappers/UserMapper.cs | 2 +- .../Persistence/Mappers/UserSectionMapper.cs | 2 +- .../Persistence/Mappers/UserTypeMapper.cs | 4 +- .../Migrations/DataLossException.cs | 8 +- .../Persistence/Migrations/ILocalMigration.cs | 2 +- .../Persistence/Migrations/IMigration.cs | 2 +- .../Migrations/IMigrationContext.cs | 2 +- .../Migrations/IMigrationExpression.cs | 2 +- .../Migrations/Initial/BaseDataCreation.cs | 28 +- .../Initial/DatabaseSchemaCreation.cs | 4 +- .../Initial/DatabaseSchemaResult.cs | 10 +- .../Migrations/MigrationAttribute.cs | 2 +- .../Persistence/Migrations/MigrationBase.cs | 2 +- .../Migrations/MigrationCollection.cs | 2 +- .../Migrations/MigrationCollectionBuilder.cs | 2 +- .../Migrations/MigrationContext.cs | 2 +- .../Migrations/MigrationExpressionBase.cs | 2 +- .../Persistence/Migrations/MigrationRunner.cs | 4 +- .../Syntax/Alter/AlterSyntaxBuilder.cs | 2 +- .../Syntax/Alter/Column/AlterColumnBuilder.cs | 4 +- ...lterColumnOptionForeignKeyCascadeSyntax.cs | 6 +- .../Alter/Column/IAlterColumnOptionSyntax.cs | 4 +- .../Syntax/Alter/Column/IAlterColumnSyntax.cs | 2 +- .../Alter/Column/IAlterColumnTypeSyntax.cs | 4 +- .../Expressions/AlterColumnExpression.cs | 4 +- .../AlterDefaultConstraintExpression.cs | 6 +- .../Alter/Expressions/AlterTableExpression.cs | 4 +- .../Syntax/Alter/IAlterSyntaxBuilder.cs | 6 +- .../Syntax/Alter/Table/AlterTableBuilder.cs | 2 +- ...ableColumnOptionForeignKeyCascadeSyntax.cs | 4 +- .../Table/IAlterTableColumnOptionSyntax.cs | 6 +- .../Table/IAlterTableColumnTypeSyntax.cs | 4 +- .../Syntax/Alter/Table/IAlterTableSyntax.cs | 2 +- .../Create/Column/CreateColumnBuilder.cs | 2 +- .../Column/ICreateColumnOnTableSyntax.cs | 2 +- ...eateColumnOptionForeignKeyCascadeSyntax.cs | 4 +- .../Column/ICreateColumnOptionSyntax.cs | 4 +- .../Create/Column/ICreateColumnTypeSyntax.cs | 4 +- .../Constraint/CreateConstraintBuilder.cs | 2 +- .../ICreateConstraintColumnsSyntax.cs | 2 +- .../ICreateConstraintOnTableSyntax.cs | 2 +- .../Migrations/Syntax/Create/CreateBuilder.cs | 2 +- .../Expressions/CreateConstraintExpression.cs | 6 +- .../Expressions/CreateTableExpression.cs | 2 +- .../ForeignKey/CreateForeignKeyBuilder.cs | 2 +- .../ICreateForeignKeyCascadeSyntax.cs | 2 +- .../ICreateForeignKeyForeignColumnSyntax.cs | 2 +- .../ICreateForeignKeyFromTableSyntax.cs | 2 +- .../ICreateForeignKeyPrimaryColumnSyntax.cs | 2 +- .../ICreateForeignKeyToTableSyntax.cs | 2 +- .../Syntax/Create/ICreateBuilder.cs | 2 +- .../Syntax/Create/Index/CreateIndexBuilder.cs | 2 +- .../Index/ICreateIndexColumnOptionsSyntax.cs | 2 +- .../Index/ICreateIndexForTableSyntax.cs | 2 +- .../Index/ICreateIndexOnColumnSyntax.cs | 2 +- .../Create/Index/ICreateIndexOptionsSyntax.cs | 2 +- .../Syntax/Create/Table/CreateTableBuilder.cs | 8 +- .../Table/ICreateTableColumnAsTypeSyntax.cs | 2 +- ...ableColumnOptionForeignKeyCascadeSyntax.cs | 2 +- .../Table/ICreateTableColumnOptionSyntax.cs | 2 +- .../Table/ICreateTableWithColumnSyntax.cs | 2 +- .../Delete/Column/DeleteColumnBuilder.cs | 2 +- .../Column/IDeleteColumnFromTableSyntax.cs | 2 +- .../Constraint/DeleteConstraintBuilder.cs | 2 +- .../IDeleteConstraintOnTableSyntax.cs | 2 +- .../DeleteDefaultConstraintBuilder.cs | 2 +- .../IDeleteDefaultConstraintOnColumnSyntax.cs | 2 +- .../IDeleteDefaultConstraintOnTableSyntax.cs | 2 +- .../Migrations/Syntax/Delete/DeleteBuilder.cs | 2 +- .../Syntax/Delete/DeleteDataBuilder.cs | 2 +- .../Expressions/DeleteColumnExpression.cs | 2 +- .../Expressions/DeleteConstraintExpression.cs | 2 +- .../Expressions/DeleteDataExpression.cs | 6 +- .../DeleteDefaultConstraintExpression.cs | 2 +- .../Expressions/DeleteForeignKeyExpression.cs | 6 +- .../Expressions/DeleteIndexExpression.cs | 4 +- .../Expressions/DeleteTableExpression.cs | 6 +- .../ForeignKey/DeleteForeignKeyBuilder.cs | 2 +- .../IDeleteForeignKeyForeignColumnSyntax.cs | 2 +- .../IDeleteForeignKeyFromTableSyntax.cs | 2 +- .../IDeleteForeignKeyOnTableSyntax.cs | 2 +- .../IDeleteForeignKeyPrimaryColumnSyntax.cs | 2 +- .../IDeleteForeignKeyToTableSyntax.cs | 2 +- .../Syntax/Delete/IDeleteBuilder.cs | 2 +- .../Syntax/Delete/IDeleteDataSyntax.cs | 2 +- .../Syntax/Delete/Index/DeleteIndexBuilder.cs | 2 +- .../Index/IDeleteIndexForTableSyntax.cs | 2 +- .../Index/IDeleteIndexOnColumnSyntax.cs | 2 +- .../Syntax/Delete/Table/DeleteTableBuilder.cs | 2 +- .../Syntax/Execute/ExecuteBuilder.cs | 2 +- .../ExecuteCodeStatementExpression.cs | 2 +- .../ExecuteSqlStatementExpression.cs | 2 +- .../Syntax/Execute/IExecuteBuilder.cs | 2 +- .../Migrations/Syntax/ExpressionBuilder.cs | 2 +- .../Syntax/ExpressionBuilderBase.cs | 2 +- .../Expressions/CreateColumnExpression.cs | 2 +- .../Expressions/CreateForeignKeyExpression.cs | 2 +- .../Expressions/CreateIndexExpression.cs | 4 +- .../Migrations/Syntax/IColumnOptionSyntax.cs | 2 +- .../Migrations/Syntax/IColumnTypeSyntax.cs | 2 +- .../Migrations/Syntax/IFluentSyntax.cs | 4 +- .../Syntax/IForeignKeyCascadeSyntax.cs | 2 +- .../Syntax/IfDatabase/IIfDatabaseBuilder.cs | 2 +- .../Syntax/IfDatabase/IfDatabaseBuilder.cs | 2 +- .../Expressions/InsertDataExpression.cs | 10 +- .../Syntax/Insert/IInsertBuilder.cs | 2 +- .../Syntax/Insert/IInsertDataSyntax.cs | 2 +- .../Migrations/Syntax/Insert/InsertBuilder.cs | 2 +- .../Syntax/Insert/InsertDataBuilder.cs | 2 +- .../Rename/Column/IRenameColumnTableSyntax.cs | 2 +- .../Rename/Column/IRenameColumnToSyntax.cs | 2 +- .../Rename/Column/RenameColumnBuilder.cs | 2 +- .../Expressions/RenameColumnExpression.cs | 4 +- .../Expressions/RenameTableExpression.cs | 4 +- .../Syntax/Rename/IRenameBuilder.cs | 2 +- .../Migrations/Syntax/Rename/RenameBuilder.cs | 2 +- .../Syntax/Rename/Table/IRenameTableSyntax.cs | 2 +- .../Syntax/Rename/Table/RenameTableBuilder.cs | 2 +- .../Expressions/UpdateDataExpression.cs | 6 +- .../Syntax/Update/IUpdateBuilder.cs | 2 +- .../Syntax/Update/IUpdateSetSyntax.cs | 2 +- .../Syntax/Update/IUpdateWhereSyntax.cs | 2 +- .../Migrations/Syntax/Update/UpdateBuilder.cs | 2 +- .../Syntax/Update/UpdateDataBuilder.cs | 2 +- .../Upgrades/TargetVersionEight/Seven1.cs | 12 +- .../RemoveUmbracoAppConstraints.cs | 6 +- .../AddPreviewXmlTable.cs | 4 +- .../AddIndexToCmsMacroPropertyTable.cs | 4 +- .../AddIndexToCmsMacroTable.cs | 10 +- .../AddPropertyEditorAliasColumn.cs | 4 +- .../AlterCmsMacroPropertyTable.cs | 2 +- .../AlterTagRelationsTable.cs | 8 +- .../TargetVersionSeven/AlterTagsTable.cs | 4 +- .../TargetVersionSeven/AlterUserTable.cs | 2 +- .../AssignMissingKeysAndIndexes.cs | 10 +- .../TargetVersionSeven/DropControlIdColumn.cs | 4 +- .../RemoveCmsMacroPropertyTypeTable.cs | 4 +- .../UpdateControlIdToPropertyEditorAlias.cs | 4 +- .../UpdateRelatedLinksData.cs | 2 +- .../RemoveStylesheetDataAndTablesAgain.cs | 4 +- .../UpdateUniqueIndexOnCmsPropertyData.cs | 8 +- .../AddDataDecimalColumn.cs | 4 +- .../AddUmbracoDeployTables.cs | 4 +- .../AddUniqueIdPropertyTypeGroupColumn.cs | 4 +- ...EnsureContentTypeUniqueIdsAreConsistent.cs | 6 +- .../FixListViewMediaSortOrder.cs | 4 +- .../RemoveParentIdPropertyTypeGroupColumn.cs | 2 +- .../AssignMissingPrimaryForMySqlKeys.cs | 6 +- .../AddIndexToCmsMemberLoginName.cs | 4 +- .../AddIndexToUmbracoNodePath.cs | 2 +- .../AddIndexToUser2NodePermission.cs | 4 +- .../AddIndexesToUmbracoRelationTables.cs | 4 +- .../NormalizeTemplateGuids.cs | 2 +- .../ReduceLoginNameColumnsSize.cs | 4 +- .../RemovePropertyDataIdIndex.cs | 8 +- .../UpdateUserLanguagesToIsoCode.cs | 6 +- .../EnsureMigrationsTableIdentityIsCorrect.cs | 6 +- .../AddExternalLoginsTable.cs | 4 +- ...reignKeysForLanguageAndDictionaryTables.cs | 14 +- .../AddMigrationTable.cs | 4 +- .../AddPublicAccessTables.cs | 4 +- .../AddRelationTypeForDocumentOnDelete.cs | 4 +- .../AddUniqueIdPropertyTypeColumn.cs | 6 +- .../AddUserColumns.cs | 6 +- .../CleanUpCorruptedPublishedFlags.cs | 4 +- .../CreateCacheInstructionTable.cs | 2 +- .../MigrateAndRemoveTemplateMasterColumn.cs | 16 +- .../MigrateStylesheetDataToFile.cs | 14 +- .../MovePublicAccessXmlDataToDb.cs | 6 +- .../RemoveHelpTextColumn.cs | 4 +- .../RemoveLanguageLocaleColumn.cs | 4 +- .../RemoveStylesheetDataAndTables.cs | 4 +- .../RemoveUmbracoLoginsTable.cs | 6 +- .../UpdateUniqueIdToHaveCorrectIndexType.cs | 4 +- .../AddIndexToUmbracoNodeTable.cs | 8 +- .../AddMissingForeignKeyForContentType.cs | 8 +- .../AlterDataTypePreValueTable.cs | 6 +- .../RemoveCmsDocumentAliasColumn.cs | 6 +- .../TargetVersionSix/DeleteAppTables.cs | 6 +- .../EnsureAppsTreesUpdated.cs | 2 +- .../MoveMasterContentTypeData.cs | 4 +- .../NewCmsContentType2ContentTypeTable.cs | 4 +- .../RemoveMasterContentTypeColumn.cs | 4 +- .../TargetVersionSix/RenameCmsTabTable.cs | 4 +- .../TargetVersionSix/RenameTabIdColumn.cs | 4 +- ...teCmsContentTypeAllowedContentTypeTable.cs | 4 +- .../UpdateCmsContentTypeTable.cs | 4 +- .../UpdateCmsContentVersionTable.cs | 4 +- .../UpdateCmsPropertyTypeGroupTable.cs | 4 +- .../CreateServerRegistryTable.cs | 2 +- .../AddChangeDocumentTypePermission.cs | 4 +- .../AdditionalIndexesAndKeys.cs | 18 +- .../AssignMissingPrimaryForMySqlKeys.cs | 6 +- .../AssignMissingPrimaryForMySqlKeys2.cs | 6 +- .../ChangePasswordColumn.cs | 6 +- .../UpdateToNewMemberPropertyAliases.cs | 4 +- .../UpdatePropertyTypesAndGroups.cs | 6 +- .../Persistence/NPocoDatabaseExtensions.cs | 2 +- .../Persistence/PocoDataDataReader.cs | 28 +- .../Persistence/Querying/CachedExpression.cs | 4 +- .../Querying/ExpressionVisitorBase.cs | 10 +- .../Persistence/Querying/IQuery.cs | 2 +- .../Querying/ModelToSqlExpressionVisitor.cs | 2 +- .../Querying/PocoToSqlExpressionVisitor.cs | 2 +- .../Persistence/Querying/Query.cs | 2 +- .../Persistence/Querying/QueryExtensions.cs | 2 +- .../Querying/SqlExpressionExtensions.cs | 4 +- .../Persistence/Querying/SqlTranslator.cs | 2 +- .../Querying/StringPropertyMatchType.cs | 2 +- .../Persistence/Querying/TextColumnType.cs | 2 +- .../Querying/ValuePropertyMatchType.cs | 2 +- .../Persistence/RecordPersistenceType.cs | 4 +- .../Repositories/AuditRepository.cs | 8 +- .../Repositories/ContentRepository.cs | 2 +- .../Repositories/ContentTypeRepository.cs | 2 +- .../Repositories/ContentTypeRepositoryBase.cs | 18 +- .../DataTypeContainerRepository.cs | 2 +- .../DataTypeDefinitionRepository.cs | 2 +- .../Repositories/DictionaryRepository.cs | 4 +- .../DocumentTypeContainerRepository.cs | 2 +- .../Repositories/DomainRepository.cs | 12 +- .../Repositories/EntityContainerRepository.cs | 8 +- .../Repositories/EntityRepository.cs | 2 +- .../Repositories/ExternalLoginRepository.cs | 8 +- .../Repositories/FileRepository.cs | 14 +- .../Interfaces/IAuditRepository.cs | 4 +- .../Interfaces/IContentRepository.cs | 2 +- .../Interfaces/IContentTypeRepository.cs | 2 +- .../Interfaces/IContentTypeRepositoryBase.cs | 4 +- .../IDataTypeContainerRepository.cs | 2 +- .../IDataTypeDefinitionRepository.cs | 4 +- .../Interfaces/IDictionaryRepository.cs | 2 +- .../IDocumentTypeContainerRepository.cs | 2 +- .../Interfaces/IDomainRepository.cs | 2 +- .../Interfaces/IEntityContainerRepository.cs | 2 +- .../Interfaces/IEntityRepository.cs | 2 +- .../Interfaces/IExternalLoginRepository.cs | 2 +- .../Interfaces/ILanguageRepository.cs | 2 +- .../Interfaces/IMacroRepository.cs | 2 +- .../Interfaces/IMediaRepository.cs | 2 +- .../IMediaTypeContainerRepository.cs | 2 +- .../Interfaces/IMediaTypeRepository.cs | 2 +- .../Interfaces/IMemberGroupRepository.cs | 2 +- .../Interfaces/IMemberRepository.cs | 2 +- .../Interfaces/IMemberTypeRepository.cs | 2 +- .../Interfaces/IMigrationEntryRepository.cs | 2 +- .../Interfaces/INotificationsRepository.cs | 2 +- .../Interfaces/IPartialViewRepository.cs | 2 +- .../Interfaces/IPublicAccessRepository.cs | 4 +- .../Interfaces/IQueryRepository.cs | 2 +- .../Interfaces/IRecycleBinRepository.cs | 2 +- .../Interfaces/IRelationRepository.cs | 2 +- .../Interfaces/IRelationTypeRepository.cs | 2 +- .../Repositories/Interfaces/IRepository.cs | 10 +- .../Interfaces/IRepositoryVersionable.cs | 4 +- .../Interfaces/IScriptRepository.cs | 2 +- .../IServerRegistrationRepository.cs | 2 +- .../Interfaces/IStylesheetRepository.cs | 4 +- .../Repositories/Interfaces/ITagRepository.cs | 6 +- .../Interfaces/ITaskRepository.cs | 4 +- .../Interfaces/ITaskTypeRepository.cs | 4 +- .../Interfaces/ITemplateRepository.cs | 2 +- .../Interfaces/IUserRepository.cs | 6 +- .../Interfaces/IUserTypeRepository.cs | 4 +- .../Interfaces/IXsltFileRepository.cs | 4 +- .../Repositories/LanguageRepository.cs | 4 +- .../Repositories/MacroRepository.cs | 2 +- .../MediaTypeContainerRepository.cs | 2 +- .../Repositories/MediaTypeRepository.cs | 8 +- .../Repositories/MemberGroupRepository.cs | 12 +- .../Repositories/MemberTypeRepository.cs | 2 +- .../Repositories/MigrationEntryRepository.cs | 6 +- .../Repositories/NPocoRepositoryBase.cs | 8 +- .../Repositories/NotificationsRepository.cs | 2 +- .../PartialViewMacroRepository.cs | 4 +- .../Repositories/PartialViewRepository.cs | 4 +- .../Repositories/PermissionRepository.cs | 2 +- .../Repositories/PublicAccessRepository.cs | 6 +- .../Repositories/RecycleBinRepository.cs | 6 +- .../Repositories/RedirectUrlRepository.cs | 4 +- .../Repositories/RelationRepository.cs | 2 +- .../Repositories/RelationTypeRepository.cs | 2 +- .../Repositories/RepositoryBase.cs | 2 +- .../RepositoryBaseOfTIdTEntity.cs | 6 +- .../Repositories/ScriptRepository.cs | 4 +- .../ServerRegistrationRepository.cs | 2 +- .../Repositories/SimilarNodeNameComparer.cs | 2 +- .../Repositories/SimpleGetRepository.cs | 10 +- .../Repositories/StylesheetRepository.cs | 4 +- .../Persistence/Repositories/TagRepository.cs | 2 +- .../Repositories/TaskRepository.cs | 4 +- .../Repositories/TaskTypeRepository.cs | 4 +- .../Repositories/TemplateRepository.cs | 2 +- .../Repositories/UserRepository.cs | 4 +- .../Repositories/UserTypeRepository.cs | 2 +- .../Repositories/VersionableRepositoryBase.cs | 16 +- .../VersionableRepositoryBaseAliasRegex.cs | 4 +- .../Repositories/XsltFileRepository.cs | 6 +- .../Persistence/RepositoryFactory.cs | 4 +- .../Persistence/SqlSyntax/ColumnInfo.cs | 2 +- .../Persistence/SqlSyntax/DbTypes.cs | 2 +- .../SqlSyntax/ISqlSyntaxProvider.cs | 6 +- .../MicrosoftSqlSyntaxProviderBase.cs | 420 ++++---- .../SqlSyntax/MySqlSyntaxProvider.cs | 6 +- .../SqlSyntax/SqlCeSyntaxProvider.cs | 12 +- .../SqlSyntax/SqlServerSyntaxProvider.cs | 30 +- .../SqlSyntax/SqlServerVersionName.cs | 2 +- .../SqlSyntax/SqlSyntaxProviderAttribute.cs | 2 +- .../SqlSyntax/SqlSyntaxProviderBase.cs | 2 +- .../SqlSyntax/SqlSyntaxProviderExtensions.cs | 4 +- .../Persistence/UmbracoDatabase.cs | 4 +- .../Persistence/UmbracoDatabaseExtensions.cs | 2 +- .../Persistence/UmbracoDatabaseFactory.cs | 12 +- .../UnitOfWork/IScopeUnitOfWork.cs | 4 +- .../UnitOfWork/IScopeUnitOfWorkProvider.cs | 4 +- .../Persistence/UnitOfWork/IUnitOfWork.cs | 8 +- .../UnitOfWork/IUnitOfWorkRepository.cs | 2 +- .../Persistence/UnitOfWork/ScopeUnitOfWork.cs | 44 +- .../UnitOfWork/ScopeUnitOfWorkProvider.cs | 4 +- .../Persistence/UnitOfWorkExtensions.cs | 2 +- src/Umbraco.Core/Properties/AssemblyInfo.cs | 2 +- .../PropertyEditors/DecimalValidator.cs | 2 +- .../DefaultPropertyValueConverterAttribute.cs | 6 +- .../DelimitedManifestValueValidator.cs | 2 +- .../PropertyEditors/EmailValidator.cs | 2 +- .../PropertyEditors/GridEditor.cs | 6 +- .../PropertyEditors/IParameterEditor.cs | 2 +- .../PropertyEditors/IPropertyValidator.cs | 2 +- .../PropertyEditors/IValueEditor.cs | 2 +- .../PropertyEditors/IntegerValidator.cs | 2 +- .../LegacyParameterEditorAliasConverter.cs | 6 +- .../LegacyPropertyEditorIdToAliasConverter.cs | 20 +- .../ManifestPropertyValidator.cs | 2 +- .../PropertyEditors/ManifestValueValidator.cs | 8 +- .../PropertyEditors/ParameterEditor.cs | 6 +- .../ParameterEditorAttribute.cs | 4 +- .../PropertyEditors/ParameterValueEditor.cs | 4 +- .../PropertyEditors/PreValueEditor.cs | 20 +- .../PropertyEditors/PreValueField.cs | 8 +- .../PropertyEditors/PreValueFieldAttribute.cs | 4 +- .../PropertyEditors/PropertyEditor.cs | 2 +- .../PropertyEditorAttribute.cs | 2 +- .../PropertyValueConverterCollection.cs | 2 +- ...PropertyValueConverterCollectionBuilder.cs | 2 +- .../PropertyEditors/PropertyValueEditor.cs | 36 +- .../PropertyEditors/RegexValidator.cs | 6 +- .../RequiredManifestValueValidator.cs | 4 +- .../PropertyEditors/SupportTagsAttribute.cs | 2 +- .../PropertyEditors/TagPropertyDefinition.cs | 4 +- .../PropertyEditors/TagValueType.cs | 4 +- .../PropertyEditors/ValidatorCollection.cs | 2 +- .../ValidatorCollectionBuilder.cs | 2 +- .../CheckboxListValueConverter.cs | 2 +- .../ColorPickerValueConverter.cs | 2 +- .../DatePickerValueConverter.cs | 16 +- .../ValueConverters/DecimalValueConverter.cs | 2 +- .../DropdownListMultipleValueConverter.cs | 2 +- ...pdownListMultipleWithKeysValueConverter.cs | 2 +- .../DropdownListValueConverter.cs | 2 +- .../DropdownListWithKeysValueConverter.cs | 2 +- .../EmailAddressValueConverter.cs | 2 +- .../ValueConverters/GridValueConverter.cs | 2 +- .../ImageCropperValueConverter.cs | 4 +- .../ValueConverters/JsonValueConverter.cs | 6 +- .../ValueConverters/LabelValueConverter.cs | 4 +- .../MemberGroupPickerValueConverter.cs | 2 +- .../RadioButtonListValueConverter.cs | 2 +- .../ValueConverters/SliderValueConverter.cs | 4 +- .../ValueConverters/TinyMceValueConverter.cs | 22 +- .../UploadPropertyConverter.cs | 4 +- .../ValueValidatorAttribute.cs | 2 +- src/Umbraco.Core/ReadLock.cs | 6 +- src/Umbraco.Core/RenderingEngine.cs | 4 +- src/Umbraco.Core/RuntimeLevel.cs | 4 +- src/Umbraco.Core/RuntimeState.cs | 4 +- src/Umbraco.Core/SafeCallContext.cs | 2 +- src/Umbraco.Core/Scoping/IScopeContext.cs | 4 +- src/Umbraco.Core/Scoping/Scope.cs | 6 +- .../Scoping/ScopeContextualBase.cs | 4 +- .../Security/AuthenticationExtensions.cs | 52 +- .../BackOfficeClaimsIdentityFactory.cs | 4 +- .../BackOfficeCookieAuthenticationProvider.cs | 4 +- .../Security/BackOfficeSignInManager.cs | 8 +- .../Security/BackOfficeUserManager.cs | 18 +- .../Security/BackOfficeUserManagerMarker.cs | 8 +- .../BackOfficeUserPasswordCheckerResult.cs | 4 +- .../Security/BackOfficeUserStore.cs | 40 +- src/Umbraco.Core/Security/EmailService.cs | 2 +- .../Security/IBackOfficeUserManagerMarker.cs | 6 +- .../IBackOfficeUserPasswordChecker.cs | 6 +- .../IUmbracoMemberTypeMembershipProvider.cs | 6 +- .../Security/IUsersMembershipProvider.cs | 4 +- .../Security/MembershipPasswordHasher.cs | 4 +- .../Security/MembershipProviderBase.cs | 38 +- .../Security/MembershipProviderExtensions.cs | 2 +- src/Umbraco.Core/Security/OwinExtensions.cs | 10 +- .../Security/UmbracoBackOfficeIdentity.cs | 28 +- .../Security/UmbracoMembershipProviderBase.cs | 8 +- src/Umbraco.Core/Security/UserData.cs | 8 +- src/Umbraco.Core/SemVersionExtensions.cs | 2 +- .../AbstractSerializationService.cs | 2 +- .../Serialization/ForceInt32Converter.cs | 2 +- src/Umbraco.Core/Serialization/Formatter.cs | 2 +- src/Umbraco.Core/Serialization/IFormatter.cs | 2 +- src/Umbraco.Core/Serialization/ISerializer.cs | 2 +- .../Serialization/IStreamedResult.cs | 2 +- .../Serialization/JsonCreationConverter.cs | 2 +- .../Serialization/JsonNetSerializer.cs | 2 +- .../Serialization/JsonToStringConverter.cs | 2 +- .../NoTypeConverterJsonConverter.cs | 8 +- .../Serialization/SerializationExtensions.cs | 2 +- .../Serialization/SerializationService.cs | 2 +- .../Serialization/StreamResultExtensions.cs | 2 +- .../Serialization/StreamedResult.cs | 2 +- .../Serialization/UdiJsonConverter.cs | 2 +- .../Serialization/UdiRangeJsonConverter.cs | 4 +- src/Umbraco.Core/ServiceProviderExtensions.cs | 4 +- src/Umbraco.Core/Services/AuditService.cs | 4 +- .../Services/Changes/ContentTypeChange.cs | 4 +- .../Services/Changes/DomainChangeTypes.cs | 2 +- .../Services/Changes/TreeChangeExtensions.cs | 4 +- .../Services/Changes/TreeChangeTypes.cs | 4 +- src/Umbraco.Core/Services/ContentService.cs | 6 +- .../Services/ContentServiceExtensions.cs | 4 +- .../Services/ContentTypeService.cs | 4 +- .../Services/ContentTypeServiceBase.cs | 4 +- .../ContentTypeServiceBaseOfTItemTService.cs | 4 +- ...peServiceBaseOfTRepositoryTItemTService.cs | 4 +- .../Services/ContentTypeServiceExtensions.cs | 22 +- src/Umbraco.Core/Services/DataTypeService.cs | 14 +- src/Umbraco.Core/Services/DomainService.cs | 4 +- src/Umbraco.Core/Services/EntityService.cs | 10 +- .../Services/EntityXmlSerializer.cs | 28 +- .../Services/ExternalLoginService.cs | 4 +- src/Umbraco.Core/Services/FileService.cs | 4 +- .../Services/IApplicationTreeService.cs | 2 +- src/Umbraco.Core/Services/IAuditService.cs | 4 +- src/Umbraco.Core/Services/IContentService.cs | 4 +- .../Services/IContentServiceBase.cs | 4 +- .../Services/IContentTypeService.cs | 4 +- src/Umbraco.Core/Services/IDataTypeService.cs | 8 +- src/Umbraco.Core/Services/IDomainService.cs | 4 +- src/Umbraco.Core/Services/IEntityService.cs | 2 +- .../Services/IExternalLoginService.cs | 6 +- src/Umbraco.Core/Services/IFileService.cs | 20 +- .../Services/ILocalizationService.cs | 4 +- .../Services/ILocalizedTextService.cs | 6 +- src/Umbraco.Core/Services/IMacroService.cs | 4 +- src/Umbraco.Core/Services/IMediaService.cs | 4 +- .../Services/IMemberGroupService.cs | 2 +- src/Umbraco.Core/Services/IMemberService.cs | 8 +- .../Services/IMemberTypeService.cs | 4 +- .../Services/IMembershipMemberService.cs | 8 +- .../Services/IMembershipRoleService.cs | 8 +- .../Services/IMembershipUserService.cs | 4 +- .../Services/IMigrationEntryService.cs | 4 +- .../Services/IPackagingService.cs | 4 +- .../Services/IPublicAccessService.cs | 6 +- .../Services/IRedirectUrlService.cs | 4 +- src/Umbraco.Core/Services/IRelationService.cs | 2 +- src/Umbraco.Core/Services/ISectionService.cs | 6 +- .../Services/IServerRegistrationService.cs | 4 +- src/Umbraco.Core/Services/IService.cs | 4 +- src/Umbraco.Core/Services/ITagService.cs | 22 +- src/Umbraco.Core/Services/ITaskService.cs | 4 +- src/Umbraco.Core/Services/IUserService.cs | 18 +- .../Services/LocalizationService.cs | 8 +- .../Services/LocalizedTextService.cs | 28 +- .../LocalizedTextServiceExtensions.cs | 2 +- .../LocalizedTextServiceFileSources.cs | 16 +- ...lizedTextServiceSupplementaryFileSource.cs | 6 +- src/Umbraco.Core/Services/MacroService.cs | 14 +- src/Umbraco.Core/Services/MediaService.cs | 4 +- .../Services/MemberGroupService.cs | 4 +- src/Umbraco.Core/Services/MemberService.cs | 2 +- .../Services/MemberTypeService.cs | 4 +- .../Services/MigrationEntryService.cs | 4 +- .../Services/MoveOperationStatusType.cs | 6 +- .../Services/NotificationService.cs | 16 +- src/Umbraco.Core/Services/OperationStatus.cs | 6 +- .../Services/OperationStatusType.cs | 4 +- src/Umbraco.Core/Services/PackagingService.cs | 20 +- .../Services/PublicAccessService.cs | 8 +- .../Services/PublicAccessServiceExtensions.cs | 6 +- src/Umbraco.Core/Services/PublishStatus.cs | 4 +- .../Services/PublishStatusType.cs | 6 +- .../Services/RedirectUrlService.cs | 4 +- src/Umbraco.Core/Services/RelationService.cs | 2 +- .../Services/RepositoryService.cs | 4 +- .../Services/ScopeRepositoryService.cs | 4 +- .../Services/ServerRegistrationService.cs | 4 +- src/Umbraco.Core/Services/ServiceContext.cs | 14 +- .../Services/ServiceWithResultExtensions.cs | 6 +- src/Umbraco.Core/Services/TagExtractor.cs | 12 +- src/Umbraco.Core/Services/TagService.cs | 40 +- src/Umbraco.Core/Services/TaskService.cs | 4 +- src/Umbraco.Core/Services/UnPublishStatus.cs | 4 +- .../Services/UnPublishedStatusType.cs | 4 +- .../Services/UserServiceExtensions.cs | 4 +- .../Strategies/ManifestWatcherComponent.cs | 2 +- .../Strategies/RelateOnTrashComponent.cs | 2 +- src/Umbraco.Core/StringAliasCaseType.cs | 4 +- src/Umbraco.Core/StringUdi.cs | 4 +- .../Strings/Css/StylesheetRule.cs | 4 +- .../Strings/DefaultShortStringHelperConfig.cs | 2 +- src/Umbraco.Core/Strings/Diff.cs | 34 +- .../Strings/IShortStringHelper.cs | 8 +- .../Strings/IUrlSegmentProvider.cs | 2 +- .../Strings/Utf8ToAsciiConverter.cs | 8 +- src/Umbraco.Core/Sync/ApplicationUrlHelper.cs | 6 +- src/Umbraco.Core/Sync/ConfigServerAddress.cs | 4 +- .../Sync/DatabaseServerMessengerOptions.cs | 6 +- .../Sync/DatabaseServerRegistrar.cs | 2 +- .../Sync/DatabaseServerRegistrarOptions.cs | 2 +- src/Umbraco.Core/Sync/IServerAddress.cs | 2 +- src/Umbraco.Core/Sync/IServerMessenger.cs | 2 +- src/Umbraco.Core/Sync/IServerRegistrar.cs | 2 +- src/Umbraco.Core/Sync/MessageType.cs | 2 +- src/Umbraco.Core/Sync/RefreshInstruction.cs | 20 +- .../Sync/RefreshInstructionEnvelope.cs | 6 +- src/Umbraco.Core/Sync/RefreshMethodType.cs | 4 +- src/Umbraco.Core/Sync/ServerMessengerBase.cs | 2 +- src/Umbraco.Core/Sync/ServerRole.cs | 4 +- .../Sync/ServerSyncWebServiceClient.cs | 132 +-- .../Sync/WebServiceServerMessenger.cs | 16 +- src/Umbraco.Core/SystemUtilities.cs | 72 +- src/Umbraco.Core/TopoGraph.cs | 2 +- src/Umbraco.Core/TopologicalSorter.cs | 2 +- src/Umbraco.Core/TypeExtensions.cs | 340 +++--- src/Umbraco.Core/Udi.cs | 16 +- src/Umbraco.Core/UdiDefinitionAttribute.cs | 4 +- src/Umbraco.Core/UdiEntityType.cs | 2 +- src/Umbraco.Core/UdiGetterExtensions.cs | 8 +- src/Umbraco.Core/UdiRange.cs | 4 +- src/Umbraco.Core/UdiType.cs | 2 +- src/Umbraco.Core/UdiTypeConverter.cs | 2 +- src/Umbraco.Core/UmbracoApplicationBase.cs | 8 +- src/Umbraco.Core/UpgradeableReadLock.cs | 28 +- src/Umbraco.Core/UriExtensions.cs | 30 +- src/Umbraco.Core/VersionExtensions.cs | 12 +- src/Umbraco.Core/WriteLock.cs | 2 +- src/Umbraco.Core/Xml/DynamicContext.cs | 520 ++++----- .../Xml/UmbracoXPathPathSyntaxParser.cs | 12 +- .../Xml/XPath/INavigableContent.cs | 2 +- src/Umbraco.Core/Xml/XPath/MacroNavigator.cs | 6 +- src/Umbraco.Core/Xml/XPathVariable.cs | 20 +- src/Umbraco.Core/Xml/XmlHelper.cs | 54 +- src/Umbraco.Core/Xml/XmlNamespaces.cs | 64 +- src/Umbraco.Core/Xml/XmlNodeListFactory.cs | 280 ++--- src/Umbraco.Core/XmlExtensions.cs | 66 +- .../PackageActions/PackageActionCollection.cs | 2 +- .../PackageActionCollectionBuilder.cs | 2 +- .../GetAssemblyFileVersion.cs | 2 +- .../Properties/AssemblyInfo.cs | 10 +- .../BulkInsertBenchmarks.cs | 32 +- .../LinqCastBenchmarks.cs | 2 +- .../ModelToSqlExpressionHelperBenchmarks.cs | 10 +- src/Umbraco.Tests.Benchmarks/Program.cs | 2 +- .../Properties/AssemblyInfo.cs | 10 +- src/Umbraco.Tests.Benchmarks/XmlBenchmarks.cs | 48 +- .../XmlPublishedContentInitBenchmarks.cs | 8 +- src/Umbraco.Tests/Cache/CacheProviderTests.cs | 8 +- .../Cache/CacheRefresherComponentTests.cs | 2 +- .../Cache/CacheRefresherTests.cs | 4 +- .../DeepCloneRuntimeCacheProviderTests.cs | 6 +- .../Cache/DefaultCachePolicyTests.cs | 4 +- .../DistributedCache/DistributedCacheTests.cs | 2 +- .../Cache/FullDataSetCachePolicyTests.cs | 6 +- .../Cache/HttpRequestCacheProviderTests.cs | 4 +- .../Cache/HttpRuntimeCacheProviderTests.cs | 2 +- .../PublishedContentCacheTests.cs | 158 +-- .../PublishedMediaCacheTests.cs | 494 ++++----- .../Cache/RuntimeCacheProviderTests.cs | 2 +- .../Cache/SingleItemsOnlyCachePolicyTests.cs | 4 +- .../Collections/DeepCloneableListTests.cs | 2 +- .../Collections/OrderedHashSetTests.cs | 2 +- .../DashboardSettingsTests.cs | 8 +- .../Configurations/FileSystemProviderTests.cs | 4 +- .../Configurations/GlobalSettingsTests.cs | 138 +-- .../Configurations/RepositorySettingsTests.cs | 2 +- .../ContentElementDefaultTests.cs | 4 +- .../UmbracoSettings/ContentElementTests.cs | 16 +- .../DeveloperElementDefaultTests.cs | 2 +- .../UmbracoSettings/DeveloperElementTests.cs | 2 +- .../DistributedCallElementDefaultTests.cs | 2 +- .../DistributedCallElementTests.cs | 4 +- .../LoggingElementDefaultTests.cs | 4 +- .../UmbracoSettings/LoggingElementTests.cs | 6 +- .../PackageRepositoriesElementDefaultTests.cs | 2 +- .../PackageRepositoriesElementTests.cs | 4 +- .../ProvidersElementDefaultTests.cs | 2 +- .../UmbracoSettings/ProvidersElementTests.cs | 2 +- .../RequestHandlerElementDefaultTests.cs | 2 +- .../RequestHandlerElementTests.cs | 12 +- .../ScheduledTasksElementDefaultTests.cs | 2 +- .../ScheduledTasksElementTests.cs | 2 +- .../SecurityElementDefaultTests.cs | 2 +- .../UmbracoSettings/SecurityElementTests.cs | 2 +- .../TemplateElementDefaultTests.cs | 2 +- .../UmbracoSettings/TemplateElementTests.cs | 6 +- .../UmbracoSettings/UmbracoSettingsTests.cs | 4 +- .../WebRoutingElementDefaultTests.cs | 2 +- .../UmbracoSettings/WebRoutingElementTests.cs | 2 +- .../CoreThings/DelegateExtensionsTests.cs | 4 +- .../CoreThings/EnumerableExtensionsTests.cs | 98 +- .../CoreThings/ObjectExtensionsTests.cs | 170 +-- src/Umbraco.Tests/CoreThings/UdiTests.cs | 4 +- .../CoreThings/UriExtensionsTests.cs | 2 +- .../CoreThings/VersionExtensionTests.cs | 4 +- .../CoreThings/XmlExtensionsTests.cs | 2 +- .../CoreXml/FrameworkXmlTests.cs | 2 +- .../CoreXml/NavigableNavigatorTests.cs | 52 +- .../ActionCollectionTests.cs | 242 ++--- .../LazyCollectionBuilderTests.cs | 62 +- .../PackageActionCollectionTests.cs | 94 +- .../DependencyInjection/ResolverBaseTest.cs | 8 +- .../XsltExtensionsResolverTests.cs | 4 +- .../FrontEnd/UmbracoHelperTests.cs | 4 +- .../IO/AbstractFileSystemTests.cs | 2 +- src/Umbraco.Tests/IO/FileSystemsTests.cs | 12 +- src/Umbraco.Tests/IO/IoHelperTests.cs | 6 +- .../IO/PhysicalFileSystemTests.cs | 2 +- .../Integration/GetCultureTests.cs | 2 +- src/Umbraco.Tests/Macros/MacroParserTests.cs | 10 +- .../Manifest/ManifestParserTests.cs | 106 +- .../Membership/MembershipProviderBaseTests.cs | 20 +- .../UmbracoServiceMembershipProviderTests.cs | 2 +- .../Migrations/AlterMigrationTests.cs | 2 +- .../Migrations/FindingMigrationsTest.cs | 4 +- .../Migrations/MigrationIssuesTests.cs | 2 +- .../Migrations/MigrationRunnerTests.cs | 6 +- .../SqlScripts/SqlResources.Designer.cs | 68 +- .../Stubs/AlterUserTableMigrationStub.cs | 4 +- .../Stubs/DropForeignKeyMigrationStub.cs | 2 +- src/Umbraco.Tests/Migrations/Stubs/Dummy.cs | 2 +- .../Migrations/Stubs/FiveZeroMigration.cs | 8 +- .../Migrations/Stubs/FourElevenMigration.cs | 8 +- .../Migrations/Stubs/SixZeroMigration1.cs | 4 +- .../Migrations/Stubs/SixZeroMigration2.cs | 8 +- .../Migrations/Upgrades/BaseUpgradeTest.cs | 2 +- .../Migrations/Upgrades/MySqlUpgradeTest.cs | 2 +- .../Upgrades/SqlCeDataUpgradeTest.cs | 2 +- .../Migrations/Upgrades/SqlCeUpgradeTest.cs | 2 +- .../Upgrades/SqlServerUpgradeTest.cs | 2 +- .../Upgrades/ValidateOlderSchemaTest.cs | 2 +- .../Upgrades/ValidateV7UpgradeTest.cs | 4 +- .../Misc/ApplicationUrlHelperTests.cs | 4 +- .../Misc/HashCodeCombinerTests.cs | 208 ++-- src/Umbraco.Tests/Misc/LibraryTests.cs | 158 +-- src/Umbraco.Tests/Misc/UriUtilityTests.cs | 204 ++-- src/Umbraco.Tests/Misc/XmlHelperTests.cs | 150 +-- src/Umbraco.Tests/Models/Collections/Item.cs | 8 +- .../Models/Collections/OrderItem.cs | 4 +- .../Collections/PropertyCollectionTests.cs | 6 +- .../Models/Collections/SimpleOrder.cs | 28 +- .../Models/ContentExtensionsTests.cs | 4 +- src/Umbraco.Tests/Models/ContentTests.cs | 2 +- src/Umbraco.Tests/Models/ContentTypeTests.cs | 18 +- src/Umbraco.Tests/Models/ContentXmlTest.cs | 4 +- .../Models/DataTypeDefinitionTests.cs | 6 +- .../Models/DeepCloneHelperTests.cs | 6 +- .../Models/DictionaryItemTests.cs | 4 +- .../Models/DictionaryTranslationTests.cs | 6 +- src/Umbraco.Tests/Models/LanguageTests.cs | 6 +- src/Umbraco.Tests/Models/MacroTests.cs | 4 +- .../Models/Mapping/AutoMapperTests.cs | 4 +- .../Mapping/ContentWebModelMappingTests.cs | 10 +- src/Umbraco.Tests/Models/MediaXmlTest.cs | 2 +- src/Umbraco.Tests/Models/MemberGroupTests.cs | 6 +- src/Umbraco.Tests/Models/MemberTests.cs | 6 +- .../Models/PreValueCollectionTests.cs | 4 +- .../Models/PropertyGroupTests.cs | 4 +- src/Umbraco.Tests/Models/PropertyTypeTests.cs | 6 +- src/Umbraco.Tests/Models/RelationTests.cs | 4 +- src/Umbraco.Tests/Models/RelationTypeTests.cs | 8 +- src/Umbraco.Tests/Models/StylesheetTests.cs | 4 +- src/Umbraco.Tests/Models/TaskTests.cs | 4 +- src/Umbraco.Tests/Models/TaskTypeTests.cs | 8 +- src/Umbraco.Tests/Models/TemplateTests.cs | 10 +- .../Models/UmbracoEntityTests.cs | 8 +- .../Models/UserExtensionsTests.cs | 2 +- src/Umbraco.Tests/Models/UserTests.cs | 10 +- src/Umbraco.Tests/Models/UserTypeTests.cs | 8 +- .../Packaging/PackageInstallationTest.cs | 2 +- .../Persistence/DatabaseContextTests.cs | 20 +- .../Persistence/DatabaseFactoryTests.cs | 2 +- .../FaultHandling/ConnectionRetryTest.cs | 2 +- .../Persistence/Mappers/ContentMapperTest.cs | 2 +- .../Mappers/ContentTypeMapperTest.cs | 2 +- .../Mappers/DataTypeDefinitionMapperTest.cs | 2 +- .../Mappers/DictionaryMapperTest.cs | 2 +- .../DictionaryTranslationMapperTest.cs | 2 +- .../Persistence/Mappers/LanguageMapperTest.cs | 2 +- .../Persistence/Mappers/MediaMapperTest.cs | 4 +- .../Mappers/PropertyGroupMapperTest.cs | 2 +- .../Mappers/PropertyTypeMapperTest.cs | 2 +- .../Persistence/Mappers/RelationMapperTest.cs | 2 +- .../Mappers/RelationTypeMapperTest.cs | 4 +- .../Migrations/PostMigrationTests.cs | 4 +- .../Persistence/NPocoExpressionsTests.cs | 2 +- .../Persistence/NPocoExtensionsTest.cs | 20 +- .../Persistence/PetaPocoCachesTest.cs | 2 +- .../Persistence/PetaPocoDynamicQueryTests.cs | 8 +- .../ContentRepositorySqlClausesTest.cs | 2 +- .../ContentTypeRepositorySqlClausesTest.cs | 2 +- .../Querying/ContentTypeSqlMappingTests.cs | 2 +- ...aTypeDefinitionRepositorySqlClausesTest.cs | 2 +- .../Persistence/Querying/ExpressionTests.cs | 4 +- .../Querying/MediaRepositorySqlClausesTest.cs | 2 +- .../MediaTypeRepositorySqlClausesTest.cs | 2 +- .../Persistence/Querying/NPocoSqlTests.cs | 6 +- .../Persistence/Querying/QueryBuilderTests.cs | 4 +- .../Repositories/AuditRepositoryTest.cs | 4 +- .../Repositories/ContentRepositoryTest.cs | 2 +- .../Repositories/ContentTypeRepositoryTest.cs | 2 +- .../DataTypeDefinitionRepositoryTest.cs | 2 +- .../Repositories/DictionaryRepositoryTest.cs | 6 +- .../Repositories/DomainRepositoryTest.cs | 4 +- .../Repositories/LanguageRepositoryTest.cs | 14 +- .../Repositories/MacroRepositoryTest.cs | 2 +- .../Repositories/MediaRepositoryTest.cs | 6 +- .../Repositories/MediaTypeRepositoryTest.cs | 12 +- .../Repositories/MemberRepositoryTest.cs | 4 +- .../Repositories/MemberTypeRepositoryTest.cs | 4 +- .../NotificationsRepositoryTest.cs | 2 +- .../PublicAccessRepositoryTest.cs | 6 +- .../Repositories/RelationRepositoryTest.cs | 2 +- .../RelationTypeRepositoryTest.cs | 2 +- .../Repositories/ScriptRepositoryTest.cs | 4 +- .../ServerRegistrationRepositoryTest.cs | 2 +- .../Repositories/StylesheetRepositoryTest.cs | 2 +- .../Repositories/TagRepositoryTest.cs | 2 +- .../Repositories/TaskRepositoryTest.cs | 4 +- .../Repositories/TaskTypeRepositoryTest.cs | 6 +- .../Repositories/TemplateRepositoryTest.cs | 4 +- .../Repositories/UserRepositoryTest.cs | 2 +- .../Repositories/UserTypeRepositoryTest.cs | 6 +- .../Persistence/SchemaValidationTest.cs | 2 +- .../Persistence/SqlCeTableByTableTest.cs | 4 +- .../SqlCeSyntaxProviderTests.cs | 8 +- .../Plugins/PluginManagerExtensions.cs | 24 +- .../Plugins/PluginManagerTests.cs | 164 +-- src/Umbraco.Tests/Plugins/TypeFinderTests.cs | 80 +- src/Umbraco.Tests/Plugins/TypeHelperTests.cs | 6 +- src/Umbraco.Tests/Properties/AssemblyInfo.cs | 12 +- .../PropertyEditors/ColorListValidatorTest.cs | 4 +- .../EnsureUniqueValuesValidatorTest.cs | 6 +- .../PropertyEditors/ImageCropperTest.cs | 8 +- ...cyPropertyEditorIdToAliasConverterTests.cs | 2 +- .../MultiValuePropertyEditorTests.cs | 2 +- .../PropertyEditorValueConverterTests.cs | 18 +- .../PropertyEditorValueEditorTests.cs | 10 +- .../PublishedContentDataTableTests.cs | 378 +++---- .../PublishedContentExtensionTests.cs | 130 +-- .../PublishedContentRequestEngineTests.cs | 8 +- .../PublishedContentTestBase.cs | 4 +- .../PublishedContent/PublishedContentTests.cs | 470 ++++----- .../PublishedContent/PublishedMediaTests.cs | 42 +- .../StronglyTypedModels/CallingMethodTests.cs | 4 +- .../StronglyTypedModels/Subpage.cs | 8 +- .../StronglyTypedModels/Textpage.cs | 10 +- .../StronglyTypedModels/TypedModelBase.cs | 10 +- .../Publishing/PublishingStrategyTests.cs | 32 +- .../Routing/ContentFinderByAliasTests.cs | 150 +-- .../ContentFinderByAliasWithDomainsTests.cs | 6 +- .../Routing/ContentFinderByIdTests.cs | 34 +- .../ContentFinderByNiceUrlAndTemplateTests.cs | 40 +- .../Routing/ContentFinderByNiceUrlTests.cs | 94 +- .../ContentFinderByNiceUrlWithDomainsTests.cs | 286 ++--- .../ContentFinderByPageIdQueryTests.cs | 46 +- .../Routing/DomainsAndCulturesTests.cs | 146 +-- .../Routing/NiceUrlProviderTests.cs | 176 ++-- .../Routing/NiceUrlRoutesTests.cs | 120 +-- .../NiceUrlsProviderWithDomainsTests.cs | 150 +-- .../Routing/RenderRouteHandlerTests.cs | 162 +-- .../Routing/RouteTestExtensions.cs | 90 +- .../Routing/UmbracoModuleTests.cs | 208 ++-- .../Routing/UrlRoutingTestBase.cs | 12 +- .../Routing/UrlsWithNestedDomains.cs | 224 ++-- src/Umbraco.Tests/Runtimes/WebRuntimeTests.cs | 100 +- .../Scheduling/BackgroundTaskRunnerTests2.cs | 2 +- .../Scoping/EventNameExtractorTests.cs | 6 +- .../PassThroughEventDispatcherTests.cs | 4 +- .../Scoping/ScopeEventDispatcherTests.cs | 4 +- src/Umbraco.Tests/Scoping/ScopeTests.cs | 4 +- .../Scoping/ScopedRepositoryTests.cs | 2 +- src/Umbraco.Tests/Scoping/ScopedXmlTests.cs | 2 +- .../Security/BackOfficeCookieManagerTests.cs | 4 +- .../UmbracoBackOfficeIdentityTests.cs | 28 +- .../Services/CachedDataTypeServiceTests.cs | 4 +- .../Services/ContentServicePerformanceTest.cs | 2 +- .../Services/ContentServiceTests.cs | 82 +- .../ContentTypeServiceExtensionsTests.cs | 8 +- .../Services/ContentTypeServiceTests.cs | 4 +- .../Services/DataTypeServiceTests.cs | 10 +- .../Services/EntityServiceTests.cs | 2 +- .../Importing/ImportResources.Designer.cs | 38 +- .../Services/Importing/PackageImportTests.cs | 10 +- .../Services/LocalizationServiceTests.cs | 10 +- .../Services/LocalizedTextServiceTests.cs | 12 +- .../Services/MacroServiceTests.cs | 2 +- .../Services/MediaServiceTests.cs | 14 +- .../Services/MemberServiceTests.cs | 4 +- .../Services/MemberTypeServiceTests.cs | 4 +- .../Services/PackagingServiceTests.cs | 2 +- .../Services/PerformanceTests.cs | 14 +- .../Services/PreValueConverterTests.cs | 2 +- .../Services/PublicAccessServiceTests.cs | 12 +- .../Services/RelationServiceTests.cs | 4 +- src/Umbraco.Tests/Services/TagServiceTests.cs | 4 +- .../Services/TestWithSomeContentBase.cs | 58 +- .../Services/ThreadSafetyServiceTest.cs | 190 ++-- .../Services/UserServiceTests.cs | 8 +- .../Strings/StringExtensionsTests.cs | 58 +- .../Strings/StringValidationTests.cs | 4 +- .../Strings/StylesheetHelperTests.cs | 14 +- .../Templates/MasterPageHelperTests.cs | 26 +- .../TestHelpers/BaseUsingSqlCeSyntax.cs | 2 +- src/Umbraco.Tests/TestHelpers/BaseWebTest.cs | 46 +- .../TestHelpers/Entities/MockedContent.cs | 28 +- .../Entities/MockedContentTypes.cs | 34 +- .../TestHelpers/Entities/MockedEntity.cs | 2 +- .../TestHelpers/Entities/MockedMedia.cs | 2 +- .../TestHelpers/Entities/MockedMember.cs | 6 +- .../Entities/MockedPropertyTypes.cs | 2 +- .../TestHelpers/Entities/MockedUser.cs | 6 +- .../TestHelpers/Entities/MockedUserType.cs | 2 +- .../TestHelpers/FakeHttpContextFactory.cs | 106 +- .../TestHelpers/NoHttpContextAccessor.cs | 2 +- .../TestHelpers/SettingsForTests.cs | 2 +- .../Stubs/TestControllerFactory.cs | 100 +- .../Stubs/TestIndexCollectionAccessor.cs | 4 +- .../TestHelpers/Stubs/TestLastChanceFinder.cs | 18 +- .../TestHelpers/Stubs/TestProfiler.cs | 4 +- .../Stubs/TestUmbracoContextAccessor.cs | 4 +- src/Umbraco.Tests/TestHelpers/TestHelper.cs | 94 +- .../TestHelpers/TestObjects-Mocks.cs | 4 +- .../TestHelpers/TestWithDatabaseBase.cs | 46 +- .../Testing/UmbracoTestOptions.cs | 2 +- .../TreesAndSections/ApplicationTreeTest.cs | 10 +- .../ResourceFiles.Designer.cs | 18 +- .../TreesAndSections/SectionTests.cs | 18 +- .../UmbracoExamine/EventsTest.cs | 2 +- .../UmbracoExamine/ExamineBaseTest.cs | 2 +- .../ExamineDemoDataContentService.cs | 68 +- .../ExamineDemoDataMediaService.cs | 32 +- .../UmbracoExamine/IndexInitializer.cs | 120 +-- src/Umbraco.Tests/UmbracoExamine/IndexTest.cs | 76 +- .../UmbracoExamine/SearchTests.cs | 6 +- .../UmbracoExamine/TestDataService.cs | 34 +- .../UmbracoExamine/TestFiles.Designer.cs | 36 +- .../UmbracoExamine/TestIndexField.cs | 14 +- .../AngularAntiForgeryTests.cs | 4 +- .../ContentModelSerializationTests.cs | 4 +- .../ServerVariablesParserTests.cs | 4 +- .../BackOfficeControllerUnitTests.cs | 2 +- .../Controllers/PluginControllerAreaTests.cs | 122 +-- .../ContentControllerUnitTests.cs | 16 +- ...terAllowedOutgoingContentAttributeTests.cs | 16 +- .../WebApiEditors/MediaControllerUnitTests.cs | 10 +- .../Mvc/HtmlHelperExtensionMethodsTests.cs | 50 +- ...ergeParentContextViewDataAttributeTests.cs | 6 +- ...RenderIndexActionSelectorAttributeTests.cs | 4 +- .../Web/Mvc/RenderModelBinderTests.cs | 22 +- .../Web/Mvc/SurfaceControllerTests.cs | 4 +- .../Web/TemplateUtilitiesTests.cs | 4 +- src/Umbraco.Web.UI/Properties/AssemblyInfo.cs | 10 +- .../Properties/Settings.Designer.cs | 10 +- .../Umbraco/create/PartialView.ascx.cs | 58 +- .../create/PartialView.ascx.designer.cs | 18 +- .../dashboard/UserControlProxy.aspx.cs | 2 +- .../UserControlProxy.aspx.designer.cs | 28 +- src/Umbraco.Web.UI/Umbraco/umbraco.aspx.cs | 2 +- .../Umbraco/umbraco.aspx.designer.cs | 6 +- .../config/splashes/NoNodes.aspx.cs | 8 +- .../config/splashes/NoNodes.aspx.designer.cs | 8 +- src/Umbraco.Web.UI/umbraco/Create.aspx.cs | 2 +- .../umbraco/Create.aspx.designer.cs | 4 +- src/Umbraco.Web.UI/umbraco/TreeInit.aspx.cs | 6 +- .../umbraco/TreeInit.aspx.designer.cs | 18 +- .../umbraco/controls/PasswordChanger.ascx.cs | 6 +- .../controls/PasswordChanger.ascx.designer.cs | 18 +- .../umbraco/create/PartialViewMacro.ascx.cs | 2 +- .../create/PartialViewMacro.ascx.designer.cs | 22 +- .../umbraco/create/User.ascx.cs | 2 +- .../umbraco/create/User.ascx.designer.cs | 26 +- .../umbraco/create/xslt.ascx.cs | 2 +- .../umbraco/create/xslt.ascx.designer.cs | 6 +- .../developer/Macros/EditMacro.aspx.cs | 176 ++-- .../Macros/EditMacro.aspx.designer.cs | 12 +- .../Packages/DirectoryBrowser.aspx.cs | 6 +- .../DirectoryBrowser.aspx.designer.cs | 12 +- .../umbraco/dialogs/ChangeDocType.aspx.cs | 6 +- .../dialogs/ChangeDocType.aspx.designer.cs | 52 +- .../umbraco/dialogs/Publish.aspx.cs | 4 +- .../umbraco/dialogs/Publish.aspx.designer.cs | 14 +- .../umbraco/dialogs/Sort.aspx.cs | 2 +- .../umbraco/dialogs/Sort.aspx.designer.cs | 10 +- .../umbraco/masterpages/Default.Master.cs | 2 +- .../masterpages/Default.Master.designer.cs | 6 +- .../masterpages/UmbracoDialog.master.cs | 8 +- .../UmbracoDialog.master.designer.cs | 8 +- .../umbraco/masterpages/UmbracoPage.master.cs | 8 +- .../UmbracoPage.master.designer.cs | 8 +- .../umbraco/settings/EditTemplate.aspx.cs | 8 +- .../settings/EditTemplate.aspx.designer.cs | 8 +- .../stylesheet/editstylesheet.aspx.cs | 2 +- .../editstylesheet.aspx.designer.cs | 6 +- .../property/EditStyleSheetProperty.aspx.cs | 2 +- .../EditStyleSheetProperty.aspx.designer.cs | 6 +- .../umbraco/settings/views/EditView.aspx.cs | 310 +++--- .../settings/views/EditView.aspx.designer.cs | 32 +- .../umbraco/users/EditUser.aspx.cs | 2 +- .../umbraco/users/EditUser.aspx.designer.cs | 6 +- .../AreaRegistrationContextExtensions.cs | 4 +- .../BatchedDatabaseServerMessenger.cs | 12 +- .../BatchedWebServiceServerMessenger.cs | 6 +- .../Cache/ApplicationCacheRefresher.cs | 2 +- .../Cache/ApplicationTreeCacheRefresher.cs | 2 +- .../Cache/CacheRefresherComponent.cs | 4 +- .../Cache/ContentTypeCacheRefresher.cs | 4 +- .../Cache/DataTypeCacheRefresher.cs | 2 +- .../Cache/DictionaryCacheRefresher.cs | 2 +- .../Cache/DistributedCacheExtensions.cs | 4 +- src/Umbraco.Web/Cache/DomainCacheRefresher.cs | 2 +- .../Cache/LanguageCacheRefresher.cs | 2 +- src/Umbraco.Web/Cache/MacroCacheRefresher.cs | 6 +- src/Umbraco.Web/Cache/MediaCacheRefresher.cs | 2 +- src/Umbraco.Web/Cache/MemberCacheRefresher.cs | 2 +- .../Cache/MemberGroupCacheRefresher.cs | 4 +- .../Cache/PublicAccessCacheRefresher.cs | 6 +- .../Cache/RelationTypeCacheRefresher.cs | 2 +- .../Cache/TemplateCacheRefresher.cs | 4 +- src/Umbraco.Web/Cache/UserCacheRefresher.cs | 2 +- .../Cache/UserPermissionsCacheRefresher.cs | 4 +- .../Cache/UserTypeCacheRefresher.cs | 4 +- src/Umbraco.Web/CacheHelperExtensions.cs | 82 +- .../Controllers/UmbLoginController.cs | 4 +- .../Controllers/UmbLoginStatusController.cs | 2 +- .../Controllers/UmbProfileController.cs | 2 +- .../Controllers/UmbRegisterController.cs | 4 +- .../DI/WebMappingProfilesCompositionRoot.cs | 4 +- .../DefaultEventMessagesFactory.cs | 4 +- .../Dictionary/UmbracoCultureDictionary.cs | 88 +- .../UmbracoCultureDictionaryFactory.cs | 30 +- .../Editors/AuthenticationController.cs | 24 +- .../Editors/BackOfficeController.cs | 2 +- .../BackOfficeNotificationsController.cs | 4 +- .../Editors/CanvasDesignerController.cs | 4 +- src/Umbraco.Web/Editors/CodeFileController.cs | 14 +- src/Umbraco.Web/Editors/ContentController.cs | 4 +- .../Editors/ContentControllerBase.cs | 4 +- .../Editors/ContentPostValidateAttribute.cs | 2 +- .../Editors/ContentTypeController.cs | 2 +- .../Editors/ContentTypeControllerBase.cs | 2 +- .../Editors/DashboardController.cs | 2 +- src/Umbraco.Web/Editors/DashboardSecurity.cs | 2 +- src/Umbraco.Web/Editors/DataTypeController.cs | 2 +- .../Editors/DataTypeValidateAttribute.cs | 2 +- .../Editors/EditorModelEventManager.cs | 6 +- src/Umbraco.Web/Editors/EditorValidator.cs | 4 +- .../Editors/EditorValidatorCollection.cs | 2 +- src/Umbraco.Web/Editors/EntityController.cs | 32 +- .../EntityControllerConfigurationAttribute.cs | 6 +- .../Editors/FromJsonPathAttribute.cs | 20 +- src/Umbraco.Web/Editors/IEditorValidator.cs | 4 +- src/Umbraco.Web/Editors/ImagesController.cs | 10 +- src/Umbraco.Web/Editors/LegacyController.cs | 2 +- src/Umbraco.Web/Editors/MacroController.cs | 4 +- src/Umbraco.Web/Editors/MediaController.cs | 2 +- .../Editors/MediaPostValidateAttribute.cs | 6 +- .../Editors/MediaTypeController.cs | 4 +- .../Editors/MemberGroupController.cs | 2 +- .../Editors/MemberTypeController.cs | 2 +- .../Editors/PackageInstallController.cs | 2 +- .../ParameterSwapControllerActionSelector.cs | 8 +- .../RedirectUrlManagementController.cs | 6 +- src/Umbraco.Web/Editors/RelationController.cs | 68 +- src/Umbraco.Web/Editors/SectionController.cs | 2 +- src/Umbraco.Web/Editors/TemplateController.cs | 10 +- .../Editors/TemplateQueryController.cs | 6 +- .../UmbracoAuthorizedJsonController.cs | 2 +- src/Umbraco.Web/Editors/UserController.cs | 4 +- src/Umbraco.Web/Editors/ValidationHelper.cs | 6 +- src/Umbraco.Web/ExamineExtensions.cs | 36 +- .../FormDataCollectionExtensions.cs | 6 +- src/Umbraco.Web/FormlessPage.cs | 32 +- src/Umbraco.Web/GridTemplateExtensions.cs | 6 +- .../Checks/Config/AbstractConfigCheck.cs | 2 +- .../Checks/Config/AcceptableConfiguration.cs | 4 +- .../Checks/Config/CompilationDebugCheck.cs | 2 +- .../Checks/Config/ConfigurationService.cs | 8 +- .../Config/ConfigurationServiceResult.cs | 4 +- .../Checks/Config/CustomErrorsCheck.cs | 2 +- .../Checks/Config/MacroErrorsCheck.cs | 2 +- .../Checks/Config/NotificationEmailCheck.cs | 2 +- .../HealthCheck/Checks/Config/TraceCheck.cs | 2 +- .../Config/TrySkipIisCustomErrorsCheck.cs | 2 +- .../Checks/Config/ValueComparisonType.cs | 2 +- .../XmlDataIntegrityHealthCheck.cs | 4 +- .../FolderAndFilePermissionsCheck.cs | 2 +- .../Checks/Security/ClickJackingCheck.cs | 2 +- .../Checks/Security/ExcessiveHeadersCheck.cs | 2 +- .../HealthCheck/Checks/Security/HttpsCheck.cs | 2 +- .../HealthCheck/Checks/Services/SmtpCheck.cs | 2 +- src/Umbraco.Web/HealthCheck/HealthCheck.cs | 2 +- .../HealthCheck/HealthCheckAction.cs | 4 +- .../HealthCheck/HealthCheckAttribute.cs | 6 +- .../HealthCheck/HealthCheckCollection.cs | 2 +- .../HealthCheck/HealthCheckController.cs | 4 +- .../HealthCheck/HealthCheckStatus.cs | 2 +- .../HealthCheck/StatusResultType.cs | 2 +- .../HtmlHelperBackOfficeExtensions.cs | 10 +- src/Umbraco.Web/HtmlHelperRenderExtensions.cs | 792 +++++++------- src/Umbraco.Web/HtmlStringUtilities.cs | 2 +- src/Umbraco.Web/HttpCookieExtensions.cs | 4 +- src/Umbraco.Web/HttpRequestExtensions.cs | 116 +- src/Umbraco.Web/HttpUrlHelperExtensions.cs | 6 +- src/Umbraco.Web/HybridAccessorBase.cs | 4 +- src/Umbraco.Web/IHttpContextAccessor.cs | 4 +- src/Umbraco.Web/IPublishedContentQuery.cs | 4 +- src/Umbraco.Web/ITagQuery.cs | 2 +- src/Umbraco.Web/IUmbracoComponentRenderer.cs | 4 +- .../IUmbracoComponentRendererWithField.cs | 8 +- src/Umbraco.Web/IUmbracoContextAccessor.cs | 4 +- .../ImageCropperTemplateExtensions.cs | 16 +- .../Install/Controllers/InstallController.cs | 8 +- .../Controllers/InstallPackageController.cs | 202 ++-- .../Install/FilePermissionHelper.cs | 2 +- .../Install/HttpInstallAuthorizeAttribute.cs | 44 +- .../Install/InstallAuthorizeAttribute.cs | 2 +- src/Umbraco.Web/Install/InstallHelper.cs | 2 +- .../Install/InstallStatusTracker.cs | 6 +- .../InstallSteps/DatabaseInstallStep.cs | 4 +- .../InstallSteps/DatabaseUpgradeStep.cs | 8 +- .../InstallSteps/FilePermissionsStep.cs | 4 +- .../MajorVersion7UpgradeReport.cs | 6 +- .../Install/InstallSteps/NewInstallStep.cs | 14 +- .../InstallSteps/SetUmbracoVersionStep.cs | 4 +- .../InstallSteps/StarterKitCleanupStep.cs | 8 +- .../InstallSteps/StarterKitDownloadStep.cs | 6 +- .../InstallSteps/StarterKitInstallStep.cs | 4 +- .../Install/InstallSteps/UpgradeStep.cs | 4 +- .../InstallSteps/Version73FileCleanup.cs | 12 +- .../Install/Models/DatabaseModel.cs | 4 +- .../Install/Models/DatabaseType.cs | 4 +- .../Install/Models/InstallInstructions.cs | 4 +- .../Models/InstallProgressResultModel.cs | 4 +- .../Install/Models/InstallSetup.cs | 8 +- .../Install/Models/InstallSetupResult.cs | 6 +- .../Install/Models/InstallSetupStep.cs | 10 +- .../Models/InstallSetupStepAttribute.cs | 4 +- .../Install/Models/InstallTrackingItem.cs | 2 +- .../Install/Models/InstallationType.cs | 4 +- src/Umbraco.Web/Install/Models/UserModel.cs | 8 +- src/Umbraco.Web/Install/UmbracoInstallArea.cs | 4 +- src/Umbraco.Web/Macros/MacroPropertyModel.cs | 44 +- .../Macros/PartialViewMacroController.cs | 4 +- .../Macros/PartialViewMacroEngine.cs | 10 +- .../Macros/PartialViewMacroPage.cs | 4 +- .../EmbedProviders/AbstractOEmbedProvider.cs | 2 +- .../Media/EmbedProviders/AbstractProvider.cs | 2 +- .../Media/EmbedProviders/Flickr.cs | 4 +- .../Media/EmbedProviders/OEmbedPhoto.cs | 2 +- .../Media/EmbedProviders/OEmbedRich.cs | 2 +- .../Media/EmbedProviders/OEmbedVideo.cs | 2 +- .../EmbedProviders/Settings/Dictionary.cs | 2 +- .../Media/EmbedProviders/Settings/String.cs | 2 +- .../Media/EmbedProviders/Twitgoo.cs | 2 +- src/Umbraco.Web/Media/ImageUrl.cs | 2 +- .../Media/ImageUrlProviderCollection.cs | 2 +- .../ImageUrlProviders/ImageUrlProvider.cs | 4 +- .../FileExtensionIconThumbnailProvider.cs | 2 +- .../ImageThumbnailProvider.cs | 14 +- .../MediaTypeIconThumbnailProvider.cs | 4 +- .../MembershipProviderExtensions.cs | 4 +- src/Umbraco.Web/ModelStateExtensions.cs | 130 +-- .../Models/ChangingPasswordModel.cs | 4 +- .../Models/ContentEditing/AuditLog.cs | 2 +- .../Models/ContentEditing/CodeFileDisplay.cs | 6 +- .../ContentEditing/ContentBaseItemSave.cs | 8 +- .../Models/ContentEditing/ContentItemBasic.cs | 6 +- .../ContentEditing/ContentItemDisplay.cs | 6 +- .../ContentEditing/ContentItemDisplayBase.cs | 6 +- .../Models/ContentEditing/ContentItemDto.cs | 6 +- .../Models/ContentEditing/ContentItemFile.cs | 2 +- .../Models/ContentEditing/ContentItemSave.cs | 4 +- .../ContentEditing/ContentPropertyBasic.cs | 2 +- .../ContentEditing/ContentPropertyDisplay.cs | 4 +- .../ContentEditing/ContentPropertyDto.cs | 2 +- .../ContentEditing/ContentRedirectUrl.cs | 4 +- .../ContentEditing/ContentSaveAction.cs | 2 +- .../Models/ContentEditing/ContentSortOrder.cs | 2 +- .../Models/ContentEditing/ContentTypeBasic.cs | 10 +- .../ContentTypeCompositionDisplay.cs | 76 +- .../Models/ContentEditing/ContentTypeSave.cs | 8 +- .../Models/ContentEditing/DataTypeBasic.cs | 42 +- .../Models/ContentEditing/DataTypeDisplay.cs | 4 +- .../Models/ContentEditing/DataTypeSave.cs | 2 +- .../ContentEditing/DocumentTypeDisplay.cs | 6 +- .../Models/ContentEditing/DocumentTypeSave.cs | 8 +- .../Models/ContentEditing/EntityBasic.cs | 4 +- .../ContentEditing/EntityTypeSearchResult.cs | 2 +- .../GetAvailableCompositionsFilter.cs | 4 +- .../Models/ContentEditing/IErrorModel.cs | 2 +- .../ContentEditing/IHaveUploadedFiles.cs | 2 +- .../ContentEditing/INotificationModel.cs | 2 +- .../ContentEditing/InstalledPackageModel.cs | 4 +- .../ListViewAwareContentItemDisplayBase.cs | 6 +- .../Models/ContentEditing/MacroParameter.cs | 2 +- .../Models/ContentEditing/MediaItemDisplay.cs | 6 +- .../Models/ContentEditing/MediaItemSave.cs | 4 +- .../Models/ContentEditing/MediaTypeDisplay.cs | 4 +- .../Models/ContentEditing/MediaTypeSave.cs | 4 +- .../Models/ContentEditing/MemberBasic.cs | 2 +- .../Models/ContentEditing/MemberDisplay.cs | 6 +- .../ContentEditing/MemberGroupDisplay.cs | 4 +- .../Models/ContentEditing/MemberGroupSave.cs | 4 +- .../ContentEditing/MemberListDisplay.cs | 4 +- .../ContentEditing/MemberPropertyTypeBasic.cs | 4 +- .../MemberPropertyTypeDisplay.cs | 4 +- .../Models/ContentEditing/MemberSave.cs | 12 +- .../ContentEditing/MemberTypeDisplay.cs | 4 +- .../Models/ContentEditing/MemberTypeSave.cs | 6 +- .../ContentEditing/MessagesExtensions.cs | 2 +- .../ContentEditing/ModelWithNotifications.cs | 4 +- .../Models/ContentEditing/Notification.cs | 6 +- .../Models/ContentEditing/PostedFiles.cs | 6 +- .../ContentEditing/PreValueFieldDisplay.cs | 4 +- .../ContentEditing/PreValueFieldSave.cs | 2 +- .../ContentEditing/PropertyEditorBasic.cs | 2 +- .../ContentEditing/PropertyGroupBasic.cs | 8 +- .../ContentEditing/PropertyGroupDisplay.cs | 2 +- .../ContentEditing/PropertyTypeBasic.cs | 2 +- .../ContentEditing/PropertyTypeDisplay.cs | 8 +- .../ContentEditing/PropertyTypeValidation.cs | 2 +- .../RedirectUrlSearchResults.cs | 6 +- .../Models/ContentEditing/RelationType.cs | 2 +- .../ContentEditing/RichTextEditorCommand.cs | 12 +- .../Models/ContentEditing/SearchResultItem.cs | 4 +- .../ContentEditing/SimpleNotificationModel.cs | 4 +- .../Models/ContentEditing/StyleSheet.cs | 2 +- src/Umbraco.Web/Models/ContentEditing/Tab.cs | 2 +- .../ContentEditing/TabbedContentItem.cs | 10 +- .../ContentEditing/UmbracoEntityTypes.cs | 8 +- .../Models/ContentEditing/UserBasic.cs | 4 +- .../Models/ContentEditing/UserDetail.cs | 4 +- src/Umbraco.Web/Models/ContentModel.cs | 40 +- src/Umbraco.Web/Models/ImageCropAnchor.cs | 2 +- .../Models/ImageCropCoordinates.cs | 6 +- src/Umbraco.Web/Models/ImageCropData.cs | 4 +- src/Umbraco.Web/Models/ImageCropDataSet.cs | 12 +- src/Umbraco.Web/Models/ImageCropFocalPoint.cs | 6 +- .../Models/LocalPackageInstallModel.cs | 6 +- src/Umbraco.Web/Models/LoginStatusModel.cs | 2 +- .../Models/Mapping/ActionButtonsResolver.cs | 4 +- .../AvailablePropertyEditorsResolver.cs | 4 +- .../Models/Mapping/ContentProfile.cs | 6 +- .../Mapping/ContentPropertyBasicConverter.cs | 2 +- .../ContentPropertyDisplayConverter.cs | 6 +- .../Mapping/ContentPropertyDtoConverter.cs | 4 +- .../Models/Mapping/ContentPropertyProfile.cs | 4 +- .../ContentTypeModelMapperExtensions.cs | 22 +- .../Models/Mapping/ContentTypeProfile.cs | 8 +- .../Models/Mapping/ContentTypeUdiResolver.cs | 4 +- .../Models/Mapping/CreatorResolver.cs | 2 +- .../Models/Mapping/DashboardProfile.cs | 2 +- .../Models/Mapping/DataTypeProfile.cs | 2 +- .../Models/Mapping/DatabaseTypeResolver.cs | 2 +- .../Models/Mapping/EntityProfile.cs | 12 +- .../Models/Mapping/MacroProfile.cs | 2 +- .../Mapping/MemberDtoPropertiesResolver.cs | 4 +- .../Models/Mapping/MemberProfile.cs | 6 +- .../Mapping/MemberProviderFieldResolver.cs | 4 +- .../MemberTabsAndPropertiesResolver.cs | 4 +- .../Mapping/MembershipScenarioResolver.cs | 4 +- .../Models/Mapping/OwnerResolver.cs | 2 +- .../Models/Mapping/PreValueDisplayResolver.cs | 6 +- .../Mapping/PropertyGroupDisplayResolver.cs | 4 +- .../Mapping/PropertyTypeGroupResolver.cs | 12 +- .../Models/Mapping/RelationProfile.cs | 4 +- .../Models/Mapping/SectionProfile.cs | 2 +- src/Umbraco.Web/Models/Mapping/TabProfile.cs | 2 +- src/Umbraco.Web/Models/Mapping/UserProfile.cs | 12 +- src/Umbraco.Web/Models/PackageInstallModel.cs | 2 +- .../Models/PackageInstallResult.cs | 2 +- .../Models/PartialViewMacroModel.cs | 16 +- .../Models/PartialViewMacroModelExtensions.cs | 8 +- .../Models/PasswordChangedModel.cs | 2 +- src/Umbraco.Web/Models/PostRedirectModel.cs | 4 +- .../Models/PublishedContentBase.cs | 154 +-- src/Umbraco.Web/Models/RelatedLink.cs | 10 +- src/Umbraco.Web/Models/RelatedLinks.cs | 2 +- src/Umbraco.Web/Models/SendCodeViewModel.cs | 2 +- src/Umbraco.Web/Models/SetPasswordModel.cs | 2 +- .../Models/TemplateQuery/Operathor.cs | 2 +- .../Models/TemplateQuery/OperathorTerm.cs | 2 +- .../Models/TemplateQuery/QueryCondition.cs | 10 +- .../Models/TemplateQuery/QueryModel.cs | 2 +- .../Models/TemplateQuery/QueryResultModel.cs | 6 +- .../Models/TemplateQuery/SortExpression.cs | 2 +- .../Models/TemplateQuery/SourceModel.cs | 2 +- .../TemplateQuery/TemplateQueryResult.cs | 2 +- .../Models/Trees/ActionMenuItem.cs | 10 +- .../Models/Trees/ActionMenuItemAttribute.cs | 2 +- .../Models/Trees/ApplicationAttribute.cs | 2 +- .../Models/Trees/CreateChildEntity.cs | 2 +- src/Umbraco.Web/Models/Trees/DisableUser.cs | 2 +- src/Umbraco.Web/Models/Trees/IApplication.cs | 2 +- src/Umbraco.Web/Models/Trees/MenuItem.cs | 16 +- .../Models/Trees/MenuItemCollection.cs | 10 +- src/Umbraco.Web/Models/Trees/MenuItemList.cs | 10 +- src/Umbraco.Web/Models/Trees/RefreshNode.cs | 4 +- .../Models/Trees/SectionRootNode.cs | 6 +- src/Umbraco.Web/Models/Trees/TreeNode.cs | 12 +- .../Models/Trees/TreeNodeCollection.cs | 2 +- .../Models/Trees/TreeNodeExtensions.cs | 2 +- src/Umbraco.Web/Models/UmbracoProperty.cs | 4 +- src/Umbraco.Web/Models/UnLinkLoginModel.cs | 2 +- .../Models/ValidatePasswordResetCodeModel.cs | 2 +- .../Mvc/ActionExecutedEventArgs.cs | 6 +- .../Mvc/AdminTokenAuthorizeAttribute.cs | 2 +- .../Mvc/AreaRegistrationExtensions.cs | 10 +- src/Umbraco.Web/Mvc/BackOfficeArea.cs | 10 +- src/Umbraco.Web/Mvc/Constants.cs | 14 +- src/Umbraco.Web/Mvc/ContentModelBinder.cs | 62 +- .../Mvc/ControllerContextExtensions.cs | 4 +- src/Umbraco.Web/Mvc/ControllerExtensions.cs | 144 +-- .../Mvc/ControllerFactoryExtensions.cs | 8 +- .../Mvc/DisableBrowserCacheAttribute.cs | 8 +- .../Mvc/DisableClientCacheAttribute.cs | 4 +- ...tialViewMacroViewContextFilterAttribute.cs | 12 +- .../EnsurePublishedContentRequestAttribute.cs | 10 +- .../FilteredControllerFactoryCollection.cs | 2 +- ...teredControllerFactoryCollectionBuilder.cs | 2 +- src/Umbraco.Web/Mvc/HtmlTagWrapper.cs | 46 +- src/Umbraco.Web/Mvc/HtmlTagWrapperTextNode.cs | 2 +- .../Mvc/IFilteredControllerFactory.cs | 24 +- src/Umbraco.Web/Mvc/IHtmlTagWrapper.cs | 8 +- src/Umbraco.Web/Mvc/IRenderController.cs | 6 +- src/Umbraco.Web/Mvc/IRenderMvcController.cs | 4 +- .../Mvc/MasterControllerFactory.cs | 106 +- .../MergeModelStateToChildActionAttribute.cs | 68 +- .../MergeParentContextViewDataAttribute.cs | 16 +- .../Mvc/MinifyJavaScriptResultAttribute.cs | 6 +- src/Umbraco.Web/Mvc/MvcVersionCheck.cs | 4 +- src/Umbraco.Web/Mvc/NotChildAction.cs | 6 +- src/Umbraco.Web/Mvc/NotFoundHandler.cs | 4 +- src/Umbraco.Web/Mvc/PluginController.cs | 8 +- src/Umbraco.Web/Mvc/PluginControllerArea.cs | 122 +-- .../Mvc/PluginControllerAttribute.cs | 38 +- .../Mvc/PluginControllerMetadata.cs | 26 +- src/Umbraco.Web/Mvc/PluginViewEngine.cs | 164 +-- src/Umbraco.Web/Mvc/PostedDataProxyInfo.cs | 18 +- .../Mvc/PreRenderViewActionFilterAttribute.cs | 8 +- src/Umbraco.Web/Mvc/ProfilingView.cs | 42 +- src/Umbraco.Web/Mvc/ProfilingViewEngine.cs | 78 +- .../Mvc/QueryStringFilterAttribute.cs | 2 +- .../Mvc/RedirectToUmbracoPageResult.cs | 174 +-- .../Mvc/RedirectToUmbracoUrlResult.cs | 10 +- .../Mvc/ReflectedFixedRazorViewEngine.cs | 6 +- src/Umbraco.Web/Mvc/RenderActionInvoker.cs | 52 +- .../Mvc/RenderControllerFactory.cs | 44 +- .../Mvc/RenderIndexActionSelectorAttribute.cs | 8 +- src/Umbraco.Web/Mvc/RenderMvcController.cs | 6 +- src/Umbraco.Web/Mvc/RenderRouteHandler.cs | 24 +- src/Umbraco.Web/Mvc/RenderViewEngine.cs | 130 +-- src/Umbraco.Web/Mvc/RouteDefinition.cs | 38 +- .../Mvc/RouteValueDictionaryExtensions.cs | 64 +- src/Umbraco.Web/Mvc/Strings.Designer.cs | 16 +- src/Umbraco.Web/Mvc/SurfaceController.cs | 12 +- .../Mvc/SurfaceControllerFactory.cs | 118 +-- .../Mvc/SurfaceControllerTypeCollection.cs | 2 +- src/Umbraco.Web/Mvc/SurfaceRouteHandler.cs | 2 +- .../Mvc/UmbracoAuthorizeAttribute.cs | 52 +- .../Mvc/UmbracoAuthorizedController.cs | 14 +- src/Umbraco.Web/Mvc/UmbracoController.cs | 2 +- .../Mvc/UmbracoControllerFactory.cs | 6 +- src/Umbraco.Web/Mvc/UmbracoMvcHandler.cs | 12 +- src/Umbraco.Web/Mvc/UmbracoPageResult.cs | 106 +- .../Mvc/UmbracoViewPageOfTModel.cs | 4 +- .../Mvc/UmbracoVirtualNodeByIdRouteHandler.cs | 2 +- .../Mvc/UmbracoVirtualNodeRouteHandler.cs | 2 +- src/Umbraco.Web/Mvc/UrlHelperExtensions.cs | 36 +- ...dateMvcAngularAntiForgeryTokenAttribute.cs | 6 +- src/Umbraco.Web/Mvc/ViewContextExtensions.cs | 96 +- .../Mvc/ViewDataContainerExtensions.cs | 82 +- .../Mvc/ViewDataDictionaryExtensions.cs | 4 +- .../NotificationServiceExtensions.cs | 8 +- .../OwinMiddlewareConfiguredEventArgs.cs | 4 +- src/Umbraco.Web/PluginManagerExtensions.cs | 74 +- src/Umbraco.Web/Properties/AssemblyInfo.cs | 8 +- .../Properties/Settings1.Designer.cs | 16 +- .../CheckBoxListPropertyEditor.cs | 6 +- .../ColorListPreValueEditor.cs | 12 +- .../ColorPickerPropertyEditor.cs | 4 +- .../ContentPicker2PropertyEditor.cs | 2 +- .../ContentPickerPropertyEditor.cs | 4 +- .../PropertyEditors/DatePreValueEditor.cs | 4 +- .../PropertyEditors/DatePropertyEditor.cs | 6 +- .../PropertyEditors/DateTimePreValueEditor.cs | 4 +- .../PropertyEditors/DateTimePropertyEditor.cs | 4 +- .../PropertyEditors/DateTimeValidator.cs | 8 +- .../PropertyEditors/DecimalPropertyEditor.cs | 8 +- .../DropDownMultiplePropertyEditor.cs | 10 +- .../DropDownMultipleWithKeysPropertyEditor.cs | 12 +- .../PropertyEditors/DropDownPropertyEditor.cs | 4 +- .../DropDownWithKeysPropertyEditor.cs | 4 +- .../EmailAddressPropertyEditor.cs | 4 +- .../FileUploadPropertyEditor.cs | 12 +- .../FileUploadPropertyValueEditor.cs | 2 +- .../FolderBrowserPropertyEditor.cs | 2 +- .../PropertyEditors/GridPropertyEditor.cs | 10 +- .../ImageCropperPropertyEditor.cs | 4 +- .../PropertyEditors/IntegerPropertyEditor.cs | 6 +- .../PropertyEditors/LabelPropertyEditor.cs | 2 +- .../PropertyEditors/ListViewPropertyEditor.cs | 2 +- .../MacroContainerPropertyEditor.cs | 2 +- .../PropertyEditors/MarkdownPropertyEditor.cs | 6 +- .../MediaPicker2PropertyEditor.cs | 2 +- .../MediaPickerPropertyEditor.cs | 2 +- .../MemberPicker2PropertyEditor.cs | 2 +- .../MemberPickerPropertyEditor.cs | 2 +- .../MultiNodeTreePicker2PropertyEditor.cs | 2 +- .../MultiNodeTreePickerPropertyEditor.cs | 2 +- .../MultipleMediaPickerPropertyEditor.cs | 2 +- .../MultipleTextStringPropertyEditor.cs | 12 +- .../MultipleContentPickerParameterEditor.cs | 2 +- .../MultipleContentTypeParameterEditor.cs | 2 +- .../MultipleMediaPickerParameterEditor.cs | 2 +- .../MultiplePropertyGroupParameterEditor.cs | 2 +- .../MultiplePropertyTypeParameterEditor.cs | 2 +- .../PropertyGroupParameterEditor.cs | 2 +- .../PropertyTypeParameterEditor.cs | 2 +- .../SingleMediaPickerParameterEditor.cs | 2 +- .../PropertyEditorAssetAttribute.cs | 6 +- .../PropertyValueEditorWrapper.cs | 4 +- .../PublishValueValueEditor.cs | 6 +- .../PublishValuesMultipleValueEditor.cs | 8 +- .../RadioButtonsPropertyEditor.cs | 4 +- .../RelatedLinks2PropertyEditor.cs | 2 +- .../RichTextPreValueController.cs | 2 +- .../PropertyEditors/RichTextPreValueEditor.cs | 2 +- .../PropertyEditors/RichTextPropertyEditor.cs | 4 +- .../PropertyEditors/SliderPropertyEditor.cs | 8 +- .../TagPropertyEditorTagDefinition.cs | 2 +- .../PropertyEditors/TagsDataController.cs | 4 +- .../PropertyEditors/TagsPropertyEditor.cs | 6 +- .../TrueFalsePropertyEditor.cs | 2 +- .../UploadFileTypeValidator.cs | 8 +- .../UserPickerPropertyEditor.cs | 2 +- .../ImageCropDataSetTypeConverter.cs | 8 +- .../ImageCropperValueConverter.cs | 4 +- .../MacroContainerValueConverter.cs | 4 +- .../MediaPickerPropertyConverter.cs | 10 +- .../MultipleMediaPickerPropertyConverter.cs | 12 +- .../RelatedLinksLegacyValueConverter.cs | 6 +- .../RteMacroRenderingValueConverter.cs | 12 +- .../ValueListPreValueEditor.cs | 24 +- .../PublishedCache/IFacadeService.cs | 18 +- .../PublishedCache/NuCache/ContentNode.cs | 2 +- .../PublishedCache/NuCache/MemberCache.cs | 4 +- .../NuCache/Navigable/NavigableContentType.cs | 20 +- .../PublishedFragmentPropertyBase.cs | 2 +- .../PublishedCache/RawValueProperty.cs | 4 +- .../UmbracoContextFacadeAccessor.cs | 2 +- .../XmlPublishedCache/FacadeService.cs | 12 +- .../PublishedContentCache.cs | 20 +- .../XmlPublishedCache/PublishedMediaCache.cs | 204 ++-- .../XmlPublishedCache/SafeXmlReaderWriter.cs | 4 +- .../XmlPublishedCache/XmlPublishedContent.cs | 646 ++++++------ .../XmlPublishedCache/XmlPublishedProperty.cs | 42 +- .../XmlStoreFilePersister.cs | 2 +- src/Umbraco.Web/PublishedContentExtensions.cs | 504 ++++----- src/Umbraco.Web/PublishedContentQuery.cs | 8 +- .../PublishedFragmentExtensions.cs | 4 +- src/Umbraco.Web/RelatedLinksTypeConverter.cs | 2 +- src/Umbraco.Web/RenderFieldCaseType.cs | 24 +- src/Umbraco.Web/RenderFieldEncodingType.cs | 22 +- src/Umbraco.Web/RouteCollectionExtensions.cs | 138 +-- .../Routing/ContentFinderByIdPath.cs | 64 +- .../Routing/ContentFinderByLegacy404.cs | 114 +- .../Routing/ContentFinderByNiceUrl.cs | 70 +- .../ContentFinderByNiceUrlAndTemplate.cs | 4 +- .../Routing/ContentFinderByPageIdQuery.cs | 50 +- .../Routing/ContentFinderByProfile.cs | 6 +- .../Routing/ContentFinderByRedirectUrl.cs | 2 +- .../Routing/ContentFinderByUrlAlias.cs | 72 +- .../Routing/CustomRouteUrlProvider.cs | 12 +- src/Umbraco.Web/Routing/DomainAndUri.cs | 2 +- src/Umbraco.Web/Routing/DomainHelper.cs | 6 +- .../Routing/EnsureRoutableOutcome.cs | 4 +- src/Umbraco.Web/Routing/FacadeRouter.cs | 790 +++++++------- src/Umbraco.Web/Routing/IContentFinder.cs | 24 +- src/Umbraco.Web/Routing/IUrlProvider.cs | 10 +- .../Routing/LegacyRequestInitializer.cs | 14 +- .../Routing/NotFoundHandlerHelper.cs | 10 +- .../PublishedContentNotFoundHandler.cs | 76 +- .../Routing/PublishedContentRequest.cs | 104 +- .../Routing/RoutableAttemptEventArgs.cs | 4 +- src/Umbraco.Web/Routing/SiteDomainHelper.cs | 84 +- .../Routing/UmbracoRequestEventArgs.cs | 2 +- src/Umbraco.Web/Routing/UrlProvider.cs | 4 +- .../Routing/UrlProviderCollection.cs | 2 +- .../Routing/UrlProviderCollectionBuilder.cs | 2 +- .../Routing/UrlProviderExtensions.cs | 2 +- src/Umbraco.Web/Routing/UrlProviderMode.cs | 2 +- .../Routing/WebServicesRouteConstraint.cs | 10 +- .../Scheduling/BackgroundTaskRunnerOptions.cs | 4 +- src/Umbraco.Web/Scheduling/IBackgroundTask.cs | 2 +- .../Scheduling/IBackgroundTaskRunner.cs | 4 +- src/Umbraco.Web/Scheduling/KeepAlive.cs | 6 +- src/Umbraco.Web/Scheduling/LogScrubber.cs | 4 +- .../Scheduling/RecurringTaskBase.cs | 4 +- .../Scheduling/ScheduledPublishing.cs | 4 +- src/Umbraco.Web/Scheduling/ScheduledTasks.cs | 4 +- .../Scheduling/TaskAndFactoryExtensions.cs | 4 +- src/Umbraco.Web/Scheduling/TaskEventArgs.cs | 2 +- .../Scheduling/ThreadingTaskImmutable.cs | 4 +- src/Umbraco.Web/Search/ExamineComponent.cs | 126 +-- src/Umbraco.Web/Search/ExamineIndexerModel.cs | 4 +- .../Search/LuceneIndexerExtensions.cs | 4 +- .../Security/Identity/AppBuilderExtensions.cs | 10 +- .../AuthenticationManagerExtensions.cs | 4 +- .../AuthenticationOptionsExtensions.cs | 12 +- .../Identity/BackOfficeCookieManager.cs | 20 +- .../Identity/ExternalSignInAutoLinkOptions.cs | 14 +- .../Identity/FixWindowsAuthMiddlware.cs | 6 +- ...ForceRenewalCookieAuthenticationHandler.cs | 12 +- ...ceRenewalCookieAuthenticationMiddleware.cs | 8 +- .../FormsAuthenticationSecureDataFormat.cs | 12 +- .../Identity/GetUserSecondsMiddleWare.cs | 10 +- .../IUmbracoBackOfficeTwoFactorOptions.cs | 4 +- .../PreviewAuthenticationMiddleware.cs | 14 +- .../UmbracoBackOfficeCookieAuthOptions.cs | 12 +- .../Security/LegacyDefaultAppMapping.cs | 8 +- src/Umbraco.Web/Security/OwinExtensions.cs | 6 +- .../Providers/MembersMembershipProvider.cs | 4 +- .../Security/Providers/MembersRoleProvider.cs | 8 +- .../Providers/UmbracoMembershipProvider.cs | 44 +- .../Providers/UsersMembershipProvider.cs | 4 +- .../Security/ValidateRequestAttempt.cs | 4 +- src/Umbraco.Web/Security/WebAuthExtensions.cs | 8 +- src/Umbraco.Web/Security/WebSecurity.cs | 2 +- src/Umbraco.Web/SignalR/IPreviewHub.cs | 2 +- .../SignalR/PreviewHubComponent.cs | 2 +- .../ClearCsrfCookiesAfterUpgrade.cs | 2 +- ...ediaXmlCacheForDeletedItemsAfterUpgrade.cs | 2 +- .../EnsureListViewDataTypeIsCreated.cs | 2 +- .../Strategies/Migrations/IPostMigration.cs | 2 +- .../Migrations/PostMigrationCollection.cs | 4 +- .../PostMigrationCollectionBuilder.cs | 4 +- .../Migrations/PostMigrationComponent.cs | 2 +- .../PublishAfterUpgradeToVersionSixth.cs | 2 +- .../RebuildXmlCachesAfterUpgrade.cs | 2 +- .../Strategies/NotificationsComponent.cs | 2 +- .../Strategies/PublicAccessComponent.cs | 2 +- src/Umbraco.Web/TagQuery.cs | 4 +- src/Umbraco.Web/Templates/TemplateRenderer.cs | 272 ++--- .../Templates/TemplateUtilities.cs | 12 +- src/Umbraco.Web/Trees/ActionUrlMethod.cs | 2 +- .../Trees/ApplicationTreeExtensions.cs | 28 +- .../Trees/ContentTreeController.cs | 2 +- .../Trees/ContentTreeControllerBase.cs | 4 +- .../Trees/ContentTypeTreeController.cs | 2 +- src/Umbraco.Web/Trees/CoreTreeAttribute.cs | 4 +- .../Trees/DataTypeTreeController.cs | 2 +- src/Umbraco.Web/Trees/ISearchableTree.cs | 2 +- .../Trees/LegacyBaseTreeAttribute.cs | 4 +- src/Umbraco.Web/Trees/LegacyTreeController.cs | 2 +- .../Trees/LegacyTreeDataConverter.cs | 18 +- src/Umbraco.Web/Trees/LegacyTreeJavascript.cs | 2 +- src/Umbraco.Web/Trees/LegacyTreeParams.cs | 2 +- src/Umbraco.Web/Trees/MacrosTreeController.cs | 2 +- src/Umbraco.Web/Trees/MediaTreeController.cs | 2 +- src/Umbraco.Web/Trees/MemberTreeController.cs | 2 +- .../Trees/MenuRenderingEventArgs.cs | 2 +- .../Trees/PackagesTreeController.cs | 2 +- .../Trees/PartialViewMacrosTreeController.cs | 34 +- src/Umbraco.Web/Trees/TreeControllerBase.cs | 2 +- .../Trees/TreeNodeRenderingEventArgs.cs | 2 +- .../Trees/TreeNodesRenderingEventArgs.cs | 2 +- .../Trees/TreeQueryStringParameters.cs | 2 +- .../Trees/TreeRenderingEventArgs.cs | 2 +- src/Umbraco.Web/Trees/UrlHelperExtensions.cs | 2 +- .../Trees/UserPermissionsTreeController.cs | 4 +- .../Trees/UserTypesTreeController.cs | 4 +- src/Umbraco.Web/Trees/UsersTreeController.cs | 2 +- src/Umbraco.Web/UI/Bundles/JsJQueryCore.cs | 2 +- src/Umbraco.Web/UI/Bundles/JsJQueryPlugins.cs | 2 +- .../UI/Bundles/JsUmbracoApplicationCore.cs | 2 +- .../UI/Bundles/JsUmbracoApplicationUI.cs | 4 +- src/Umbraco.Web/UI/Bundles/JsUmbracoTree.cs | 4 +- .../UI/Controls/InsertMacroSplitButton.cs | 234 ++--- src/Umbraco.Web/UI/Controls/ProgressBar.cs | 2 +- src/Umbraco.Web/UI/Controls/UmbracoControl.cs | 22 +- .../UI/Controls/UmbracoUserControl.cs | 2 +- src/Umbraco.Web/UI/IAssignedApp.cs | 2 +- .../UI/JavaScript/AssetInitialization.cs | 2 +- .../UI/JavaScript/CssInitialization.cs | 4 +- .../UI/JavaScript/DependencyPathRenderer.cs | 4 +- .../UI/JavaScript/JsInitialization.cs | 4 +- .../UI/JavaScript/Resources.Designer.cs | 22 +- .../UI/JavaScript/ServerVariablesParser.cs | 8 +- .../UmbracoClientDependencyLoader.cs | 4 +- src/Umbraco.Web/UI/Pages/ClientTools.cs | 424 ++++---- .../UI/Pages/UmbracoEnsuredPage.cs | 8 +- src/Umbraco.Web/UmbracoApplication.cs | 16 +- src/Umbraco.Web/UmbracoComponentRenderer.cs | 36 +- src/Umbraco.Web/UmbracoContext.cs | 54 +- src/Umbraco.Web/UmbracoHelper.cs | 552 +++++----- src/Umbraco.Web/UmbracoModule.cs | 390 +++---- src/Umbraco.Web/UriUtility.cs | 234 ++--- src/Umbraco.Web/UrlHelperExtensions.cs | 14 +- src/Umbraco.Web/UrlHelperRenderExtensions.cs | 18 +- .../org.umbraco.our/Reference.cs | 388 +++---- .../org.umbraco.update/Reference.cs | 98 +- .../WebApi/AngularJsonMediaTypeFormatter.cs | 2 +- .../AngularJsonOnlyConfigurationAttribute.cs | 4 +- .../WebApi/Binders/ContentItemBaseBinder.cs | 2 +- .../WebApi/Binders/ContentItemBinder.cs | 2 +- .../WebApi/Binders/MediaItemBinder.cs | 2 +- .../WebApi/Binders/MemberBinder.cs | 2 +- .../WebApi/CustomDateTimeConvertor.cs | 4 +- .../Filters/AngularAntiForgeryHelper.cs | 12 +- .../AppendCurrentEventMessagesAttribute.cs | 6 +- .../ClearAngularAntiForgeryTokenAttribute.cs | 2 +- .../Filters/ContentItemValidationHelper.cs | 10 +- .../EnableOverrideAuthorizationAttribute.cs | 4 +- ...EnsureUserPermissionForContentAttribute.cs | 2 +- .../EnsureUserPermissionForMediaAttribute.cs | 4 +- .../FileUploadCleanupFilterAttribute.cs | 12 +- .../FilterAllowedOutgoingContentAttribute.cs | 2 +- .../FilterAllowedOutgoingMediaAttribute.cs | 2 +- .../WebApi/Filters/FilterGrouping.cs | 2 +- .../Filters/HttpQueryStringFilterAttribute.cs | 6 +- .../Filters/LegacyTreeAuthorizeAttribute.cs | 2 +- .../OutgoingDateTimeFormatAttribute.cs | 2 +- .../OutgoingEditorModelEventAttribute.cs | 6 +- .../OutgoingNoHyphenGuidFormatAttribute.cs | 4 +- .../OverridableAuthorizationAttribute.cs | 6 +- .../SetAngularAntiForgeryTokensAttribute.cs | 4 +- .../UmbracoApplicationAuthorizeAttribute.cs | 2 +- .../UmbracoBackOfficeLogoutAttribute.cs | 2 +- .../Filters/UmbracoTreeAuthorizeAttribute.cs | 2 +- .../UmbracoUserTimeoutFilterAttribute.cs | 6 +- .../UmbracoWebApiRequireHttpsAttribute.cs | 6 +- ...alidateAngularAntiForgeryTokenAttribute.cs | 4 +- .../Filters/ValidationFilterAttribute.cs | 2 +- .../WebApi/GuidNoHyphenConverter.cs | 2 +- .../WebApi/HttpControllerContextExtensions.cs | 8 +- .../WebApi/HttpRequestMessageExtensions.cs | 6 +- .../WebApi/IsBackOfficeAttribute.cs | 2 +- .../WebApi/JsonCamelCaseFormatter.cs | 4 +- .../WebApi/MemberAuthorizeAttribute.cs | 2 +- src/Umbraco.Web/WebApi/MvcVersionCheck.cs | 4 +- .../WebApi/NamespaceHttpControllerSelector.cs | 16 +- .../WebApi/PrefixlessBodyModelValidator.cs | 2 +- .../PrefixlessBodyModelValidatorAttribute.cs | 6 +- .../SessionHttpControllerRouteHandler.cs | 8 +- .../WebApi/UmbracoApiControllerBase.cs | 6 +- .../WebApi/UmbracoAuthorizeAttribute.cs | 2 +- .../WebApi/UmbracoAuthorizedApiController.cs | 2 +- .../WebServices/BulkPublishController.cs | 10 +- .../WebServices/CoreStringsController.cs | 4 +- .../WebServices/EmbedMediaService.cs | 2 +- .../ExamineManagementApiController.cs | 2 +- .../WebServices/SaveFileController.cs | 12 +- .../WebServices/ScheduledPublishController.cs | 6 +- .../UmbracoAuthorizedHttpHandler.cs | 2 +- .../WebServices/UmbracoHttpHandler.cs | 2 +- .../WebServices/UmbracoWebService.cs | 2 +- .../WebServices/XmlDataIntegrityController.cs | 4 +- .../_Legacy/Actions/ActionAssignDomain.cs | 120 +-- .../_Legacy/Actions/ActionAudit.cs | 130 +-- .../_Legacy/Actions/ActionBrowse.cs | 100 +- src/Umbraco.Web/_Legacy/Actions/ActionCopy.cs | 140 +-- .../_Legacy/Actions/ActionDelete.cs | 142 +-- .../_Legacy/Actions/ActionEmptyTranscan.cs | 142 +-- .../_Legacy/Actions/ActionExport.cs | 140 +-- .../_Legacy/Actions/ActionImport.cs | 140 +-- src/Umbraco.Web/_Legacy/Actions/ActionMove.cs | 140 +-- src/Umbraco.Web/_Legacy/Actions/ActionNew.cs | 130 +-- .../_Legacy/Actions/ActionNewFolder.cs | 142 +-- .../_Legacy/Actions/ActionNotify.cs | 140 +-- src/Umbraco.Web/_Legacy/Actions/ActionNull.cs | 90 +- .../_Legacy/Actions/ActionPackage.cs | 140 +-- .../_Legacy/Actions/ActionPackageCreate.cs | 140 +-- .../_Legacy/Actions/ActionProtect.cs | 140 +-- .../_Legacy/Actions/ActionPublish.cs | 140 +-- src/Umbraco.Web/_Legacy/Actions/ActionQuit.cs | 142 +-- .../_Legacy/Actions/ActionRePublish.cs | 140 +-- .../_Legacy/Actions/ActionRefresh.cs | 142 +-- .../_Legacy/Actions/ActionRestore.cs | 2 +- .../_Legacy/Actions/ActionRights.cs | 140 +-- .../_Legacy/Actions/ActionRollback.cs | 140 +-- .../_Legacy/Actions/ActionSendToTranslate.cs | 140 +-- src/Umbraco.Web/_Legacy/Actions/ActionSort.cs | 140 +-- .../_Legacy/Actions/ActionToPublish.cs | 142 +-- .../_Legacy/Actions/ActionTranslate.cs | 140 +-- .../_Legacy/Actions/ActionUnPublish.cs | 114 +- .../_Legacy/Actions/ActionUpdate.cs | 142 +-- .../_Legacy/Actions/ContextMenuSeperator.cs | 90 +- .../Actions/LegacyActionMenuItemAttribute.cs | 6 +- src/Umbraco.Web/_Legacy/Controls/CodeArea.cs | 28 +- .../_Legacy/Controls/FieldDropDownList.cs | 2 +- .../_Legacy/Controls/MenuButton.cs | 4 +- .../_Legacy/Controls/MenuButtonI.cs | 4 +- src/Umbraco.Web/_Legacy/Controls/MenuIcon.cs | 14 +- src/Umbraco.Web/_Legacy/Controls/Panel.cs | 18 +- .../_Legacy/Controls/PropertyPanel.cs | 6 +- .../_Legacy/Controls/ScrollingMenu.cs | 12 +- src/Umbraco.Web/_Legacy/Controls/Splitter.cs | 4 +- src/Umbraco.Web/_Legacy/Controls/TabPage.cs | 8 +- src/Umbraco.Web/_Legacy/Controls/TabView.cs | 44 +- src/Umbraco.Web/_Legacy/Controls/feedback.cs | 12 +- src/Umbraco.Web/_Legacy/Controls/pane.cs | 6 +- .../_Legacy/PackageActions/PackageHelper.cs | 134 +-- .../_Legacy/PackageActions/addApplication.cs | 100 +- .../PackageActions/addDashboardSection.cs | 156 +-- .../PackageActions/addProxyFeedHost.cs | 152 +-- .../PackageActions/addStringToHtmlElement.cs | 320 +++--- .../_Legacy/PackageActions/allowDoctype.cs | 146 +-- .../PackageActions/moveRootDocument.cs | 4 +- .../PackageActions/publishRootDocument.cs | 118 +-- .../removeStringFromTemplate.cs | 48 +- .../FileResources/PackageFiles.Designer.cs | 16 +- src/Umbraco.Web/_Legacy/Packager/Installer.cs | 20 +- src/Umbraco.Web/_Legacy/Packager/Package.cs | 10 +- .../PackageInstance/InstalledPackage.cs | 26 +- .../PackageInstance/PackageActions.cs | 102 +- .../PackageInstance/PackagerUtility.cs | 8 +- .../Packager/Repositories/Repository.cs | 14 +- .../Repositories/RepositoryWebservice.cs | 4 +- .../_Legacy/Packager/RequirementsType.cs | 4 +- src/Umbraco.Web/_Legacy/Packager/Settings.cs | 88 +- src/Umbraco.Web/_Legacy/UI/ITask.cs | 26 +- src/Umbraco.Web/_Legacy/UI/ITaskReturnUrl.cs | 12 +- .../_Legacy/UI/LegacyDialogHandler.cs | 16 +- .../AttributeCollectionAdapter.cs | 544 +++++----- .../umbraco.presentation/MacroCacheContent.cs | 40 +- .../XsltExtensionAttribute.cs | 8 +- .../umbraco.presentation/default.aspx.cs | 8 +- .../umbraco.presentation/helper.cs | 4 +- src/Umbraco.Web/umbraco.presentation/item.cs | 6 +- .../umbraco.presentation/library.cs | 112 +- src/Umbraco.Web/umbraco.presentation/page.cs | 528 +++++----- .../umbraco.presentation/template.cs | 4 +- .../umbraco/Trees/BaseTree.cs | 96 +- .../umbraco/Trees/ITreeService.cs | 36 +- .../umbraco/Trees/NullTree.cs | 18 +- .../umbraco/Trees/TreeDefinition.cs | 8 +- .../umbraco/Trees/TreeDefinitionCollection.cs | 30 +- .../umbraco/Trees/TreeEventArgs.cs | 4 +- .../umbraco/Trees/TreeRequestParams.cs | 242 ++--- .../umbraco/Trees/TreeService.cs | 190 ++-- .../umbraco/Trees/TreeUrlGenerator.cs | 12 +- .../umbraco/Trees/XmlTree.cs | 748 ++++++------- .../umbraco/Trees/loadPackager.cs | 26 +- .../umbraco/Trees/loadPackages.cs | 24 +- .../umbraco/Trees/loadTranslationTasks.cs | 18 +- .../umbraco/Web/UI/ContentPage.cs | 40 +- .../umbraco/actions/delete.aspx.cs | 6 +- .../umbraco/actions/delete.aspx.designer.cs | 20 +- .../actions/editContent.aspx.designer.cs | 8 +- .../umbraco/actions/preview.aspx.designer.cs | 8 +- .../umbraco/actions/publish.aspx.cs | 6 +- .../umbraco/actions/publish.aspx.designer.cs | 20 +- .../umbraco/controls/ContentControl.cs | 12 +- .../umbraco/controls/ContentPicker.cs | 20 +- .../umbraco/controls/ContentTypeControl.cs | 154 +-- .../umbraco/controls/ProgressBar.ascx.cs | 26 +- .../controls/ProgressBar.ascx.designer.cs | 6 +- .../controls/Tree/CustomTreeControl.cs | 12 +- .../controls/Tree/CustomTreeService.cs | 10 +- .../umbraco/controls/Tree/JTreeContextMenu.cs | 38 +- .../controls/Tree/JTreeContextMenuItem.cs | 118 +-- .../umbraco/controls/Tree/NodeInfo.cs | 54 +- .../umbraco/controls/Tree/TreeControl.ascx.cs | 10 +- .../umbraco/controls/dualSelectBox.cs | 122 +-- .../umbraco/controls/passwordChanger.ascx.cs | 4 +- .../umbraco/create/CreatedPackageTasks.cs | 4 +- .../umbraco/create/PartialViewMacrosTasks.cs | 4 +- .../umbraco/create/PartialViewTasks.cs | 2 +- .../umbraco/create/XsltTasks.cs | 74 +- .../umbraco/create/dictionaryTasks.cs | 4 +- .../umbraco/create/language.ascx.cs | 4 +- .../umbraco/create/languageTasks.cs | 4 +- .../umbraco/create/script.ascx.cs | 42 +- .../umbraco/create/simple.ascx.cs | 2 +- .../umbraco/create/templateTasks.cs | 8 +- .../umbraco/create/xslt.ascx.cs | 4 +- .../umbraco/dashboard/FeedProxy.aspx.cs | 6 +- .../dashboard/FeedProxy.aspx.designer.cs | 6 +- .../Macros/assemblyBrowser.aspx.designer.cs | 20 +- .../developer/Macros/editMacro.aspx.cs | 742 ++++++------- .../developer/Packages/editPackage.aspx.cs | 12 +- .../Packages/editPackage.aspx.designer.cs | 124 +-- .../developer/Packages/installer.aspx.cs | 14 +- .../RelationTypes/EditRelationType.aspx.cs | 24 +- .../EditRelationType.aspx.designer.cs | 424 ++++---- .../RelationTypes/NewRelationType.aspx.cs | 136 +-- .../NewRelationType.aspx.designer.cs | 280 ++--- .../RelationTypesWebService.asmx.cs | 48 +- .../TreeMenu/ActionDeleteRelationType.cs | 134 +-- .../TreeMenu/ActionNewRelationType.cs | 136 +-- .../umbraco/developer/Xslt/editXslt.aspx.cs | 248 ++--- .../developer/Xslt/getXsltStatus.asmx.cs | 132 +-- .../Xslt/xsltChooseExtension.aspx.cs | 158 +-- .../Xslt/xsltChooseExtension.aspx.designer.cs | 14 +- .../developer/Xslt/xsltInsertValueOf.aspx.cs | 42 +- .../Xslt/xsltInsertValueOf.aspx.designer.cs | 14 +- .../developer/Xslt/xsltVisualize.aspx.cs | 12 +- .../Xslt/xsltVisualize.aspx.designer.cs | 20 +- .../umbraco/developer/autoDoc.aspx.cs | 76 +- .../developer/autoDoc.aspx.designer.cs | 4 +- .../umbraco/dialogs/AssignDomain2.aspx.cs | 4 +- .../dialogs/AssignDomain2.aspx.designer.cs | 20 +- .../umbraco/dialogs/Preview.aspx.designer.cs | 16 +- .../umbraco/dialogs/SendPublish.aspx.cs | 28 +- .../dialogs/SendPublish.aspx.designer.cs | 6 +- .../umbraco/dialogs/about.aspx.cs | 62 +- .../umbraco/dialogs/about.aspx.designer.cs | 12 +- .../umbraco/dialogs/create.aspx.cs | 2 +- .../umbraco/dialogs/cruds.aspx.cs | 18 +- .../dialogs/exportDocumenttype.aspx.cs | 76 +- .../dialogs/importDocumenttype.aspx.cs | 154 +-- .../insertMasterpageContent.aspx.designer.cs | 12 +- .../insertMasterpagePlaceholder.aspx.cs | 2 +- ...sertMasterpagePlaceholder.aspx.designer.cs | 8 +- .../umbraco/dialogs/notifications.aspx.cs | 4 +- .../dialogs/notifications.aspx.designer.cs | 14 +- .../umbraco/dialogs/protectPage.aspx.cs | 6 +- .../umbraco/dialogs/republish.aspx.cs | 8 +- .../dialogs/republish.aspx.designer.cs | 14 +- .../umbraco/dialogs/rollBack.aspx.cs | 6 +- .../umbraco/dialogs/rollBack.aspx.designer.cs | 38 +- .../umbraco/dialogs/search.aspx.cs | 4 +- .../umbraco/dialogs/search.aspx.designer.cs | 16 +- .../sendToTranslation.aspx.designer.cs | 30 +- .../umbraco/dialogs/sort.aspx.cs | 2 +- .../umbraco/dialogs/treePicker.aspx.cs | 42 +- .../umbraco/dialogs/umbracoField.aspx.cs | 420 ++++---- .../umbraco/dialogs/viewAuditTrail.aspx.cs | 98 +- .../dialogs/viewAuditTrail.aspx.designer.cs | 10 +- .../umbraco/endPreview.aspx.cs | 2 +- .../umbraco/masterpages/default.Master.cs | 2 +- .../masterpages/umbracoDialog.Master.cs | 262 ++--- .../umbraco.presentation/umbraco/ping.aspx.cs | 2 +- .../settings/DictionaryItemList.aspx.cs | 16 +- .../DictionaryItemList.aspx.designer.cs | 14 +- .../settings/EditDictionaryItem.aspx.cs | 28 +- .../EditDictionaryItem.aspx.designer.cs | 10 +- .../umbraco/settings/editLanguage.aspx.cs | 124 +-- .../settings/editLanguage.aspx.designer.cs | 16 +- .../umbraco/settings/editTemplate.aspx.cs | 550 +++++----- .../stylesheet/editstylesheet.aspx.cs | 4 +- .../property/EditStyleSheetProperty.aspx.cs | 4 +- .../umbraco/templateControls/ContentType.cs | 4 +- .../DisableEventValidation.cs | 2 +- .../umbraco/templateControls/Image.cs | 42 +- .../umbraco/templateControls/Item.cs | 4 +- .../umbraco/templateControls/Macro.cs | 74 +- .../templateControls/Resources.Designer.cs | 28 +- .../translation/default.aspx.designer.cs | 22 +- .../umbraco/translation/details.aspx.cs | 6 +- .../translation/details.aspx.designer.cs | 30 +- .../umbraco/translation/preview.aspx.cs | 6 +- .../translation/preview.aspx.designer.cs | 6 +- .../umbraco/translation/xml.aspx.designer.cs | 8 +- .../umbraco/users/EditUser.aspx.cs | 6 +- .../umbraco/users/EditUserType.aspx.cs | 6 +- .../users/EditUserType.aspx.designer.cs | 28 +- .../umbraco/users/NodePermissions.ascx.cs | 26 +- .../users/NodePermissions.ascx.designer.cs | 16 +- .../umbraco/users/PermissionEditor.aspx.cs | 46 +- .../users/PermissionEditor.aspx.designer.cs | 22 +- .../umbraco/users/UserPermissions.cs | 10 +- .../webservices/CacheRefresher.asmx.cs | 90 +- .../umbraco/webservices/Developer.asmx.cs | 92 +- .../webservices/codeEditorSave.asmx.cs | 10 +- .../webservices/legacyAjaxCalls.asmx.cs | 10 +- .../umbraco/webservices/nodeSorter.asmx.cs | 4 +- .../umbraco/webservices/templates.asmx.cs | 28 +- .../umbraco.presentation/umbracoPageHolder.cs | 194 ++-- .../DataServices/UmbracoContentService.cs | 4 +- src/UmbracoExamine/DeletePolicyTracker.cs | 2 +- .../ExamineIndexCollectionAccessor.cs | 4 +- .../IExamineIndexCollectionAccessor.cs | 4 +- src/UmbracoExamine/IndexTypes.cs | 6 +- src/UmbracoExamine/LegacyExtensions.cs | 6 +- src/UmbracoExamine/LegacyLibrary.cs | 66 +- .../AzureLocalStorageDirectory.cs | 6 +- .../CodeGenLocalStorageDirectory.cs | 6 +- .../LocalStorage/DirectoryTracker.cs | 4 +- .../LocalStorage/ILocalStorageDirectory.cs | 4 +- .../LocalStorage/LocalStorageType.cs | 2 +- .../LocalStorage/LocalTempStorageDirectory.cs | 34 +- .../LocalTempStorageDirectoryTracker.cs | 4 +- .../LocalStorage/LocalTempStorageIndexer.cs | 4 +- .../LocalStorage/MultiIndexLock.cs | 8 +- .../LocalStorage/MultiIndexLockFactory.cs | 6 +- .../LocalStorage/MultiIndexOutput.cs | 6 +- src/UmbracoExamine/LoggingLevel.cs | 2 +- src/UmbracoExamine/StaticField.cs | 2 +- src/UmbracoExamine/StaticFieldCollection.cs | 2 +- src/UmbracoExamine/UmbracoContentIndexer.cs | 2 +- .../UmbracoContentIndexerOptions.cs | 4 +- .../UmbracoContentValueSetValidator.cs | 12 +- src/UmbracoExamine/XsltExtensions.cs | 8 +- 2466 files changed, 26012 insertions(+), 26010 deletions(-) diff --git a/src/SolutionInfo.cs b/src/SolutionInfo.cs index 54e1aa629a..3410d01dd1 100644 --- a/src/SolutionInfo.cs +++ b/src/SolutionInfo.cs @@ -17,4 +17,4 @@ using System.Resources; // these are FYI and changed automatically [assembly: AssemblyFileVersion("8.0.0")] -[assembly: AssemblyInformationalVersion("8.0.0-alpha0021")] \ No newline at end of file +[assembly: AssemblyInformationalVersion("8.0.0-alpha0021")] diff --git a/src/Umbraco.Compat7/Core/ApplicationContext.cs b/src/Umbraco.Compat7/Core/ApplicationContext.cs index bfc672fdaa..136ab42138 100644 --- a/src/Umbraco.Compat7/Core/ApplicationContext.cs +++ b/src/Umbraco.Compat7/Core/ApplicationContext.cs @@ -25,7 +25,7 @@ namespace Umbraco.Core public bool IsConfigured => Composing.Current.RuntimeState.Level == RuntimeLevel.Run; - public bool IsUpgrading => Composing.Current.RuntimeState.Level == RuntimeLevel.Upgrade; + public bool IsUpgrading => Composing.Current.RuntimeState.Level == RuntimeLevel.Upgrade; public DatabaseContext DatabaseContext { get; } diff --git a/src/Umbraco.Compat7/Core/ApplicationEventHandler.cs b/src/Umbraco.Compat7/Core/ApplicationEventHandler.cs index 9125d267f6..b60c5dd49f 100644 --- a/src/Umbraco.Compat7/Core/ApplicationEventHandler.cs +++ b/src/Umbraco.Compat7/Core/ApplicationEventHandler.cs @@ -60,4 +60,4 @@ namespace Umbraco.Core protected virtual bool ExecuteWhenDatabaseNotConfigured => false; } -} \ No newline at end of file +} diff --git a/src/Umbraco.Compat7/Core/Cache/CacheRefreshersResolver.cs b/src/Umbraco.Compat7/Core/Cache/CacheRefreshersResolver.cs index afee038a51..849e9ad483 100644 --- a/src/Umbraco.Compat7/Core/Cache/CacheRefreshersResolver.cs +++ b/src/Umbraco.Compat7/Core/Cache/CacheRefreshersResolver.cs @@ -9,7 +9,7 @@ namespace Umbraco.Core.Cache { public class CacheRefreshersResolver : LazyManyObjectsResolverBase { - private CacheRefreshersResolver(CacheRefresherCollectionBuilder builder) + private CacheRefreshersResolver(CacheRefresherCollectionBuilder builder) : base(builder) { } diff --git a/src/Umbraco.Compat7/Core/IApplicationEventHandler.cs b/src/Umbraco.Compat7/Core/IApplicationEventHandler.cs index afc8c36e0d..098e66e1aa 100644 --- a/src/Umbraco.Compat7/Core/IApplicationEventHandler.cs +++ b/src/Umbraco.Compat7/Core/IApplicationEventHandler.cs @@ -5,9 +5,9 @@ using Umbraco.Core.Composing; namespace Umbraco.Core { /// - /// Custom IApplicationStartupHandler that auto subscribes to the applications events - /// - public interface IApplicationEventHandler : IDiscoverable + /// Custom IApplicationStartupHandler that auto subscribes to the applications events + /// + public interface IApplicationEventHandler : IDiscoverable { /// /// ApplicationContext is created and other static objects that require initialization have been setup @@ -31,4 +31,4 @@ namespace Umbraco.Core /// void OnApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Compat7/Core/Logging/LogHelper.cs b/src/Umbraco.Compat7/Core/Logging/LogHelper.cs index 8bfefbedf6..fa94125ce1 100644 --- a/src/Umbraco.Compat7/Core/Logging/LogHelper.cs +++ b/src/Umbraco.Compat7/Core/Logging/LogHelper.cs @@ -29,7 +29,7 @@ namespace Umbraco.Core.Logging #endregion - #region Warn + #region Warn public static void Warn(Type callingType, string message, params Func[] formatItems) { diff --git a/src/Umbraco.Compat7/Core/ObjectResolution/ManyObjectsResolverBase.cs b/src/Umbraco.Compat7/Core/ObjectResolution/ManyObjectsResolverBase.cs index 92e412e367..3b45998fee 100644 --- a/src/Umbraco.Compat7/Core/ObjectResolution/ManyObjectsResolverBase.cs +++ b/src/Umbraco.Compat7/Core/ObjectResolution/ManyObjectsResolverBase.cs @@ -100,4 +100,4 @@ namespace Umbraco.Core.ObjectResolution return _builder.Has(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Compat7/Core/PropertyEditors/PropertyValueConvertersResolver.cs b/src/Umbraco.Compat7/Core/PropertyEditors/PropertyValueConvertersResolver.cs index 466403db6e..1e31de05ac 100644 --- a/src/Umbraco.Compat7/Core/PropertyEditors/PropertyValueConvertersResolver.cs +++ b/src/Umbraco.Compat7/Core/PropertyEditors/PropertyValueConvertersResolver.cs @@ -12,7 +12,7 @@ namespace Umbraco.Core.PropertyEditors : base(builder) { } - public static PropertyValueConvertersResolver Current { get; } + public static PropertyValueConvertersResolver Current { get; } = new PropertyValueConvertersResolver(CoreCurrent.Container.GetInstance()); public IEnumerable Converters => CoreCurrent.PropertyValueConverters; diff --git a/src/Umbraco.Compat7/Core/Strings/UrlSegmentProviderResolver.cs b/src/Umbraco.Compat7/Core/Strings/UrlSegmentProviderResolver.cs index 97300d166b..2677ddb618 100644 --- a/src/Umbraco.Compat7/Core/Strings/UrlSegmentProviderResolver.cs +++ b/src/Umbraco.Compat7/Core/Strings/UrlSegmentProviderResolver.cs @@ -12,9 +12,9 @@ namespace Umbraco.Core.Strings : base(builder) { } - public static UrlSegmentProviderResolver Current { get; } + public static UrlSegmentProviderResolver Current { get; } = new UrlSegmentProviderResolver(CoreCurrent.Container.GetInstance()); public IEnumerable Providers => CoreCurrent.UrlSegmentProviders; } -} \ No newline at end of file +} diff --git a/src/Umbraco.Compat7/Properties/AssemblyInfo.cs b/src/Umbraco.Compat7/Properties/AssemblyInfo.cs index bd30fcbcce..95773b60d9 100644 --- a/src/Umbraco.Compat7/Properties/AssemblyInfo.cs +++ b/src/Umbraco.Compat7/Properties/AssemblyInfo.cs @@ -1,7 +1,7 @@ using System.Reflection; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following +// 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("Umbraco.Compat7")] @@ -9,8 +9,8 @@ using System.Runtime.InteropServices; [assembly: AssemblyConfiguration("")] [assembly: AssemblyProduct("Umbraco CMS")] -// 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 +// 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)] diff --git a/src/Umbraco.Compat7/Web/HealthCheck/HealthCheckResolver.cs b/src/Umbraco.Compat7/Web/HealthCheck/HealthCheckResolver.cs index 092ca9fb8e..ea5334239a 100644 --- a/src/Umbraco.Compat7/Web/HealthCheck/HealthCheckResolver.cs +++ b/src/Umbraco.Compat7/Web/HealthCheck/HealthCheckResolver.cs @@ -8,7 +8,7 @@ namespace Umbraco.Web.HealthCheck { public class HealthCheckResolver : LazyManyObjectsResolverBase { - private HealthCheckResolver(HealthCheckCollectionBuilder builder) + private HealthCheckResolver(HealthCheckCollectionBuilder builder) : base(builder) { } diff --git a/src/Umbraco.Compat7/Web/Models/RenderModel.cs b/src/Umbraco.Compat7/Web/Models/RenderModel.cs index 1eed39d203..bc0a58cab9 100644 --- a/src/Umbraco.Compat7/Web/Models/RenderModel.cs +++ b/src/Umbraco.Compat7/Web/Models/RenderModel.cs @@ -36,4 +36,4 @@ namespace Umbraco.Web.Models /// public CultureInfo CurrentCulture { get; private set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Compat7/Web/Mvc/FilteredControllerFactoriesResolver.cs b/src/Umbraco.Compat7/Web/Mvc/FilteredControllerFactoriesResolver.cs index edf185fb01..ceec453c3d 100644 --- a/src/Umbraco.Compat7/Web/Mvc/FilteredControllerFactoriesResolver.cs +++ b/src/Umbraco.Compat7/Web/Mvc/FilteredControllerFactoriesResolver.cs @@ -9,7 +9,7 @@ namespace Umbraco.Web.Mvc { public class FilteredControllerFactoriesResolver : ManyObjectsResolverBase { - public FilteredControllerFactoriesResolver(FilteredControllerFactoryCollectionBuilder builder) + public FilteredControllerFactoriesResolver(FilteredControllerFactoryCollectionBuilder builder) : base(builder) { } diff --git a/src/Umbraco.Compat7/Web/Mvc/UmbracoTemplatePage.cs b/src/Umbraco.Compat7/Web/Mvc/UmbracoTemplatePage.cs index 5b582a7f35..70124ab3c9 100644 --- a/src/Umbraco.Compat7/Web/Mvc/UmbracoTemplatePage.cs +++ b/src/Umbraco.Compat7/Web/Mvc/UmbracoTemplatePage.cs @@ -26,4 +26,4 @@ namespace Umbraco.Web.Mvc } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Compat7/Web/Routing/ContentFinderResolver.cs b/src/Umbraco.Compat7/Web/Routing/ContentFinderResolver.cs index 48951c3cd3..620dcfac8d 100644 --- a/src/Umbraco.Compat7/Web/Routing/ContentFinderResolver.cs +++ b/src/Umbraco.Compat7/Web/Routing/ContentFinderResolver.cs @@ -9,7 +9,7 @@ namespace Umbraco.Web.Routing { public class ContentFinderResolver : ManyObjectsResolverBase { - private ContentFinderResolver(ContentFinderCollectionBuilder builder) + private ContentFinderResolver(ContentFinderCollectionBuilder builder) : base(builder) { } diff --git a/src/Umbraco.Compat7/Web/Routing/UrlProviderResolver.cs b/src/Umbraco.Compat7/Web/Routing/UrlProviderResolver.cs index b25fdc0aa4..0a3a8e2b38 100644 --- a/src/Umbraco.Compat7/Web/Routing/UrlProviderResolver.cs +++ b/src/Umbraco.Compat7/Web/Routing/UrlProviderResolver.cs @@ -9,7 +9,7 @@ namespace Umbraco.Web.Routing { public class UrlProviderResolver : ManyObjectsResolverBase { - private UrlProviderResolver(UrlProviderCollectionBuilder builder) + private UrlProviderResolver(UrlProviderCollectionBuilder builder) : base(builder) { } diff --git a/src/Umbraco.Core/ActivatorHelper.cs b/src/Umbraco.Core/ActivatorHelper.cs index 90a21f7386..c7a6b7d983 100644 --- a/src/Umbraco.Core/ActivatorHelper.cs +++ b/src/Umbraco.Core/ActivatorHelper.cs @@ -1,20 +1,20 @@ -namespace Umbraco.Core +namespace Umbraco.Core { /// - /// Helper methods for Activation - /// - internal static class ActivatorHelper - { - /// - /// Creates an instance of a type using that type's default constructor. - /// - /// - /// - public static T CreateInstance() where T : class, new() - { - return new ActivatorServiceProvider().GetService(typeof (T)) as T; - } + /// Helper methods for Activation + /// + internal static class ActivatorHelper + { + /// + /// Creates an instance of a type using that type's default constructor. + /// + /// + /// + public static T CreateInstance() where T : class, new() + { + return new ActivatorServiceProvider().GetService(typeof (T)) as T; + } - - } -} \ No newline at end of file + + } +} diff --git a/src/Umbraco.Core/ActivatorServiceProvider.cs b/src/Umbraco.Core/ActivatorServiceProvider.cs index 550a4a3ca8..70b1b121d1 100644 --- a/src/Umbraco.Core/ActivatorServiceProvider.cs +++ b/src/Umbraco.Core/ActivatorServiceProvider.cs @@ -1,4 +1,4 @@ -using System; +using System; namespace Umbraco.Core { @@ -9,4 +9,4 @@ namespace Umbraco.Core return Activator.CreateInstance(serviceType); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/AssemblyExtensions.cs b/src/Umbraco.Core/AssemblyExtensions.cs index b9e1f4d812..6b77a09b73 100644 --- a/src/Umbraco.Core/AssemblyExtensions.cs +++ b/src/Umbraco.Core/AssemblyExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.IO; using System.Linq; @@ -6,20 +6,20 @@ using System.Reflection; namespace Umbraco.Core { - internal static class AssemblyExtensions - { - /// - /// Returns the file used to load the assembly - /// - /// - /// - public static FileInfo GetAssemblyFile(this Assembly assembly) - { - var codeBase = assembly.CodeBase; - var uri = new Uri(codeBase); - var path = uri.LocalPath; - return new FileInfo(path); - } + internal static class AssemblyExtensions + { + /// + /// Returns the file used to load the assembly + /// + /// + /// + public static FileInfo GetAssemblyFile(this Assembly assembly) + { + var codeBase = assembly.CodeBase; + var uri = new Uri(codeBase); + var path = uri.LocalPath; + return new FileInfo(path); + } /// /// Returns true if the assembly is the App_Code assembly @@ -49,24 +49,24 @@ namespace Umbraco.Core /// /// /// - public static bool IsGlobalAsaxAssembly(this Assembly assembly) - { + public static bool IsGlobalAsaxAssembly(this Assembly assembly) + { //only way I can figure out how to test is by the name return assembly.FullName.StartsWith("App_global.asax"); - } + } - /// - /// Returns the file used to load the assembly - /// - /// - /// - public static FileInfo GetAssemblyFile(this AssemblyName assemblyName) - { - var codeBase = assemblyName.CodeBase; - var uri = new Uri(codeBase); - var path = uri.LocalPath; - return new FileInfo(path); - } + /// + /// Returns the file used to load the assembly + /// + /// + /// + public static FileInfo GetAssemblyFile(this AssemblyName assemblyName) + { + var codeBase = assemblyName.CodeBase; + var uri = new Uri(codeBase); + var path = uri.LocalPath; + return new FileInfo(path); + } - } -} \ No newline at end of file + } +} diff --git a/src/Umbraco.Core/AsyncLock.cs b/src/Umbraco.Core/AsyncLock.cs index b6a3f8534e..158b132f26 100644 --- a/src/Umbraco.Core/AsyncLock.cs +++ b/src/Umbraco.Core/AsyncLock.cs @@ -69,11 +69,11 @@ namespace Umbraco.Core public Task LockAsync() { - var wait = _semaphore != null + var wait = _semaphore != null ? _semaphore.WaitAsync() : _semaphore2.WaitOneAsync(); - return wait.IsCompleted + return wait.IsCompleted ? _releaserTask ?? Task.FromResult(CreateReleaser()) // anonymous vs named : wait.ContinueWith((_, state) => (((AsyncLock) state).CreateReleaser()), this, CancellationToken.None, @@ -112,7 +112,7 @@ namespace Umbraco.Core return _releaser ?? CreateReleaser(); // anonymous vs named } - // note - before making those classes some structs, read + // note - before making those classes some structs, read // about "impure methods" and mutating readonly structs... private class NamedSemaphoreReleaser : CriticalFinalizerObject, IDisposable @@ -140,9 +140,9 @@ namespace Umbraco.Core _semaphore.Dispose(); } - // we WANT to release the semaphore because it's a system object, ie a critical + // we WANT to release the semaphore because it's a system object, ie a critical // non-managed resource - and if it is not released then noone else can acquire - // the lock - so we inherit from CriticalFinalizerObject which means that the + // the lock - so we inherit from CriticalFinalizerObject which means that the // finalizer "should" run in all situations - there is always a chance that it // does not run and the semaphore remains "acquired" but then chances are the // whole process (w3wp.exe...) is going down, at which point the semaphore will @@ -200,4 +200,4 @@ namespace Umbraco.Core } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Attempt.cs b/src/Umbraco.Core/Attempt.cs index b5c7430974..24063c6fbe 100644 --- a/src/Umbraco.Core/Attempt.cs +++ b/src/Umbraco.Core/Attempt.cs @@ -1,4 +1,4 @@ -using System; +using System; namespace Umbraco.Core { @@ -113,4 +113,4 @@ namespace Umbraco.Core return Attempt.If(condition, succStatus, failStatus, result); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/AttemptOfTResult.cs b/src/Umbraco.Core/AttemptOfTResult.cs index 81268e4e5a..9afa74b3f3 100644 --- a/src/Umbraco.Core/AttemptOfTResult.cs +++ b/src/Umbraco.Core/AttemptOfTResult.cs @@ -1,4 +1,4 @@ -using System; +using System; namespace Umbraco.Core { @@ -7,8 +7,8 @@ namespace Umbraco.Core /// /// The type of the attempted operation result. [Serializable] - public struct Attempt - { + public struct Attempt + { /// /// Gets a value indicating whether this was successful. /// @@ -25,7 +25,7 @@ namespace Umbraco.Core public TResult Result { get; } // optimize, use a singleton failed attempt - private static readonly Attempt Failed = new Attempt(false, default(TResult), null); + private static readonly Attempt Failed = new Attempt(false, default(TResult), null); // private - use Succeed() or Fail() methods to create attempts private Attempt(bool success, TResult result, Exception exception) @@ -125,4 +125,4 @@ namespace Umbraco.Core return a.Success; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/BindingRedirects.cs b/src/Umbraco.Core/BindingRedirects.cs index 4fadb4db70..a93485085e 100644 --- a/src/Umbraco.Core/BindingRedirects.cs +++ b/src/Umbraco.Core/BindingRedirects.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Reflection; using System.Text.RegularExpressions; using System.Web; @@ -21,7 +21,7 @@ namespace Umbraco.Core private static readonly Regex Log4NetAssemblyPattern = new Regex("log4net, Version=([\\d\\.]+?), Culture=neutral, PublicKeyToken=\\w+$", RegexOptions.Compiled); private const string Log4NetReplacement = "log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a"; - + /// /// This is used to do an assembly binding redirect via code - normally required due to signature changes in assemblies /// @@ -30,12 +30,12 @@ namespace Umbraco.Core /// private static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args) { - //log4net: + //log4net: if (Log4NetAssemblyPattern.IsMatch(args.Name) && args.Name != Log4NetReplacement) { return Assembly.Load(Log4NetAssemblyPattern.Replace(args.Name, Log4NetReplacement)); } - + //AutoMapper: // ensure the assembly is indeed AutoMapper and that the PublicKeyToken is null before trying to Load again // do NOT just replace this with 'return Assembly', as it will cause an infinite loop -> stackoverflow @@ -43,7 +43,7 @@ namespace Umbraco.Core return Assembly.Load(args.Name.Replace(", PublicKeyToken=null", ", PublicKeyToken=be96cd2c38ef1005")); return null; - + } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Cache/CacheHelper.cs b/src/Umbraco.Core/Cache/CacheHelper.cs index 157cedb3eb..ac2840a59f 100644 --- a/src/Umbraco.Core/Cache/CacheHelper.cs +++ b/src/Umbraco.Core/Cache/CacheHelper.cs @@ -6,19 +6,19 @@ using System.Web.Caching; namespace Umbraco.Core.Cache { - /// - /// Class that is exposed by the ApplicationContext for application wide caching purposes - /// + /// + /// Class that is exposed by the ApplicationContext for application wide caching purposes + /// public class CacheHelper - { + { private static readonly ICacheProvider NullRequestCache = new NullCacheProvider(); private static readonly ICacheProvider NullStaticCache = new NullCacheProvider(); private static readonly IRuntimeCacheProvider NullRuntimeCache = new NullCacheProvider(); private static readonly IsolatedRuntimeCache NullIsolatedCache = new IsolatedRuntimeCache(_ => NullRuntimeCache); - public static CacheHelper NoCache { get; } = new CacheHelper(NullRuntimeCache, NullStaticCache, NullRequestCache, NullIsolatedCache); + public static CacheHelper NoCache { get; } = new CacheHelper(NullRuntimeCache, NullStaticCache, NullRequestCache, NullIsolatedCache); - /// + /// /// Creates a cache helper with disabled caches /// /// @@ -33,59 +33,59 @@ namespace Umbraco.Core.Cache return new CacheHelper(NullRuntimeCache, NullStaticCache, NullRequestCache, NullIsolatedCache); } - /// - /// Initializes a new instance for use in the web - /// - public CacheHelper() - : this( - new HttpRuntimeCacheProvider(HttpRuntime.Cache), - new StaticCacheProvider(), + /// + /// Initializes a new instance for use in the web + /// + public CacheHelper() + : this( + new HttpRuntimeCacheProvider(HttpRuntime.Cache), + new StaticCacheProvider(), new HttpRequestCacheProvider(), new IsolatedRuntimeCache(t => new ObjectCacheRuntimeCacheProvider())) - { - } - - /// - /// Initializes a new instance for use in the web - /// - /// - public CacheHelper(System.Web.Caching.Cache cache) - : this( - new HttpRuntimeCacheProvider(cache), - new StaticCacheProvider(), - new HttpRequestCacheProvider(), - new IsolatedRuntimeCache(t => new ObjectCacheRuntimeCacheProvider())) - { - } - - [Obsolete("Use the constructor the specifies all dependencies")] - [EditorBrowsable(EditorBrowsableState.Never)] - public CacheHelper( - IRuntimeCacheProvider httpCacheProvider, - ICacheProvider staticCacheProvider, - ICacheProvider requestCacheProvider) - : this(httpCacheProvider, staticCacheProvider, requestCacheProvider, new IsolatedRuntimeCache(t => new ObjectCacheRuntimeCacheProvider())) - { + { } - /// - /// Initializes a new instance based on the provided providers - /// - /// - /// - /// - /// - public CacheHelper( + /// + /// Initializes a new instance for use in the web + /// + /// + public CacheHelper(System.Web.Caching.Cache cache) + : this( + new HttpRuntimeCacheProvider(cache), + new StaticCacheProvider(), + new HttpRequestCacheProvider(), + new IsolatedRuntimeCache(t => new ObjectCacheRuntimeCacheProvider())) + { + } + + [Obsolete("Use the constructor the specifies all dependencies")] + [EditorBrowsable(EditorBrowsableState.Never)] + public CacheHelper( + IRuntimeCacheProvider httpCacheProvider, + ICacheProvider staticCacheProvider, + ICacheProvider requestCacheProvider) + : this(httpCacheProvider, staticCacheProvider, requestCacheProvider, new IsolatedRuntimeCache(t => new ObjectCacheRuntimeCacheProvider())) + { + } + + /// + /// Initializes a new instance based on the provided providers + /// + /// + /// + /// + /// + public CacheHelper( IRuntimeCacheProvider httpCacheProvider, ICacheProvider staticCacheProvider, ICacheProvider requestCacheProvider, - IsolatedRuntimeCache isolatedCacheManager) + IsolatedRuntimeCache isolatedCacheManager) { - if (httpCacheProvider == null) throw new ArgumentNullException("httpCacheProvider"); - if (staticCacheProvider == null) throw new ArgumentNullException("staticCacheProvider"); - if (requestCacheProvider == null) throw new ArgumentNullException("requestCacheProvider"); - if (isolatedCacheManager == null) throw new ArgumentNullException("isolatedCacheManager"); - RuntimeCache = httpCacheProvider; + if (httpCacheProvider == null) throw new ArgumentNullException("httpCacheProvider"); + if (staticCacheProvider == null) throw new ArgumentNullException("staticCacheProvider"); + if (requestCacheProvider == null) throw new ArgumentNullException("requestCacheProvider"); + if (isolatedCacheManager == null) throw new ArgumentNullException("isolatedCacheManager"); + RuntimeCache = httpCacheProvider; StaticCache = staticCacheProvider; RequestCache = requestCacheProvider; IsolatedRuntimeCache = isolatedCacheManager; @@ -95,7 +95,7 @@ namespace Umbraco.Core.Cache /// Returns the current Request cache /// public ICacheProvider RequestCache { get; internal set; } - + /// /// Returns the current Runtime cache /// @@ -104,7 +104,7 @@ namespace Umbraco.Core.Cache /// /// Returns the current Runtime cache /// - public IRuntimeCacheProvider RuntimeCache { get; internal set; } + public IRuntimeCacheProvider RuntimeCache { get; internal set; } /// /// Returns the current Isolated Runtime cache manager @@ -125,7 +125,7 @@ namespace Umbraco.Core.Cache } /// - /// Clears the item in umbraco's runtime cache with the given key + /// Clears the item in umbraco's runtime cache with the given key /// /// Key [Obsolete("Do not use this method, access the runtime cache from the RuntimeCache property")] @@ -405,23 +405,23 @@ namespace Umbraco.Core.Cache cache.InsertCacheItem(cacheKey, () => getCacheItem(), timeout, false, priority, refreshAction, cacheDependency); } throw new InvalidOperationException("Cannot use this obsoleted overload when the current provider is not of type " + typeof(HttpRuntimeCacheProvider)); - } + } #endregion - private HttpRuntimeCacheProvider GetHttpRuntimeCacheProvider(IRuntimeCacheProvider runtimeCache) - { - HttpRuntimeCacheProvider cache; + private HttpRuntimeCacheProvider GetHttpRuntimeCacheProvider(IRuntimeCacheProvider runtimeCache) + { + HttpRuntimeCacheProvider cache; var wrapper = RuntimeCache as IRuntimeCacheProviderWrapper; - if (wrapper != null) - { - cache = wrapper.InnerProvider as HttpRuntimeCacheProvider; - } - else - { + if (wrapper != null) + { + cache = wrapper.InnerProvider as HttpRuntimeCacheProvider; + } + else + { cache = RuntimeCache as HttpRuntimeCacheProvider; } - return cache; - } + return cache; + } } } diff --git a/src/Umbraco.Core/Cache/CacheKeys.cs b/src/Umbraco.Core/Cache/CacheKeys.cs index d0155ae520..a98c75ceae 100644 --- a/src/Umbraco.Core/Cache/CacheKeys.cs +++ b/src/Umbraco.Core/Cache/CacheKeys.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.ComponentModel; using Umbraco.Core.CodeAnnotations; @@ -52,7 +52,7 @@ namespace Umbraco.Core.Cache [Obsolete("This is no longer used and will be removed from the codebase in the future")] [EditorBrowsable(EditorBrowsableState.Never)] public const string UserCacheKey = "UmbracoUser"; - + public const string UserPermissionsCacheKey = "UmbracoUserPermissions"; [UmbracoWillObsolete("This cache key is only used for legacy business logic caching, remove in v8")] @@ -88,4 +88,4 @@ namespace Umbraco.Core.Cache public const string IdToKeyCacheKey = "UI2K"; public const string KeyToIdCacheKey = "UK2I"; } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Cache/CacheProviderExtensions.cs b/src/Umbraco.Core/Cache/CacheProviderExtensions.cs index 7e5b91ea6a..a3d55eb25f 100644 --- a/src/Umbraco.Core/Cache/CacheProviderExtensions.cs +++ b/src/Umbraco.Core/Cache/CacheProviderExtensions.cs @@ -67,4 +67,4 @@ namespace Umbraco.Core.Cache return result.TryConvertTo().Result; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Cache/CacheRefresherBase.cs b/src/Umbraco.Core/Cache/CacheRefresherBase.cs index 6ccffa54f6..568c955eda 100644 --- a/src/Umbraco.Core/Cache/CacheRefresherBase.cs +++ b/src/Umbraco.Core/Cache/CacheRefresherBase.cs @@ -117,4 +117,4 @@ namespace Umbraco.Core.Cache #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Cache/CacheRefresherEventArgs.cs b/src/Umbraco.Core/Cache/CacheRefresherEventArgs.cs index 09d9226002..b7ae0477a6 100644 --- a/src/Umbraco.Core/Cache/CacheRefresherEventArgs.cs +++ b/src/Umbraco.Core/Cache/CacheRefresherEventArgs.cs @@ -16,4 +16,4 @@ namespace Umbraco.Core.Cache public object MessageObject { get; private set; } public MessageType MessageType { get; private set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Cache/DeepCloneRuntimeCacheProvider.cs b/src/Umbraco.Core/Cache/DeepCloneRuntimeCacheProvider.cs index 456c2955f0..d42d934c78 100644 --- a/src/Umbraco.Core/Cache/DeepCloneRuntimeCacheProvider.cs +++ b/src/Umbraco.Core/Cache/DeepCloneRuntimeCacheProvider.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Web.Caching; @@ -16,7 +16,7 @@ namespace Umbraco.Core.Cache } /// - /// A wrapper for any IRuntimeCacheProvider that ensures that all inserts and returns + /// A wrapper for any IRuntimeCacheProvider that ensures that all inserts and returns /// are a deep cloned copy of the item when the item is IDeepCloneable and that tracks changes are /// reset if the object is TracksChangesEntityBase /// @@ -84,7 +84,7 @@ namespace Umbraco.Core.Cache return InnerProvider.GetCacheItemsByKeyExpression(regexString) .Select(CheckCloneableAndTracksChanges); } - + public object GetCacheItem(string cacheKey) { var item = InnerProvider.GetCacheItem(cacheKey); @@ -130,7 +130,7 @@ namespace Umbraco.Core.Cache // clone / reset to go into the cache return CheckCloneableAndTracksChanges(value); - }, timeout, isSliding, priority, removedCallback, dependentFiles); + }, timeout, isSliding, priority, removedCallback, dependentFiles); } private static object CheckCloneableAndTracksChanges(object input) @@ -138,7 +138,7 @@ namespace Umbraco.Core.Cache var cloneable = input as IDeepCloneable; if (cloneable != null) { - input = cloneable.DeepClone(); + input = cloneable.DeepClone(); } //on initial construction we don't want to have dirty properties tracked @@ -153,4 +153,4 @@ namespace Umbraco.Core.Cache return input; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Cache/DefaultRepositoryCachePolicy.cs b/src/Umbraco.Core/Cache/DefaultRepositoryCachePolicy.cs index 67df32d3ea..3833da1618 100644 --- a/src/Umbraco.Core/Cache/DefaultRepositoryCachePolicy.cs +++ b/src/Umbraco.Core/Cache/DefaultRepositoryCachePolicy.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using Umbraco.Core.Models.EntityBase; @@ -246,4 +246,4 @@ namespace Umbraco.Core.Cache Cache.ClearCacheByKeySearch(GetEntityTypeCacheKey()); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Cache/DictionaryCacheProviderBase.cs b/src/Umbraco.Core/Cache/DictionaryCacheProviderBase.cs index fedfa9899b..cc62fbac8d 100644 --- a/src/Umbraco.Core/Cache/DictionaryCacheProviderBase.cs +++ b/src/Umbraco.Core/Cache/DictionaryCacheProviderBase.cs @@ -253,4 +253,4 @@ namespace Umbraco.Core.Cache #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Cache/FullDataSetRepositoryCachePolicy.cs b/src/Umbraco.Core/Cache/FullDataSetRepositoryCachePolicy.cs index d362f0482b..00a5a7fe66 100644 --- a/src/Umbraco.Core/Cache/FullDataSetRepositoryCachePolicy.cs +++ b/src/Umbraco.Core/Cache/FullDataSetRepositoryCachePolicy.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using Umbraco.Core.Collections; @@ -177,4 +177,4 @@ namespace Umbraco.Core.Cache Cache.ClearCacheItem(GetEntityTypeCacheKey()); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Cache/HttpRequestCacheProvider.cs b/src/Umbraco.Core/Cache/HttpRequestCacheProvider.cs index 792b5982b1..5f5a599135 100644 --- a/src/Umbraco.Core/Cache/HttpRequestCacheProvider.cs +++ b/src/Umbraco.Core/Cache/HttpRequestCacheProvider.cs @@ -94,8 +94,8 @@ namespace Umbraco.Core.Cache get { - return HasContextItems - ? (IDisposable) new MonitorLock(ContextItems.SyncRoot) + return HasContextItems + ? (IDisposable) new MonitorLock(ContextItems.SyncRoot) : new NoopLocker(); } } @@ -152,4 +152,4 @@ namespace Umbraco.Core.Cache { } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Cache/HttpRuntimeCacheProvider.cs b/src/Umbraco.Core/Cache/HttpRuntimeCacheProvider.cs index 0e98cd5318..6368eef78c 100644 --- a/src/Umbraco.Core/Cache/HttpRuntimeCacheProvider.cs +++ b/src/Umbraco.Core/Cache/HttpRuntimeCacheProvider.cs @@ -98,7 +98,7 @@ namespace Umbraco.Core.Cache // on the Lazy lock to ensure that getCacheItem runs once and everybody waits on it, while the global // application lock has been released. - // NOTE + // NOTE // The Lazy value creation may produce a null value. // Must make sure (for backward compatibility) that we pretend they are not in the cache. // So if we find an entry in the cache that already has its value created and is null, @@ -215,4 +215,4 @@ namespace Umbraco.Core.Cache #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Cache/ICacheProvider.cs b/src/Umbraco.Core/Cache/ICacheProvider.cs index e53123d7e8..da0c1cc918 100644 --- a/src/Umbraco.Core/Cache/ICacheProvider.cs +++ b/src/Umbraco.Core/Cache/ICacheProvider.cs @@ -55,7 +55,7 @@ namespace Umbraco.Core.Cache IEnumerable GetCacheItemsByKeySearch(string keyStartsWith); IEnumerable GetCacheItemsByKeyExpression(string regexString); - + /// /// Returns an item with a given key /// diff --git a/src/Umbraco.Core/Cache/ICacheRefresher.cs b/src/Umbraco.Core/Cache/ICacheRefresher.cs index bab0acf2cf..d254c770eb 100644 --- a/src/Umbraco.Core/Cache/ICacheRefresher.cs +++ b/src/Umbraco.Core/Cache/ICacheRefresher.cs @@ -5,7 +5,7 @@ namespace Umbraco.Core.Cache { /// /// The IcacheRefresher Interface is used for loadbalancing. - /// + /// /// public interface ICacheRefresher : IDiscoverable { @@ -23,11 +23,11 @@ namespace Umbraco.Core.Cache /// /// /// This is much better for performance when we're not running in a load balanced environment so we can refresh the cache - /// against a already resolved object instead of looking the object back up by id. + /// against a already resolved object instead of looking the object back up by id. /// interface ICacheRefresher : ICacheRefresher { void Refresh(T instance); void Remove(T instance); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Cache/IJsonCacheRefresher.cs b/src/Umbraco.Core/Cache/IJsonCacheRefresher.cs index 215c79aaa4..a9ecd6050c 100644 --- a/src/Umbraco.Core/Cache/IJsonCacheRefresher.cs +++ b/src/Umbraco.Core/Cache/IJsonCacheRefresher.cs @@ -11,4 +11,4 @@ /// void Refresh(string json); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Cache/IRepositoryCachePolicy.cs b/src/Umbraco.Core/Cache/IRepositoryCachePolicy.cs index eeb4f77de3..d01ae736c4 100644 --- a/src/Umbraco.Core/Cache/IRepositoryCachePolicy.cs +++ b/src/Umbraco.Core/Cache/IRepositoryCachePolicy.cs @@ -94,4 +94,4 @@ namespace Umbraco.Core.Cache /// void ClearAll(); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Cache/IRuntimeCacheProvider.cs b/src/Umbraco.Core/Cache/IRuntimeCacheProvider.cs index 7f38257d1c..202bcbaa9e 100644 --- a/src/Umbraco.Core/Cache/IRuntimeCacheProvider.cs +++ b/src/Umbraco.Core/Cache/IRuntimeCacheProvider.cs @@ -14,8 +14,8 @@ namespace Umbraco.Core.Cache public interface IRuntimeCacheProvider : ICacheProvider { object GetCacheItem( - string cacheKey, - Func getCacheItem, + string cacheKey, + Func getCacheItem, TimeSpan? timeout, bool isSliding = false, CacheItemPriority priority = CacheItemPriority.Normal, diff --git a/src/Umbraco.Core/Cache/IsolatedRuntimeCache.cs b/src/Umbraco.Core/Cache/IsolatedRuntimeCache.cs index da20f7eb73..ee73a17532 100644 --- a/src/Umbraco.Core/Cache/IsolatedRuntimeCache.cs +++ b/src/Umbraco.Core/Cache/IsolatedRuntimeCache.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Concurrent; namespace Umbraco.Core.Cache @@ -7,7 +7,7 @@ namespace Umbraco.Core.Cache /// Used to get/create/manipulate isolated runtime cache /// /// - /// This is useful for repository level caches to ensure that cache lookups by key are fast so + /// This is useful for repository level caches to ensure that cache lookups by key are fast so /// that the repository doesn't need to search through all keys on a global scale. /// public class IsolatedRuntimeCache @@ -29,7 +29,7 @@ namespace Umbraco.Core.Cache /// Returns an isolated runtime cache for a given type /// /// - /// + /// public IRuntimeCacheProvider GetOrCreateCache() { return _isolatedCache.GetOrAdd(typeof(T), type => CacheFactory(type)); @@ -38,7 +38,7 @@ namespace Umbraco.Core.Cache /// /// Returns an isolated runtime cache for a given type /// - /// + /// public IRuntimeCacheProvider GetOrCreateCache(Type type) { return _isolatedCache.GetOrAdd(type, t => CacheFactory(t)); @@ -88,4 +88,4 @@ namespace Umbraco.Core.Cache } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Cache/JsonCacheRefresherBase.cs b/src/Umbraco.Core/Cache/JsonCacheRefresherBase.cs index 20d0cf2a80..f2ffac4608 100644 --- a/src/Umbraco.Core/Cache/JsonCacheRefresherBase.cs +++ b/src/Umbraco.Core/Cache/JsonCacheRefresherBase.cs @@ -22,8 +22,8 @@ namespace Umbraco.Core.Cache /// /// The json payload. public virtual void Refresh(string json) - { + { OnCacheUpdated(This, new CacheRefresherEventArgs(json, MessageType.RefreshByJson)); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Cache/NullCacheProvider.cs b/src/Umbraco.Core/Cache/NullCacheProvider.cs index 6b797307ac..f35f0ea2d3 100644 --- a/src/Umbraco.Core/Cache/NullCacheProvider.cs +++ b/src/Umbraco.Core/Cache/NullCacheProvider.cs @@ -59,4 +59,4 @@ namespace Umbraco.Core.Cache public void InsertCacheItem(string cacheKey, Func getCacheItem, TimeSpan? timeout = null, bool isSliding = false, CacheItemPriority priority = CacheItemPriority.Normal, CacheItemRemovedCallback removedCallback = null, string[] dependentFiles = null) { } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Cache/ObjectCacheRuntimeCacheProvider.cs b/src/Umbraco.Core/Cache/ObjectCacheRuntimeCacheProvider.cs index 44d28b1700..76a3d1c558 100644 --- a/src/Umbraco.Core/Cache/ObjectCacheRuntimeCacheProvider.cs +++ b/src/Umbraco.Core/Cache/ObjectCacheRuntimeCacheProvider.cs @@ -297,4 +297,4 @@ namespace Umbraco.Core.Cache return policy; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Cache/RepositoryCachePolicyBase.cs b/src/Umbraco.Core/Cache/RepositoryCachePolicyBase.cs index 2897a6c1d1..a2febba029 100644 --- a/src/Umbraco.Core/Cache/RepositoryCachePolicyBase.cs +++ b/src/Umbraco.Core/Cache/RepositoryCachePolicyBase.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using Umbraco.Core.Models.EntityBase; using Umbraco.Core.Scoping; @@ -46,4 +46,4 @@ namespace Umbraco.Core.Cache /// public abstract void ClearAll(); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Cache/RepositoryCachePolicyOptions.cs b/src/Umbraco.Core/Cache/RepositoryCachePolicyOptions.cs index 607c4c210c..72baa05564 100644 --- a/src/Umbraco.Core/Cache/RepositoryCachePolicyOptions.cs +++ b/src/Umbraco.Core/Cache/RepositoryCachePolicyOptions.cs @@ -1,4 +1,4 @@ -using System; +using System; namespace Umbraco.Core.Cache { @@ -34,8 +34,8 @@ namespace Umbraco.Core.Cache /// /// True/false as to validate the total item count when all items are returned from cache, the default is true but this - /// means that a db lookup will occur - though that lookup will probably be significantly less expensive than the normal - /// GetAll method. + /// means that a db lookup will occur - though that lookup will probably be significantly less expensive than the normal + /// GetAll method. /// /// /// setting this to return false will improve performance of GetAll cache with no params but should only be used @@ -48,4 +48,4 @@ namespace Umbraco.Core.Cache /// public bool GetAllCacheAllowZeroCount { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Cache/SingleItemsOnlyRepositoryCachePolicy.cs b/src/Umbraco.Core/Cache/SingleItemsOnlyRepositoryCachePolicy.cs index 7ba7d445fe..76fe71b953 100644 --- a/src/Umbraco.Core/Cache/SingleItemsOnlyRepositoryCachePolicy.cs +++ b/src/Umbraco.Core/Cache/SingleItemsOnlyRepositoryCachePolicy.cs @@ -1,4 +1,4 @@ -using Umbraco.Core.Models.EntityBase; +using Umbraco.Core.Models.EntityBase; namespace Umbraco.Core.Cache { @@ -24,4 +24,4 @@ namespace Umbraco.Core.Cache // nop } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Cache/StaticCacheProvider.cs b/src/Umbraco.Core/Cache/StaticCacheProvider.cs index c7fd00d39a..bb63768b1e 100644 --- a/src/Umbraco.Core/Cache/StaticCacheProvider.cs +++ b/src/Umbraco.Core/Cache/StaticCacheProvider.cs @@ -48,7 +48,7 @@ namespace Umbraco.Core.Cache public virtual void ClearCacheByKeyExpression(string regexString) { - StaticCache.RemoveAll(kvp => Regex.IsMatch(kvp.Key, regexString)); + StaticCache.RemoveAll(kvp => Regex.IsMatch(kvp.Key, regexString)); } public virtual IEnumerable GetCacheItemsByKeySearch(string keyStartsWith) @@ -61,7 +61,7 @@ namespace Umbraco.Core.Cache public IEnumerable GetCacheItemsByKeyExpression(string regexString) { return (from KeyValuePair c in StaticCache - where Regex.IsMatch(c.Key, regexString) + where Regex.IsMatch(c.Key, regexString) select c.Value).ToList(); } @@ -74,6 +74,6 @@ namespace Umbraco.Core.Cache public virtual object GetCacheItem(string cacheKey, Func getCacheItem) { return StaticCache.GetOrAdd(cacheKey, key => getCacheItem()); - } + } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Cache/TypedCacheRefresherBase.cs b/src/Umbraco.Core/Cache/TypedCacheRefresherBase.cs index c3358d3a07..e1070f8cc9 100644 --- a/src/Umbraco.Core/Cache/TypedCacheRefresherBase.cs +++ b/src/Umbraco.Core/Cache/TypedCacheRefresherBase.cs @@ -33,4 +33,4 @@ namespace Umbraco.Core.Cache #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/CodeAnnotations/FriendlyNameAttribute.cs b/src/Umbraco.Core/CodeAnnotations/FriendlyNameAttribute.cs index 226b74266b..ae864e85be 100644 --- a/src/Umbraco.Core/CodeAnnotations/FriendlyNameAttribute.cs +++ b/src/Umbraco.Core/CodeAnnotations/FriendlyNameAttribute.cs @@ -32,4 +32,4 @@ namespace Umbraco.Core.CodeAnnotations return this._friendlyName; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/CodeAnnotations/UmbracoExperimentalFeatureAttribute.cs b/src/Umbraco.Core/CodeAnnotations/UmbracoExperimentalFeatureAttribute.cs index 568561c078..e1377ff266 100644 --- a/src/Umbraco.Core/CodeAnnotations/UmbracoExperimentalFeatureAttribute.cs +++ b/src/Umbraco.Core/CodeAnnotations/UmbracoExperimentalFeatureAttribute.cs @@ -1,35 +1,35 @@ -using System; +using System; namespace Umbraco.Core.CodeAnnotations { - /// - /// Marks the program elements that Umbraco is experimenting with and could become public. - /// - /// - /// Indicates that Umbraco is experimenting with code that potentially could become - /// public, but we're not sure, and the code is not stable and can be refactored at any time. - /// The issue tracker should contain more details, discussion, and planning. - /// - [AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = false)] - internal sealed class UmbracoExperimentalFeatureAttribute : Attribute - { - /// - /// Initializes a new instance of the class with a description. - /// - /// The text string that describes what is intended. - public UmbracoExperimentalFeatureAttribute(string description) - { + /// + /// Marks the program elements that Umbraco is experimenting with and could become public. + /// + /// + /// Indicates that Umbraco is experimenting with code that potentially could become + /// public, but we're not sure, and the code is not stable and can be refactored at any time. + /// The issue tracker should contain more details, discussion, and planning. + /// + [AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = false)] + internal sealed class UmbracoExperimentalFeatureAttribute : Attribute + { + /// + /// Initializes a new instance of the class with a description. + /// + /// The text string that describes what is intended. + public UmbracoExperimentalFeatureAttribute(string description) + { - } + } - /// - /// Initializes a new instance of the class with a tracker url and a description. - /// - /// The url of a tracker issue containing more details, discussion, and planning. - /// The text string that describes what is intended. - public UmbracoExperimentalFeatureAttribute(string trackerUrl, string description) - { - - } - } -} \ No newline at end of file + /// + /// Initializes a new instance of the class with a tracker url and a description. + /// + /// The url of a tracker issue containing more details, discussion, and planning. + /// The text string that describes what is intended. + public UmbracoExperimentalFeatureAttribute(string trackerUrl, string description) + { + + } + } +} diff --git a/src/Umbraco.Core/CodeAnnotations/UmbracoObjectTypeAttribute.cs b/src/Umbraco.Core/CodeAnnotations/UmbracoObjectTypeAttribute.cs index 8a44ba1589..d2c431254f 100644 --- a/src/Umbraco.Core/CodeAnnotations/UmbracoObjectTypeAttribute.cs +++ b/src/Umbraco.Core/CodeAnnotations/UmbracoObjectTypeAttribute.cs @@ -23,4 +23,4 @@ namespace Umbraco.Core.CodeAnnotations public Type ModelType { get; private set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/CodeAnnotations/UmbracoProposedPublicAttribute.cs b/src/Umbraco.Core/CodeAnnotations/UmbracoProposedPublicAttribute.cs index b34726960d..24d46224c5 100644 --- a/src/Umbraco.Core/CodeAnnotations/UmbracoProposedPublicAttribute.cs +++ b/src/Umbraco.Core/CodeAnnotations/UmbracoProposedPublicAttribute.cs @@ -1,36 +1,36 @@ -using System; +using System; namespace Umbraco.Core.CodeAnnotations { - /// - /// Marks the program elements that Umbraco is considering making public. - /// - /// - /// Indicates that Umbraco considers making the (currently internal) program element public - /// at some point in the future, but the decision is not fully made yet and is still pending reviews. - /// Note that it is not a commitment to make the program element public. It may not ever become public. - /// The issue tracker should contain more details, discussion, and planning. - /// - [AttributeUsage(AttributeTargets.All, AllowMultiple=false, Inherited=false)] - internal sealed class UmbracoProposedPublicAttribute : Attribute - { - /// - /// Initializes a new instance of the class with a description. - /// - /// The text string that describes what is intended. - public UmbracoProposedPublicAttribute(string description) - { + /// + /// Marks the program elements that Umbraco is considering making public. + /// + /// + /// Indicates that Umbraco considers making the (currently internal) program element public + /// at some point in the future, but the decision is not fully made yet and is still pending reviews. + /// Note that it is not a commitment to make the program element public. It may not ever become public. + /// The issue tracker should contain more details, discussion, and planning. + /// + [AttributeUsage(AttributeTargets.All, AllowMultiple=false, Inherited=false)] + internal sealed class UmbracoProposedPublicAttribute : Attribute + { + /// + /// Initializes a new instance of the class with a description. + /// + /// The text string that describes what is intended. + public UmbracoProposedPublicAttribute(string description) + { - } + } - /// - /// Initializes a new instance of the class with a tracker url and a description. - /// - /// The url of a tracker issue containing more details, discussion, and planning. - /// The text string that describes what is intended. - public UmbracoProposedPublicAttribute(string trackerUrl, string description) - { - - } - } -} \ No newline at end of file + /// + /// Initializes a new instance of the class with a tracker url and a description. + /// + /// The url of a tracker issue containing more details, discussion, and planning. + /// The text string that describes what is intended. + public UmbracoProposedPublicAttribute(string trackerUrl, string description) + { + + } + } +} diff --git a/src/Umbraco.Core/CodeAnnotations/UmbracoUdiTypeAttribute.cs b/src/Umbraco.Core/CodeAnnotations/UmbracoUdiTypeAttribute.cs index 0bb9de6c86..0666b68166 100644 --- a/src/Umbraco.Core/CodeAnnotations/UmbracoUdiTypeAttribute.cs +++ b/src/Umbraco.Core/CodeAnnotations/UmbracoUdiTypeAttribute.cs @@ -1,4 +1,4 @@ -using System; +using System; namespace Umbraco.Core.CodeAnnotations { @@ -12,4 +12,4 @@ namespace Umbraco.Core.CodeAnnotations UdiType = udiType; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/CodeAnnotations/UmbracoWillObsoleteAttribute.cs b/src/Umbraco.Core/CodeAnnotations/UmbracoWillObsoleteAttribute.cs index 745d74bb50..3d129a8a0a 100644 --- a/src/Umbraco.Core/CodeAnnotations/UmbracoWillObsoleteAttribute.cs +++ b/src/Umbraco.Core/CodeAnnotations/UmbracoWillObsoleteAttribute.cs @@ -5,33 +5,33 @@ using System.Text; namespace Umbraco.Core.CodeAnnotations { - /// - /// Marks the program elements that Umbraco will obsolete. - /// - /// - /// Indicates that Umbraco will obsolete the program element at some point in the future, but we do not want to - /// explicitely mark it [Obsolete] yet to avoid warning messages showing when developers compile Umbraco. - /// - [AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = false)] - internal sealed class UmbracoWillObsoleteAttribute : Attribute - { - /// - /// Initializes a new instance of the class with a description. - /// - /// The text string that describes what is intended. - public UmbracoWillObsoleteAttribute(string description) - { + /// + /// Marks the program elements that Umbraco will obsolete. + /// + /// + /// Indicates that Umbraco will obsolete the program element at some point in the future, but we do not want to + /// explicitely mark it [Obsolete] yet to avoid warning messages showing when developers compile Umbraco. + /// + [AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = false)] + internal sealed class UmbracoWillObsoleteAttribute : Attribute + { + /// + /// Initializes a new instance of the class with a description. + /// + /// The text string that describes what is intended. + public UmbracoWillObsoleteAttribute(string description) + { - } + } - /// - /// Initializes a new instance of the class with a tracker url and a description. - /// - /// The url of a tracker issue containing more details, discussion, and planning. - /// The text string that describes what is intended. - public UmbracoWillObsoleteAttribute(string trackerUrl, string description) - { - - } - } + /// + /// Initializes a new instance of the class with a tracker url and a description. + /// + /// The url of a tracker issue containing more details, discussion, and planning. + /// The text string that describes what is intended. + public UmbracoWillObsoleteAttribute(string trackerUrl, string description) + { + + } + } } diff --git a/src/Umbraco.Core/Collections/ConcurrentHashSet.cs b/src/Umbraco.Core/Collections/ConcurrentHashSet.cs index 9596c718a5..39cb701e69 100644 --- a/src/Umbraco.Core/Collections/ConcurrentHashSet.cs +++ b/src/Umbraco.Core/Collections/ConcurrentHashSet.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.Collections.Generic; using System.Linq; @@ -7,7 +7,7 @@ using System.Threading; namespace Umbraco.Core.Collections { /// - /// A thread-safe representation of a . + /// A thread-safe representation of a . /// Enumerating this collection is thread-safe and will only operate on a clone that is generated before returning the enumerator. /// /// @@ -91,7 +91,7 @@ namespace Umbraco.Core.Collections _innerSet.Add(item); } } - + /// /// Attempts to add an item to the collection /// @@ -164,4 +164,4 @@ namespace Umbraco.Core.Collections Array.Copy(clone.ToArray(), 0, array, index, clone.Count); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Collections/DeepCloneableList.cs b/src/Umbraco.Core/Collections/DeepCloneableList.cs index 5067562aa7..8afedca08b 100644 --- a/src/Umbraco.Core/Collections/DeepCloneableList.cs +++ b/src/Umbraco.Core/Collections/DeepCloneableList.cs @@ -15,12 +15,12 @@ namespace Umbraco.Core.Collections internal class DeepCloneableList : List, IDeepCloneable, IRememberBeingDirty { private readonly ListCloneBehavior _listCloneBehavior; - + public DeepCloneableList(ListCloneBehavior listCloneBehavior) { _listCloneBehavior = listCloneBehavior; } - + public DeepCloneableList(IEnumerable collection, ListCloneBehavior listCloneBehavior) : base(collection) { _listCloneBehavior = listCloneBehavior; diff --git a/src/Umbraco.Core/Collections/ListCloneBehavior.cs b/src/Umbraco.Core/Collections/ListCloneBehavior.cs index 4fe935f7ff..14c6a0841f 100644 --- a/src/Umbraco.Core/Collections/ListCloneBehavior.cs +++ b/src/Umbraco.Core/Collections/ListCloneBehavior.cs @@ -1,4 +1,4 @@ -namespace Umbraco.Core.Collections +namespace Umbraco.Core.Collections { internal enum ListCloneBehavior { @@ -17,4 +17,4 @@ namespace Umbraco.Core.Collections /// Always } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Collections/ObservableDictionary.cs b/src/Umbraco.Core/Collections/ObservableDictionary.cs index 0907a9da0e..caa2be92a8 100644 --- a/src/Umbraco.Core/Collections/ObservableDictionary.cs +++ b/src/Umbraco.Core/Collections/ObservableDictionary.cs @@ -6,7 +6,7 @@ using System.Linq; namespace Umbraco.Core.Collections { /// - /// An ObservableDictionary + /// An ObservableDictionary /// /// /// Assumes that the key will not change and is unique for each element in the collection. @@ -109,7 +109,7 @@ namespace Umbraco.Core.Collections /// /// Key of element to replace /// New value - /// + /// /// /// False if key not found public virtual bool Replace(TKey key, TValue value) diff --git a/src/Umbraco.Core/Components/Composition.cs b/src/Umbraco.Core/Components/Composition.cs index a57eeeb417..671469c73a 100644 --- a/src/Umbraco.Core/Components/Composition.cs +++ b/src/Umbraco.Core/Components/Composition.cs @@ -34,4 +34,4 @@ namespace Umbraco.Core.Components /// public RuntimeLevel RuntimeLevel { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Components/CompositionExtensions.cs b/src/Umbraco.Core/Components/CompositionExtensions.cs index bab16ed3b4..9500ccaa2d 100644 --- a/src/Umbraco.Core/Components/CompositionExtensions.cs +++ b/src/Umbraco.Core/Components/CompositionExtensions.cs @@ -245,4 +245,4 @@ namespace Umbraco.Core.Components #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Components/RequireComponentAttribute.cs b/src/Umbraco.Core/Components/RequireComponentAttribute.cs index e9e85ca344..2d53413f99 100644 --- a/src/Umbraco.Core/Components/RequireComponentAttribute.cs +++ b/src/Umbraco.Core/Components/RequireComponentAttribute.cs @@ -6,15 +6,15 @@ namespace Umbraco.Core.Components /// Indicates that a component requires another component. /// /// - /// This attribute is *not* inherited. This means that a component class inheriting from + /// This attribute is *not* inherited. This means that a component class inheriting from /// another component class does *not* inherit its requirements. However, the bootloader checks /// the *interfaces* of every component for their requirements, so requirements declared on /// interfaces are inherited by every component class implementing the interface. /// When targetting a class, indicates a dependency on the component which must be enabled, /// unless the requirement has explicitely been declared as weak (and then, only if the component /// is enabled). - /// When targetting an interface, indicates a dependency on enabled components implementing - /// the interface. It could be no component at all, unless the requirement has explicitely been + /// When targetting an interface, indicates a dependency on enabled components implementing + /// the interface. It could be no component at all, unless the requirement has explicitely been /// declared as strong (and at least one component must be enabled). /// [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, AllowMultiple = true, Inherited = false)] diff --git a/src/Umbraco.Core/Components/RequiredComponentAttribute.cs b/src/Umbraco.Core/Components/RequiredComponentAttribute.cs index e62e55ad61..7895445179 100644 --- a/src/Umbraco.Core/Components/RequiredComponentAttribute.cs +++ b/src/Umbraco.Core/Components/RequiredComponentAttribute.cs @@ -7,15 +7,15 @@ namespace Umbraco.Core.Components /// /// /// fixme - /// This attribute is *not* inherited. This means that a component class inheriting from + /// This attribute is *not* inherited. This means that a component class inheriting from /// another component class does *not* inherit its requirements. However, the bootloader checks /// the *interfaces* of every component for their requirements, so requirements declared on /// interfaces are inherited by every component class implementing the interface. /// When targetting a class, indicates a dependency on the component which must be enabled, /// unless the requirement has explicitely been declared as weak (and then, only if the component /// is enabled). - /// When targetting an interface, indicates a dependency on enabled components implementing - /// the interface. It could be no component at all, unless the requirement has explicitely been + /// When targetting an interface, indicates a dependency on enabled components implementing + /// the interface. It could be no component at all, unless the requirement has explicitely been /// declared as strong (and at least one component must be enabled). /// @@ -38,4 +38,4 @@ namespace Umbraco.Core.Components /// public Type RequiringType { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Composing/BuilderCollectionBase.cs b/src/Umbraco.Core/Composing/BuilderCollectionBase.cs index e516dd3ce7..484a9b930f 100644 --- a/src/Umbraco.Core/Composing/BuilderCollectionBase.cs +++ b/src/Umbraco.Core/Composing/BuilderCollectionBase.cs @@ -1,4 +1,4 @@ -using System.Collections; +using System.Collections; using System.Collections.Generic; using System.Linq; @@ -40,4 +40,4 @@ namespace Umbraco.Core.Composing return GetEnumerator(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Composing/CollectionBuilderBase.cs b/src/Umbraco.Core/Composing/CollectionBuilderBase.cs index 2e08b44867..3fac2d3255 100644 --- a/src/Umbraco.Core/Composing/CollectionBuilderBase.cs +++ b/src/Umbraco.Core/Composing/CollectionBuilderBase.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; @@ -188,4 +188,4 @@ namespace Umbraco.Core.Composing return _types.Contains(type); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Composing/CompositionRoots/ConfigurationCompositionRoot.cs b/src/Umbraco.Core/Composing/CompositionRoots/ConfigurationCompositionRoot.cs index 5721f5d2b4..a254c7820d 100644 --- a/src/Umbraco.Core/Composing/CompositionRoots/ConfigurationCompositionRoot.cs +++ b/src/Umbraco.Core/Composing/CompositionRoots/ConfigurationCompositionRoot.cs @@ -1,4 +1,4 @@ -using LightInject; +using LightInject; using Umbraco.Core.Configuration; using Umbraco.Core.Configuration.UmbracoSettings; @@ -19,4 +19,4 @@ namespace Umbraco.Core.Composing.CompositionRoots // fixme - other sections we need to add? } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Composing/CompositionRoots/CoreMappingProfilesCompositionRoot.cs b/src/Umbraco.Core/Composing/CompositionRoots/CoreMappingProfilesCompositionRoot.cs index 9c2ed4781b..b68aef3c3d 100644 --- a/src/Umbraco.Core/Composing/CompositionRoots/CoreMappingProfilesCompositionRoot.cs +++ b/src/Umbraco.Core/Composing/CompositionRoots/CoreMappingProfilesCompositionRoot.cs @@ -1,4 +1,4 @@ -using LightInject; +using LightInject; using Umbraco.Core.Models.Identity; namespace Umbraco.Core.Composing.CompositionRoots @@ -10,4 +10,4 @@ namespace Umbraco.Core.Composing.CompositionRoots container.Register(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Composing/CompositionRoots/RepositoryCompositionRoot.cs b/src/Umbraco.Core/Composing/CompositionRoots/RepositoryCompositionRoot.cs index dec91bbd0d..ff4e77d6b7 100644 --- a/src/Umbraco.Core/Composing/CompositionRoots/RepositoryCompositionRoot.cs +++ b/src/Umbraco.Core/Composing/CompositionRoots/RepositoryCompositionRoot.cs @@ -1,4 +1,4 @@ -using System; +using System; using LightInject; using Umbraco.Core.Cache; using Umbraco.Core.Persistence; @@ -88,4 +88,4 @@ namespace Umbraco.Core.Composing.CompositionRoots if (serviceContainer == null) throw new Exception("Container is not IServiceContainer."); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Composing/CompositionRoots/ServicesCompositionRoot.cs b/src/Umbraco.Core/Composing/CompositionRoots/ServicesCompositionRoot.cs index 71cfef3c55..b8e6f69781 100644 --- a/src/Umbraco.Core/Composing/CompositionRoots/ServicesCompositionRoot.cs +++ b/src/Umbraco.Core/Composing/CompositionRoots/ServicesCompositionRoot.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.IO; using System.Linq; using LightInject; @@ -85,4 +85,4 @@ namespace Umbraco.Core.Composing.CompositionRoots container.RegisterSingleton(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Composing/HideFromTypeFinderAttribute.cs b/src/Umbraco.Core/Composing/HideFromTypeFinderAttribute.cs index ff138563c3..54c846b944 100644 --- a/src/Umbraco.Core/Composing/HideFromTypeFinderAttribute.cs +++ b/src/Umbraco.Core/Composing/HideFromTypeFinderAttribute.cs @@ -1,4 +1,4 @@ -using System; +using System; namespace Umbraco.Core.Composing { @@ -8,4 +8,4 @@ namespace Umbraco.Core.Composing [AttributeUsage(AttributeTargets.Class)] public sealed class HideFromTypeFinderAttribute : Attribute { } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Composing/ICollectionBuilder.cs b/src/Umbraco.Core/Composing/ICollectionBuilder.cs index b57876d073..5efc03c9ac 100644 --- a/src/Umbraco.Core/Composing/ICollectionBuilder.cs +++ b/src/Umbraco.Core/Composing/ICollectionBuilder.cs @@ -1,4 +1,4 @@ -namespace Umbraco.Core.Composing +namespace Umbraco.Core.Composing { /// /// Represents a collection builder. @@ -15,4 +15,4 @@ namespace Umbraco.Core.Composing /// Creates a new collection each time it is invoked. TCollection CreateCollection(); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Composing/LazyCollectionBuilderBase.cs b/src/Umbraco.Core/Composing/LazyCollectionBuilderBase.cs index a8f87a8760..52e5a764fd 100644 --- a/src/Umbraco.Core/Composing/LazyCollectionBuilderBase.cs +++ b/src/Umbraco.Core/Composing/LazyCollectionBuilderBase.cs @@ -175,4 +175,4 @@ namespace Umbraco.Core.Composing .Except(_excluded); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Composing/TypeFinder.cs b/src/Umbraco.Core/Composing/TypeFinder.cs index a84ef2575b..dc0f3eb7ea 100644 --- a/src/Umbraco.Core/Composing/TypeFinder.cs +++ b/src/Umbraco.Core/Composing/TypeFinder.cs @@ -179,7 +179,7 @@ namespace Umbraco.Core.Composing internal static readonly string[] KnownAssemblyExclusionFilter = new[] { "mscorlib,", - "System.", + "System.", "Antlr3.", "Autofac.", "Autofac,", @@ -200,8 +200,8 @@ namespace Umbraco.Core.Composing "SqlCE4Umbraco,", "umbraco.datalayer,", "umbraco.interfaces,", - //"umbraco.providers,", - //"Umbraco.Web.UI,", + //"umbraco.providers,", + //"Umbraco.Web.UI,", "umbraco.webservices", "Lucene.", "Examine,", diff --git a/src/Umbraco.Core/Composing/TypeHelper.cs b/src/Umbraco.Core/Composing/TypeHelper.cs index 63a6389614..1ab48b71f8 100644 --- a/src/Umbraco.Core/Composing/TypeHelper.cs +++ b/src/Umbraco.Core/Composing/TypeHelper.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.Collections.Concurrent; using System.Collections.Generic; @@ -9,58 +9,58 @@ using System.Reflection; namespace Umbraco.Core.Composing { /// - /// A utility class for type checking, this provides internal caching so that calls to these methods will be faster - /// than doing a manual type check in c# - /// - internal static class TypeHelper - { - private static readonly ConcurrentDictionary, PropertyInfo[]> GetPropertiesCache + /// A utility class for type checking, this provides internal caching so that calls to these methods will be faster + /// than doing a manual type check in c# + /// + internal static class TypeHelper + { + private static readonly ConcurrentDictionary, PropertyInfo[]> GetPropertiesCache = new ConcurrentDictionary, PropertyInfo[]>(); - private static readonly ConcurrentDictionary GetFieldsCache + private static readonly ConcurrentDictionary GetFieldsCache = new ConcurrentDictionary(); private static readonly Assembly[] EmptyAssemblies = new Assembly[0]; - /// - /// Based on a type we'll check if it is IEnumerable{T} (or similar) and if so we'll return a List{T}, this will also deal with array types and return List{T} for those too. - /// If it cannot be done, null is returned. - /// - /// - /// - // fixme wtf is this and do we need it in v8? - internal static IList CreateGenericEnumerableFromObject(object obj) - { - var type = obj.GetType(); + /// + /// Based on a type we'll check if it is IEnumerable{T} (or similar) and if so we'll return a List{T}, this will also deal with array types and return List{T} for those too. + /// If it cannot be done, null is returned. + /// + /// + /// + // fixme wtf is this and do we need it in v8? + internal static IList CreateGenericEnumerableFromObject(object obj) + { + var type = obj.GetType(); - if (type.IsGenericType) - { - var genericTypeDef = type.GetGenericTypeDefinition(); + if (type.IsGenericType) + { + var genericTypeDef = type.GetGenericTypeDefinition(); - if (genericTypeDef == typeof(IEnumerable<>) - || genericTypeDef == typeof(ICollection<>) - || genericTypeDef == typeof(Collection<>) - || genericTypeDef == typeof(IList<>) - || genericTypeDef == typeof(List<>) - //this will occur when Linq is used and we get the odd WhereIterator or DistinctIterators since those are special iterator types - || obj is IEnumerable) - { - //if it is a IEnumerable<>, IList or ICollection<> we'll use a List<> - var genericType = typeof(List<>).MakeGenericType(type.GetGenericArguments()); - //pass in obj to fill the list - return (IList)Activator.CreateInstance(genericType, obj); - } - } + if (genericTypeDef == typeof(IEnumerable<>) + || genericTypeDef == typeof(ICollection<>) + || genericTypeDef == typeof(Collection<>) + || genericTypeDef == typeof(IList<>) + || genericTypeDef == typeof(List<>) + //this will occur when Linq is used and we get the odd WhereIterator or DistinctIterators since those are special iterator types + || obj is IEnumerable) + { + //if it is a IEnumerable<>, IList or ICollection<> we'll use a List<> + var genericType = typeof(List<>).MakeGenericType(type.GetGenericArguments()); + //pass in obj to fill the list + return (IList)Activator.CreateInstance(genericType, obj); + } + } - if (type.IsArray) - { - //if its an array, we'll use a List<> - var genericType = typeof(List<>).MakeGenericType(type.GetElementType()); - //pass in obj to fill the list - return (IList)Activator.CreateInstance(genericType, obj); - } + if (type.IsArray) + { + //if its an array, we'll use a List<> + var genericType = typeof(List<>).MakeGenericType(type.GetElementType()); + //pass in obj to fill the list + return (IList)Activator.CreateInstance(genericType, obj); + } - return null; - } + return null; + } /// /// Checks if the method is actually overriding a base method @@ -95,12 +95,12 @@ namespace Umbraco.Core.Composing return assemblies.Where(x => x == assembly || HasReference(x, name)).ToArray(); } - /// - /// Determines if an assembly references another assembly. - /// - /// - /// - /// + /// + /// Determines if an assembly references another assembly. + /// + /// + /// + /// public static bool HasReference(Assembly assembly, string name) { // ReSharper disable once LoopCanBeConvertedToQuery - no! @@ -116,12 +116,12 @@ namespace Umbraco.Core.Composing /// /// /// - public static bool IsNonStaticClass(Type t) + public static bool IsNonStaticClass(Type t) { return t.IsClass && IsStaticClass(t) == false; } - /// + /// /// Returns true if the type is a static class /// /// @@ -135,7 +135,7 @@ namespace Umbraco.Core.Composing return type.IsAbstract && type.IsSealed; } - /// + /// /// Finds a lowest base class amongst a collection of types /// /// @@ -145,54 +145,54 @@ namespace Umbraco.Core.Composing /// If a base type is not found amongst the type collection then an invalid attempt is returned. /// public static Attempt GetLowestBaseType(params Type[] types) - { - if (types.Length == 0) - return Attempt.Fail(); + { + if (types.Length == 0) + return Attempt.Fail(); if (types.Length == 1) return Attempt.Succeed(types[0]); - foreach (var curr in types) - { - var others = types.Except(new[] {curr}); + foreach (var curr in types) + { + var others = types.Except(new[] {curr}); - //is the curr type a common denominator for all others ? - var isBase = others.All(curr.IsAssignableFrom); + //is the curr type a common denominator for all others ? + var isBase = others.All(curr.IsAssignableFrom); - //if this type is the base for all others - if (isBase) - { - return Attempt.Succeed(curr); - } - } + //if this type is the base for all others + if (isBase) + { + return Attempt.Succeed(curr); + } + } - return Attempt.Fail(); - } + return Attempt.Fail(); + } /// - /// Determines whether the type is assignable from the specified implementation, - /// and caches the result across the application using a . - /// - /// The type of the contract. - /// The implementation. - /// - /// true if [is type assignable from] [the specified contract]; otherwise, false. - /// - public static bool IsTypeAssignableFrom(Type contract, Type implementation) - { - return contract.IsAssignableFrom(implementation); - } + /// Determines whether the type is assignable from the specified implementation, + /// and caches the result across the application using a . + /// + /// The type of the contract. + /// The implementation. + /// + /// true if [is type assignable from] [the specified contract]; otherwise, false. + /// + public static bool IsTypeAssignableFrom(Type contract, Type implementation) + { + return contract.IsAssignableFrom(implementation); + } - /// - /// Determines whether the type is assignable from the specified implementation , - /// and caches the result across the application using a . - /// - /// The type of the contract. - /// The implementation. - public static bool IsTypeAssignableFrom(Type implementation) - { - return IsTypeAssignableFrom(typeof(TContract), implementation); - } + /// + /// Determines whether the type is assignable from the specified implementation , + /// and caches the result across the application using a . + /// + /// The type of the contract. + /// The implementation. + public static bool IsTypeAssignableFrom(Type implementation) + { + return IsTypeAssignableFrom(typeof(TContract), implementation); + } /// /// Determines whether the object instance is assignable from the specified implementation , @@ -206,78 +206,78 @@ namespace Umbraco.Core.Composing return IsTypeAssignableFrom(implementation.GetType()); } - /// - /// A method to determine whether represents a value type. - /// - /// The implementation. - public static bool IsValueType(Type implementation) - { - return implementation.IsValueType || implementation.IsPrimitive; - } - - /// - /// A method to determine whether is an implied value type (, or a string). - /// - /// The implementation. - public static bool IsImplicitValueType(Type implementation) - { - return IsValueType(implementation) || implementation.IsEnum || implementation == typeof (string); - } - - /// - /// Returns (and caches) a PropertyInfo from a type - /// - /// - /// - /// - /// - /// - /// - /// - public static PropertyInfo GetProperty(Type type, string name, - bool mustRead = true, - bool mustWrite = true, - bool includeIndexed = false, - bool caseSensitive = true) - { - return CachedDiscoverableProperties(type, mustRead, mustWrite, includeIndexed) - .FirstOrDefault(x => caseSensitive ? (x.Name == name) : x.Name.InvariantEquals(name)); + /// + /// A method to determine whether represents a value type. + /// + /// The implementation. + public static bool IsValueType(Type implementation) + { + return implementation.IsValueType || implementation.IsPrimitive; } - /// - /// Gets (and caches) discoverable in the current for a given . - /// - /// The source. - /// - public static FieldInfo[] CachedDiscoverableFields(Type type) - { - return GetFieldsCache.GetOrAdd( - type, - x => type - .GetFields(BindingFlags.Public | BindingFlags.Instance) - .Where(y => y.IsInitOnly == false) - .ToArray()); - } + /// + /// A method to determine whether is an implied value type (, or a string). + /// + /// The implementation. + public static bool IsImplicitValueType(Type implementation) + { + return IsValueType(implementation) || implementation.IsEnum || implementation == typeof (string); + } - /// - /// Gets (and caches) discoverable in the current for a given . - /// - /// The source. - /// true if the properties discovered are readable - /// true if the properties discovered are writable - /// true if the properties discovered are indexable - /// - public static PropertyInfo[] CachedDiscoverableProperties(Type type, bool mustRead = true, bool mustWrite = true, bool includeIndexed = false) - { - return GetPropertiesCache.GetOrAdd( - new Tuple(type, mustRead, mustWrite, includeIndexed), - x => type - .GetProperties(BindingFlags.Public | BindingFlags.Instance) - .Where(y => (mustRead == false || y.CanRead) - && (mustWrite == false || y.CanWrite) - && (includeIndexed || y.GetIndexParameters().Any() == false)) - .ToArray()); - } + /// + /// Returns (and caches) a PropertyInfo from a type + /// + /// + /// + /// + /// + /// + /// + /// + public static PropertyInfo GetProperty(Type type, string name, + bool mustRead = true, + bool mustWrite = true, + bool includeIndexed = false, + bool caseSensitive = true) + { + return CachedDiscoverableProperties(type, mustRead, mustWrite, includeIndexed) + .FirstOrDefault(x => caseSensitive ? (x.Name == name) : x.Name.InvariantEquals(name)); + } + + /// + /// Gets (and caches) discoverable in the current for a given . + /// + /// The source. + /// + public static FieldInfo[] CachedDiscoverableFields(Type type) + { + return GetFieldsCache.GetOrAdd( + type, + x => type + .GetFields(BindingFlags.Public | BindingFlags.Instance) + .Where(y => y.IsInitOnly == false) + .ToArray()); + } + + /// + /// Gets (and caches) discoverable in the current for a given . + /// + /// The source. + /// true if the properties discovered are readable + /// true if the properties discovered are writable + /// true if the properties discovered are indexable + /// + public static PropertyInfo[] CachedDiscoverableProperties(Type type, bool mustRead = true, bool mustWrite = true, bool includeIndexed = false) + { + return GetPropertiesCache.GetOrAdd( + new Tuple(type, mustRead, mustWrite, includeIndexed), + x => type + .GetProperties(BindingFlags.Public | BindingFlags.Instance) + .Where(y => (mustRead == false || y.CanRead) + && (mustWrite == false || y.CanWrite) + && (includeIndexed || y.GetIndexParameters().Any() == false)) + .ToArray()); + } #region Match Type @@ -381,5 +381,5 @@ namespace Umbraco.Core.Composing } #endregion - } -} \ No newline at end of file + } +} diff --git a/src/Umbraco.Core/Composing/TypeLoader.cs b/src/Umbraco.Core/Composing/TypeLoader.cs index 8954d0dad5..58d8d80432 100644 --- a/src/Umbraco.Core/Composing/TypeLoader.cs +++ b/src/Umbraco.Core/Composing/TypeLoader.cs @@ -160,16 +160,16 @@ namespace Umbraco.Core.Composing return _currentAssembliesHash; _currentAssembliesHash = GetFileHash(new List> - { - // the bin folder and everything in it - new Tuple(new DirectoryInfo(IOHelper.MapPath(SystemDirectories.Bin)), false), - // the app code folder and everything in it - new Tuple(new DirectoryInfo(IOHelper.MapPath("~/App_Code")), false), - // global.asax (the app domain also monitors this, if it changes will do a full restart) - new Tuple(new FileInfo(IOHelper.MapPath("~/global.asax")), false), + { + // the bin folder and everything in it + new Tuple(new DirectoryInfo(IOHelper.MapPath(SystemDirectories.Bin)), false), + // the app code folder and everything in it + new Tuple(new DirectoryInfo(IOHelper.MapPath("~/App_Code")), false), + // global.asax (the app domain also monitors this, if it changes will do a full restart) + new Tuple(new FileInfo(IOHelper.MapPath("~/global.asax")), false), // trees.config - use the contents to create the hash since this gets resaved on every app startup! new Tuple(new FileInfo(IOHelper.MapPath(SystemDirectories.Config + "/trees.config")), true) - }, _logger); + }, _logger); return _currentAssembliesHash; } diff --git a/src/Umbraco.Core/Composing/TypeLoaderExtensions.cs b/src/Umbraco.Core/Composing/TypeLoaderExtensions.cs index 4f91eff5e9..71a59c2d4d 100644 --- a/src/Umbraco.Core/Composing/TypeLoaderExtensions.cs +++ b/src/Umbraco.Core/Composing/TypeLoaderExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using Umbraco.Core.Cache; @@ -75,4 +75,4 @@ namespace Umbraco.Core.Composing return mgr.GetTypesWithAttribute(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Composing/WeightAttribute.cs b/src/Umbraco.Core/Composing/WeightAttribute.cs index aeec84de09..ec652ba9a3 100644 --- a/src/Umbraco.Core/Composing/WeightAttribute.cs +++ b/src/Umbraco.Core/Composing/WeightAttribute.cs @@ -22,4 +22,4 @@ namespace Umbraco.Core.Composing /// public int Weight { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Composing/WeightedCollectionBuilderBase.cs b/src/Umbraco.Core/Composing/WeightedCollectionBuilderBase.cs index cec44a2ab3..99fa2d3eb9 100644 --- a/src/Umbraco.Core/Composing/WeightedCollectionBuilderBase.cs +++ b/src/Umbraco.Core/Composing/WeightedCollectionBuilderBase.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using LightInject; @@ -131,4 +131,4 @@ namespace Umbraco.Core.Composing return attr?.Weight ?? DefaultWeight; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/ClientDependencyConfiguration.cs b/src/Umbraco.Core/Configuration/ClientDependencyConfiguration.cs index 6fbdec6901..842a67cb96 100644 --- a/src/Umbraco.Core/Configuration/ClientDependencyConfiguration.cs +++ b/src/Umbraco.Core/Configuration/ClientDependencyConfiguration.cs @@ -50,4 +50,4 @@ namespace Umbraco.Core.Configuration return false; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/CommaDelimitedConfigurationElement.cs b/src/Umbraco.Core/Configuration/CommaDelimitedConfigurationElement.cs index d8be9c850b..5015e9d8a2 100644 --- a/src/Umbraco.Core/Configuration/CommaDelimitedConfigurationElement.cs +++ b/src/Umbraco.Core/Configuration/CommaDelimitedConfigurationElement.cs @@ -1,4 +1,4 @@ -using System.Collections; +using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; using System.Configuration; @@ -12,8 +12,8 @@ namespace Umbraco.Core.Configuration { public override CommaDelimitedStringCollection Value { - get - { + get + { var converter = new CommaDelimitedStringCollectionConverter(); return (CommaDelimitedStringCollection) converter.ConvertFrom(RawValue); } @@ -67,4 +67,4 @@ namespace Umbraco.Core.Configuration } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/ContentXmlStorage.cs b/src/Umbraco.Core/Configuration/ContentXmlStorage.cs index 7cbbc70675..f81ca8f8cc 100644 --- a/src/Umbraco.Core/Configuration/ContentXmlStorage.cs +++ b/src/Umbraco.Core/Configuration/ContentXmlStorage.cs @@ -1,4 +1,4 @@ -namespace Umbraco.Core.Configuration +namespace Umbraco.Core.Configuration { internal enum ContentXmlStorage { @@ -6,4 +6,4 @@ namespace Umbraco.Core.Configuration AspNetTemp, EnvironmentTemp } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/Dashboard/AccessElement.cs b/src/Umbraco.Core/Configuration/Dashboard/AccessElement.cs index da7f7e3e49..d83fc3ccfc 100644 --- a/src/Umbraco.Core/Configuration/Dashboard/AccessElement.cs +++ b/src/Umbraco.Core/Configuration/Dashboard/AccessElement.cs @@ -8,7 +8,7 @@ namespace Umbraco.Core.Configuration.Dashboard { public AccessElement() { - + } public AccessElement(XElement rawXml) @@ -31,4 +31,4 @@ namespace Umbraco.Core.Configuration.Dashboard } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/Dashboard/AccessItem.cs b/src/Umbraco.Core/Configuration/Dashboard/AccessItem.cs index 0daacfb17c..ec270bada5 100644 --- a/src/Umbraco.Core/Configuration/Dashboard/AccessItem.cs +++ b/src/Umbraco.Core/Configuration/Dashboard/AccessItem.cs @@ -6,10 +6,10 @@ /// This can be grant, deny or grantBySection /// public AccessType Action { get; set; } - + /// /// The value of the action /// public string Value { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/Dashboard/AccessType.cs b/src/Umbraco.Core/Configuration/Dashboard/AccessType.cs index afc74b671f..0d46b2e0e6 100644 --- a/src/Umbraco.Core/Configuration/Dashboard/AccessType.cs +++ b/src/Umbraco.Core/Configuration/Dashboard/AccessType.cs @@ -6,4 +6,4 @@ Deny, GrantBySection } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/Dashboard/AreaCollection.cs b/src/Umbraco.Core/Configuration/Dashboard/AreaCollection.cs index ac3706d0d4..488e9a625b 100644 --- a/src/Umbraco.Core/Configuration/Dashboard/AreaCollection.cs +++ b/src/Umbraco.Core/Configuration/Dashboard/AreaCollection.cs @@ -29,4 +29,4 @@ namespace Umbraco.Core.Configuration.Dashboard return GetEnumerator(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/Dashboard/AreaElement.cs b/src/Umbraco.Core/Configuration/Dashboard/AreaElement.cs index baea6ce2cd..a688b69008 100644 --- a/src/Umbraco.Core/Configuration/Dashboard/AreaElement.cs +++ b/src/Umbraco.Core/Configuration/Dashboard/AreaElement.cs @@ -9,4 +9,4 @@ namespace Umbraco.Core.Configuration.Dashboard get { return Value; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/Dashboard/AreasElement.cs b/src/Umbraco.Core/Configuration/Dashboard/AreasElement.cs index 037c394799..549096f6d9 100644 --- a/src/Umbraco.Core/Configuration/Dashboard/AreasElement.cs +++ b/src/Umbraco.Core/Configuration/Dashboard/AreasElement.cs @@ -12,4 +12,4 @@ namespace Umbraco.Core.Configuration.Dashboard set { base[""] = value; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/Dashboard/ControlCollection.cs b/src/Umbraco.Core/Configuration/Dashboard/ControlCollection.cs index 1b39c206c6..a3fe9d9300 100644 --- a/src/Umbraco.Core/Configuration/Dashboard/ControlCollection.cs +++ b/src/Umbraco.Core/Configuration/Dashboard/ControlCollection.cs @@ -34,4 +34,4 @@ namespace Umbraco.Core.Configuration.Dashboard return GetEnumerator(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/Dashboard/ControlElement.cs b/src/Umbraco.Core/Configuration/Dashboard/ControlElement.cs index 582998d1f2..680cebe2a6 100644 --- a/src/Umbraco.Core/Configuration/Dashboard/ControlElement.cs +++ b/src/Umbraco.Core/Configuration/Dashboard/ControlElement.cs @@ -5,7 +5,7 @@ using System.Xml.Linq; namespace Umbraco.Core.Configuration.Dashboard { - + internal class ControlElement : RawXmlConfigurationElement, IDashboardControl { public bool ShowOnce @@ -51,8 +51,8 @@ namespace Umbraco.Core.Configuration.Dashboard } } - public string ControlPath - { + public string ControlPath + { get { //we need to return the first (and only) text element of the children (wtf... who designed this configuration ! :P ) @@ -71,4 +71,4 @@ namespace Umbraco.Core.Configuration.Dashboard get { return Access; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/Dashboard/IAccess.cs b/src/Umbraco.Core/Configuration/Dashboard/IAccess.cs index 0c275e1373..477745ee1b 100644 --- a/src/Umbraco.Core/Configuration/Dashboard/IAccess.cs +++ b/src/Umbraco.Core/Configuration/Dashboard/IAccess.cs @@ -6,4 +6,4 @@ namespace Umbraco.Core.Configuration.Dashboard { IEnumerable Rules { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/Dashboard/IAccessItem.cs b/src/Umbraco.Core/Configuration/Dashboard/IAccessItem.cs index a0ae9c2d5e..e343a39bfb 100644 --- a/src/Umbraco.Core/Configuration/Dashboard/IAccessItem.cs +++ b/src/Umbraco.Core/Configuration/Dashboard/IAccessItem.cs @@ -12,4 +12,4 @@ /// string Value { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/Dashboard/IArea.cs b/src/Umbraco.Core/Configuration/Dashboard/IArea.cs index c562c915d7..71dbfdde75 100644 --- a/src/Umbraco.Core/Configuration/Dashboard/IArea.cs +++ b/src/Umbraco.Core/Configuration/Dashboard/IArea.cs @@ -4,4 +4,4 @@ { string AreaName { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/Dashboard/IDashboardControl.cs b/src/Umbraco.Core/Configuration/Dashboard/IDashboardControl.cs index c362d3ed78..ee766bef29 100644 --- a/src/Umbraco.Core/Configuration/Dashboard/IDashboardControl.cs +++ b/src/Umbraco.Core/Configuration/Dashboard/IDashboardControl.cs @@ -12,4 +12,4 @@ IAccess AccessRights { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/Dashboard/IDashboardSection.cs b/src/Umbraco.Core/Configuration/Dashboard/IDashboardSection.cs index 2b1da4a869..52b6e66d98 100644 --- a/src/Umbraco.Core/Configuration/Dashboard/IDashboardSection.cs +++ b/src/Umbraco.Core/Configuration/Dashboard/IDashboardSection.cs @@ -6,4 +6,4 @@ namespace Umbraco.Core.Configuration.Dashboard { IEnumerable Sections { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/Dashboard/IDashboardTab.cs b/src/Umbraco.Core/Configuration/Dashboard/IDashboardTab.cs index 28cdc64021..ad49d084d6 100644 --- a/src/Umbraco.Core/Configuration/Dashboard/IDashboardTab.cs +++ b/src/Umbraco.Core/Configuration/Dashboard/IDashboardTab.cs @@ -10,4 +10,4 @@ namespace Umbraco.Core.Configuration.Dashboard IAccess AccessRights { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/Dashboard/ISection.cs b/src/Umbraco.Core/Configuration/Dashboard/ISection.cs index 48c53382c6..319dcacc12 100644 --- a/src/Umbraco.Core/Configuration/Dashboard/ISection.cs +++ b/src/Umbraco.Core/Configuration/Dashboard/ISection.cs @@ -12,4 +12,4 @@ namespace Umbraco.Core.Configuration.Dashboard IAccess AccessRights { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/Dashboard/SectionCollection.cs b/src/Umbraco.Core/Configuration/Dashboard/SectionCollection.cs index 2f47de2af6..c3ae6743a0 100644 --- a/src/Umbraco.Core/Configuration/Dashboard/SectionCollection.cs +++ b/src/Umbraco.Core/Configuration/Dashboard/SectionCollection.cs @@ -34,4 +34,4 @@ namespace Umbraco.Core.Configuration.Dashboard return GetEnumerator(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/Dashboard/SectionElement.cs b/src/Umbraco.Core/Configuration/Dashboard/SectionElement.cs index 9adacd0b87..55498f98c5 100644 --- a/src/Umbraco.Core/Configuration/Dashboard/SectionElement.cs +++ b/src/Umbraco.Core/Configuration/Dashboard/SectionElement.cs @@ -17,7 +17,7 @@ namespace Umbraco.Core.Configuration.Dashboard { get { return (AreasElement)this["areas"]; } } - + [ConfigurationProperty("access")] public AccessElement Access { @@ -34,7 +34,7 @@ namespace Umbraco.Core.Configuration.Dashboard IEnumerable ISection.Tabs { - get { return TabCollection; } + get { return TabCollection; } } IEnumerable ISection.Areas @@ -47,4 +47,4 @@ namespace Umbraco.Core.Configuration.Dashboard get { return Access; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/Dashboard/TabCollection.cs b/src/Umbraco.Core/Configuration/Dashboard/TabCollection.cs index 42aa912114..eed0f7af11 100644 --- a/src/Umbraco.Core/Configuration/Dashboard/TabCollection.cs +++ b/src/Umbraco.Core/Configuration/Dashboard/TabCollection.cs @@ -34,4 +34,4 @@ namespace Umbraco.Core.Configuration.Dashboard return GetEnumerator(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/Dashboard/TabElement.cs b/src/Umbraco.Core/Configuration/Dashboard/TabElement.cs index abf3511db0..21dc953677 100644 --- a/src/Umbraco.Core/Configuration/Dashboard/TabElement.cs +++ b/src/Umbraco.Core/Configuration/Dashboard/TabElement.cs @@ -10,7 +10,7 @@ namespace Umbraco.Core.Configuration.Dashboard { get { return (string)this["caption"]; } } - + [ConfigurationProperty("access")] public AccessElement Access { @@ -24,10 +24,10 @@ namespace Umbraco.Core.Configuration.Dashboard get { return (ControlCollection)base[""]; } set { base[""] = value; } } - + IEnumerable IDashboardTab.Controls { - get { return ControlCollection; } + get { return ControlCollection; } } IAccess IDashboardTab.AccessRights @@ -35,4 +35,4 @@ namespace Umbraco.Core.Configuration.Dashboard get { return Access; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/FileSystemProviderElementCollection.cs b/src/Umbraco.Core/Configuration/FileSystemProviderElementCollection.cs index 0604560939..363eaba00b 100644 --- a/src/Umbraco.Core/Configuration/FileSystemProviderElementCollection.cs +++ b/src/Umbraco.Core/Configuration/FileSystemProviderElementCollection.cs @@ -7,7 +7,7 @@ using System.Text; namespace Umbraco.Core.Configuration { [ConfigurationCollection(typeof(FileSystemProviderElement), AddItemName = "Provider")] - public class FileSystemProviderElementCollection : ConfigurationElementCollection + public class FileSystemProviderElementCollection : ConfigurationElementCollection { protected override ConfigurationElement CreateNewElement() { diff --git a/src/Umbraco.Core/Configuration/GlobalSettings.cs b/src/Umbraco.Core/Configuration/GlobalSettings.cs index 7336939cbd..f85dbdb4d4 100644 --- a/src/Umbraco.Core/Configuration/GlobalSettings.cs +++ b/src/Umbraco.Core/Configuration/GlobalSettings.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Configuration; using System.Linq; @@ -36,7 +36,7 @@ namespace Umbraco.Core.Configuration private static Version _version; private static readonly object Locker = new object(); //make this volatile so that we can ensure thread safety with a double check lock - private static volatile string _reservedUrlsCache; + private static volatile string _reservedUrlsCache; private static string _reservedPathsCache; private static HashSet _reservedList = new HashSet(); private static string _reservedPaths; @@ -66,7 +66,7 @@ namespace Umbraco.Core.Configuration ResetInternal(); } - /// + /// /// Gets the reserved urls from web.config. /// /// The reserved urls. @@ -172,7 +172,7 @@ namespace Umbraco.Core.Configuration /// This will return the MVC area that we will route all custom routes through like surface controllers, etc... /// We will use the 'Path' (default ~/umbraco) to create it but since it cannot contain '/' and people may specify a path of ~/asdf/asdf/admin /// we will convert the '/' to '-' and use that as the path. its a bit lame but will work. - /// + /// /// We also make sure that the virtual directory (SystemDirectories.Root) is stripped off first, otherwise we'd end up with something /// like "MyVirtualDirectory-Umbraco" instead of just "Umbraco". /// @@ -187,7 +187,7 @@ namespace Umbraco.Core.Configuration var path = Path; if (path.StartsWith(SystemDirectories.Root)) // beware of TrimStart, see U4-2518 path = path.Substring(SystemDirectories.Root.Length); - return path.TrimStart('~').TrimStart('/').Replace('/', '-').Trim().ToLower(); + return path.TrimStart('~').TrimStart('/').Replace('/', '-').Trim().ToLower(); } } @@ -514,7 +514,7 @@ namespace Umbraco.Core.Configuration /// Gets a value indicating whether umbraco should hide top level nodes from generated urls. /// /// - /// true if umbraco hides top level nodes from urls; otherwise, false. + /// true if umbraco hides top level nodes from urls; otherwise, false. /// public static bool HideTopLevelNodeFromPath { @@ -696,7 +696,7 @@ namespace Umbraco.Core.Configuration /// /// The URL to check. /// - /// true if the specified URL is reserved; otherwise, false. + /// true if the specified URL is reserved; otherwise, false. /// public static bool IsReservedPathOrUrl(string url) { diff --git a/src/Umbraco.Core/Configuration/Grid/GridConfig.cs b/src/Umbraco.Core/Configuration/Grid/GridConfig.cs index 334124a4e5..beade2d6d1 100644 --- a/src/Umbraco.Core/Configuration/Grid/GridConfig.cs +++ b/src/Umbraco.Core/Configuration/Grid/GridConfig.cs @@ -1,4 +1,4 @@ -using System.IO; +using System.IO; using Umbraco.Core.Cache; using Umbraco.Core.Logging; @@ -13,4 +13,4 @@ namespace Umbraco.Core.Configuration.Grid public IGridEditorsConfig EditorsConfig { get; private set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/Grid/GridEditorsConfig.cs b/src/Umbraco.Core/Configuration/Grid/GridEditorsConfig.cs index c74cb9d081..517f80b383 100644 --- a/src/Umbraco.Core/Configuration/Grid/GridEditorsConfig.cs +++ b/src/Umbraco.Core/Configuration/Grid/GridEditorsConfig.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.IO; using Newtonsoft.Json.Linq; @@ -51,7 +51,7 @@ namespace Umbraco.Core.Configuration.Grid } } - + var builder = new ManifestBuilder(_runtimeCache, parser); foreach (var gridEditor in builder.GridEditors) { @@ -74,7 +74,7 @@ namespace Umbraco.Core.Configuration.Grid return result; } - + } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/Grid/IGridEditorConfig.cs b/src/Umbraco.Core/Configuration/Grid/IGridEditorConfig.cs index 0eedd5e035..e447f7f493 100644 --- a/src/Umbraco.Core/Configuration/Grid/IGridEditorConfig.cs +++ b/src/Umbraco.Core/Configuration/Grid/IGridEditorConfig.cs @@ -12,4 +12,4 @@ namespace Umbraco.Core.Configuration.Grid string Icon { get; } IDictionary Config { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/Grid/IGridEditorsConfig.cs b/src/Umbraco.Core/Configuration/Grid/IGridEditorsConfig.cs index 64fb1a831f..418d9b9560 100644 --- a/src/Umbraco.Core/Configuration/Grid/IGridEditorsConfig.cs +++ b/src/Umbraco.Core/Configuration/Grid/IGridEditorsConfig.cs @@ -6,4 +6,4 @@ namespace Umbraco.Core.Configuration.Grid { IEnumerable Editors { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/InnerTextConfigurationElement.cs b/src/Umbraco.Core/Configuration/InnerTextConfigurationElement.cs index fdbbc7889e..cfeec5ab1b 100644 --- a/src/Umbraco.Core/Configuration/InnerTextConfigurationElement.cs +++ b/src/Umbraco.Core/Configuration/InnerTextConfigurationElement.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Xml; using System.Xml.Linq; @@ -66,4 +66,4 @@ namespace Umbraco.Core.Configuration } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/OptionalCommaDelimitedConfigurationElement.cs b/src/Umbraco.Core/Configuration/OptionalCommaDelimitedConfigurationElement.cs index 59ad883e03..8b5b21762f 100644 --- a/src/Umbraco.Core/Configuration/OptionalCommaDelimitedConfigurationElement.cs +++ b/src/Umbraco.Core/Configuration/OptionalCommaDelimitedConfigurationElement.cs @@ -1,4 +1,4 @@ -using System.Configuration; +using System.Configuration; using Umbraco.Core.Configuration.UmbracoSettings; namespace Umbraco.Core.Configuration @@ -12,7 +12,7 @@ namespace Umbraco.Core.Configuration private readonly string[] _defaultValue; public OptionalCommaDelimitedConfigurationElement() - { + { } public OptionalCommaDelimitedConfigurationElement(CommaDelimitedConfigurationElement wrapped, string[] defaultValue) @@ -40,4 +40,4 @@ namespace Umbraco.Core.Configuration } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/OptionalInnerTextConfigurationElement.cs b/src/Umbraco.Core/Configuration/OptionalInnerTextConfigurationElement.cs index 832a74fec2..8245811af0 100644 --- a/src/Umbraco.Core/Configuration/OptionalInnerTextConfigurationElement.cs +++ b/src/Umbraco.Core/Configuration/OptionalInnerTextConfigurationElement.cs @@ -1,4 +1,4 @@ -namespace Umbraco.Core.Configuration +namespace Umbraco.Core.Configuration { /// /// This is used to supply optional/default values when using InnerTextConfigurationElement @@ -20,4 +20,4 @@ namespace Umbraco.Core.Configuration get { return string.IsNullOrEmpty(_wrapped.RawValue) ? _defaultValue : _wrapped.Value; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/RawXmlConfigurationElement.cs b/src/Umbraco.Core/Configuration/RawXmlConfigurationElement.cs index f2d2d8a52f..1b09b80d68 100644 --- a/src/Umbraco.Core/Configuration/RawXmlConfigurationElement.cs +++ b/src/Umbraco.Core/Configuration/RawXmlConfigurationElement.cs @@ -1,4 +1,4 @@ -using System.Configuration; +using System.Configuration; using System.Xml; using System.Xml.Linq; @@ -12,7 +12,7 @@ namespace Umbraco.Core.Configuration { protected RawXmlConfigurationElement() { - + } protected RawXmlConfigurationElement(XElement rawXml) @@ -27,4 +27,4 @@ namespace Umbraco.Core.Configuration protected XElement RawXml { get; private set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoConfig.cs b/src/Umbraco.Core/Configuration/UmbracoConfig.cs index 77bb82c95f..9a0dc12485 100644 --- a/src/Umbraco.Core/Configuration/UmbracoConfig.cs +++ b/src/Umbraco.Core/Configuration/UmbracoConfig.cs @@ -21,13 +21,13 @@ namespace Umbraco.Core.Configuration public static UmbracoConfig For { - get { return Lazy.Value; } + get { return Lazy.Value; } } #endregion /// - /// Default constructor + /// Default constructor /// private UmbracoConfig() { @@ -83,7 +83,7 @@ namespace Umbraco.Core.Configuration } return _dashboardSection; - } + } /// /// Only for testing @@ -117,7 +117,7 @@ namespace Umbraco.Core.Configuration return _umbracoSettings; } - + /// /// Only for testing /// @@ -142,4 +142,4 @@ namespace Umbraco.Core.Configuration //TODO: Add other configurations here ! } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoConfigurationSection.cs b/src/Umbraco.Core/Configuration/UmbracoConfigurationSection.cs index 2b7678a6d8..930d73c5f5 100644 --- a/src/Umbraco.Core/Configuration/UmbracoConfigurationSection.cs +++ b/src/Umbraco.Core/Configuration/UmbracoConfigurationSection.cs @@ -7,7 +7,7 @@ namespace Umbraco.Core.Configuration /// public interface IUmbracoConfigurationSection { - + } /// diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/AppCodeFileExtensionsCollection.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/AppCodeFileExtensionsCollection.cs index 95510f094b..f602389f1f 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/AppCodeFileExtensionsCollection.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/AppCodeFileExtensionsCollection.cs @@ -33,4 +33,4 @@ namespace Umbraco.Core.Configuration.UmbracoSettings return GetEnumerator(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/AppCodeFileExtensionsElement.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/AppCodeFileExtensionsElement.cs index db260dbe66..3642cc576e 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/AppCodeFileExtensionsElement.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/AppCodeFileExtensionsElement.cs @@ -14,4 +14,4 @@ namespace Umbraco.Core.Configuration.UmbracoSettings } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/CharCollection.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/CharCollection.cs index f7ba4de35d..8ce65f95cb 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/CharCollection.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/CharCollection.cs @@ -33,4 +33,4 @@ namespace Umbraco.Core.Configuration.UmbracoSettings return GetEnumerator(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/CharElement.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/CharElement.cs index f785bf616c..6252ef7888 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/CharElement.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/CharElement.cs @@ -20,13 +20,13 @@ string IChar.Char { get { return Char; } - + } string IChar.Replacement { get { return Replacement; } - + } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/ContentElement.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/ContentElement.cs index c84a054fa1..87d4c4a7f5 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/ContentElement.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/ContentElement.cs @@ -84,7 +84,7 @@ namespace Umbraco.Core.Configuration.UmbracoSettings get { return GetOptionalTextElement("PropertyContextHelpOption", "text"); } } - + [ConfigurationProperty("ForceSafeAliases")] internal InnerTextConfigurationElement ForceSafeAliases { @@ -96,7 +96,7 @@ namespace Umbraco.Core.Configuration.UmbracoSettings { get { - return GetOptionalTextElement("PreviewBadge", @"In Preview Mode - click to end"); + return GetOptionalTextElement("PreviewBadge", @"In Preview Mode - click to end"); } } @@ -116,7 +116,7 @@ namespace Umbraco.Core.Configuration.UmbracoSettings internal CommaDelimitedConfigurationElement DisallowedUploadFiles { get { return GetOptionalDelimitedElement("disallowedUploadFiles", new[] {"ashx", "aspx", "ascx", "config", "cshtml", "vbhtml", "asmx", "air", "axd"}); } - } + } [ConfigurationProperty("allowedUploadFiles")] internal CommaDelimitedConfigurationElement AllowedUploadFiles @@ -214,12 +214,12 @@ namespace Umbraco.Core.Configuration.UmbracoSettings bool IContentSection.UploadAllowDirectories { get { return UploadAllowDirectories; } - } + } bool IContentSection.EnsureUniqueNaming { get { return EnsureUniqueNaming; } - } + } bool IContentSection.XmlCacheEnabled { @@ -269,7 +269,7 @@ namespace Umbraco.Core.Configuration.UmbracoSettings IEnumerable IContentSection.DisallowedUploadFiles { get { return DisallowedUploadFiles; } - } + } IEnumerable IContentSection.AllowedUploadFiles { @@ -306,4 +306,4 @@ namespace Umbraco.Core.Configuration.UmbracoSettings get { return LoginBackgroundImage; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/ContentError404Collection.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/ContentError404Collection.cs index 6691400cc7..cd1b9722de 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/ContentError404Collection.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/ContentError404Collection.cs @@ -34,4 +34,4 @@ namespace Umbraco.Core.Configuration.UmbracoSettings return GetEnumerator(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/ContentErrorPageElement.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/ContentErrorPageElement.cs index eed15b9a0e..5cedee59dc 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/ContentErrorPageElement.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/ContentErrorPageElement.cs @@ -12,7 +12,7 @@ namespace Umbraco.Core.Configuration.UmbracoSettings public ContentErrorPageElement() { - + } public bool HasContentId @@ -62,4 +62,4 @@ namespace Umbraco.Core.Configuration.UmbracoSettings set { RawXml.Attribute("culture").Value = value; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/ContentErrorsElement.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/ContentErrorsElement.cs index c03444aa6c..8066306bf0 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/ContentErrorsElement.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/ContentErrorsElement.cs @@ -5,7 +5,7 @@ namespace Umbraco.Core.Configuration.UmbracoSettings { internal class ContentErrorsElement : RawXmlConfigurationElement { - + public IEnumerable Error404Collection { get @@ -14,7 +14,7 @@ namespace Umbraco.Core.Configuration.UmbracoSettings if (RawXml != null) { var e404 = RawXml.Elements("error404").First(); - var ePages = e404.Elements("errorPage").ToArray(); + var ePages = e404.Elements("errorPage").ToArray(); if (ePages.Any()) { //there are multiple @@ -34,11 +34,11 @@ namespace Umbraco.Core.Configuration.UmbracoSettings { RawValue = e404.Value }); - } + } } return result; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/ContentImagingElement.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/ContentImagingElement.cs index 305463856b..61406ed7b9 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/ContentImagingElement.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/ContentImagingElement.cs @@ -4,7 +4,7 @@ namespace Umbraco.Core.Configuration.UmbracoSettings { internal class ContentImagingElement : ConfigurationElement { - + [ConfigurationProperty("imageFileTypes")] internal CommaDelimitedConfigurationElement ImageFileTypes { @@ -61,7 +61,7 @@ namespace Umbraco.Core.Configuration.UmbracoSettings }; return _defaultImageAutoFill; } - + return (ImagingAutoFillPropertiesCollection) base["autoFillImageProperties"]; } } @@ -78,4 +78,4 @@ namespace Umbraco.Core.Configuration.UmbracoSettings } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/ContentScriptEditorElement.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/ContentScriptEditorElement.cs index f60e964a04..f0c6400799 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/ContentScriptEditorElement.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/ContentScriptEditorElement.cs @@ -24,4 +24,4 @@ namespace Umbraco.Core.Configuration.UmbracoSettings } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/ContentSectionExtensions.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/ContentSectionExtensions.cs index a4f182b373..519c0e6af1 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/ContentSectionExtensions.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/ContentSectionExtensions.cs @@ -16,4 +16,4 @@ namespace Umbraco.Core.Configuration.UmbracoSettings contentSection.DisallowedUploadFiles.Any(x => x.InvariantEquals(extension)) == false); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/DeveloperElement.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/DeveloperElement.cs index f2bf88db04..66531a1ab1 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/DeveloperElement.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/DeveloperElement.cs @@ -44,4 +44,4 @@ namespace Umbraco.Core.Configuration.UmbracoSettings get { return AppCodeFileExtensions.AppCodeFileExtensionsCollection; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/DisabledLogTypesCollection.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/DisabledLogTypesCollection.cs index 63841b3445..1674274990 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/DisabledLogTypesCollection.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/DisabledLogTypesCollection.cs @@ -28,4 +28,4 @@ namespace Umbraco.Core.Configuration.UmbracoSettings return GetEnumerator(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/DistributedCallElement.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/DistributedCallElement.cs index 9a9047f838..af035d2e0e 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/DistributedCallElement.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/DistributedCallElement.cs @@ -45,4 +45,4 @@ namespace Umbraco.Core.Configuration.UmbracoSettings get { return Servers; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/ExternalLoggerElement.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/ExternalLoggerElement.cs index 8d8d7b3f0d..cf6e785325 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/ExternalLoggerElement.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/ExternalLoggerElement.cs @@ -22,4 +22,4 @@ namespace Umbraco.Core.Configuration.UmbracoSettings get { return (bool)base["logAuditTrail"]; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/FileExtensionElement.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/FileExtensionElement.cs index 939b91cd0f..d0f566093f 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/FileExtensionElement.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/FileExtensionElement.cs @@ -12,10 +12,10 @@ namespace Umbraco.Core.Configuration.UmbracoSettings : base(rawXml) { } - + string IFileExtension.Extension { get { return Value; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/IChar.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/IChar.cs index 4ec15603c2..0b3f5cb404 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/IChar.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/IChar.cs @@ -5,4 +5,4 @@ string Char { get; } string Replacement { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/IContentErrorPage.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/IContentErrorPage.cs index 5f10e542bb..9761727be8 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/IContentErrorPage.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/IContentErrorPage.cs @@ -11,4 +11,4 @@ namespace Umbraco.Core.Configuration.UmbracoSettings bool HasContentKey { get; } string Culture { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/IContentSection.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/IContentSection.cs index 3c4e9df48d..babc3811f1 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/IContentSection.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/IContentSection.cs @@ -63,4 +63,4 @@ namespace Umbraco.Core.Configuration.UmbracoSettings string LoginBackgroundImage { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/IDeveloperSection.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/IDeveloperSection.cs index a1f1bffd3e..40aa6af0db 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/IDeveloperSection.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/IDeveloperSection.cs @@ -6,4 +6,4 @@ namespace Umbraco.Core.Configuration.UmbracoSettings { IEnumerable AppCodeFileExtensions { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/IDistributedCallSection.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/IDistributedCallSection.cs index 5f8e51d60f..96f695c8c7 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/IDistributedCallSection.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/IDistributedCallSection.cs @@ -10,4 +10,4 @@ namespace Umbraco.Core.Configuration.UmbracoSettings IEnumerable Servers { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/IFileExtension.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/IFileExtension.cs index 2d9ee19fcd..08ae1d3699 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/IFileExtension.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/IFileExtension.cs @@ -4,4 +4,4 @@ { string Extension { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/IImagingAutoFillUploadField.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/IImagingAutoFillUploadField.cs index 6f42e14668..320cf641be 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/IImagingAutoFillUploadField.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/IImagingAutoFillUploadField.cs @@ -15,4 +15,4 @@ string ExtensionFieldAlias { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/ILink.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/ILink.cs index d2afec55f3..8de74c0f7c 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/ILink.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/ILink.cs @@ -12,4 +12,4 @@ string HelpUrl { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/ILogType.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/ILogType.cs index 559fb1fb13..bf1a9306da 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/ILogType.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/ILogType.cs @@ -4,4 +4,4 @@ { string LogTypeAlias { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/ILoggingSection.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/ILoggingSection.cs index 9d8c78a37b..b5b1a0dc37 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/ILoggingSection.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/ILoggingSection.cs @@ -12,6 +12,6 @@ namespace Umbraco.Core.Configuration.UmbracoSettings int MaxLogAge { get; } - IEnumerable DisabledLogTypes { get; } + IEnumerable DisabledLogTypes { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/IProvidersSection.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/IProvidersSection.cs index 8a61bfffb3..52e4405847 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/IProvidersSection.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/IProvidersSection.cs @@ -3,7 +3,7 @@ namespace Umbraco.Core.Configuration.UmbracoSettings { public interface IProvidersSection : IUmbracoConfigurationSection - { + { string DefaultBackOfficeUserProvider { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/IRepositoriesSection.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/IRepositoriesSection.cs index 063acbe1cf..7dbb44ba25 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/IRepositoriesSection.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/IRepositoriesSection.cs @@ -7,4 +7,4 @@ namespace Umbraco.Core.Configuration.UmbracoSettings { IEnumerable Repositories { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/IRepository.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/IRepository.cs index 7559f090c0..cff1d40145 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/IRepository.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/IRepository.cs @@ -8,7 +8,7 @@ namespace Umbraco.Core.Configuration.UmbracoSettings Guid Id { get; } string RepositoryUrl { get; } string WebServiceUrl { get; } - bool HasCustomWebServiceUrl { get; } + bool HasCustomWebServiceUrl { get; } string RestApiUrl { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/IRequestHandlerSection.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/IRequestHandlerSection.cs index 2d78e68bf5..5d03466402 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/IRequestHandlerSection.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/IRequestHandlerSection.cs @@ -14,4 +14,4 @@ namespace Umbraco.Core.Configuration.UmbracoSettings IEnumerable CharCollection { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/IScheduledTask.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/IScheduledTask.cs index 46d4256170..fd448897ee 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/IScheduledTask.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/IScheduledTask.cs @@ -10,4 +10,4 @@ string Url { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/IScheduledTasksSection.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/IScheduledTasksSection.cs index 8b25e11e91..8da6446675 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/IScheduledTasksSection.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/IScheduledTasksSection.cs @@ -8,4 +8,4 @@ namespace Umbraco.Core.Configuration.UmbracoSettings string BaseUrl { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/ISecuritySection.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/ISecuritySection.cs index c44c0cf0df..fd24d840ab 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/ISecuritySection.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/ISecuritySection.cs @@ -12,4 +12,4 @@ string AuthCookieDomain { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/IServer.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/IServer.cs index 856c570277..26b1db056e 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/IServer.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/IServer.cs @@ -9,4 +9,4 @@ string AppId { get; } string ServerName { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/ITemplatesSection.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/ITemplatesSection.cs index a80fc6d2c7..a08bae87fb 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/ITemplatesSection.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/ITemplatesSection.cs @@ -13,4 +13,4 @@ namespace Umbraco.Core.Configuration.UmbracoSettings [Obsolete("This has no affect and will be removed in future versions")] bool EnableTemplateFolders { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/IUmbracoSettingsSection.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/IUmbracoSettingsSection.cs index 56faf4f973..11504cf2a4 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/IUmbracoSettingsSection.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/IUmbracoSettingsSection.cs @@ -22,8 +22,8 @@ IRepositoriesSection PackageRepositories { get; } IProvidersSection Providers { get; } - + IWebRoutingSection WebRouting { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/IWebRoutingSection.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/IWebRoutingSection.cs index 9eb6d02aa7..c7b7a07206 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/IWebRoutingSection.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/IWebRoutingSection.cs @@ -9,7 +9,7 @@ bool DisableAlternativeTemplates { get; } bool DisableFindContentByIdPath { get; } - + bool DisableRedirectUrlTracking { get; } string UrlProviderMode { get; } @@ -17,4 +17,4 @@ string UmbracoApplicationUrl { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/ImagingAutoFillPropertiesCollection.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/ImagingAutoFillPropertiesCollection.cs index 28cca97c8e..60d68252e2 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/ImagingAutoFillPropertiesCollection.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/ImagingAutoFillPropertiesCollection.cs @@ -15,7 +15,7 @@ namespace Umbraco.Core.Configuration.UmbracoSettings { return ((ImagingAutoFillUploadFieldElement)element).Alias; } - + internal void Add(ImagingAutoFillUploadFieldElement item) { BaseAdd(item); @@ -34,4 +34,4 @@ namespace Umbraco.Core.Configuration.UmbracoSettings return GetEnumerator(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/ImagingAutoFillUploadFieldElement.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/ImagingAutoFillUploadFieldElement.cs index eafe43817d..77b9faec8e 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/ImagingAutoFillUploadFieldElement.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/ImagingAutoFillUploadFieldElement.cs @@ -41,7 +41,7 @@ namespace Umbraco.Core.Configuration.UmbracoSettings string IImagingAutoFillUploadField.Alias { get { return Alias; } - + } string IImagingAutoFillUploadField.WidthFieldAlias @@ -64,4 +64,4 @@ namespace Umbraco.Core.Configuration.UmbracoSettings get { return ExtensionFieldAlias; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/LogTypeElement.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/LogTypeElement.cs index 44ca547c8b..ff92d9c173 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/LogTypeElement.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/LogTypeElement.cs @@ -8,4 +8,4 @@ get { return Value; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/LoggingElement.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/LoggingElement.cs index b230641591..3f9e93ed86 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/LoggingElement.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/LoggingElement.cs @@ -5,7 +5,7 @@ namespace Umbraco.Core.Configuration.UmbracoSettings { internal class LoggingElement : UmbracoConfigurationElement, ILoggingSection { - + [ConfigurationProperty("autoCleanLogs")] internal InnerTextConfigurationElement AutoCleanLogs { @@ -62,7 +62,7 @@ namespace Umbraco.Core.Configuration.UmbracoSettings return false; } } - + bool ILoggingSection.AutoCleanLogs { get { return AutoCleanLogs; } @@ -72,7 +72,7 @@ namespace Umbraco.Core.Configuration.UmbracoSettings { get { return EnableLogging; } } - + int ILoggingSection.CleaningMiliseconds { get { return CleaningMiliseconds; } @@ -89,4 +89,4 @@ namespace Umbraco.Core.Configuration.UmbracoSettings } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/NotificationsElement.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/NotificationsElement.cs index 89e3f447ee..0facef0f87 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/NotificationsElement.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/NotificationsElement.cs @@ -17,4 +17,4 @@ namespace Umbraco.Core.Configuration.UmbracoSettings } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/ProvidersElement.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/ProvidersElement.cs index 5cc94a4eb2..2a02ceaa80 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/ProvidersElement.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/ProvidersElement.cs @@ -15,4 +15,4 @@ namespace Umbraco.Core.Configuration.UmbracoSettings get { return Users.DefaultBackOfficeProvider; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/RepositoriesCollection.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/RepositoriesCollection.cs index 994c808703..1a228d33f2 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/RepositoriesCollection.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/RepositoriesCollection.cs @@ -33,4 +33,4 @@ namespace Umbraco.Core.Configuration.UmbracoSettings return GetEnumerator(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/RepositoriesElement.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/RepositoriesElement.cs index e2c3ba3036..0f1063adb0 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/RepositoriesElement.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/RepositoriesElement.cs @@ -20,4 +20,4 @@ namespace Umbraco.Core.Configuration.UmbracoSettings get { return Repositories; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/RepositoryConfigExtensions.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/RepositoryConfigExtensions.cs index e2c4283dc6..d311a4423b 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/RepositoryConfigExtensions.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/RepositoryConfigExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; namespace Umbraco.Core.Configuration.UmbracoSettings @@ -16,4 +16,4 @@ namespace Umbraco.Core.Configuration.UmbracoSettings return found; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/RepositoryElement.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/RepositoryElement.cs index a249be2ee3..ae583ca7c3 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/RepositoryElement.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/RepositoryElement.cs @@ -38,7 +38,7 @@ namespace Umbraco.Core.Configuration.UmbracoSettings get { var prop = Properties["webserviceurl"]; - return (string) prop.DefaultValue != (string) this[prop]; + return (string) prop.DefaultValue != (string) this[prop]; } } @@ -48,6 +48,6 @@ namespace Umbraco.Core.Configuration.UmbracoSettings get { return (string)base["restapiurl"]; } set { base["restapiurl"] = value; } } - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/RequestHandlerElement.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/RequestHandlerElement.cs index 779d33c8b8..76d23b1757 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/RequestHandlerElement.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/RequestHandlerElement.cs @@ -29,7 +29,7 @@ namespace Umbraco.Core.Configuration.UmbracoSettings { return _defaultUrlReplacing; } - + //here we need to check if this element is defined, if it is not then we'll setup the defaults var prop = Properties["urlReplacing"]; var urls = this[prop] as ConfigurationElement; @@ -42,11 +42,11 @@ namespace Umbraco.Core.Configuration.UmbracoSettings return _defaultUrlReplacing; } - + return (UrlReplacingElement)this["urlReplacing"]; } } - + internal static CharCollection GetDefaultCharReplacements() { var dictionary = new Dictionary() @@ -119,4 +119,4 @@ namespace Umbraco.Core.Configuration.UmbracoSettings get { return UrlReplacing.CharCollection; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/ScheduledTaskElement.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/ScheduledTaskElement.cs index 46b25ddaa2..1ba844f6e1 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/ScheduledTaskElement.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/ScheduledTaskElement.cs @@ -28,4 +28,4 @@ namespace Umbraco.Core.Configuration.UmbracoSettings get { return (string)base["url"]; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/ScheduledTasksCollection.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/ScheduledTasksCollection.cs index ce6fbd2cc6..5ff35ccf63 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/ScheduledTasksCollection.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/ScheduledTasksCollection.cs @@ -28,4 +28,4 @@ namespace Umbraco.Core.Configuration.UmbracoSettings return GetEnumerator(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/ScheduledTasksElement.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/ScheduledTasksElement.cs index 0598aeec9e..7829259ab8 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/ScheduledTasksElement.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/ScheduledTasksElement.cs @@ -23,4 +23,4 @@ namespace Umbraco.Core.Configuration.UmbracoSettings get { return (string)base["baseUrl"]; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/SecurityElement.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/SecurityElement.cs index ddb168ddbd..88f5b975b0 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/SecurityElement.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/SecurityElement.cs @@ -59,4 +59,4 @@ namespace Umbraco.Core.Configuration.UmbracoSettings get { return AuthCookieDomain; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/ServerCollection.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/ServerCollection.cs index 2333549faa..dfaa5c5247 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/ServerCollection.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/ServerCollection.cs @@ -28,4 +28,4 @@ namespace Umbraco.Core.Configuration.UmbracoSettings return GetEnumerator(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/ServerElement.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/ServerElement.cs index 7c00c02277..30c836bc07 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/ServerElement.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/ServerElement.cs @@ -20,7 +20,7 @@ ? null : RawXml.Attribute("forceProtocol").Value; } - } + } string IServer.ServerAddress { @@ -46,4 +46,4 @@ } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/TemplatesElement.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/TemplatesElement.cs index 4e249df3a2..9eb843313c 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/TemplatesElement.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/TemplatesElement.cs @@ -51,4 +51,4 @@ namespace Umbraco.Core.Configuration.UmbracoSettings get { return EnableTemplateFolders; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/UmbracoConfigurationElement.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/UmbracoConfigurationElement.cs index 063b5324d8..670f620b15 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/UmbracoConfigurationElement.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/UmbracoConfigurationElement.cs @@ -1,4 +1,4 @@ -using System.Collections.Concurrent; +using System.Collections.Concurrent; using System.Configuration; namespace Umbraco.Core.Configuration.UmbracoSettings @@ -33,4 +33,4 @@ namespace Umbraco.Core.Configuration.UmbracoSettings defaultVal)); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/UmbracoSettingsSection.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/UmbracoSettingsSection.cs index a92b2b952c..2c9875522d 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/UmbracoSettingsSection.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/UmbracoSettingsSection.cs @@ -79,7 +79,7 @@ namespace Umbraco.Core.Configuration.UmbracoSettings new RepositoryElement() {Name = "Umbraco package Repository", Id = new Guid("65194810-1f85-11dd-bd0b-0800200c9a66")} }; - + _defaultRepositories = new RepositoriesElement() { Repositories = collection @@ -92,7 +92,7 @@ namespace Umbraco.Core.Configuration.UmbracoSettings var reposElement = (RepositoriesElement)base["repositories"]; if (reposElement.Repositories.All(x => x.Id != new Guid("65194810-1f85-11dd-bd0b-0800200c9a66"))) { - reposElement.Repositories.Add(new RepositoryElement() { Name = "Umbraco package Repository", Id = new Guid("65194810-1f85-11dd-bd0b-0800200c9a66") }); + reposElement.Repositories.Add(new RepositoryElement() { Name = "Umbraco package Repository", Id = new Guid("65194810-1f85-11dd-bd0b-0800200c9a66") }); } return reposElement; diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/UrlReplacingElement.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/UrlReplacingElement.cs index a378a27dcd..f95a999f8a 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/UrlReplacingElement.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/UrlReplacingElement.cs @@ -24,6 +24,6 @@ namespace Umbraco.Core.Configuration.UmbracoSettings get { return (CharCollection)base[""]; } set { base[""] = value; } } - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/UserProviderElement.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/UserProviderElement.cs index 53e85bc774..60da143b58 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/UserProviderElement.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/UserProviderElement.cs @@ -16,6 +16,6 @@ namespace Umbraco.Core.Configuration.UmbracoSettings } } - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/WebRoutingElement.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/WebRoutingElement.cs index 82f5d46b28..393aac4f50 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/WebRoutingElement.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/WebRoutingElement.cs @@ -45,4 +45,4 @@ namespace Umbraco.Core.Configuration.UmbracoSettings get { return (string)base["umbracoApplicationUrl"]; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Configuration/UmbracoVersion.cs b/src/Umbraco.Core/Configuration/UmbracoVersion.cs index 1953b1c2b2..21d282d78c 100644 --- a/src/Umbraco.Core/Configuration/UmbracoVersion.cs +++ b/src/Umbraco.Core/Configuration/UmbracoVersion.cs @@ -41,4 +41,4 @@ namespace Umbraco.Core.Configuration CurrentComment.IsNullOrWhiteSpace() ? null : CurrentComment, Current.Revision > 0 ? Current.Revision.ToInvariantString() : null); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Constants-Applications.cs b/src/Umbraco.Core/Constants-Applications.cs index d2a836863e..c917d62154 100644 --- a/src/Umbraco.Core/Constants-Applications.cs +++ b/src/Umbraco.Core/Constants-Applications.cs @@ -1,52 +1,52 @@ namespace Umbraco.Core { - public static partial class Constants - { - /// - /// Defines the alias identifiers for Umbraco's core application sections. - /// - public static class Applications - { - /// - /// Application alias for the content section. - /// - public const string Content = "content"; + public static partial class Constants + { + /// + /// Defines the alias identifiers for Umbraco's core application sections. + /// + public static class Applications + { + /// + /// Application alias for the content section. + /// + public const string Content = "content"; - /// - /// Application alias for the developer section. - /// - public const string Developer = "developer"; + /// + /// Application alias for the developer section. + /// + public const string Developer = "developer"; - /// - /// Application alias for the media section. - /// - public const string Media = "media"; + /// + /// Application alias for the media section. + /// + public const string Media = "media"; - /// - /// Application alias for the members section. - /// - public const string Members = "member"; + /// + /// Application alias for the members section. + /// + public const string Members = "member"; - /// - /// Application alias for the settings section. - /// - public const string Settings = "settings"; + /// + /// Application alias for the settings section. + /// + public const string Settings = "settings"; - /// - /// Application alias for the translation section. - /// - public const string Translation = "translation"; + /// + /// Application alias for the translation section. + /// + public const string Translation = "translation"; - /// - /// Application alias for the users section. - /// - public const string Users = "users"; + /// + /// Application alias for the users section. + /// + public const string Users = "users"; /// /// Application alias for the forms section. /// public const string Forms = "forms"; - } + } /// /// Defines the alias identifiers for Umbraco's core trees. @@ -71,17 +71,17 @@ /// /// alias for the datatype tree. /// - public const string DataTypes = "dataTypes"; + public const string DataTypes = "dataTypes"; /// /// alias for the packages tree /// public const string Packages = "packager"; - /// - /// alias for the dictionary tree. - /// - public const string Dictionary = "dictionary"; + /// + /// alias for the dictionary tree. + /// + public const string Dictionary = "dictionary"; public const string Stylesheets = "stylesheets"; @@ -115,7 +115,7 @@ public const string Xslt = "xslt"; public const string Languages = "languages"; - + public const string Macros = "macros"; /// @@ -139,7 +139,7 @@ public const string PartialViewMacros = "partialViewMacros"; - //TODO: Fill in the rest! + //TODO: Fill in the rest! } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Constants-Conventions.cs b/src/Umbraco.Core/Constants-Conventions.cs index d7f4576137..0d2c8b9887 100644 --- a/src/Umbraco.Core/Constants-Conventions.cs +++ b/src/Umbraco.Core/Constants-Conventions.cs @@ -4,136 +4,136 @@ using Umbraco.Core.Models; namespace Umbraco.Core { - public static partial class Constants - { - /// - /// Defines the identifiers for property-type alias conventions that are used within the Umbraco core. - /// - public static class Conventions - { - public static class PublicAccess - { - public const string MemberUsernameRuleType = "MemberUsername"; + public static partial class Constants + { + /// + /// Defines the identifiers for property-type alias conventions that are used within the Umbraco core. + /// + public static class Conventions + { + public static class PublicAccess + { + public const string MemberUsernameRuleType = "MemberUsername"; public const string MemberRoleRuleType = "MemberRole"; [Obsolete("No longer supported, this is here for backwards compatibility only")] public const string MemberIdRuleType = "MemberId"; [Obsolete("No longer supported, this is here for backwards compatibility only")] public const string MemberGroupIdRuleType = "MemberGroupId"; - } + } - public static class Localization - { + public static class Localization + { /// /// The root id for all top level dictionary items /// [Obsolete("There is no dictionary root item id anymore, it is simply null")] public const string DictionaryItemRootId = "41c7638d-f529-4bff-853e-59a0c2fb1bde"; - } + } - public static class DataTypes - { - public const string ListViewPrefix = "List View - "; - } + public static class DataTypes + { + public const string ListViewPrefix = "List View - "; + } - public static class PropertyGroups - { - public const string ListViewGroupName = "umbContainerView"; - } + public static class PropertyGroups + { + public const string ListViewGroupName = "umbContainerView"; + } - /// - /// Constants for Umbraco Content property aliases. - /// - public static class Content - { - /// - /// Property alias for the Content's Url (internal) redirect. - /// - public const string InternalRedirectId = "umbracoInternalRedirectId"; - - /// - /// Property alias for the Content's navigational hide, (not actually used in core code). - /// - public const string NaviHide = "umbracoNaviHide"; - - /// - /// Property alias for the Content's Url redirect. - /// - public const string Redirect = "umbracoRedirect"; - - /// - /// Property alias for the Content's Url alias. - /// - public const string UrlAlias = "umbracoUrlAlias"; - - /// - /// Property alias for the Content's Url name. - /// - public const string UrlName = "umbracoUrlName"; - } - - /// - /// Constants for Umbraco Media property aliases. - /// - public static class Media - { - /// - /// Property alias for the Media's file name. - /// - public const string File = "umbracoFile"; - - /// - /// Property alias for the Media's width. - /// - public const string Width = "umbracoWidth"; - - /// - /// Property alias for the Media's height. - /// - public const string Height = "umbracoHeight"; - - /// - /// Property alias for the Media's file size (in bytes). - /// - public const string Bytes = "umbracoBytes"; - - /// - /// Property alias for the Media's file extension. - /// - public const string Extension = "umbracoExtension"; - } - - /// - /// Defines the alias identifiers for Umbraco media types. - /// - public static class MediaTypes - { - /// - /// MediaType alias for a file. - /// - public const string File = "File"; - - /// - /// MediaType alias for a folder. + /// + /// Constants for Umbraco Content property aliases. + /// + public static class Content + { + /// + /// Property alias for the Content's Url (internal) redirect. /// - public const string Folder = "Folder"; + public const string InternalRedirectId = "umbracoInternalRedirectId"; - /// - /// MediaType alias for an image. - /// - public const string Image = "Image"; + /// + /// Property alias for the Content's navigational hide, (not actually used in core code). + /// + public const string NaviHide = "umbracoNaviHide"; + + /// + /// Property alias for the Content's Url redirect. + /// + public const string Redirect = "umbracoRedirect"; + + /// + /// Property alias for the Content's Url alias. + /// + public const string UrlAlias = "umbracoUrlAlias"; + + /// + /// Property alias for the Content's Url name. + /// + public const string UrlName = "umbracoUrlName"; + } + + /// + /// Constants for Umbraco Media property aliases. + /// + public static class Media + { + /// + /// Property alias for the Media's file name. + /// + public const string File = "umbracoFile"; + + /// + /// Property alias for the Media's width. + /// + public const string Width = "umbracoWidth"; + + /// + /// Property alias for the Media's height. + /// + public const string Height = "umbracoHeight"; + + /// + /// Property alias for the Media's file size (in bytes). + /// + public const string Bytes = "umbracoBytes"; + + /// + /// Property alias for the Media's file extension. + /// + public const string Extension = "umbracoExtension"; + } + + /// + /// Defines the alias identifiers for Umbraco media types. + /// + public static class MediaTypes + { + /// + /// MediaType alias for a file. + /// + public const string File = "File"; + + /// + /// MediaType alias for a folder. + /// + public const string Folder = "Folder"; + + /// + /// MediaType alias for an image. + /// + public const string Image = "Image"; /// /// MediaType alias indicating allowing auto-selection. /// - public const string AutoSelect = "umbracoAutoSelect"; - } - - /// - /// Constants for Umbraco Member property aliases. - /// - public static class Member - { + public const string AutoSelect = "umbracoAutoSelect"; + } + + /// + /// Constants for Umbraco Member property aliases. + /// + public static class Member + { /// /// if a role starts with __umbracoRole we won't show it as it's an internal role used for public access /// @@ -211,103 +211,103 @@ namespace Umbraco.Core /// internal const string StandardPropertiesGroupName = "Membership"; - public static Dictionary GetStandardPropertyTypeStubs() - { - return new Dictionary - { - { - Comments, - new PropertyType(PropertyEditors.TextboxMultipleAlias, DataTypeDatabaseType.Ntext, true, Comments) - { - Name = CommentsLabel - } - }, - { - FailedPasswordAttempts, - new PropertyType(PropertyEditors.NoEditAlias, DataTypeDatabaseType.Integer, true, FailedPasswordAttempts) - { - Name = FailedPasswordAttemptsLabel - } - }, - { - IsApproved, - new PropertyType(PropertyEditors.TrueFalseAlias, DataTypeDatabaseType.Integer, true, IsApproved) - { - Name = IsApprovedLabel - } - }, - { - IsLockedOut, - new PropertyType(PropertyEditors.TrueFalseAlias, DataTypeDatabaseType.Integer, true, IsLockedOut) - { - Name = IsLockedOutLabel - } - }, - { - LastLockoutDate, - new PropertyType(PropertyEditors.NoEditAlias, DataTypeDatabaseType.Date, true, LastLockoutDate) - { - Name = LastLockoutDateLabel - } - }, - { - LastLoginDate, - new PropertyType(PropertyEditors.NoEditAlias, DataTypeDatabaseType.Date, true, LastLoginDate) - { - Name = LastLoginDateLabel - } - }, - { - LastPasswordChangeDate, - new PropertyType(PropertyEditors.NoEditAlias, DataTypeDatabaseType.Date, true, LastPasswordChangeDate) - { - Name = LastPasswordChangeDateLabel - } - }, - { - PasswordAnswer, - new PropertyType(PropertyEditors.NoEditAlias, DataTypeDatabaseType.Nvarchar, true, PasswordAnswer) - { - Name = PasswordAnswerLabel - } - }, - { - PasswordQuestion, - new PropertyType(PropertyEditors.NoEditAlias, DataTypeDatabaseType.Nvarchar, true, PasswordQuestion) - { - Name = PasswordQuestionLabel - } - } - }; - } - } + public static Dictionary GetStandardPropertyTypeStubs() + { + return new Dictionary + { + { + Comments, + new PropertyType(PropertyEditors.TextboxMultipleAlias, DataTypeDatabaseType.Ntext, true, Comments) + { + Name = CommentsLabel + } + }, + { + FailedPasswordAttempts, + new PropertyType(PropertyEditors.NoEditAlias, DataTypeDatabaseType.Integer, true, FailedPasswordAttempts) + { + Name = FailedPasswordAttemptsLabel + } + }, + { + IsApproved, + new PropertyType(PropertyEditors.TrueFalseAlias, DataTypeDatabaseType.Integer, true, IsApproved) + { + Name = IsApprovedLabel + } + }, + { + IsLockedOut, + new PropertyType(PropertyEditors.TrueFalseAlias, DataTypeDatabaseType.Integer, true, IsLockedOut) + { + Name = IsLockedOutLabel + } + }, + { + LastLockoutDate, + new PropertyType(PropertyEditors.NoEditAlias, DataTypeDatabaseType.Date, true, LastLockoutDate) + { + Name = LastLockoutDateLabel + } + }, + { + LastLoginDate, + new PropertyType(PropertyEditors.NoEditAlias, DataTypeDatabaseType.Date, true, LastLoginDate) + { + Name = LastLoginDateLabel + } + }, + { + LastPasswordChangeDate, + new PropertyType(PropertyEditors.NoEditAlias, DataTypeDatabaseType.Date, true, LastPasswordChangeDate) + { + Name = LastPasswordChangeDateLabel + } + }, + { + PasswordAnswer, + new PropertyType(PropertyEditors.NoEditAlias, DataTypeDatabaseType.Nvarchar, true, PasswordAnswer) + { + Name = PasswordAnswerLabel + } + }, + { + PasswordQuestion, + new PropertyType(PropertyEditors.NoEditAlias, DataTypeDatabaseType.Nvarchar, true, PasswordQuestion) + { + Name = PasswordQuestionLabel + } + } + }; + } + } - /// - /// Defines the alias identifiers for Umbraco member types. - /// - public static class MemberTypes - { - /// - /// MemberType alias for default member type. - /// - public const string DefaultAlias = "Member"; + /// + /// Defines the alias identifiers for Umbraco member types. + /// + public static class MemberTypes + { + /// + /// MemberType alias for default member type. + /// + public const string DefaultAlias = "Member"; public const string SystemDefaultProtectType = "_umbracoSystemDefaultProtectType"; - public const string AllMembersListId = "all-members"; - } + public const string AllMembersListId = "all-members"; + } + + /// + /// Constants for Umbraco URLs/Querystrings. + /// + public static class Url + { + /// + /// Querystring parameter name used for Umbraco's alternative template functionality. + /// + public const string AltTemplate = "altTemplate"; + } - /// - /// Constants for Umbraco URLs/Querystrings. - /// - public static class Url - { - /// - /// Querystring parameter name used for Umbraco's alternative template functionality. - /// - public const string AltTemplate = "altTemplate"; - } - /// /// Defines the alias identifiers for built-in Umbraco relation types. /// @@ -317,7 +317,7 @@ namespace Umbraco.Core /// ContentType name for default relation type "Relate Document On Copy". /// public const string RelateDocumentOnCopyName = "Relate Document On Copy"; - + /// /// ContentType alias for default relation type "Relate Document On Copy". /// @@ -333,6 +333,6 @@ namespace Umbraco.Core /// public const string RelateParentDocumentOnDeleteAlias = "relateParentDocumentOnDelete"; } - } - } -} \ No newline at end of file + } + } +} diff --git a/src/Umbraco.Core/Constants-DataTypes.cs b/src/Umbraco.Core/Constants-DataTypes.cs index 931a231b4c..60a8507149 100644 --- a/src/Umbraco.Core/Constants-DataTypes.cs +++ b/src/Umbraco.Core/Constants-DataTypes.cs @@ -13,4 +13,4 @@ public const int DefaultMembersListView = -97; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Constants-DatabaseProviders.cs b/src/Umbraco.Core/Constants-DatabaseProviders.cs index 2a64ade081..c1430eb82d 100644 --- a/src/Umbraco.Core/Constants-DatabaseProviders.cs +++ b/src/Umbraco.Core/Constants-DatabaseProviders.cs @@ -9,4 +9,4 @@ public const string MySql = "MySql.Data.MySqlClient"; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Constants-DeploySelector.cs b/src/Umbraco.Core/Constants-DeploySelector.cs index cd9c48a6f5..f6f3f5fbae 100644 --- a/src/Umbraco.Core/Constants-DeploySelector.cs +++ b/src/Umbraco.Core/Constants-DeploySelector.cs @@ -1,5 +1,5 @@ namespace Umbraco.Core -{ +{ public static partial class Constants { /// @@ -14,4 +14,4 @@ public const string DescendantsOfThis = "descendants"; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Constants-Icons.cs b/src/Umbraco.Core/Constants-Icons.cs index a0928919f0..f74b44b70b 100644 --- a/src/Umbraco.Core/Constants-Icons.cs +++ b/src/Umbraco.Core/Constants-Icons.cs @@ -10,7 +10,7 @@ namespace Umbraco.Core { public static class Icons { - + /// /// System contenttype icon diff --git a/src/Umbraco.Core/Constants-ObjectTypes.cs b/src/Umbraco.Core/Constants-ObjectTypes.cs index 6af011d4bd..41e6a0bc4a 100644 --- a/src/Umbraco.Core/Constants-ObjectTypes.cs +++ b/src/Umbraco.Core/Constants-ObjectTypes.cs @@ -214,4 +214,4 @@ namespace Umbraco.Core public static readonly Guid FormsDataSourceGuid = new Guid(FormsDataSource); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Constants-Packaging.cs b/src/Umbraco.Core/Constants-Packaging.cs index 31cbad1246..e88639ebbd 100644 --- a/src/Umbraco.Core/Constants-Packaging.cs +++ b/src/Umbraco.Core/Constants-Packaging.cs @@ -52,4 +52,4 @@ public const string RunatNodeAttribute = "runat"; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Constants-PropertyEditors.cs b/src/Umbraco.Core/Constants-PropertyEditors.cs index ddec54b2dd..0837a9bcb9 100644 --- a/src/Umbraco.Core/Constants-PropertyEditors.cs +++ b/src/Umbraco.Core/Constants-PropertyEditors.cs @@ -2,7 +2,7 @@ namespace Umbraco.Core { - public static partial class Constants + public static partial class Constants { // fixme - kill the Whatever2! @@ -449,5 +449,5 @@ namespace Umbraco.Core public const string DataValueType = "umbracoDataValueType"; } } - } -} \ No newline at end of file + } +} diff --git a/src/Umbraco.Core/Constants-PropertyTypeGroups.cs b/src/Umbraco.Core/Constants-PropertyTypeGroups.cs index 5dabe90029..ef6951df1a 100644 --- a/src/Umbraco.Core/Constants-PropertyTypeGroups.cs +++ b/src/Umbraco.Core/Constants-PropertyTypeGroups.cs @@ -28,4 +28,4 @@ public const string Membership = "0756729D-D665-46E3-B84A-37ACEAA614F8"; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Constants-Security.cs b/src/Umbraco.Core/Constants-Security.cs index bd2e1c5acf..e02e2cb988 100644 --- a/src/Umbraco.Core/Constants-Security.cs +++ b/src/Umbraco.Core/Constants-Security.cs @@ -18,7 +18,7 @@ namespace Umbraco.Core /// The prefix used for external identity providers for their authentication type /// /// - /// By default we don't want to interfere with front-end external providers and their default setup, for back office the + /// By default we don't want to interfere with front-end external providers and their default setup, for back office the /// providers need to be setup differently and each auth type for the back office will be prefixed with this value /// public const string BackOfficeExternalAuthenticationTypePrefix = "Umbraco."; @@ -30,4 +30,4 @@ namespace Umbraco.Core } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Constants-System.cs b/src/Umbraco.Core/Constants-System.cs index bc4151c7d9..69a3bbc9bd 100644 --- a/src/Umbraco.Core/Constants-System.cs +++ b/src/Umbraco.Core/Constants-System.cs @@ -24,6 +24,6 @@ public const string UmbracoConnectionName = "umbracoDbDSN"; public const string UmbracoMigrationName = "Umbraco"; - } + } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Constants-Web.cs b/src/Umbraco.Core/Constants-Web.cs index e299fa507a..ec06b742da 100644 --- a/src/Umbraco.Core/Constants-Web.cs +++ b/src/Umbraco.Core/Constants-Web.cs @@ -3,8 +3,8 @@ using System.ComponentModel; namespace Umbraco.Core { - public static partial class Constants - { + public static partial class Constants + { /// /// Defines the identifiers for Umbraco system nodes. /// @@ -29,5 +29,5 @@ namespace Umbraco.Core public const string AuthCookieName = "UMB_UCONTEXT"; } - } -} \ No newline at end of file + } +} diff --git a/src/Umbraco.Core/Constants.cs b/src/Umbraco.Core/Constants.cs index d7ef971d4c..a1e77bc919 100644 --- a/src/Umbraco.Core/Constants.cs +++ b/src/Umbraco.Core/Constants.cs @@ -1,10 +1,10 @@ namespace Umbraco.Core { - /// - /// Constants all the identifiers within the Umbraco core. - /// - public static partial class Constants - { - // generic constants can go here - } + /// + /// Constants all the identifiers within the Umbraco core. + /// + public static partial class Constants + { + // generic constants can go here + } } diff --git a/src/Umbraco.Core/CustomBooleanTypeConverter.cs b/src/Umbraco.Core/CustomBooleanTypeConverter.cs index 002639e40d..f96f8ef460 100644 --- a/src/Umbraco.Core/CustomBooleanTypeConverter.cs +++ b/src/Umbraco.Core/CustomBooleanTypeConverter.cs @@ -1,32 +1,32 @@ -using System; +using System; using System.ComponentModel; namespace Umbraco.Core { - /// - /// Allows for converting string representations of 0 and 1 to boolean - /// - internal class CustomBooleanTypeConverter : BooleanConverter - { - public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) - { - if (sourceType == typeof(string)) - { - return true; - } - return base.CanConvertFrom(context, sourceType); - } + /// + /// Allows for converting string representations of 0 and 1 to boolean + /// + internal class CustomBooleanTypeConverter : BooleanConverter + { + public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) + { + if (sourceType == typeof(string)) + { + return true; + } + return base.CanConvertFrom(context, sourceType); + } - public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) - { - if (value is string) - { - var str = (string)value; - if (str == null || str.Length == 0 || str == "0") return false; - if (str == "1") return true; - } + public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) + { + if (value is string) + { + var str = (string)value; + if (str == null || str.Length == 0 || str == "0") return false; + if (str == "1") return true; + } - return base.ConvertFrom(context, culture, value); - } - } -} \ No newline at end of file + return base.ConvertFrom(context, culture, value); + } + } +} diff --git a/src/Umbraco.Core/DataTableExtensions.cs b/src/Umbraco.Core/DataTableExtensions.cs index 8418616348..272fc064c4 100644 --- a/src/Umbraco.Core/DataTableExtensions.cs +++ b/src/Umbraco.Core/DataTableExtensions.cs @@ -9,111 +9,111 @@ using System.Threading; namespace Umbraco.Core { - - /// - /// Static and extension methods for the DataTable object - /// - internal static class DataTableExtensions - { - - /// - /// Creates a DataTable with the specified alias and columns and uses a callback to populate the headers. - /// - /// - /// - /// - /// - /// - /// This has been migrated from the Node class and uses proper locking now. It is now used by the Node class and the - /// DynamicPublishedContent extensions for legacy reasons. - /// - public static DataTable GenerateDataTable( - string tableAlias, - Func>> getHeaders, - Func>, IEnumerable>>>> rowData) - { - var dt = new DataTable(tableAlias); - - //get all row data - var tableData = rowData().ToArray(); - - //get all headers - var propertyHeaders = GetPropertyHeaders(tableAlias, getHeaders); - foreach(var h in propertyHeaders) - { - dt.Columns.Add(new DataColumn(h.Value)); - } - - //add row data - foreach(var r in tableData) - { - dt.PopulateRow( - propertyHeaders, - r.Item1, - r.Item2); - } + /// + /// Static and extension methods for the DataTable object + /// + internal static class DataTableExtensions + { - return dt; - } - /// - /// Helper method to return this ugly object - /// - /// - /// - /// This is for legacy code, I didn't want to go creating custom classes for these - /// - internal static List>, IEnumerable>>> CreateTableData() - { - return new List>, IEnumerable>>>(); - } + /// + /// Creates a DataTable with the specified alias and columns and uses a callback to populate the headers. + /// + /// + /// + /// + /// + /// + /// This has been migrated from the Node class and uses proper locking now. It is now used by the Node class and the + /// DynamicPublishedContent extensions for legacy reasons. + /// + public static DataTable GenerateDataTable( + string tableAlias, + Func>> getHeaders, + Func>, IEnumerable>>>> rowData) + { + var dt = new DataTable(tableAlias); - /// - /// Helper method to deal with these ugly objects - /// - /// - /// - /// - /// - /// This is for legacy code, I didn't want to go creating custom classes for these - /// - internal static void AddRowData( - List>, IEnumerable>>> rowData, - IEnumerable> standardVals, - IEnumerable> userVals) - { - rowData.Add(new System.Tuple>, IEnumerable>>( - standardVals, - userVals - )); - } + //get all row data + var tableData = rowData().ToArray(); - private static IDictionary GetPropertyHeaders(string alias, Func>> getHeaders) - { - var headers = getHeaders(alias); - var def = headers.ToDictionary(pt => pt.Key, pt => pt.Value); - return def; - } + //get all headers + var propertyHeaders = GetPropertyHeaders(tableAlias, getHeaders); + foreach(var h in propertyHeaders) + { + dt.Columns.Add(new DataColumn(h.Value)); + } - private static void PopulateRow( - this DataTable dt, - IDictionary aliasesToNames, - IEnumerable> standardVals, - IEnumerable> userPropertyVals) - { - var dr = dt.NewRow(); - foreach (var r in standardVals) - { - dr[r.Key] = r.Value; - } - foreach (var p in userPropertyVals.Where(p => p.Value != null)) - { - dr[aliasesToNames[p.Key]] = p.Value; - } - dt.Rows.Add(dr); - } + //add row data + foreach(var r in tableData) + { + dt.PopulateRow( + propertyHeaders, + r.Item1, + r.Item2); + } - } + return dt; + } + + /// + /// Helper method to return this ugly object + /// + /// + /// + /// This is for legacy code, I didn't want to go creating custom classes for these + /// + internal static List>, IEnumerable>>> CreateTableData() + { + return new List>, IEnumerable>>>(); + } + + /// + /// Helper method to deal with these ugly objects + /// + /// + /// + /// + /// + /// This is for legacy code, I didn't want to go creating custom classes for these + /// + internal static void AddRowData( + List>, IEnumerable>>> rowData, + IEnumerable> standardVals, + IEnumerable> userVals) + { + rowData.Add(new System.Tuple>, IEnumerable>>( + standardVals, + userVals + )); + } + + private static IDictionary GetPropertyHeaders(string alias, Func>> getHeaders) + { + var headers = getHeaders(alias); + var def = headers.ToDictionary(pt => pt.Key, pt => pt.Value); + return def; + } + + private static void PopulateRow( + this DataTable dt, + IDictionary aliasesToNames, + IEnumerable> standardVals, + IEnumerable> userPropertyVals) + { + var dr = dt.NewRow(); + foreach (var r in standardVals) + { + dr[r.Key] = r.Value; + } + foreach (var p in userPropertyVals.Where(p => p.Value != null)) + { + dr[aliasesToNames[p.Key]] = p.Value; + } + dt.Rows.Add(dr); + } + + } } diff --git a/src/Umbraco.Core/DatabaseBuilder.cs b/src/Umbraco.Core/DatabaseBuilder.cs index 626607f9a4..0694e5c7eb 100644 --- a/src/Umbraco.Core/DatabaseBuilder.cs +++ b/src/Umbraco.Core/DatabaseBuilder.cs @@ -667,4 +667,4 @@ namespace Umbraco.Core #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/DecimalExtensions.cs b/src/Umbraco.Core/DecimalExtensions.cs index b4d74fdb2e..24afb9f7a9 100644 --- a/src/Umbraco.Core/DecimalExtensions.cs +++ b/src/Umbraco.Core/DecimalExtensions.cs @@ -3,7 +3,7 @@ /// /// Provides extension methods for System.Decimal. /// - /// See System.Decimal on MSDN and also + /// See System.Decimal on MSDN and also /// http://stackoverflow.com/questions/4298719/parse-decimal-and-filter-extra-0-on-the-right/4298787#4298787. /// public static class DecimalExtensions diff --git a/src/Umbraco.Core/DelegateEqualityComparer.cs b/src/Umbraco.Core/DelegateEqualityComparer.cs index 140ea016d1..d9c4f14435 100644 --- a/src/Umbraco.Core/DelegateEqualityComparer.cs +++ b/src/Umbraco.Core/DelegateEqualityComparer.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; namespace Umbraco.Core @@ -57,4 +57,4 @@ namespace Umbraco.Core #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/DelegateExtensions.cs b/src/Umbraco.Core/DelegateExtensions.cs index 78450448e2..c9b2e681c5 100644 --- a/src/Umbraco.Core/DelegateExtensions.cs +++ b/src/Umbraco.Core/DelegateExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics; using System.Threading; @@ -41,4 +41,4 @@ namespace Umbraco.Core return Attempt.Fail(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Deploy/ArtifactBase.cs b/src/Umbraco.Core/Deploy/ArtifactBase.cs index a3fd160a49..f645c50824 100644 --- a/src/Umbraco.Core/Deploy/ArtifactBase.cs +++ b/src/Umbraco.Core/Deploy/ArtifactBase.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using Newtonsoft.Json; @@ -53,4 +53,4 @@ namespace Umbraco.Core.Deploy public string Name { get; set; } public string Alias { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Deploy/ArtifactDependency.cs b/src/Umbraco.Core/Deploy/ArtifactDependency.cs index 41e349d636..374772210c 100644 --- a/src/Umbraco.Core/Deploy/ArtifactDependency.cs +++ b/src/Umbraco.Core/Deploy/ArtifactDependency.cs @@ -1,4 +1,4 @@ -namespace Umbraco.Core.Deploy +namespace Umbraco.Core.Deploy { /// /// Represents an artifact dependency. @@ -37,4 +37,4 @@ namespace Umbraco.Core.Deploy /// public ArtifactDependencyMode Mode { get; private set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Deploy/ArtifactDependencyCollection.cs b/src/Umbraco.Core/Deploy/ArtifactDependencyCollection.cs index fd036f4628..c447dbcde2 100644 --- a/src/Umbraco.Core/Deploy/ArtifactDependencyCollection.cs +++ b/src/Umbraco.Core/Deploy/ArtifactDependencyCollection.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.Collections.Generic; @@ -66,4 +66,4 @@ namespace Umbraco.Core.Deploy get { return false; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Deploy/ArtifactDependencyMode.cs b/src/Umbraco.Core/Deploy/ArtifactDependencyMode.cs index 7ee5c2f220..c285a5f9fb 100644 --- a/src/Umbraco.Core/Deploy/ArtifactDependencyMode.cs +++ b/src/Umbraco.Core/Deploy/ArtifactDependencyMode.cs @@ -1,4 +1,4 @@ -namespace Umbraco.Core.Deploy +namespace Umbraco.Core.Deploy { /// /// Indicates the mode of the dependency. @@ -15,4 +15,4 @@ namespace Umbraco.Core.Deploy /// Exist } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Deploy/ArtifactDeployState.cs b/src/Umbraco.Core/Deploy/ArtifactDeployState.cs index 3723e483cb..ede6801953 100644 --- a/src/Umbraco.Core/Deploy/ArtifactDeployState.cs +++ b/src/Umbraco.Core/Deploy/ArtifactDeployState.cs @@ -1,4 +1,4 @@ -namespace Umbraco.Core.Deploy +namespace Umbraco.Core.Deploy { /// /// Represent the state of an artifact being deployed. @@ -47,4 +47,4 @@ namespace Umbraco.Core.Deploy /// public int NextPass { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Deploy/ArtifactDeployStateOfTArtifactTEntity.cs b/src/Umbraco.Core/Deploy/ArtifactDeployStateOfTArtifactTEntity.cs index b4d2be23cd..6d7a51b383 100644 --- a/src/Umbraco.Core/Deploy/ArtifactDeployStateOfTArtifactTEntity.cs +++ b/src/Umbraco.Core/Deploy/ArtifactDeployStateOfTArtifactTEntity.cs @@ -45,4 +45,4 @@ return Artifact; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Deploy/ArtifactSignature.cs b/src/Umbraco.Core/Deploy/ArtifactSignature.cs index 4bea6a5ce8..219e27140e 100644 --- a/src/Umbraco.Core/Deploy/ArtifactSignature.cs +++ b/src/Umbraco.Core/Deploy/ArtifactSignature.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; namespace Umbraco.Core.Deploy @@ -18,4 +18,4 @@ namespace Umbraco.Core.Deploy public IEnumerable Dependencies { get; private set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Deploy/Difference.cs b/src/Umbraco.Core/Deploy/Difference.cs index 90329afdd6..05d7c66013 100644 --- a/src/Umbraco.Core/Deploy/Difference.cs +++ b/src/Umbraco.Core/Deploy/Difference.cs @@ -1,4 +1,4 @@ -namespace Umbraco.Core.Deploy +namespace Umbraco.Core.Deploy { public class Difference { @@ -25,4 +25,4 @@ namespace Umbraco.Core.Deploy return s; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Deploy/Direction.cs b/src/Umbraco.Core/Deploy/Direction.cs index b0e1c1dc0a..4d87afa3a0 100644 --- a/src/Umbraco.Core/Deploy/Direction.cs +++ b/src/Umbraco.Core/Deploy/Direction.cs @@ -1,8 +1,8 @@ -namespace Umbraco.Core.Deploy +namespace Umbraco.Core.Deploy { public enum Direction { ToArtifact, FromArtifact } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Deploy/IArtifact.cs b/src/Umbraco.Core/Deploy/IArtifact.cs index 653e6386bb..0668047fea 100644 --- a/src/Umbraco.Core/Deploy/IArtifact.cs +++ b/src/Umbraco.Core/Deploy/IArtifact.cs @@ -1,4 +1,4 @@ -namespace Umbraco.Core.Deploy +namespace Umbraco.Core.Deploy { /// /// Represents an artifact ie an object that can be transfered between environments. @@ -8,4 +8,4 @@ namespace Umbraco.Core.Deploy string Name { get; } string Alias { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Deploy/IArtifactSignature.cs b/src/Umbraco.Core/Deploy/IArtifactSignature.cs index 83b112586b..287b70a8f4 100644 --- a/src/Umbraco.Core/Deploy/IArtifactSignature.cs +++ b/src/Umbraco.Core/Deploy/IArtifactSignature.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; namespace Umbraco.Core.Deploy { @@ -38,4 +38,4 @@ namespace Umbraco.Core.Deploy /// IEnumerable Dependencies { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Deploy/IDeployContext.cs b/src/Umbraco.Core/Deploy/IDeployContext.cs index 7d4066e015..fe70bf6a81 100644 --- a/src/Umbraco.Core/Deploy/IDeployContext.cs +++ b/src/Umbraco.Core/Deploy/IDeployContext.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; namespace Umbraco.Core.Deploy @@ -39,4 +39,4 @@ namespace Umbraco.Core.Deploy /// The item with the specified key and type, if any, else null. T Item(string key) where T : class; } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Deploy/IFileSource.cs b/src/Umbraco.Core/Deploy/IFileSource.cs index 7d13e0fbde..e789e0bf24 100644 --- a/src/Umbraco.Core/Deploy/IFileSource.cs +++ b/src/Umbraco.Core/Deploy/IFileSource.cs @@ -88,4 +88,4 @@ namespace Umbraco.Core.Deploy ///// A byte array containing the file content. //byte[] GetFileBytes(StringUdi Udi); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Deploy/IGridCellValueConnector.cs b/src/Umbraco.Core/Deploy/IGridCellValueConnector.cs index a4c5e7aeab..827a902b89 100644 --- a/src/Umbraco.Core/Deploy/IGridCellValueConnector.cs +++ b/src/Umbraco.Core/Deploy/IGridCellValueConnector.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using Umbraco.Core.Models; namespace Umbraco.Core.Deploy @@ -38,4 +38,4 @@ namespace Umbraco.Core.Deploy /// The should only be used to assist with context data relevant when setting the value. void SetValue(GridValue.GridControl gridControl, Property property); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Deploy/IImageSourceParser.cs b/src/Umbraco.Core/Deploy/IImageSourceParser.cs index d8e8d860ac..061125955c 100644 --- a/src/Umbraco.Core/Deploy/IImageSourceParser.cs +++ b/src/Umbraco.Core/Deploy/IImageSourceParser.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; namespace Umbraco.Core.Deploy { @@ -24,4 +24,4 @@ namespace Umbraco.Core.Deploy /// Turns umb://media/... into /media/.... string FromArtifact(string value); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Deploy/ILocalLinkParser.cs b/src/Umbraco.Core/Deploy/ILocalLinkParser.cs index c5906c2060..d6d68ed81d 100644 --- a/src/Umbraco.Core/Deploy/ILocalLinkParser.cs +++ b/src/Umbraco.Core/Deploy/ILocalLinkParser.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; namespace Umbraco.Core.Deploy { @@ -24,4 +24,4 @@ namespace Umbraco.Core.Deploy /// Turns {{localLink:umb://{type}/{id}}} into {{localLink:1234}}. string FromArtifact(string value); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Deploy/IMacroParser.cs b/src/Umbraco.Core/Deploy/IMacroParser.cs index 9cde8ef8b6..725cd6c88e 100644 --- a/src/Umbraco.Core/Deploy/IMacroParser.cs +++ b/src/Umbraco.Core/Deploy/IMacroParser.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; namespace Umbraco.Core.Deploy { @@ -29,4 +29,4 @@ namespace Umbraco.Core.Deploy /// Value with converted identifiers string ReplaceAttributeValue(string value, string editorAlias, ICollection dependencies, Direction direction); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Deploy/IPreValueConnector.cs b/src/Umbraco.Core/Deploy/IPreValueConnector.cs index 4ef898cc74..3f97b324fc 100644 --- a/src/Umbraco.Core/Deploy/IPreValueConnector.cs +++ b/src/Umbraco.Core/Deploy/IPreValueConnector.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; namespace Umbraco.Core.Deploy { @@ -29,4 +29,4 @@ namespace Umbraco.Core.Deploy /// IDictionary ConvertToLocalEnvironment(IDictionary preValues); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Deploy/IValueConnector.cs b/src/Umbraco.Core/Deploy/IValueConnector.cs index a93e5a05a4..35304e3fde 100644 --- a/src/Umbraco.Core/Deploy/IValueConnector.cs +++ b/src/Umbraco.Core/Deploy/IValueConnector.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using Umbraco.Core.Models; namespace Umbraco.Core.Deploy @@ -32,4 +32,4 @@ namespace Umbraco.Core.Deploy /// The deploy property value. void SetValue(IContentBase content, string alias, string value); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Dictionary/ICultureDictionary.cs b/src/Umbraco.Core/Dictionary/ICultureDictionary.cs index 8617d7440e..f8a6e49973 100644 --- a/src/Umbraco.Core/Dictionary/ICultureDictionary.cs +++ b/src/Umbraco.Core/Dictionary/ICultureDictionary.cs @@ -1,31 +1,31 @@ -using System; +using System; using System.Collections.Generic; using System.Globalization; namespace Umbraco.Core.Dictionary { - /// - /// Represents a dictionary based on a specific culture - /// - public interface ICultureDictionary - { - /// - /// Returns the dictionary value based on the key supplied - /// - /// - /// - string this[string key] { get; } + /// + /// Represents a dictionary based on a specific culture + /// + public interface ICultureDictionary + { + /// + /// Returns the dictionary value based on the key supplied + /// + /// + /// + string this[string key] { get; } - /// - /// Returns the current culture - /// - CultureInfo Culture { get; } + /// + /// Returns the current culture + /// + CultureInfo Culture { get; } /// /// Returns the child dictionary entries for a given key /// /// /// - IDictionary GetChildren(string key); - } -} \ No newline at end of file + IDictionary GetChildren(string key); + } +} diff --git a/src/Umbraco.Core/Dictionary/ICultureDictionaryFactory.cs b/src/Umbraco.Core/Dictionary/ICultureDictionaryFactory.cs index 798c3c47c6..ce896a5ef7 100644 --- a/src/Umbraco.Core/Dictionary/ICultureDictionaryFactory.cs +++ b/src/Umbraco.Core/Dictionary/ICultureDictionaryFactory.cs @@ -1,7 +1,7 @@ -namespace Umbraco.Core.Dictionary +namespace Umbraco.Core.Dictionary { - public interface ICultureDictionaryFactory - { - ICultureDictionary CreateDictionary(); - } -} \ No newline at end of file + public interface ICultureDictionaryFactory + { + ICultureDictionary CreateDictionary(); + } +} diff --git a/src/Umbraco.Core/DictionaryExtensions.cs b/src/Umbraco.Core/DictionaryExtensions.cs index c488650496..8c618a06ac 100644 --- a/src/Umbraco.Core/DictionaryExtensions.cs +++ b/src/Umbraco.Core/DictionaryExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.Collections.Concurrent; using System.Collections.Generic; @@ -9,11 +9,11 @@ using System.Web; namespace Umbraco.Core { - /// - /// Extension methods for dictionary & concurrentdictionary - /// - internal static class DictionaryExtensions - { + /// + /// Extension methods for dictionary & concurrentdictionary + /// + internal static class DictionaryExtensions + { /// /// Method to Get a value by the key. If the key doesn't exist it will create a new TVal object for the key and return it. @@ -23,15 +23,15 @@ namespace Umbraco.Core /// /// /// - public static TVal GetOrCreate(this IDictionary dict, TKey key) + public static TVal GetOrCreate(this IDictionary dict, TKey key) where TVal : class, new() - { - if (dict.ContainsKey(key) == false) - { + { + if (dict.ContainsKey(key) == false) + { dict.Add(key, new TVal()); - } + } return dict[key]; - } + } /// /// Updates an item with the specified key with the specified value @@ -44,7 +44,7 @@ namespace Umbraco.Core /// /// /// Taken from: http://stackoverflow.com/questions/12240219/is-there-a-way-to-use-concurrentdictionary-tryupdate-with-a-lambda-expression - /// + /// /// If there is an item in the dictionary with the key, it will keep trying to update it until it can /// public static bool TryUpdate(this ConcurrentDictionary dict, TKey key, Func updateFactory) @@ -71,7 +71,7 @@ namespace Umbraco.Core /// /// /// Taken from: http://stackoverflow.com/questions/12240219/is-there-a-way-to-use-concurrentdictionary-tryupdate-with-a-lambda-expression - /// + /// /// WARNING: If the value changes after we've retreived it, then the item will not be updated /// public static bool TryUpdateOptimisitic(this ConcurrentDictionary dict, TKey key, Func updateFactory) @@ -83,80 +83,58 @@ namespace Umbraco.Core return true;//note we return true whether we succeed or not, see explanation below. } - /// - /// Converts a dictionary to another type by only using direct casting - /// - /// - /// - /// - /// - public static IDictionary ConvertTo(this IDictionary d) - { - var result = new Dictionary(); - foreach (DictionaryEntry v in d) - { - result.Add((TKeyOut)v.Key, (TValOut)v.Value); - } - return result; - } + /// + /// Converts a dictionary to another type by only using direct casting + /// + /// + /// + /// + /// + public static IDictionary ConvertTo(this IDictionary d) + { + var result = new Dictionary(); + foreach (DictionaryEntry v in d) + { + result.Add((TKeyOut)v.Key, (TValOut)v.Value); + } + return result; + } - /// - /// Converts a dictionary to another type using the specified converters - /// - /// - /// - /// - /// - /// - /// - public static IDictionary ConvertTo(this IDictionary d, Func keyConverter, Func valConverter) - { - var result = new Dictionary(); - foreach (DictionaryEntry v in d) - { - result.Add(keyConverter(v.Key), valConverter(v.Value)); - } - return result; - } + /// + /// Converts a dictionary to another type using the specified converters + /// + /// + /// + /// + /// + /// + /// + public static IDictionary ConvertTo(this IDictionary d, Func keyConverter, Func valConverter) + { + var result = new Dictionary(); + foreach (DictionaryEntry v in d) + { + result.Add(keyConverter(v.Key), valConverter(v.Value)); + } + return result; + } - /// - /// Converts a dictionary to a NameValueCollection - /// - /// - /// - public static NameValueCollection ToNameValueCollection(this IDictionary d) - { - var n = new NameValueCollection(); - foreach (var i in d) - { - n.Add(i.Key, i.Value); - } - return n; - } + /// + /// Converts a dictionary to a NameValueCollection + /// + /// + /// + public static NameValueCollection ToNameValueCollection(this IDictionary d) + { + var n = new NameValueCollection(); + foreach (var i in d) + { + n.Add(i.Key, i.Value); + } + return n; + } - /// - /// Merges all key/values from the sources dictionaries into the destination dictionary - /// - /// - /// - /// - /// The source dictionary to merge other dictionaries into - /// - /// By default all values will be retained in the destination if the same keys exist in the sources but - /// this can changed if overwrite = true, then any key/value found in any of the sources will overwritten in the destination. Note that - /// it will just use the last found key/value if this is true. - /// - /// The other dictionaries to merge values from - public static void MergeLeft(this T destination, IEnumerable> sources, bool overwrite = false) - where T : IDictionary - { - foreach (var p in sources.SelectMany(src => src).Where(p => overwrite || destination.ContainsKey(p.Key) == false)) - { - destination[p.Key] = p.Value; - } - } - /// /// Merges all key/values from the sources dictionaries into the destination dictionary /// @@ -165,7 +143,29 @@ namespace Umbraco.Core /// /// The source dictionary to merge other dictionaries into /// - /// By default all values will be retained in the destination if the same keys exist in the sources but + /// By default all values will be retained in the destination if the same keys exist in the sources but + /// this can changed if overwrite = true, then any key/value found in any of the sources will overwritten in the destination. Note that + /// it will just use the last found key/value if this is true. + /// + /// The other dictionaries to merge values from + public static void MergeLeft(this T destination, IEnumerable> sources, bool overwrite = false) + where T : IDictionary + { + foreach (var p in sources.SelectMany(src => src).Where(p => overwrite || destination.ContainsKey(p.Key) == false)) + { + destination[p.Key] = p.Value; + } + } + + /// + /// Merges all key/values from the sources dictionaries into the destination dictionary + /// + /// + /// + /// + /// The source dictionary to merge other dictionaries into + /// + /// By default all values will be retained in the destination if the same keys exist in the sources but /// this can changed if overwrite = true, then any key/value found in any of the sources will overwritten in the destination. Note that /// it will just use the last found key/value if this is true. /// @@ -176,109 +176,109 @@ namespace Umbraco.Core destination.MergeLeft(new[] {source}, overwrite); } - /// - /// Returns the value of the key value based on the key, if the key is not found, a null value is returned - /// - /// The type of the key. - /// The type of the val. - /// The d. - /// The key. - /// The default value. - /// - public static TVal GetValue(this IDictionary d, TKey key, TVal defaultValue = default(TVal)) - { - if (d.ContainsKey(key)) - { - return d[key]; - } - return defaultValue; - } - - /// - /// Returns the value of the key value based on the key as it's string value, if the key is not found, then an empty string is returned - /// - /// - /// - /// - public static string GetValueAsString(this IDictionary d, TKey key) - { - if (d.ContainsKey(key)) - { - return d[key].ToString(); - } - return String.Empty; - } - - /// - /// Returns the value of the key value based on the key as it's string value, if the key is not found or is an empty string, then the provided default value is returned - /// - /// - /// - /// - /// - public static string GetValueAsString(this IDictionary d, TKey key, string defaultValue) - { - if (d.ContainsKey(key)) - { - var value = d[key].ToString(); - if (value != string.Empty) - return value; - } - + /// + /// Returns the value of the key value based on the key, if the key is not found, a null value is returned + /// + /// The type of the key. + /// The type of the val. + /// The d. + /// The key. + /// The default value. + /// + public static TVal GetValue(this IDictionary d, TKey key, TVal defaultValue = default(TVal)) + { + if (d.ContainsKey(key)) + { + return d[key]; + } return defaultValue; - } + } - /// contains key ignore case. - /// The dictionary. - /// The key. - /// Value Type - /// The contains key ignore case. - public static bool ContainsKeyIgnoreCase(this IDictionary dictionary, string key) - { - return dictionary.Keys.InvariantContains(key); - } + /// + /// Returns the value of the key value based on the key as it's string value, if the key is not found, then an empty string is returned + /// + /// + /// + /// + public static string GetValueAsString(this IDictionary d, TKey key) + { + if (d.ContainsKey(key)) + { + return d[key].ToString(); + } + return String.Empty; + } - /// - /// Converts a dictionary object to a query string representation such as: - /// firstname=shannon&lastname=deminick - /// - /// - /// - public static string ToQueryString(this IDictionary d) - { - if (!d.Any()) return ""; + /// + /// Returns the value of the key value based on the key as it's string value, if the key is not found or is an empty string, then the provided default value is returned + /// + /// + /// + /// + /// + public static string GetValueAsString(this IDictionary d, TKey key, string defaultValue) + { + if (d.ContainsKey(key)) + { + var value = d[key].ToString(); + if (value != string.Empty) + return value; + } - var builder = new StringBuilder(); - foreach (var i in d) - { - builder.Append(String.Format("{0}={1}&", HttpUtility.UrlEncode(i.Key), i.Value == null ? string.Empty : HttpUtility.UrlEncode(i.Value.ToString()))); - } - return builder.ToString().TrimEnd('&'); - } + return defaultValue; + } - /// The get entry ignore case. - /// The dictionary. - /// The key. - /// The type - /// The entry - public static TValue GetValueIgnoreCase(this IDictionary dictionary, string key) - { - return dictionary.GetValueIgnoreCase(key, default(TValue)); - } + /// contains key ignore case. + /// The dictionary. + /// The key. + /// Value Type + /// The contains key ignore case. + public static bool ContainsKeyIgnoreCase(this IDictionary dictionary, string key) + { + return dictionary.Keys.InvariantContains(key); + } - /// The get entry ignore case. - /// The dictionary. - /// The key. - /// The default value. - /// The type - /// The entry - public static TValue GetValueIgnoreCase(this IDictionary dictionary, string key, TValue defaultValue) - { - key = dictionary.Keys.FirstOrDefault(i => i.InvariantEquals(key)); + /// + /// Converts a dictionary object to a query string representation such as: + /// firstname=shannon&lastname=deminick + /// + /// + /// + public static string ToQueryString(this IDictionary d) + { + if (!d.Any()) return ""; - return key.IsNullOrWhiteSpace() == false - ? dictionary[key] - : defaultValue; - } - } -} \ No newline at end of file + var builder = new StringBuilder(); + foreach (var i in d) + { + builder.Append(String.Format("{0}={1}&", HttpUtility.UrlEncode(i.Key), i.Value == null ? string.Empty : HttpUtility.UrlEncode(i.Value.ToString()))); + } + return builder.ToString().TrimEnd('&'); + } + + /// The get entry ignore case. + /// The dictionary. + /// The key. + /// The type + /// The entry + public static TValue GetValueIgnoreCase(this IDictionary dictionary, string key) + { + return dictionary.GetValueIgnoreCase(key, default(TValue)); + } + + /// The get entry ignore case. + /// The dictionary. + /// The key. + /// The default value. + /// The type + /// The entry + public static TValue GetValueIgnoreCase(this IDictionary dictionary, string key, TValue defaultValue) + { + key = dictionary.Keys.FirstOrDefault(i => i.InvariantEquals(key)); + + return key.IsNullOrWhiteSpace() == false + ? dictionary[key] + : defaultValue; + } + } +} diff --git a/src/Umbraco.Core/DisposableObject.cs b/src/Umbraco.Core/DisposableObject.cs index fc561fe3d7..956804e347 100644 --- a/src/Umbraco.Core/DisposableObject.cs +++ b/src/Umbraco.Core/DisposableObject.cs @@ -1,39 +1,39 @@ -using System; +using System; namespace Umbraco.Core { - /// - /// Abstract implementation of IDisposable. - /// - /// - /// Can also be used as a pattern for when inheriting is not possible. - /// + /// + /// Abstract implementation of IDisposable. + /// + /// + /// Can also be used as a pattern for when inheriting is not possible. + /// /// See also: https://msdn.microsoft.com/en-us/library/b1yfkh5e%28v=vs.110%29.aspx /// See also: https://lostechies.com/chrispatterson/2012/11/29/idisposable-done-right/ /// /// Note: if an object's ctor throws, it will never be disposed, and so if that ctor /// has allocated disposable objects, it should take care of disposing them. - /// - public abstract class DisposableObject : IDisposable - { - private readonly object _locko = new object(); + /// + public abstract class DisposableObject : IDisposable + { + private readonly object _locko = new object(); - // gets a value indicating whether this instance is disposed. + // gets a value indicating whether this instance is disposed. // for internal tests only (not thread safe) - public bool Disposed { get; private set; } + public bool Disposed { get; private set; } - // implements IDisposable - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } + // implements IDisposable + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } // finalizer - ~DisposableObject() - { - Dispose(false); - } + ~DisposableObject() + { + Dispose(false); + } private void Dispose(bool disposing) { @@ -41,21 +41,21 @@ namespace Umbraco.Core if (_locko == null) return; - lock (_locko) - { - if (Disposed) return; - Disposed = true; - } + lock (_locko) + { + if (Disposed) return; + Disposed = true; + } DisposeUnmanagedResources(); if (disposing) DisposeResources(); - } + } - protected abstract void DisposeResources(); + protected abstract void DisposeResources(); - protected virtual void DisposeUnmanagedResources() - { } - } -} \ No newline at end of file + protected virtual void DisposeUnmanagedResources() + { } + } +} diff --git a/src/Umbraco.Core/DisposableTimer.cs b/src/Umbraco.Core/DisposableTimer.cs index f5a506a0e8..819e86f8e1 100644 --- a/src/Umbraco.Core/DisposableTimer.cs +++ b/src/Umbraco.Core/DisposableTimer.cs @@ -1,34 +1,34 @@ -using System; +using System; using System.Diagnostics; using Umbraco.Core.Logging; namespace Umbraco.Core { - /// - /// Starts the timer and invokes a callback upon disposal. Provides a simple way of timing an operation by wrapping it in a using (C#) statement. - /// - public class DisposableTimer : DisposableObject - { - private readonly ILogger _logger; - private readonly LogType? _logType; - private readonly Type _loggerType; - private readonly int _thresholdMilliseconds; - private readonly IDisposable _profilerStep; + /// + /// Starts the timer and invokes a callback upon disposal. Provides a simple way of timing an operation by wrapping it in a using (C#) statement. + /// + public class DisposableTimer : DisposableObject + { + private readonly ILogger _logger; + private readonly LogType? _logType; + private readonly Type _loggerType; + private readonly int _thresholdMilliseconds; + private readonly IDisposable _profilerStep; private readonly string _endMessage; private string _failMessage; - private Exception _failException; - private bool _failed; + private Exception _failException; + private bool _failed; internal enum LogType - { - Debug, Info - } + { + Debug, Info + } // internal - created by profiling logger - internal DisposableTimer(ILogger logger, LogType logType, IProfiler profiler, Type loggerType, + internal DisposableTimer(ILogger logger, LogType logType, IProfiler profiler, Type loggerType, string startMessage, string endMessage, string failMessage = null, int thresholdMilliseconds = 0) - { + { if (logger == null) throw new ArgumentNullException(nameof(logger)); if (loggerType == null) throw new ArgumentNullException(nameof(loggerType)); @@ -36,8 +36,8 @@ namespace Umbraco.Core _logType = logType; _loggerType = loggerType; _endMessage = endMessage; - _failMessage = failMessage; - _thresholdMilliseconds = thresholdMilliseconds < 0 ? 0 : thresholdMilliseconds; + _failMessage = failMessage; + _thresholdMilliseconds = thresholdMilliseconds < 0 ? 0 : thresholdMilliseconds; if (thresholdMilliseconds == 0) { @@ -73,26 +73,26 @@ namespace Umbraco.Core _failException = exception; } - public Stopwatch Stopwatch { get; } = Stopwatch.StartNew(); + public Stopwatch Stopwatch { get; } = Stopwatch.StartNew(); /// ///Disposes resources. /// /// Overrides abstract class which handles required locking. protected override void DisposeResources() - { + { Stopwatch.Stop(); - _profilerStep?.Dispose(); + _profilerStep?.Dispose(); - if ((Stopwatch.ElapsedMilliseconds >= _thresholdMilliseconds || _failed) + if ((Stopwatch.ElapsedMilliseconds >= _thresholdMilliseconds || _failed) && _logType.HasValue && _loggerType != null && _logger != null && (_endMessage.IsNullOrWhiteSpace() == false || _failed)) - { - if (_failed) - { - _logger.Error(_loggerType, $"{_failMessage} ({Stopwatch.ElapsedMilliseconds}ms)", _failException); - } + { + if (_failed) + { + _logger.Error(_loggerType, $"{_failMessage} ({Stopwatch.ElapsedMilliseconds}ms)", _failException); + } else switch (_logType) { case LogType.Debug: @@ -102,10 +102,10 @@ namespace Umbraco.Core _logger.Info(_loggerType, () => $"{_endMessage} ({Stopwatch.ElapsedMilliseconds}ms)"); break; // filtered in the ctor - //default: + //default: // throw new Exception(); } } - } - } -} \ No newline at end of file + } + } +} diff --git a/src/Umbraco.Core/Enum.cs b/src/Umbraco.Core/Enum.cs index 9d7b96f695..d7a9e60818 100644 --- a/src/Umbraco.Core/Enum.cs +++ b/src/Umbraco.Core/Enum.cs @@ -5,104 +5,104 @@ using System.Text; namespace Umbraco.Core { - /// - /// A very useful class for parsing, enumerating and querying Enum objects - /// - /// - /// - /// Taken from http://damieng.com/blog/2010/10/17/enums-better-syntax-improved-performance-and-tryparse-in-net-3-5 - /// - public static class Enum where T : struct - { - private static readonly IEnumerable All = Enum.GetValues(typeof(T)).Cast(); - private static readonly Dictionary InsensitiveNames = All.ToDictionary(k => Enum.GetName(typeof(T), k).ToLowerInvariant()); - private static readonly Dictionary SensitiveNames = All.ToDictionary(k => Enum.GetName(typeof(T), k)); - private static readonly Dictionary Values = All.ToDictionary(k => Convert.ToInt32(k)); - private static readonly Dictionary Names = All.ToDictionary(k => k, v => v.ToString()); + /// + /// A very useful class for parsing, enumerating and querying Enum objects + /// + /// + /// + /// Taken from http://damieng.com/blog/2010/10/17/enums-better-syntax-improved-performance-and-tryparse-in-net-3-5 + /// + public static class Enum where T : struct + { + private static readonly IEnumerable All = Enum.GetValues(typeof(T)).Cast(); + private static readonly Dictionary InsensitiveNames = All.ToDictionary(k => Enum.GetName(typeof(T), k).ToLowerInvariant()); + private static readonly Dictionary SensitiveNames = All.ToDictionary(k => Enum.GetName(typeof(T), k)); + private static readonly Dictionary Values = All.ToDictionary(k => Convert.ToInt32(k)); + private static readonly Dictionary Names = All.ToDictionary(k => k, v => v.ToString()); - public static bool IsDefined(T value) - { - return Names.Keys.Contains(value); - } + public static bool IsDefined(T value) + { + return Names.Keys.Contains(value); + } - public static bool IsDefined(string value) - { - return SensitiveNames.Keys.Contains(value); - } + public static bool IsDefined(string value) + { + return SensitiveNames.Keys.Contains(value); + } - public static bool IsDefined(int value) - { - return Values.Keys.Contains(value); - } + public static bool IsDefined(int value) + { + return Values.Keys.Contains(value); + } - public static IEnumerable GetValues() - { - return All; - } + public static IEnumerable GetValues() + { + return All; + } - public static string[] GetNames() - { - return Names.Values.ToArray(); - } + public static string[] GetNames() + { + return Names.Values.ToArray(); + } - public static string GetName(T value) - { - string name; - Names.TryGetValue(value, out name); - return name; - } + public static string GetName(T value) + { + string name; + Names.TryGetValue(value, out name); + return name; + } - public static T Parse(string value) - { - T parsed = default(T); - if (!SensitiveNames.TryGetValue(value, out parsed)) - throw new ArgumentException("Value is not one of the named constants defined for the enumeration", "value"); - return parsed; - } + public static T Parse(string value) + { + T parsed = default(T); + if (!SensitiveNames.TryGetValue(value, out parsed)) + throw new ArgumentException("Value is not one of the named constants defined for the enumeration", "value"); + return parsed; + } - public static T Parse(string value, bool ignoreCase) - { - if (!ignoreCase) - return Parse(value); + public static T Parse(string value, bool ignoreCase) + { + if (!ignoreCase) + return Parse(value); - T parsed = default(T); - if (!InsensitiveNames.TryGetValue(value.ToLowerInvariant(), out parsed)) - throw new ArgumentException("Value is not one of the named constants defined for the enumeration", "value"); - return parsed; - } + T parsed = default(T); + if (!InsensitiveNames.TryGetValue(value.ToLowerInvariant(), out parsed)) + throw new ArgumentException("Value is not one of the named constants defined for the enumeration", "value"); + return parsed; + } - public static bool TryParse(string value, out T returnValue) - { - return SensitiveNames.TryGetValue(value, out returnValue); - } + public static bool TryParse(string value, out T returnValue) + { + return SensitiveNames.TryGetValue(value, out returnValue); + } - public static bool TryParse(string value, bool ignoreCase, out T returnValue) - { - if (!ignoreCase) - return TryParse(value, out returnValue); + public static bool TryParse(string value, bool ignoreCase, out T returnValue) + { + if (!ignoreCase) + return TryParse(value, out returnValue); - return InsensitiveNames.TryGetValue(value.ToLowerInvariant(), out returnValue); - } + return InsensitiveNames.TryGetValue(value.ToLowerInvariant(), out returnValue); + } - public static T? ParseOrNull(string value) - { - if (String.IsNullOrEmpty(value)) - return null; + public static T? ParseOrNull(string value) + { + if (String.IsNullOrEmpty(value)) + return null; - T foundValue; - if (InsensitiveNames.TryGetValue(value.ToLowerInvariant(), out foundValue)) - return foundValue; + T foundValue; + if (InsensitiveNames.TryGetValue(value.ToLowerInvariant(), out foundValue)) + return foundValue; - return null; - } + return null; + } - public static T? CastOrNull(int value) - { - T foundValue; - if (Values.TryGetValue(value, out foundValue)) - return foundValue; + public static T? CastOrNull(int value) + { + T foundValue; + if (Values.TryGetValue(value, out foundValue)) + return foundValue; - return null; - } - } + return null; + } + } } diff --git a/src/Umbraco.Core/Events/CancellableEventArgs.cs b/src/Umbraco.Core/Events/CancellableEventArgs.cs index a102ea66ef..247b732145 100644 --- a/src/Umbraco.Core/Events/CancellableEventArgs.cs +++ b/src/Umbraco.Core/Events/CancellableEventArgs.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Security.Permissions; @@ -7,12 +7,12 @@ using Umbraco.Core.Models.PublishedContent; namespace Umbraco.Core.Events { /// - /// Event args for that can support cancellation - /// - [HostProtection(SecurityAction.LinkDemand, SharedState = true)] - public class CancellableEventArgs : EventArgs, IEquatable + /// Event args for that can support cancellation + /// + [HostProtection(SecurityAction.LinkDemand, SharedState = true)] + public class CancellableEventArgs : EventArgs, IEquatable { - private bool _cancel; + private bool _cancel; public CancellableEventArgs(bool canCancel, EventMessages messages, IDictionary additionalData) { @@ -30,8 +30,8 @@ namespace Umbraco.Core.Events } public CancellableEventArgs(bool canCancel) - { - CanCancel = canCancel; + { + CanCancel = canCancel; //create a standalone messages Messages = new EventMessages(); AdditionalData = new ReadOnlyDictionary(new Dictionary()); @@ -43,37 +43,37 @@ namespace Umbraco.Core.Events } public CancellableEventArgs() - : this(true) - { - } + : this(true) + { + } - /// - /// Flag to determine if this instance will support being cancellable - /// - public bool CanCancel { get; set; } + /// + /// Flag to determine if this instance will support being cancellable + /// + public bool CanCancel { get; set; } - /// - /// If this instance supports cancellation, this gets/sets the cancel value - /// - public bool Cancel - { - get - { - if (CanCancel == false) - { - throw new InvalidOperationException("This event argument class does not support cancelling."); - } - return _cancel; - } - set - { - if (CanCancel == false) - { - throw new InvalidOperationException("This event argument class does not support cancelling."); - } - _cancel = value; - } - } + /// + /// If this instance supports cancellation, this gets/sets the cancel value + /// + public bool Cancel + { + get + { + if (CanCancel == false) + { + throw new InvalidOperationException("This event argument class does not support cancelling."); + } + return _cancel; + } + set + { + if (CanCancel == false) + { + throw new InvalidOperationException("This event argument class does not support cancelling."); + } + _cancel = value; + } + } /// /// if this instance supports cancellation, this will set Cancel to true with an affiliated cancellation message @@ -95,39 +95,39 @@ namespace Umbraco.Core.Events /// In some cases raised evens might need to contain additional arbitrary readonly data which can be read by event subscribers /// /// - /// This allows for a bit of flexibility in our event raising - it's not pretty but we need to maintain backwards compatibility + /// This allows for a bit of flexibility in our event raising - it's not pretty but we need to maintain backwards compatibility /// so we cannot change the strongly typed nature for some events. /// public ReadOnlyDictionary AdditionalData { get; private set; } - public bool Equals(CancellableEventArgs other) - { - if (ReferenceEquals(null, other)) return false; - if (ReferenceEquals(this, other)) return true; - return Equals(AdditionalData, other.AdditionalData); - } + public bool Equals(CancellableEventArgs other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + return Equals(AdditionalData, other.AdditionalData); + } - public override bool Equals(object obj) - { - if (ReferenceEquals(null, obj)) return false; - if (ReferenceEquals(this, obj)) return true; - if (obj.GetType() != this.GetType()) return false; - return Equals((CancellableEventArgs) obj); - } + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != this.GetType()) return false; + return Equals((CancellableEventArgs) obj); + } - public override int GetHashCode() - { - return (AdditionalData != null ? AdditionalData.GetHashCode() : 0); - } + public override int GetHashCode() + { + return (AdditionalData != null ? AdditionalData.GetHashCode() : 0); + } - public static bool operator ==(CancellableEventArgs left, CancellableEventArgs right) - { - return Equals(left, right); - } + public static bool operator ==(CancellableEventArgs left, CancellableEventArgs right) + { + return Equals(left, right); + } - public static bool operator !=(CancellableEventArgs left, CancellableEventArgs right) - { - return !Equals(left, right); - } - } -} \ No newline at end of file + public static bool operator !=(CancellableEventArgs left, CancellableEventArgs right) + { + return !Equals(left, right); + } + } +} diff --git a/src/Umbraco.Core/Events/CancellableObjectEventArgs.cs b/src/Umbraco.Core/Events/CancellableObjectEventArgs.cs index 63562eb53e..c2998352c0 100644 --- a/src/Umbraco.Core/Events/CancellableObjectEventArgs.cs +++ b/src/Umbraco.Core/Events/CancellableObjectEventArgs.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.Collections.Generic; using System.Linq; @@ -174,4 +174,4 @@ namespace Umbraco.Core.Events return HashCodeHelper.GetHashCode(EventObject); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Events/ContentCacheEventArgs.cs b/src/Umbraco.Core/Events/ContentCacheEventArgs.cs index d9b627309e..b177f25674 100644 --- a/src/Umbraco.Core/Events/ContentCacheEventArgs.cs +++ b/src/Umbraco.Core/Events/ContentCacheEventArgs.cs @@ -1,4 +1,4 @@ -namespace Umbraco.Core.Events +namespace Umbraco.Core.Events { - public class ContentCacheEventArgs : System.ComponentModel.CancelEventArgs { } -} \ No newline at end of file + public class ContentCacheEventArgs : System.ComponentModel.CancelEventArgs { } +} diff --git a/src/Umbraco.Core/Events/CopyEventArgs.cs b/src/Umbraco.Core/Events/CopyEventArgs.cs index 65dc54cc88..c697dcbc06 100644 --- a/src/Umbraco.Core/Events/CopyEventArgs.cs +++ b/src/Umbraco.Core/Events/CopyEventArgs.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; namespace Umbraco.Core.Events @@ -84,4 +84,4 @@ namespace Umbraco.Core.Events return !Equals(left, right); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Events/DatabaseCreationEventArgs.cs b/src/Umbraco.Core/Events/DatabaseCreationEventArgs.cs index 5fb9cc0d97..5736a08890 100644 --- a/src/Umbraco.Core/Events/DatabaseCreationEventArgs.cs +++ b/src/Umbraco.Core/Events/DatabaseCreationEventArgs.cs @@ -1,4 +1,4 @@ -namespace Umbraco.Core.Events +namespace Umbraco.Core.Events { internal class DatabaseCreationEventArgs : System.ComponentModel.CancelEventArgs{} -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Events/DeleteEventArgs.cs b/src/Umbraco.Core/Events/DeleteEventArgs.cs index d0a4f024e1..a093e82d32 100644 --- a/src/Umbraco.Core/Events/DeleteEventArgs.cs +++ b/src/Umbraco.Core/Events/DeleteEventArgs.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; @@ -9,46 +9,46 @@ namespace Umbraco.Core.Events [SupersedeEvent(typeof(MoveEventArgs<>))] [SupersedeEvent(typeof(CopyEventArgs<>))] public class DeleteEventArgs : CancellableEnumerableObjectEventArgs, IEquatable>, IDeletingMediaFilesEventArgs - { - /// - /// Constructor accepting multiple entities that are used in the delete operation - /// - /// - /// - /// - public DeleteEventArgs(IEnumerable eventObject, bool canCancel, EventMessages eventMessages) : base(eventObject, canCancel, eventMessages) + { + /// + /// Constructor accepting multiple entities that are used in the delete operation + /// + /// + /// + /// + public DeleteEventArgs(IEnumerable eventObject, bool canCancel, EventMessages eventMessages) : base(eventObject, canCancel, eventMessages) { MediaFilesToDelete = new List(); } - /// - /// Constructor accepting multiple entities that are used in the delete operation - /// - /// - /// - public DeleteEventArgs(IEnumerable eventObject, EventMessages eventMessages) : base(eventObject, eventMessages) + /// + /// Constructor accepting multiple entities that are used in the delete operation + /// + /// + /// + public DeleteEventArgs(IEnumerable eventObject, EventMessages eventMessages) : base(eventObject, eventMessages) { MediaFilesToDelete = new List(); } - /// - /// Constructor accepting a single entity instance - /// - /// - /// - public DeleteEventArgs(TEntity eventObject, EventMessages eventMessages) + /// + /// Constructor accepting a single entity instance + /// + /// + /// + public DeleteEventArgs(TEntity eventObject, EventMessages eventMessages) : base(new List { eventObject }, eventMessages) { MediaFilesToDelete = new List(); } - /// - /// Constructor accepting a single entity instance - /// - /// - /// - /// - public DeleteEventArgs(TEntity eventObject, bool canCancel, EventMessages eventMessages) + /// + /// Constructor accepting a single entity instance + /// + /// + /// + /// + public DeleteEventArgs(TEntity eventObject, bool canCancel, EventMessages eventMessages) : base(new List { eventObject }, canCancel, eventMessages) { MediaFilesToDelete = new List(); @@ -60,89 +60,89 @@ namespace Umbraco.Core.Events /// /// public DeleteEventArgs(IEnumerable eventObject, bool canCancel) : base(eventObject, canCancel) - { + { MediaFilesToDelete = new List(); - } + } - /// - /// Constructor accepting multiple entities that are used in the delete operation - /// - /// - public DeleteEventArgs(IEnumerable eventObject) : base(eventObject) - { + /// + /// Constructor accepting multiple entities that are used in the delete operation + /// + /// + public DeleteEventArgs(IEnumerable eventObject) : base(eventObject) + { MediaFilesToDelete = new List(); - } + } - /// - /// Constructor accepting a single entity instance - /// - /// - public DeleteEventArgs(TEntity eventObject) - : base(new List { eventObject }) - { + /// + /// Constructor accepting a single entity instance + /// + /// + public DeleteEventArgs(TEntity eventObject) + : base(new List { eventObject }) + { MediaFilesToDelete = new List(); - } + } - /// - /// Constructor accepting a single entity instance - /// - /// - /// - public DeleteEventArgs(TEntity eventObject, bool canCancel) - : base(new List { eventObject }, canCancel) - { + /// + /// Constructor accepting a single entity instance + /// + /// + /// + public DeleteEventArgs(TEntity eventObject, bool canCancel) + : base(new List { eventObject }, canCancel) + { MediaFilesToDelete = new List(); - } + } - /// - /// Returns all entities that were deleted during the operation - /// - public IEnumerable DeletedEntities - { - get { return EventObject; } - } + /// + /// Returns all entities that were deleted during the operation + /// + public IEnumerable DeletedEntities + { + get { return EventObject; } + } /// /// A list of media files that can be added to during a deleted operation for which Umbraco will ensure are removed /// public List MediaFilesToDelete { get; private set; } - public bool Equals(DeleteEventArgs other) - { - if (ReferenceEquals(null, other)) return false; - if (ReferenceEquals(this, other)) return true; - return base.Equals(other) && MediaFilesToDelete.SequenceEqual(other.MediaFilesToDelete); - } + public bool Equals(DeleteEventArgs other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + return base.Equals(other) && MediaFilesToDelete.SequenceEqual(other.MediaFilesToDelete); + } - public override bool Equals(object obj) - { - if (ReferenceEquals(null, obj)) return false; - if (ReferenceEquals(this, obj)) return true; - if (obj.GetType() != this.GetType()) return false; - return Equals((DeleteEventArgs) obj); - } + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != this.GetType()) return false; + return Equals((DeleteEventArgs) obj); + } - public override int GetHashCode() - { - unchecked - { - return (base.GetHashCode() * 397) ^ MediaFilesToDelete.GetHashCode(); - } - } + public override int GetHashCode() + { + unchecked + { + return (base.GetHashCode() * 397) ^ MediaFilesToDelete.GetHashCode(); + } + } - public static bool operator ==(DeleteEventArgs left, DeleteEventArgs right) - { - return Equals(left, right); - } + public static bool operator ==(DeleteEventArgs left, DeleteEventArgs right) + { + return Equals(left, right); + } - public static bool operator !=(DeleteEventArgs left, DeleteEventArgs right) - { - return !Equals(left, right); - } - } + public static bool operator !=(DeleteEventArgs left, DeleteEventArgs right) + { + return !Equals(left, right); + } + } - public class DeleteEventArgs : CancellableEventArgs, IEquatable - { + public class DeleteEventArgs : CancellableEventArgs, IEquatable + { public DeleteEventArgs(int id, bool canCancel, EventMessages eventMessages) : base(canCancel, eventMessages) { @@ -150,52 +150,52 @@ namespace Umbraco.Core.Events } public DeleteEventArgs(int id, bool canCancel) - : base(canCancel) - { - Id = id; - } + : base(canCancel) + { + Id = id; + } - public DeleteEventArgs(int id) - { - Id = id; - } + public DeleteEventArgs(int id) + { + Id = id; + } - /// - /// Gets the Id of the object being deleted. - /// - public int Id { get; private set; } + /// + /// Gets the Id of the object being deleted. + /// + public int Id { get; private set; } - public bool Equals(DeleteEventArgs other) - { - if (ReferenceEquals(null, other)) return false; - if (ReferenceEquals(this, other)) return true; - return base.Equals(other) && Id == other.Id; - } + public bool Equals(DeleteEventArgs other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + return base.Equals(other) && Id == other.Id; + } - public override bool Equals(object obj) - { - if (ReferenceEquals(null, obj)) return false; - if (ReferenceEquals(this, obj)) return true; - if (obj.GetType() != this.GetType()) return false; - return Equals((DeleteEventArgs) obj); - } + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != this.GetType()) return false; + return Equals((DeleteEventArgs) obj); + } - public override int GetHashCode() - { - unchecked - { - return (base.GetHashCode() * 397) ^ Id; - } - } + public override int GetHashCode() + { + unchecked + { + return (base.GetHashCode() * 397) ^ Id; + } + } - public static bool operator ==(DeleteEventArgs left, DeleteEventArgs right) - { - return Equals(left, right); - } + public static bool operator ==(DeleteEventArgs left, DeleteEventArgs right) + { + return Equals(left, right); + } - public static bool operator !=(DeleteEventArgs left, DeleteEventArgs right) - { - return !Equals(left, right); - } - } -} \ No newline at end of file + public static bool operator !=(DeleteEventArgs left, DeleteEventArgs right) + { + return !Equals(left, right); + } + } +} diff --git a/src/Umbraco.Core/Events/DeleteRevisionsEventArgs.cs b/src/Umbraco.Core/Events/DeleteRevisionsEventArgs.cs index 1db1296640..a4d50d9aaf 100644 --- a/src/Umbraco.Core/Events/DeleteRevisionsEventArgs.cs +++ b/src/Umbraco.Core/Events/DeleteRevisionsEventArgs.cs @@ -1,72 +1,72 @@ -using System; +using System; namespace Umbraco.Core.Events { - public class DeleteRevisionsEventArgs : DeleteEventArgs, IEquatable - { - public DeleteRevisionsEventArgs(int id, bool canCancel, Guid specificVersion = default(Guid), bool deletePriorVersions = false, DateTime dateToRetain = default(DateTime)) - : base(id, canCancel) - { - DeletePriorVersions = deletePriorVersions; - SpecificVersion = specificVersion; - DateToRetain = dateToRetain; - } + public class DeleteRevisionsEventArgs : DeleteEventArgs, IEquatable + { + public DeleteRevisionsEventArgs(int id, bool canCancel, Guid specificVersion = default(Guid), bool deletePriorVersions = false, DateTime dateToRetain = default(DateTime)) + : base(id, canCancel) + { + DeletePriorVersions = deletePriorVersions; + SpecificVersion = specificVersion; + DateToRetain = dateToRetain; + } - public DeleteRevisionsEventArgs(int id, Guid specificVersion = default(Guid), bool deletePriorVersions = false, DateTime dateToRetain = default(DateTime)) - : base(id) - { - DeletePriorVersions = deletePriorVersions; - SpecificVersion = specificVersion; - DateToRetain = dateToRetain; - } + public DeleteRevisionsEventArgs(int id, Guid specificVersion = default(Guid), bool deletePriorVersions = false, DateTime dateToRetain = default(DateTime)) + : base(id) + { + DeletePriorVersions = deletePriorVersions; + SpecificVersion = specificVersion; + DateToRetain = dateToRetain; + } - public bool DeletePriorVersions { get; private set; } - public Guid SpecificVersion { get; private set; } - public DateTime DateToRetain { get; private set; } - - /// - /// Returns true if we are deleting a specific revision - /// - public bool IsDeletingSpecificRevision - { - get { return SpecificVersion != default(Guid); } - } + public bool DeletePriorVersions { get; private set; } + public Guid SpecificVersion { get; private set; } + public DateTime DateToRetain { get; private set; } - public bool Equals(DeleteRevisionsEventArgs other) - { - if (ReferenceEquals(null, other)) return false; - if (ReferenceEquals(this, other)) return true; - return base.Equals(other) && DateToRetain.Equals(other.DateToRetain) && DeletePriorVersions == other.DeletePriorVersions && SpecificVersion.Equals(other.SpecificVersion); - } + /// + /// Returns true if we are deleting a specific revision + /// + public bool IsDeletingSpecificRevision + { + get { return SpecificVersion != default(Guid); } + } - public override bool Equals(object obj) - { - if (ReferenceEquals(null, obj)) return false; - if (ReferenceEquals(this, obj)) return true; - if (obj.GetType() != this.GetType()) return false; - return Equals((DeleteRevisionsEventArgs) obj); - } + public bool Equals(DeleteRevisionsEventArgs other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + return base.Equals(other) && DateToRetain.Equals(other.DateToRetain) && DeletePriorVersions == other.DeletePriorVersions && SpecificVersion.Equals(other.SpecificVersion); + } - public override int GetHashCode() - { - unchecked - { - int hashCode = base.GetHashCode(); - hashCode = (hashCode * 397) ^ DateToRetain.GetHashCode(); - hashCode = (hashCode * 397) ^ DeletePriorVersions.GetHashCode(); - hashCode = (hashCode * 397) ^ SpecificVersion.GetHashCode(); - return hashCode; - } - } + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != this.GetType()) return false; + return Equals((DeleteRevisionsEventArgs) obj); + } - public static bool operator ==(DeleteRevisionsEventArgs left, DeleteRevisionsEventArgs right) - { - return Equals(left, right); - } + public override int GetHashCode() + { + unchecked + { + int hashCode = base.GetHashCode(); + hashCode = (hashCode * 397) ^ DateToRetain.GetHashCode(); + hashCode = (hashCode * 397) ^ DeletePriorVersions.GetHashCode(); + hashCode = (hashCode * 397) ^ SpecificVersion.GetHashCode(); + return hashCode; + } + } - public static bool operator !=(DeleteRevisionsEventArgs left, DeleteRevisionsEventArgs right) - { - return !Equals(left, right); - } - } -} \ No newline at end of file + public static bool operator ==(DeleteRevisionsEventArgs left, DeleteRevisionsEventArgs right) + { + return Equals(left, right); + } + + public static bool operator !=(DeleteRevisionsEventArgs left, DeleteRevisionsEventArgs right) + { + return !Equals(left, right); + } + } +} diff --git a/src/Umbraco.Core/Events/EventDefinition.cs b/src/Umbraco.Core/Events/EventDefinition.cs index e861e9496e..17030bad54 100644 --- a/src/Umbraco.Core/Events/EventDefinition.cs +++ b/src/Umbraco.Core/Events/EventDefinition.cs @@ -1,4 +1,4 @@ -using System; +using System; namespace Umbraco.Core.Events { @@ -54,7 +54,7 @@ namespace Umbraco.Core.Events private readonly TSender _sender; private readonly TEventArgs _args; - public EventDefinition(TypedEventHandler trackedEvent, TSender sender, TEventArgs args, string eventName = null) + public EventDefinition(TypedEventHandler trackedEvent, TSender sender, TEventArgs args, string eventName = null) : base(sender, args, eventName) { _trackedEvent = trackedEvent; @@ -70,4 +70,4 @@ namespace Umbraco.Core.Events } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Events/EventDefinitionBase.cs b/src/Umbraco.Core/Events/EventDefinitionBase.cs index 909868ac5b..b61d00d75f 100644 --- a/src/Umbraco.Core/Events/EventDefinitionBase.cs +++ b/src/Umbraco.Core/Events/EventDefinitionBase.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Reflection; namespace Umbraco.Core.Events @@ -27,7 +27,7 @@ namespace Umbraco.Core.Events public object Sender { get; } public object Args { get; } public string EventName { get; } - + public abstract void RaiseEvent(); public bool Equals(EventDefinitionBase other) @@ -66,4 +66,4 @@ namespace Umbraco.Core.Events return Equals(left, right) == false; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Events/EventDefinitionFilter.cs b/src/Umbraco.Core/Events/EventDefinitionFilter.cs index 4bbe75d10b..36838a1e3c 100644 --- a/src/Umbraco.Core/Events/EventDefinitionFilter.cs +++ b/src/Umbraco.Core/Events/EventDefinitionFilter.cs @@ -21,4 +21,4 @@ /// LastIn } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Events/EventExtensions.cs b/src/Umbraco.Core/Events/EventExtensions.cs index a366ad0cce..ecd9bb0240 100644 --- a/src/Umbraco.Core/Events/EventExtensions.cs +++ b/src/Umbraco.Core/Events/EventExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Reflection; @@ -7,11 +7,11 @@ using Umbraco.Core.Persistence.UnitOfWork; namespace Umbraco.Core.Events { - /// - /// Extension methods for cancellable event operations - /// - public static class EventExtensions - { + /// + /// Extension methods for cancellable event operations + /// + public static class EventExtensions + { // keep these two for backward compatibility reasons but understand that // they are *not* part of any scope / event dispatcher / anything... @@ -26,12 +26,12 @@ namespace Umbraco.Core.Events /// A value indicating whether the cancelable event should be cancelled /// A cancelable event is raised by a component when it is about to perform an action that can be canceled. public static bool IsRaisedEventCancelled(this TypedEventHandler eventHandler, TArgs args, TSender sender) - where TArgs : CancellableEventArgs + where TArgs : CancellableEventArgs { if (eventHandler == null) return args.Cancel; - eventHandler(sender, args); - return args.Cancel; - } + eventHandler(sender, args); + return args.Cancel; + } /// /// Raises an event. @@ -48,4 +48,4 @@ namespace Umbraco.Core.Events eventHandler(sender, args); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Events/EventMessage.cs b/src/Umbraco.Core/Events/EventMessage.cs index 473f955d45..c66753aeca 100644 --- a/src/Umbraco.Core/Events/EventMessage.cs +++ b/src/Umbraco.Core/Events/EventMessage.cs @@ -1,10 +1,10 @@ -namespace Umbraco.Core.Events +namespace Umbraco.Core.Events { /// /// An event message /// public sealed class EventMessage - { + { /// /// Initializes a new instance of the class. /// @@ -24,4 +24,4 @@ namespace Umbraco.Core.Events /// internal bool IsDefaultEventMessage { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Events/EventMessageType.cs b/src/Umbraco.Core/Events/EventMessageType.cs index 6299a0e7d7..c112312ee6 100644 --- a/src/Umbraco.Core/Events/EventMessageType.cs +++ b/src/Umbraco.Core/Events/EventMessageType.cs @@ -1,4 +1,4 @@ -namespace Umbraco.Core.Events +namespace Umbraco.Core.Events { /// /// The type of event message @@ -8,7 +8,7 @@ namespace Umbraco.Core.Events Default = 0, Info = 1, Error = 2, - Success = 3, + Success = 3, Warning = 4 } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Events/EventMessages.cs b/src/Umbraco.Core/Events/EventMessages.cs index 2900f3d471..aac0d07e85 100644 --- a/src/Umbraco.Core/Events/EventMessages.cs +++ b/src/Umbraco.Core/Events/EventMessages.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; namespace Umbraco.Core.Events { @@ -29,4 +29,4 @@ namespace Umbraco.Core.Events _msgs.Clear(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Events/EventNameExtractor.cs b/src/Umbraco.Core/Events/EventNameExtractor.cs index b46948af80..5cb9ca64ef 100644 --- a/src/Umbraco.Core/Events/EventNameExtractor.cs +++ b/src/Umbraco.Core/Events/EventNameExtractor.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Concurrent; using System.Linq; using System.Reflection; @@ -7,17 +7,17 @@ using System.Text.RegularExpressions; namespace Umbraco.Core.Events { /// - /// There is actually no way to discover an event name in c# at the time of raising the event. It is possible - /// to get the event name from the handler that is being executed based on the event being raised, however that is not + /// There is actually no way to discover an event name in c# at the time of raising the event. It is possible + /// to get the event name from the handler that is being executed based on the event being raised, however that is not /// what we want in this case. We need to find the event name before it is being raised - you would think that it's possible /// with reflection or anything but that is not the case, the delegate that defines an event has no info attached to it, it /// is literally just an event. - /// + /// /// So what this does is take the sender and event args objects, looks up all public/static events on the sender that have /// a generic event handler with generic arguments (but only) one, then we match the type of event arguments with the ones /// being passed in. As it turns out, in our services this will work for the majority of our events! In some cases it may not - /// work and we'll have to supply a string but hopefully this saves a bit of magic strings. - /// + /// work and we'll have to supply a string but hopefully this saves a bit of magic strings. + /// /// We can also write tests to validate these are all working correctly for all services. /// internal class EventNameExtractor @@ -35,7 +35,7 @@ namespace Umbraco.Core.Events /// null if not found or an ambiguous match /// public static Attempt FindEvent(Type senderType, Type argsType, Func exclude) - { + { var found = MatchedEventNames.GetOrAdd(new Tuple(senderType, argsType), tuple => { var events = CandidateEvents.GetOrAdd(senderType, t => @@ -156,4 +156,4 @@ namespace Umbraco.Core.Events /// private static readonly ConcurrentDictionary, string[]> MatchedEventNames = new ConcurrentDictionary, string[]>(); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Events/EventNameExtractorError.cs b/src/Umbraco.Core/Events/EventNameExtractorError.cs index 3b27db2a1a..a4aa47d611 100644 --- a/src/Umbraco.Core/Events/EventNameExtractorError.cs +++ b/src/Umbraco.Core/Events/EventNameExtractorError.cs @@ -1,8 +1,8 @@ -namespace Umbraco.Core.Events +namespace Umbraco.Core.Events { internal enum EventNameExtractorError { NoneFound, Ambiguous } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Events/EventNameExtractorResult.cs b/src/Umbraco.Core/Events/EventNameExtractorResult.cs index 6213882d1f..7c2a295e38 100644 --- a/src/Umbraco.Core/Events/EventNameExtractorResult.cs +++ b/src/Umbraco.Core/Events/EventNameExtractorResult.cs @@ -1,4 +1,4 @@ -namespace Umbraco.Core.Events +namespace Umbraco.Core.Events { internal class EventNameExtractorResult { @@ -15,4 +15,4 @@ namespace Umbraco.Core.Events Error = error; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Events/ExportEventArgs.cs b/src/Umbraco.Core/Events/ExportEventArgs.cs index acbf920636..f46cccf05c 100644 --- a/src/Umbraco.Core/Events/ExportEventArgs.cs +++ b/src/Umbraco.Core/Events/ExportEventArgs.cs @@ -13,7 +13,7 @@ namespace Umbraco.Core.Events /// /// public ExportEventArgs(TEntity eventObject, XElement xml, bool canCancel) - : base(new List { eventObject }, canCancel) + : base(new List { eventObject }, canCancel) { Xml = xml; } @@ -83,4 +83,4 @@ namespace Umbraco.Core.Events return !Equals(left, right); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Events/IDeletingMediaFilesEventArgs.cs b/src/Umbraco.Core/Events/IDeletingMediaFilesEventArgs.cs index 45681042ba..19580b4106 100644 --- a/src/Umbraco.Core/Events/IDeletingMediaFilesEventArgs.cs +++ b/src/Umbraco.Core/Events/IDeletingMediaFilesEventArgs.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; namespace Umbraco.Core.Events { @@ -6,4 +6,4 @@ namespace Umbraco.Core.Events { List MediaFilesToDelete { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Events/IEventDefinition.cs b/src/Umbraco.Core/Events/IEventDefinition.cs index eb4fe65eb8..2afab1ee0f 100644 --- a/src/Umbraco.Core/Events/IEventDefinition.cs +++ b/src/Umbraco.Core/Events/IEventDefinition.cs @@ -10,4 +10,4 @@ namespace Umbraco.Core.Events void RaiseEvent(); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Events/IEventDispatcher.cs b/src/Umbraco.Core/Events/IEventDispatcher.cs index 78f8ed3a4a..9d2c12ceac 100644 --- a/src/Umbraco.Core/Events/IEventDispatcher.cs +++ b/src/Umbraco.Core/Events/IEventDispatcher.cs @@ -95,4 +95,4 @@ namespace Umbraco.Core.Events /// The collected events. IEnumerable GetEvents(EventDefinitionFilter filter); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Events/IEventMessagesFactory.cs b/src/Umbraco.Core/Events/IEventMessagesFactory.cs index 992220ab87..c35539b658 100644 --- a/src/Umbraco.Core/Events/IEventMessagesFactory.cs +++ b/src/Umbraco.Core/Events/IEventMessagesFactory.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; namespace Umbraco.Core.Events { @@ -11,4 +11,4 @@ namespace Umbraco.Core.Events EventMessages GetOrDefault(); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Events/ImportEventArgs.cs b/src/Umbraco.Core/Events/ImportEventArgs.cs index 892149c0a2..fb8f7d4936 100644 --- a/src/Umbraco.Core/Events/ImportEventArgs.cs +++ b/src/Umbraco.Core/Events/ImportEventArgs.cs @@ -81,4 +81,4 @@ namespace Umbraco.Core.Events return !Equals(left, right); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Events/ImportPackageEventArgs.cs b/src/Umbraco.Core/Events/ImportPackageEventArgs.cs index 2fb0870b16..589f758531 100644 --- a/src/Umbraco.Core/Events/ImportPackageEventArgs.cs +++ b/src/Umbraco.Core/Events/ImportPackageEventArgs.cs @@ -23,8 +23,8 @@ namespace Umbraco.Core.Events { get { return _packageMetaData; } } - - public IEnumerable InstallationSummary + + public IEnumerable InstallationSummary { get { return EventObject; } } @@ -32,7 +32,7 @@ namespace Umbraco.Core.Events public bool Equals(ImportPackageEventArgs other) { if (ReferenceEquals(null, other)) return false; - if (ReferenceEquals(this, other)) return true; + if (ReferenceEquals(this, other)) return true; //TODO: MetaData for package metadata has no equality operators :/ return base.Equals(other) && _packageMetaData.Equals(other._packageMetaData); } @@ -63,4 +63,4 @@ namespace Umbraco.Core.Events return !Equals(left, right); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Events/MigrationEventArgs.cs b/src/Umbraco.Core/Events/MigrationEventArgs.cs index 61c56ecd8f..34f97d7550 100644 --- a/src/Umbraco.Core/Events/MigrationEventArgs.cs +++ b/src/Umbraco.Core/Events/MigrationEventArgs.cs @@ -37,7 +37,7 @@ namespace Umbraco.Core.Events [Obsolete("Use constructor accepting SemVersion instances and a product name instead.")] [EditorBrowsable(EditorBrowsableState.Never)] public MigrationEventArgs(IList eventObject, Version configuredVersion, Version targetVersion, bool canCancel) - : this(eventObject, null, new SemVersion(configuredVersion), new SemVersion(targetVersion), Constants.System.UmbracoMigrationName, canCancel) + : this(eventObject, null, new SemVersion(configuredVersion), new SemVersion(targetVersion), Constants.System.UmbracoMigrationName, canCancel) { } /// @@ -103,16 +103,16 @@ namespace Umbraco.Core.Events [Obsolete("Use constructor accepting SemVersion instances and a product name instead.")] [EditorBrowsable(EditorBrowsableState.Never)] public MigrationEventArgs(IList eventObject, Version configuredVersion, Version targetVersion) - : this(eventObject, null, new SemVersion(configuredVersion), new SemVersion(targetVersion), Constants.System.UmbracoMigrationName, false) - { } + : this(eventObject, null, new SemVersion(configuredVersion), new SemVersion(targetVersion), Constants.System.UmbracoMigrationName, false) + { } - /// - /// Returns all migrations that were used in the migration runner - /// + /// + /// Returns all migrations that were used in the migration runner + /// public IList Migrations - { - get { return EventObject; } - } + { + get { return EventObject; } + } [Obsolete("Use ConfiguredSemVersion instead")] [EditorBrowsable(EditorBrowsableState.Never)] @@ -180,4 +180,4 @@ namespace Umbraco.Core.Events return !Equals(left, right); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Events/MoveEventArgs.cs b/src/Umbraco.Core/Events/MoveEventArgs.cs index 228e1ca2f7..a9d56a1ca5 100644 --- a/src/Umbraco.Core/Events/MoveEventArgs.cs +++ b/src/Umbraco.Core/Events/MoveEventArgs.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; @@ -157,4 +157,4 @@ namespace Umbraco.Core.Events return !Equals(left, right); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Events/MoveEventInfo.cs b/src/Umbraco.Core/Events/MoveEventInfo.cs index 9e77971837..0b6702611b 100644 --- a/src/Umbraco.Core/Events/MoveEventInfo.cs +++ b/src/Umbraco.Core/Events/MoveEventInfo.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; namespace Umbraco.Core.Events @@ -52,4 +52,4 @@ namespace Umbraco.Core.Events return !Equals(left, right); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Events/NewEventArgs.cs b/src/Umbraco.Core/Events/NewEventArgs.cs index 415d82b90e..280a628fa9 100644 --- a/src/Umbraco.Core/Events/NewEventArgs.cs +++ b/src/Umbraco.Core/Events/NewEventArgs.cs @@ -1,11 +1,11 @@ -using System; +using System; using System.Collections.Generic; using Umbraco.Core.Models; namespace Umbraco.Core.Events { - public class NewEventArgs : CancellableObjectEventArgs, IEquatable> - { + public class NewEventArgs : CancellableObjectEventArgs, IEquatable> + { public NewEventArgs(TEntity eventObject, bool canCancel, string @alias, int parentId, EventMessages eventMessages) @@ -22,7 +22,7 @@ namespace Umbraco.Core.Events Parent = parent; } - public NewEventArgs(TEntity eventObject, string @alias, int parentId, EventMessages eventMessages) + public NewEventArgs(TEntity eventObject, string @alias, int parentId, EventMessages eventMessages) : base(eventObject, eventMessages) { Alias = alias; @@ -39,10 +39,10 @@ namespace Umbraco.Core.Events public NewEventArgs(TEntity eventObject, bool canCancel, string @alias, int parentId) : base(eventObject, canCancel) - { - Alias = alias; - ParentId = parentId; - } + { + Alias = alias; + ParentId = parentId; + } public NewEventArgs(TEntity eventObject, bool canCancel, string @alias, TEntity parent) : base(eventObject, canCancel) @@ -51,11 +51,11 @@ namespace Umbraco.Core.Events Parent = parent; } - public NewEventArgs(TEntity eventObject, string @alias, int parentId) : base(eventObject) - { - Alias = alias; - ParentId = parentId; - } + public NewEventArgs(TEntity eventObject, string @alias, int parentId) : base(eventObject) + { + Alias = alias; + ParentId = parentId; + } public NewEventArgs(TEntity eventObject, string @alias, TEntity parent) : base(eventObject) @@ -64,64 +64,64 @@ namespace Umbraco.Core.Events Parent = parent; } - /// - /// The entity being created - /// - public TEntity Entity - { - get { return EventObject; } - } + /// + /// The entity being created + /// + public TEntity Entity + { + get { return EventObject; } + } - /// - /// Gets or Sets the Alias. - /// - public string Alias { get; private set; } + /// + /// Gets or Sets the Alias. + /// + public string Alias { get; private set; } - /// - /// Gets or Sets the Id of the parent. - /// - public int ParentId { get; private set; } + /// + /// Gets or Sets the Id of the parent. + /// + public int ParentId { get; private set; } /// /// Gets or Sets the parent IContent object. /// public TEntity Parent { get; private set; } - public bool Equals(NewEventArgs other) - { - if (ReferenceEquals(null, other)) return false; - if (ReferenceEquals(this, other)) return true; - return base.Equals(other) && string.Equals(Alias, other.Alias) && EqualityComparer.Default.Equals(Parent, other.Parent) && ParentId == other.ParentId; - } + public bool Equals(NewEventArgs other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + return base.Equals(other) && string.Equals(Alias, other.Alias) && EqualityComparer.Default.Equals(Parent, other.Parent) && ParentId == other.ParentId; + } - public override bool Equals(object obj) - { - if (ReferenceEquals(null, obj)) return false; - if (ReferenceEquals(this, obj)) return true; - if (obj.GetType() != this.GetType()) return false; - return Equals((NewEventArgs) obj); - } + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != this.GetType()) return false; + return Equals((NewEventArgs) obj); + } - public override int GetHashCode() - { - unchecked - { - int hashCode = base.GetHashCode(); - hashCode = (hashCode * 397) ^ Alias.GetHashCode(); - hashCode = (hashCode * 397) ^ EqualityComparer.Default.GetHashCode(Parent); - hashCode = (hashCode * 397) ^ ParentId; - return hashCode; - } - } + public override int GetHashCode() + { + unchecked + { + int hashCode = base.GetHashCode(); + hashCode = (hashCode * 397) ^ Alias.GetHashCode(); + hashCode = (hashCode * 397) ^ EqualityComparer.Default.GetHashCode(Parent); + hashCode = (hashCode * 397) ^ ParentId; + return hashCode; + } + } - public static bool operator ==(NewEventArgs left, NewEventArgs right) - { - return Equals(left, right); - } + public static bool operator ==(NewEventArgs left, NewEventArgs right) + { + return Equals(left, right); + } - public static bool operator !=(NewEventArgs left, NewEventArgs right) - { - return !Equals(left, right); - } - } -} \ No newline at end of file + public static bool operator !=(NewEventArgs left, NewEventArgs right) + { + return !Equals(left, right); + } + } +} diff --git a/src/Umbraco.Core/Events/PassThroughEventDispatcher.cs b/src/Umbraco.Core/Events/PassThroughEventDispatcher.cs index 8ec965c29c..dec3a62a88 100644 --- a/src/Umbraco.Core/Events/PassThroughEventDispatcher.cs +++ b/src/Umbraco.Core/Events/PassThroughEventDispatcher.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; @@ -57,4 +57,4 @@ namespace Umbraco.Core.Events public void ScopeExit(bool completed) { } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Events/PublishEventArgs.cs b/src/Umbraco.Core/Events/PublishEventArgs.cs index 10bf94146c..3226162980 100644 --- a/src/Umbraco.Core/Events/PublishEventArgs.cs +++ b/src/Umbraco.Core/Events/PublishEventArgs.cs @@ -58,28 +58,28 @@ namespace Umbraco.Core.Events /// /// public PublishEventArgs(IEnumerable eventObject, bool canCancel, bool isAllPublished) - : base(eventObject, canCancel) - { + : base(eventObject, canCancel) + { IsAllRepublished = isAllPublished; - } + } /// /// Constructor accepting multiple entities that are used in the publish operation /// /// public PublishEventArgs(IEnumerable eventObject) - : base(eventObject) - { - } + : base(eventObject) + { + } /// /// Constructor accepting a single entity instance /// /// public PublishEventArgs(TEntity eventObject) - : base(new List { eventObject }) - { - } + : base(new List { eventObject }) + { + } /// /// Constructor accepting a single entity instance @@ -88,18 +88,18 @@ namespace Umbraco.Core.Events /// /// public PublishEventArgs(TEntity eventObject, bool canCancel, bool isAllPublished) - : base(new List { eventObject }, canCancel) - { + : base(new List { eventObject }, canCancel) + { IsAllRepublished = isAllPublished; - } + } - /// - /// Returns all entities that were published during the operation - /// - public IEnumerable PublishedEntities - { - get { return EventObject; } - } + /// + /// Returns all entities that were published during the operation + /// + public IEnumerable PublishedEntities + { + get { return EventObject; } + } public bool IsAllRepublished { get; private set; } @@ -136,4 +136,4 @@ namespace Umbraco.Core.Events return !Equals(left, right); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Events/QueuingEventDispatcher.cs b/src/Umbraco.Core/Events/QueuingEventDispatcher.cs index 11630a956c..e0d3847c17 100644 --- a/src/Umbraco.Core/Events/QueuingEventDispatcher.cs +++ b/src/Umbraco.Core/Events/QueuingEventDispatcher.cs @@ -1,4 +1,4 @@ -using Umbraco.Core.Composing; +using Umbraco.Core.Composing; using Umbraco.Core.IO; namespace Umbraco.Core.Events @@ -37,4 +37,4 @@ namespace Umbraco.Core.Events // fixme inject private MediaFileSystem MediaFileSystem => _mediaFileSystem ?? (_mediaFileSystem = Current.FileSystems.MediaFileSystem); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Events/QueuingEventDispatcherBase.cs b/src/Umbraco.Core/Events/QueuingEventDispatcherBase.cs index b2680b6cc3..4d4c97093a 100644 --- a/src/Umbraco.Core/Events/QueuingEventDispatcherBase.cs +++ b/src/Umbraco.Core/Events/QueuingEventDispatcherBase.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using Umbraco.Core.Models.EntityBase; @@ -340,4 +340,4 @@ namespace Umbraco.Core.Events protected abstract void ScopeExitCompleted(); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Events/RecycleBinEventArgs.cs b/src/Umbraco.Core/Events/RecycleBinEventArgs.cs index 811dea679e..35d8fd3293 100644 --- a/src/Umbraco.Core/Events/RecycleBinEventArgs.cs +++ b/src/Umbraco.Core/Events/RecycleBinEventArgs.cs @@ -12,7 +12,7 @@ namespace Umbraco.Core.Events { AllPropertyData = allPropertyData; NodeObjectType = nodeObjectType; - Ids = AllPropertyData.Select(x => x.Key); + Ids = AllPropertyData.Select(x => x.Key); RecycleBinEmptiedSuccessfully = emptiedSuccessfully; Files = new List(); } @@ -97,11 +97,11 @@ namespace Umbraco.Core.Events } /// - /// Gets the Id of the node object type of the items + /// Gets the Id of the node object type of the items /// being deleted from the Recycle Bin. /// public Guid NodeObjectType { get; private set; } - + /// /// Gets the list of Ids for each of the items being deleted from the Recycle Bin. /// @@ -183,4 +183,4 @@ namespace Umbraco.Core.Events return !Equals(left, right); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Events/RefreshContentEventArgs.cs b/src/Umbraco.Core/Events/RefreshContentEventArgs.cs index a295b239c9..b54c286668 100644 --- a/src/Umbraco.Core/Events/RefreshContentEventArgs.cs +++ b/src/Umbraco.Core/Events/RefreshContentEventArgs.cs @@ -1,4 +1,4 @@ -namespace Umbraco.Core.Events +namespace Umbraco.Core.Events { - //public class RefreshContentEventArgs : System.ComponentModel.CancelEventArgs { } -} \ No newline at end of file + //public class RefreshContentEventArgs : System.ComponentModel.CancelEventArgs { } +} diff --git a/src/Umbraco.Core/Events/RollbackEventArgs.cs b/src/Umbraco.Core/Events/RollbackEventArgs.cs index db9dded08c..279edef67c 100644 --- a/src/Umbraco.Core/Events/RollbackEventArgs.cs +++ b/src/Umbraco.Core/Events/RollbackEventArgs.cs @@ -1,21 +1,21 @@ -namespace Umbraco.Core.Events +namespace Umbraco.Core.Events { - public class RollbackEventArgs : CancellableObjectEventArgs - { - public RollbackEventArgs(TEntity eventObject, bool canCancel) : base(eventObject, canCancel) - { - } + public class RollbackEventArgs : CancellableObjectEventArgs + { + public RollbackEventArgs(TEntity eventObject, bool canCancel) : base(eventObject, canCancel) + { + } - public RollbackEventArgs(TEntity eventObject) : base(eventObject) - { - } + public RollbackEventArgs(TEntity eventObject) : base(eventObject) + { + } - /// - /// The entity being rolledback - /// - public TEntity Entity - { - get { return EventObject; } - } - } -} \ No newline at end of file + /// + /// The entity being rolledback + /// + public TEntity Entity + { + get { return EventObject; } + } + } +} diff --git a/src/Umbraco.Core/Events/SaveEventArgs.cs b/src/Umbraco.Core/Events/SaveEventArgs.cs index cd19038d8e..a37cb357ca 100644 --- a/src/Umbraco.Core/Events/SaveEventArgs.cs +++ b/src/Umbraco.Core/Events/SaveEventArgs.cs @@ -1,10 +1,10 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; namespace Umbraco.Core.Events { - public class SaveEventArgs : CancellableEnumerableObjectEventArgs - { + public class SaveEventArgs : CancellableEnumerableObjectEventArgs + { /// /// Constructor accepting multiple entities that are used in the saving operation /// @@ -12,28 +12,28 @@ namespace Umbraco.Core.Events /// /// /// - public SaveEventArgs(IEnumerable eventObject, bool canCancel, EventMessages messages, IDictionary additionalData) + public SaveEventArgs(IEnumerable eventObject, bool canCancel, EventMessages messages, IDictionary additionalData) : base(eventObject, canCancel, messages, additionalData) - { - } + { + } - /// - /// Constructor accepting multiple entities that are used in the saving operation - /// - /// - /// - /// - public SaveEventArgs(IEnumerable eventObject, bool canCancel, EventMessages eventMessages) + /// + /// Constructor accepting multiple entities that are used in the saving operation + /// + /// + /// + /// + public SaveEventArgs(IEnumerable eventObject, bool canCancel, EventMessages eventMessages) : base(eventObject, canCancel, eventMessages) { } - /// - /// Constructor accepting multiple entities that are used in the saving operation - /// - /// - /// - public SaveEventArgs(IEnumerable eventObject, EventMessages eventMessages) + /// + /// Constructor accepting multiple entities that are used in the saving operation + /// + /// + /// + public SaveEventArgs(IEnumerable eventObject, EventMessages eventMessages) : base(eventObject, eventMessages) { } @@ -60,13 +60,13 @@ namespace Umbraco.Core.Events { } - /// - /// Constructor accepting a single entity instance - /// - /// - /// - /// - public SaveEventArgs(TEntity eventObject, bool canCancel, EventMessages eventMessages) + /// + /// Constructor accepting a single entity instance + /// + /// + /// + /// + public SaveEventArgs(TEntity eventObject, bool canCancel, EventMessages eventMessages) : base(new List { eventObject }, canCancel, eventMessages) { } @@ -78,44 +78,44 @@ namespace Umbraco.Core.Events /// /// public SaveEventArgs(IEnumerable eventObject, bool canCancel) - : base(eventObject, canCancel) - { - } + : base(eventObject, canCancel) + { + } - /// - /// Constructor accepting multiple entities that are used in the saving operation - /// - /// - public SaveEventArgs(IEnumerable eventObject) - : base(eventObject) - { - } + /// + /// Constructor accepting multiple entities that are used in the saving operation + /// + /// + public SaveEventArgs(IEnumerable eventObject) + : base(eventObject) + { + } - /// - /// Constructor accepting a single entity instance - /// - /// - public SaveEventArgs(TEntity eventObject) - : base(new List { eventObject }) - { - } + /// + /// Constructor accepting a single entity instance + /// + /// + public SaveEventArgs(TEntity eventObject) + : base(new List { eventObject }) + { + } - /// - /// Constructor accepting a single entity instance - /// - /// - /// - public SaveEventArgs(TEntity eventObject, bool canCancel) - : base(new List { eventObject }, canCancel) - { - } + /// + /// Constructor accepting a single entity instance + /// + /// + /// + public SaveEventArgs(TEntity eventObject, bool canCancel) + : base(new List { eventObject }, canCancel) + { + } - /// - /// Returns all entities that were saved during the operation - /// - public IEnumerable SavedEntities - { - get { return EventObject; } - } - } -} \ No newline at end of file + /// + /// Returns all entities that were saved during the operation + /// + public IEnumerable SavedEntities + { + get { return EventObject; } + } + } +} diff --git a/src/Umbraco.Core/Events/SendToPublishEventArgs.cs b/src/Umbraco.Core/Events/SendToPublishEventArgs.cs index b246395a92..6895572c78 100644 --- a/src/Umbraco.Core/Events/SendToPublishEventArgs.cs +++ b/src/Umbraco.Core/Events/SendToPublishEventArgs.cs @@ -1,21 +1,21 @@ -namespace Umbraco.Core.Events +namespace Umbraco.Core.Events { - public class SendToPublishEventArgs : CancellableObjectEventArgs - { - public SendToPublishEventArgs(TEntity eventObject, bool canCancel) : base(eventObject, canCancel) - { - } + public class SendToPublishEventArgs : CancellableObjectEventArgs + { + public SendToPublishEventArgs(TEntity eventObject, bool canCancel) : base(eventObject, canCancel) + { + } - public SendToPublishEventArgs(TEntity eventObject) : base(eventObject) - { - } + public SendToPublishEventArgs(TEntity eventObject) : base(eventObject) + { + } - /// - /// The entity being sent to publish - /// - public TEntity Entity - { - get { return EventObject; } - } - } -} \ No newline at end of file + /// + /// The entity being sent to publish + /// + public TEntity Entity + { + get { return EventObject; } + } + } +} diff --git a/src/Umbraco.Core/Events/SupersedeEventAttribute.cs b/src/Umbraco.Core/Events/SupersedeEventAttribute.cs index c7a14ea158..30a218a677 100644 --- a/src/Umbraco.Core/Events/SupersedeEventAttribute.cs +++ b/src/Umbraco.Core/Events/SupersedeEventAttribute.cs @@ -1,9 +1,9 @@ -using System; +using System; namespace Umbraco.Core.Events { /// - /// This is used to know if the event arg attributed should supersede another event arg type when + /// This is used to know if the event arg attributed should supersede another event arg type when /// tracking events for the same entity. If one event args supercedes another then the event args that have been superseded /// will mean that the event will not be dispatched or the args will be filtered to exclude the entity. /// @@ -17,4 +17,4 @@ namespace Umbraco.Core.Events SupersededEventArgsType = supersededEventArgsType; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Events/TransientEventMessagesFactory.cs b/src/Umbraco.Core/Events/TransientEventMessagesFactory.cs index 880332ac40..bd2e12dc17 100644 --- a/src/Umbraco.Core/Events/TransientEventMessagesFactory.cs +++ b/src/Umbraco.Core/Events/TransientEventMessagesFactory.cs @@ -1,4 +1,4 @@ -namespace Umbraco.Core.Events +namespace Umbraco.Core.Events { /// /// A simple/default transient messages factory @@ -15,4 +15,4 @@ namespace Umbraco.Core.Events return null; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Events/TypedEventHandler.cs b/src/Umbraco.Core/Events/TypedEventHandler.cs index a8170190d4..abe75e6da9 100644 --- a/src/Umbraco.Core/Events/TypedEventHandler.cs +++ b/src/Umbraco.Core/Events/TypedEventHandler.cs @@ -1,7 +1,7 @@ -using System; +using System; namespace Umbraco.Core.Events { - [Serializable] - public delegate void TypedEventHandler(TSender sender, TEventArgs e); -} \ No newline at end of file + [Serializable] + public delegate void TypedEventHandler(TSender sender, TEventArgs e); +} diff --git a/src/Umbraco.Core/Events/UninstallPackageEventArgs.cs b/src/Umbraco.Core/Events/UninstallPackageEventArgs.cs index dcbaba550e..feeb92fc03 100644 --- a/src/Umbraco.Core/Events/UninstallPackageEventArgs.cs +++ b/src/Umbraco.Core/Events/UninstallPackageEventArgs.cs @@ -19,4 +19,4 @@ namespace Umbraco.Core.Events public IEnumerable UninstallationSummary => EventObject; } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Exceptions/BootFailedException.cs b/src/Umbraco.Core/Exceptions/BootFailedException.cs index dbfe9a33eb..ec07389d37 100644 --- a/src/Umbraco.Core/Exceptions/BootFailedException.cs +++ b/src/Umbraco.Core/Exceptions/BootFailedException.cs @@ -30,4 +30,4 @@ namespace Umbraco.Core.Exceptions : base(message, inner) { } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Exceptions/ConnectionException.cs b/src/Umbraco.Core/Exceptions/ConnectionException.cs index 3535dd52bf..64fdbeee52 100644 --- a/src/Umbraco.Core/Exceptions/ConnectionException.cs +++ b/src/Umbraco.Core/Exceptions/ConnectionException.cs @@ -1,4 +1,4 @@ -using System; +using System; namespace Umbraco.Core.Exceptions { @@ -6,7 +6,7 @@ namespace Umbraco.Core.Exceptions { public ConnectionException(string message, Exception innerException) : base(message, innerException) { - + } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Exceptions/DataOperationException.cs b/src/Umbraco.Core/Exceptions/DataOperationException.cs index 60a3ccd4eb..14fefcf9d3 100644 --- a/src/Umbraco.Core/Exceptions/DataOperationException.cs +++ b/src/Umbraco.Core/Exceptions/DataOperationException.cs @@ -18,4 +18,4 @@ namespace Umbraco.Core.Exceptions Operation = operation; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Exceptions/InvalidCompositionException.cs b/src/Umbraco.Core/Exceptions/InvalidCompositionException.cs index bb9becf058..9d154c6a6f 100644 --- a/src/Umbraco.Core/Exceptions/InvalidCompositionException.cs +++ b/src/Umbraco.Core/Exceptions/InvalidCompositionException.cs @@ -41,4 +41,4 @@ namespace Umbraco.Core.Exceptions } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/ExpressionExtensions.cs b/src/Umbraco.Core/ExpressionExtensions.cs index 521c7753e0..392316e4eb 100644 --- a/src/Umbraco.Core/ExpressionExtensions.cs +++ b/src/Umbraco.Core/ExpressionExtensions.cs @@ -1,28 +1,28 @@ -using System; +using System; using System.Linq; using System.Linq.Expressions; namespace Umbraco.Core { - internal static class ExpressionExtensions - { - public static Expression> True() { return f => true; } - public static Expression> False() { return f => false; } + internal static class ExpressionExtensions + { + public static Expression> True() { return f => true; } + public static Expression> False() { return f => false; } - public static Expression> Or(this Expression> left, - Expression> right) - { - var invokedExpr = Expression.Invoke(right, left.Parameters.Cast()); - return Expression.Lambda> - (Expression.OrElse(left.Body, invokedExpr), left.Parameters); - } + public static Expression> Or(this Expression> left, + Expression> right) + { + var invokedExpr = Expression.Invoke(right, left.Parameters.Cast()); + return Expression.Lambda> + (Expression.OrElse(left.Body, invokedExpr), left.Parameters); + } - public static Expression> And(this Expression> left, - Expression> right) - { - var invokedExpr = Expression.Invoke(right, left.Parameters.Cast()); - return Expression.Lambda> - (Expression.AndAlso(left.Body, invokedExpr), left.Parameters); - } - } -} \ No newline at end of file + public static Expression> And(this Expression> left, + Expression> right) + { + var invokedExpr = Expression.Invoke(right, left.Parameters.Cast()); + return Expression.Lambda> + (Expression.AndAlso(left.Body, invokedExpr), left.Parameters); + } + } +} diff --git a/src/Umbraco.Core/ExpressionHelper.cs b/src/Umbraco.Core/ExpressionHelper.cs index 4c5c60dcd5..10b0eda8e6 100644 --- a/src/Umbraco.Core/ExpressionHelper.cs +++ b/src/Umbraco.Core/ExpressionHelper.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq; @@ -7,80 +7,80 @@ using System.Reflection; namespace Umbraco.Core { - /// - /// A set of helper methods for dealing with expressions - /// - /// - internal static class ExpressionHelper - { - private static readonly ConcurrentDictionary PropertyInfoCache = new ConcurrentDictionary(); + /// + /// A set of helper methods for dealing with expressions + /// + /// + internal static class ExpressionHelper + { + private static readonly ConcurrentDictionary PropertyInfoCache = new ConcurrentDictionary(); - /// - /// Gets a object from an expression. - /// - /// The type of the source. - /// The type of the property. - /// The source. - /// The property lambda. - /// - /// - public static PropertyInfo GetPropertyInfo(this TSource source, Expression> propertyLambda) - { - return GetPropertyInfo(propertyLambda); - } + /// + /// Gets a object from an expression. + /// + /// The type of the source. + /// The type of the property. + /// The source. + /// The property lambda. + /// + /// + public static PropertyInfo GetPropertyInfo(this TSource source, Expression> propertyLambda) + { + return GetPropertyInfo(propertyLambda); + } - /// - /// Gets a object from an expression. - /// - /// The type of the source. - /// The type of the property. - /// The property lambda. - /// - /// - public static PropertyInfo GetPropertyInfo(Expression> propertyLambda) - { - return PropertyInfoCache.GetOrAdd( - new LambdaExpressionCacheKey(propertyLambda), - x => - { - var type = typeof(TSource); + /// + /// Gets a object from an expression. + /// + /// The type of the source. + /// The type of the property. + /// The property lambda. + /// + /// + public static PropertyInfo GetPropertyInfo(Expression> propertyLambda) + { + return PropertyInfoCache.GetOrAdd( + new LambdaExpressionCacheKey(propertyLambda), + x => + { + var type = typeof(TSource); - var member = propertyLambda.Body as MemberExpression; - if (member == null) - { - if (propertyLambda.Body.GetType().Name == "UnaryExpression") - { - // The expression might be for some boxing, e.g. representing a value type like HiveId as an object - // in which case the expression will be Convert(x.MyProperty) - var unary = propertyLambda.Body as UnaryExpression; - if (unary != null) - { - var boxedMember = unary.Operand as MemberExpression; - if (boxedMember == null) - throw new ArgumentException("The type of property could not be infered, try specifying the type parameters explicitly. This can happen if you have tried to access PropertyInfo where the property's return type is a value type, but the expression is trying to convert it to an object"); - else member = boxedMember; - } - } - else throw new ArgumentException(string.Format("Expression '{0}' refers to a method, not a property.", propertyLambda)); - } + var member = propertyLambda.Body as MemberExpression; + if (member == null) + { + if (propertyLambda.Body.GetType().Name == "UnaryExpression") + { + // The expression might be for some boxing, e.g. representing a value type like HiveId as an object + // in which case the expression will be Convert(x.MyProperty) + var unary = propertyLambda.Body as UnaryExpression; + if (unary != null) + { + var boxedMember = unary.Operand as MemberExpression; + if (boxedMember == null) + throw new ArgumentException("The type of property could not be infered, try specifying the type parameters explicitly. This can happen if you have tried to access PropertyInfo where the property's return type is a value type, but the expression is trying to convert it to an object"); + else member = boxedMember; + } + } + else throw new ArgumentException(string.Format("Expression '{0}' refers to a method, not a property.", propertyLambda)); + } - var propInfo = member.Member as PropertyInfo; - if (propInfo == null) - throw new ArgumentException(string.Format( - "Expression '{0}' refers to a field, not a property.", - propertyLambda)); + var propInfo = member.Member as PropertyInfo; + if (propInfo == null) + throw new ArgumentException(string.Format( + "Expression '{0}' refers to a field, not a property.", + propertyLambda)); - if (type != propInfo.ReflectedType && - !type.IsSubclassOf(propInfo.ReflectedType)) - throw new ArgumentException(string.Format( - "Expresion '{0}' refers to a property that is not from type {1}.", - propertyLambda, - type)); + if (type != propInfo.ReflectedType && + !type.IsSubclassOf(propInfo.ReflectedType)) + throw new ArgumentException(string.Format( + "Expresion '{0}' refers to a property that is not from type {1}.", + propertyLambda, + type)); - return propInfo; - }); - } + return propInfo; + }); + } public static MemberInfo FindProperty(LambdaExpression lambdaExpression) { @@ -119,64 +119,64 @@ namespace Umbraco.Core throw new Exception("Configuration for members is only supported for top-level individual members on a type."); } - public static IDictionary GetMethodParams(Expression> fromExpression) - { - if (fromExpression == null) return null; - var body = fromExpression.Body as MethodCallExpression; - if (body == null) - return new Dictionary(); + public static IDictionary GetMethodParams(Expression> fromExpression) + { + if (fromExpression == null) return null; + var body = fromExpression.Body as MethodCallExpression; + if (body == null) + return new Dictionary(); - var rVal = new Dictionary(); - var parameters = body.Method.GetParameters().Select(x => x.Name).ToArray(); - var i = 0; - foreach (var argument in body.Arguments) - { - var lambda = Expression.Lambda(argument, fromExpression.Parameters); - var d = lambda.Compile(); - var value = d.DynamicInvoke(new object[1]); - rVal.Add(parameters[i], value); - i++; - } - return rVal; - } + var rVal = new Dictionary(); + var parameters = body.Method.GetParameters().Select(x => x.Name).ToArray(); + var i = 0; + foreach (var argument in body.Arguments) + { + var lambda = Expression.Lambda(argument, fromExpression.Parameters); + var d = lambda.Compile(); + var value = d.DynamicInvoke(new object[1]); + rVal.Add(parameters[i], value); + i++; + } + return rVal; + } - /// - /// Gets a from an provided it refers to a method call. - /// - /// - /// From expression. - /// The or null if is null or cannot be converted to . - /// - public static MethodInfo GetMethodInfo(Expression> fromExpression) - { - if (fromExpression == null) return null; - var body = fromExpression.Body as MethodCallExpression; - return body != null ? body.Method : null; - } + /// + /// Gets a from an provided it refers to a method call. + /// + /// + /// From expression. + /// The or null if is null or cannot be converted to . + /// + public static MethodInfo GetMethodInfo(Expression> fromExpression) + { + if (fromExpression == null) return null; + var body = fromExpression.Body as MethodCallExpression; + return body != null ? body.Method : null; + } - /// - /// Gets the method info. - /// - /// The return type of the method. - /// From expression. - /// - public static MethodInfo GetMethodInfo(Expression> fromExpression) - { - if (fromExpression == null) return null; - var body = fromExpression.Body as MethodCallExpression; - return body != null ? body.Method : null; - } + /// + /// Gets the method info. + /// + /// The return type of the method. + /// From expression. + /// + public static MethodInfo GetMethodInfo(Expression> fromExpression) + { + if (fromExpression == null) return null; + var body = fromExpression.Body as MethodCallExpression; + return body != null ? body.Method : null; + } - /// - /// Gets the method info. - /// - /// The type of the 1. - /// The type of the 2. - /// From expression. - /// - public static MethodInfo GetMethodInfo(Expression> fromExpression) - { - if (fromExpression == null) return null; + /// + /// Gets the method info. + /// + /// The type of the 1. + /// The type of the 2. + /// From expression. + /// + public static MethodInfo GetMethodInfo(Expression> fromExpression) + { + if (fromExpression == null) return null; MethodCallExpression me; switch (fromExpression.Body.NodeType) @@ -192,162 +192,162 @@ namespace Umbraco.Core } return me != null ? me.Method : null; - } + } - /// - /// Gets a from an provided it refers to a method call. - /// - /// The expression. - /// The or null if cannot be converted to . - /// - public static MethodInfo GetMethod(Expression expression) - { - if (expression == null) return null; - return IsMethod(expression) ? (((MethodCallExpression)expression).Method) : null; - } + /// + /// Gets a from an provided it refers to a method call. + /// + /// The expression. + /// The or null if cannot be converted to . + /// + public static MethodInfo GetMethod(Expression expression) + { + if (expression == null) return null; + return IsMethod(expression) ? (((MethodCallExpression)expression).Method) : null; + } - /// - /// Gets a from an provided it refers to member access. - /// - /// - /// The type of the return. - /// From expression. - /// The or null if cannot be converted to . - /// - public static MemberInfo GetMemberInfo(Expression> fromExpression) - { - if (fromExpression == null) return null; - var body = fromExpression.Body as MemberExpression; - return body != null ? body.Member : null; - } + /// + /// Gets a from an provided it refers to member access. + /// + /// + /// The type of the return. + /// From expression. + /// The or null if cannot be converted to . + /// + public static MemberInfo GetMemberInfo(Expression> fromExpression) + { + if (fromExpression == null) return null; + var body = fromExpression.Body as MemberExpression; + return body != null ? body.Member : null; + } - /// - /// Determines whether the MethodInfo is the same based on signature, not based on the equality operator or HashCode. - /// - /// The left. - /// The right. - /// - /// true if [is method signature equal to] [the specified left]; otherwise, false. - /// - /// - /// This is useful for comparing Expression methods that may contain different generic types - /// - public static bool IsMethodSignatureEqualTo(this MethodInfo left, MethodInfo right) - { - if (left.Equals(right)) - return true; - if (left.DeclaringType != right.DeclaringType) - return false; - if (left.Name != right.Name) - return false; - var leftParams = left.GetParameters(); - var rightParams = right.GetParameters(); - if (leftParams.Length != rightParams.Length) - return false; - for (int i = 0; i < leftParams.Length; i++) - { - //if they are delegate parameters, then assume they match as they could be anything - if (typeof(Delegate).IsAssignableFrom(leftParams[i].ParameterType) && typeof(Delegate).IsAssignableFrom(rightParams[i].ParameterType)) - continue; - //if they are not delegates, then compare the types - if (leftParams[i].ParameterType != rightParams[i].ParameterType) - return false; - } - if (left.ReturnType != right.ReturnType) - return false; - return true; - } + /// + /// Determines whether the MethodInfo is the same based on signature, not based on the equality operator or HashCode. + /// + /// The left. + /// The right. + /// + /// true if [is method signature equal to] [the specified left]; otherwise, false. + /// + /// + /// This is useful for comparing Expression methods that may contain different generic types + /// + public static bool IsMethodSignatureEqualTo(this MethodInfo left, MethodInfo right) + { + if (left.Equals(right)) + return true; + if (left.DeclaringType != right.DeclaringType) + return false; + if (left.Name != right.Name) + return false; + var leftParams = left.GetParameters(); + var rightParams = right.GetParameters(); + if (leftParams.Length != rightParams.Length) + return false; + for (int i = 0; i < leftParams.Length; i++) + { + //if they are delegate parameters, then assume they match as they could be anything + if (typeof(Delegate).IsAssignableFrom(leftParams[i].ParameterType) && typeof(Delegate).IsAssignableFrom(rightParams[i].ParameterType)) + continue; + //if they are not delegates, then compare the types + if (leftParams[i].ParameterType != rightParams[i].ParameterType) + return false; + } + if (left.ReturnType != right.ReturnType) + return false; + return true; + } - /// - /// Gets a from an provided it refers to member access. - /// - /// The expression. - /// - /// - public static MemberInfo GetMember(Expression expression) - { - if (expression == null) return null; - return IsMember(expression) ? (((MemberExpression)expression).Member) : null; - } + /// + /// Gets a from an provided it refers to member access. + /// + /// The expression. + /// + /// + public static MemberInfo GetMember(Expression expression) + { + if (expression == null) return null; + return IsMember(expression) ? (((MemberExpression)expression).Member) : null; + } - /// - /// Gets a from a - /// - /// From method group. - /// - /// - public static MethodInfo GetStaticMethodInfo(Delegate fromMethodGroup) - { - if (fromMethodGroup == null) throw new ArgumentNullException("fromMethodGroup"); + /// + /// Gets a from a + /// + /// From method group. + /// + /// + public static MethodInfo GetStaticMethodInfo(Delegate fromMethodGroup) + { + if (fromMethodGroup == null) throw new ArgumentNullException("fromMethodGroup"); - return fromMethodGroup.Method; - } + return fromMethodGroup.Method; + } - ///// - ///// Formats an unhandled item for representing the expression as a string. - ///// - ///// - ///// The unhandled item. - ///// - ///// - //public static string FormatUnhandledItem(T unhandledItem) where T : class - //{ - // if (unhandledItem == null) throw new ArgumentNullException("unhandledItem"); + ///// + ///// Formats an unhandled item for representing the expression as a string. + ///// + ///// + ///// The unhandled item. + ///// + ///// + //public static string FormatUnhandledItem(T unhandledItem) where T : class + //{ + // if (unhandledItem == null) throw new ArgumentNullException("unhandledItem"); - // var itemAsExpression = unhandledItem as Expression; - // return itemAsExpression != null - // ? FormattingExpressionTreeVisitor.Format(itemAsExpression) - // : unhandledItem.ToString(); - //} + // var itemAsExpression = unhandledItem as Expression; + // return itemAsExpression != null + // ? FormattingExpressionTreeVisitor.Format(itemAsExpression) + // : unhandledItem.ToString(); + //} - /// - /// Determines whether the specified expression is a method. - /// - /// The expression. - /// true if the specified expression is method; otherwise, false. - /// - public static bool IsMethod(Expression expression) - { - return expression is MethodCallExpression; - } + /// + /// Determines whether the specified expression is a method. + /// + /// The expression. + /// true if the specified expression is method; otherwise, false. + /// + public static bool IsMethod(Expression expression) + { + return expression is MethodCallExpression; + } - /// - /// Determines whether the specified expression is a member. - /// - /// The expression. - /// true if the specified expression is member; otherwise, false. - /// - public static bool IsMember(Expression expression) - { - return expression is MemberExpression; - } + /// + /// Determines whether the specified expression is a member. + /// + /// The expression. + /// true if the specified expression is member; otherwise, false. + /// + public static bool IsMember(Expression expression) + { + return expression is MemberExpression; + } - /// - /// Determines whether the specified expression is a constant. - /// - /// The expression. - /// true if the specified expression is constant; otherwise, false. - /// - public static bool IsConstant(Expression expression) - { - return expression is ConstantExpression; - } + /// + /// Determines whether the specified expression is a constant. + /// + /// The expression. + /// true if the specified expression is constant; otherwise, false. + /// + public static bool IsConstant(Expression expression) + { + return expression is ConstantExpression; + } - /// - /// Gets the first value from the supplied arguments of an expression, for those arguments that can be cast to . - /// - /// The arguments. - /// - /// - public static object GetFirstValueFromArguments(IEnumerable arguments) - { - if (arguments == null) return false; - return - arguments.Where(x => x is ConstantExpression).Cast - ().Select(x => x.Value).DefaultIfEmpty(null).FirstOrDefault(); - } - } -} \ No newline at end of file + /// + /// Gets the first value from the supplied arguments of an expression, for those arguments that can be cast to . + /// + /// The arguments. + /// + /// + public static object GetFirstValueFromArguments(IEnumerable arguments) + { + if (arguments == null) return false; + return + arguments.Where(x => x is ConstantExpression).Cast + ().Select(x => x.Value).DefaultIfEmpty(null).FirstOrDefault(); + } + } +} diff --git a/src/Umbraco.Core/FileResources/Files.Designer.cs b/src/Umbraco.Core/FileResources/Files.Designer.cs index 500f9bf36c..afc88ff636 100644 --- a/src/Umbraco.Core/FileResources/Files.Designer.cs +++ b/src/Umbraco.Core/FileResources/Files.Designer.cs @@ -10,8 +10,8 @@ namespace Umbraco.Core.FileResources { using System; - - + + /// /// A strongly-typed resource class, for looking up localized strings, etc. /// @@ -23,15 +23,15 @@ namespace Umbraco.Core.FileResources { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Files { - + private static global::System.Resources.ResourceManager resourceMan; - + private static global::System.Globalization.CultureInfo resourceCulture; - + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Files() { } - + /// /// Returns the cached ResourceManager instance used by this class. /// @@ -45,7 +45,7 @@ namespace Umbraco.Core.FileResources { return resourceMan; } } - + /// /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. @@ -59,13 +59,13 @@ namespace Umbraco.Core.FileResources { resourceCulture = value; } } - + /// /// Looks up a localized string similar to <?xml version="1.0"?> /// ///<!-- Blocks public downloading of anything in this folder and sub folders --> /// - ///<configuration> + ///<configuration> /// <system.web> /// <httpHandlers> /// <add path="*" verb="*" type="System.Web.HttpNotFoundHandler"/> diff --git a/src/Umbraco.Core/GuidUdi.cs b/src/Umbraco.Core/GuidUdi.cs index 7a740ef58f..a80390479f 100644 --- a/src/Umbraco.Core/GuidUdi.cs +++ b/src/Umbraco.Core/GuidUdi.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.ComponentModel; namespace Umbraco.Core @@ -82,4 +82,4 @@ namespace Umbraco.Core return this; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/HashCodeCombiner.cs b/src/Umbraco.Core/HashCodeCombiner.cs index 6d65ab3704..73e442a3df 100644 --- a/src/Umbraco.Core/HashCodeCombiner.cs +++ b/src/Umbraco.Core/HashCodeCombiner.cs @@ -4,32 +4,32 @@ using System.IO; namespace Umbraco.Core { - /// - /// Used to create a hash code from multiple objects. - /// - /// - /// .Net has a class the same as this: System.Web.Util.HashCodeCombiner and of course it works for all sorts of things - /// which we've not included here as we just need a quick easy class for this in order to create a unique - /// hash of directories/files to see if they have changed. - /// - internal class HashCodeCombiner - { - private long _combinedHash = 5381L; + /// + /// Used to create a hash code from multiple objects. + /// + /// + /// .Net has a class the same as this: System.Web.Util.HashCodeCombiner and of course it works for all sorts of things + /// which we've not included here as we just need a quick easy class for this in order to create a unique + /// hash of directories/files to see if they have changed. + /// + internal class HashCodeCombiner + { + private long _combinedHash = 5381L; - internal void AddInt(int i) - { - _combinedHash = ((_combinedHash << 5) + _combinedHash) ^ i; - } + internal void AddInt(int i) + { + _combinedHash = ((_combinedHash << 5) + _combinedHash) ^ i; + } - internal void AddObject(object o) - { - AddInt(o.GetHashCode()); - } + internal void AddObject(object o) + { + AddInt(o.GetHashCode()); + } - internal void AddDateTime(DateTime d) - { - AddInt(d.GetHashCode()); - } + internal void AddDateTime(DateTime d) + { + AddInt(d.GetHashCode()); + } internal void AddString(string s) { @@ -37,61 +37,61 @@ namespace Umbraco.Core AddInt((StringComparer.InvariantCulture).GetHashCode(s)); } - internal void AddCaseInsensitiveString(string s) - { - if (s != null) - AddInt((StringComparer.InvariantCultureIgnoreCase).GetHashCode(s)); - } + internal void AddCaseInsensitiveString(string s) + { + if (s != null) + AddInt((StringComparer.InvariantCultureIgnoreCase).GetHashCode(s)); + } - internal void AddFileSystemItem(FileSystemInfo f) - { - //if it doesn't exist, don't proceed. - if (!f.Exists) - return; + internal void AddFileSystemItem(FileSystemInfo f) + { + //if it doesn't exist, don't proceed. + if (!f.Exists) + return; - AddCaseInsensitiveString(f.FullName); - AddDateTime(f.CreationTimeUtc); - AddDateTime(f.LastWriteTimeUtc); + AddCaseInsensitiveString(f.FullName); + AddDateTime(f.CreationTimeUtc); + AddDateTime(f.LastWriteTimeUtc); - //check if it is a file or folder - var fileInfo = f as FileInfo; - if (fileInfo != null) - { - AddInt(fileInfo.Length.GetHashCode()); - } + //check if it is a file or folder + var fileInfo = f as FileInfo; + if (fileInfo != null) + { + AddInt(fileInfo.Length.GetHashCode()); + } - var dirInfo = f as DirectoryInfo; - if (dirInfo != null) - { - foreach (var d in dirInfo.GetFiles()) - { - AddFile(d); - } - foreach (var s in dirInfo.GetDirectories()) - { - AddFolder(s); - } - } - } + var dirInfo = f as DirectoryInfo; + if (dirInfo != null) + { + foreach (var d in dirInfo.GetFiles()) + { + AddFile(d); + } + foreach (var s in dirInfo.GetDirectories()) + { + AddFolder(s); + } + } + } - internal void AddFile(FileInfo f) - { - AddFileSystemItem(f); - } + internal void AddFile(FileInfo f) + { + AddFileSystemItem(f); + } - internal void AddFolder(DirectoryInfo d) - { - AddFileSystemItem(d); - } + internal void AddFolder(DirectoryInfo d) + { + AddFileSystemItem(d); + } - /// - /// Returns the hex code of the combined hash code - /// - /// - internal string GetCombinedHashCode() - { - return _combinedHash.ToString("x", CultureInfo.InvariantCulture); - } + /// + /// Returns the hex code of the combined hash code + /// + /// + internal string GetCombinedHashCode() + { + return _combinedHash.ToString("x", CultureInfo.InvariantCulture); + } - } + } } diff --git a/src/Umbraco.Core/HashCodeHelper.cs b/src/Umbraco.Core/HashCodeHelper.cs index f0f281056d..f3dc7fcd0e 100644 --- a/src/Umbraco.Core/HashCodeHelper.cs +++ b/src/Umbraco.Core/HashCodeHelper.cs @@ -66,7 +66,7 @@ namespace Umbraco.Core } /// - /// Gets a hashcode for a collection for that the order of items + /// Gets a hashcode for a collection for that the order of items /// does not matter. /// So {1, 2, 3} and {3, 2, 1} will get same hash code. /// @@ -88,7 +88,7 @@ namespace Umbraco.Core } /// - /// Alternative way to get a hashcode is to use a fluent + /// Alternative way to get a hashcode is to use a fluent /// interface like this:
/// return 0.CombineHashCode(field1).CombineHashCode(field2). /// CombineHashCode(field3); @@ -101,4 +101,4 @@ namespace Umbraco.Core } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/HttpContextExtensions.cs b/src/Umbraco.Core/HttpContextExtensions.cs index d734d09158..df134ad7ca 100644 --- a/src/Umbraco.Core/HttpContextExtensions.cs +++ b/src/Umbraco.Core/HttpContextExtensions.cs @@ -56,4 +56,4 @@ namespace Umbraco.Core } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/IO/FileSecurityException.cs b/src/Umbraco.Core/IO/FileSecurityException.cs index 8358b5efd2..df5891910c 100644 --- a/src/Umbraco.Core/IO/FileSecurityException.cs +++ b/src/Umbraco.Core/IO/FileSecurityException.cs @@ -9,12 +9,12 @@ namespace Umbraco.Core.IO { public FileSecurityException() { - + } public FileSecurityException(string message) : base(message) { - + } } } diff --git a/src/Umbraco.Core/IO/FileSystemProviderAttribute.cs b/src/Umbraco.Core/IO/FileSystemProviderAttribute.cs index f94cee537d..db6a414f29 100644 --- a/src/Umbraco.Core/IO/FileSystemProviderAttribute.cs +++ b/src/Umbraco.Core/IO/FileSystemProviderAttribute.cs @@ -5,7 +5,7 @@ using System.Text; using Umbraco.Core.CodeAnnotations; namespace Umbraco.Core.IO -{ +{ [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)] public class FileSystemProviderAttribute : Attribute { diff --git a/src/Umbraco.Core/IO/FileSystemWrapper.cs b/src/Umbraco.Core/IO/FileSystemWrapper.cs index 918883823e..e9272893e4 100644 --- a/src/Umbraco.Core/IO/FileSystemWrapper.cs +++ b/src/Umbraco.Core/IO/FileSystemWrapper.cs @@ -1,118 +1,118 @@ -using System; +using System; using System.Collections.Generic; using System.IO; namespace Umbraco.Core.IO { - /// - /// All custom file systems that are based upon another IFileSystem should inherit from FileSystemWrapper - /// - /// - /// An IFileSystem is generally used as a base file system, for example like a PhysicalFileSystem or an S3FileSystem. - /// Then, other custom file systems are wrapped upon these files systems like MediaFileSystem, etc... All of the custom - /// file systems must inherit from FileSystemWrapper. - /// - /// This abstract class just wraps the 'real' IFileSystem object passed in to its constructor. - /// - public abstract class FileSystemWrapper : IFileSystem - { - protected FileSystemWrapper(IFileSystem wrapped) - { - Wrapped = wrapped; - } + /// + /// All custom file systems that are based upon another IFileSystem should inherit from FileSystemWrapper + /// + /// + /// An IFileSystem is generally used as a base file system, for example like a PhysicalFileSystem or an S3FileSystem. + /// Then, other custom file systems are wrapped upon these files systems like MediaFileSystem, etc... All of the custom + /// file systems must inherit from FileSystemWrapper. + /// + /// This abstract class just wraps the 'real' IFileSystem object passed in to its constructor. + /// + public abstract class FileSystemWrapper : IFileSystem + { + protected FileSystemWrapper(IFileSystem wrapped) + { + Wrapped = wrapped; + } internal IFileSystem Wrapped { get; set; } - public IEnumerable GetDirectories(string path) - { - return Wrapped.GetDirectories(path); - } + public IEnumerable GetDirectories(string path) + { + return Wrapped.GetDirectories(path); + } - public void DeleteDirectory(string path) - { - Wrapped.DeleteDirectory(path); - } + public void DeleteDirectory(string path) + { + Wrapped.DeleteDirectory(path); + } - public void DeleteDirectory(string path, bool recursive) - { - Wrapped.DeleteDirectory(path, recursive); - } + public void DeleteDirectory(string path, bool recursive) + { + Wrapped.DeleteDirectory(path, recursive); + } - public bool DirectoryExists(string path) - { - return Wrapped.DirectoryExists(path); - } + public bool DirectoryExists(string path) + { + return Wrapped.DirectoryExists(path); + } - public void AddFile(string path, Stream stream) - { - Wrapped.AddFile(path, stream); - } + public void AddFile(string path, Stream stream) + { + Wrapped.AddFile(path, stream); + } - public void AddFile(string path, Stream stream, bool overrideExisting) - { - Wrapped.AddFile(path, stream, overrideExisting); - } + public void AddFile(string path, Stream stream, bool overrideExisting) + { + Wrapped.AddFile(path, stream, overrideExisting); + } - public IEnumerable GetFiles(string path) - { - return Wrapped.GetFiles(path); - } + public IEnumerable GetFiles(string path) + { + return Wrapped.GetFiles(path); + } - public IEnumerable GetFiles(string path, string filter) - { - return Wrapped.GetFiles(path, filter); - } + public IEnumerable GetFiles(string path, string filter) + { + return Wrapped.GetFiles(path, filter); + } - public Stream OpenFile(string path) - { - return Wrapped.OpenFile(path); - } + public Stream OpenFile(string path) + { + return Wrapped.OpenFile(path); + } - public void DeleteFile(string path) - { - Wrapped.DeleteFile(path); - } + public void DeleteFile(string path) + { + Wrapped.DeleteFile(path); + } - public bool FileExists(string path) - { - return Wrapped.FileExists(path); - } + public bool FileExists(string path) + { + return Wrapped.FileExists(path); + } - public string GetRelativePath(string fullPathOrUrl) - { - return Wrapped.GetRelativePath(fullPathOrUrl); - } + public string GetRelativePath(string fullPathOrUrl) + { + return Wrapped.GetRelativePath(fullPathOrUrl); + } - public string GetFullPath(string path) - { - return Wrapped.GetFullPath(path); - } + public string GetFullPath(string path) + { + return Wrapped.GetFullPath(path); + } - public string GetUrl(string path) - { - return Wrapped.GetUrl(path); - } + public string GetUrl(string path) + { + return Wrapped.GetUrl(path); + } - public DateTimeOffset GetLastModified(string path) - { - return Wrapped.GetLastModified(path); - } + public DateTimeOffset GetLastModified(string path) + { + return Wrapped.GetLastModified(path); + } - public DateTimeOffset GetCreated(string path) - { - return Wrapped.GetCreated(path); - } + public DateTimeOffset GetCreated(string path) + { + return Wrapped.GetCreated(path); + } - public long GetSize(string path) - { - return Wrapped.GetSize(path); - } + public long GetSize(string path) + { + return Wrapped.GetSize(path); + } - public bool CanAddPhysical => Wrapped.CanAddPhysical; + public bool CanAddPhysical => Wrapped.CanAddPhysical; - public void AddFile(string path, string physicalPath, bool overrideIfExists = true, bool copy = false) - { - Wrapped.AddFile(path, physicalPath, overrideIfExists, copy); - } - } -} \ No newline at end of file + public void AddFile(string path, string physicalPath, bool overrideIfExists = true, bool copy = false) + { + Wrapped.AddFile(path, physicalPath, overrideIfExists, copy); + } + } +} diff --git a/src/Umbraco.Core/IO/FileSystems.cs b/src/Umbraco.Core/IO/FileSystems.cs index adf62397a8..76866a065b 100644 --- a/src/Umbraco.Core/IO/FileSystems.cs +++ b/src/Umbraco.Core/IO/FileSystems.cs @@ -114,7 +114,7 @@ namespace Umbraco.Core.IO if (Volatile.Read(ref _wkfsInitialized) == false) EnsureWellKnownFileSystems(); return _masterPagesFileSystem;// fixme - see 7.6?! } - } + } public IFileSystem MvcViewsFileSystem { @@ -173,11 +173,11 @@ namespace Umbraco.Core.IO /// used to cache the lookup of how to construct this object so we don't have to reflect each time. ///
private class ProviderConstructionInfo - { - public object[] Parameters { get; set; } - public ConstructorInfo Constructor { get; set; } - //public string ProviderAlias { get; set; } - } + { + public object[] Parameters { get; set; } + public ConstructorInfo Constructor { get; set; } + //public string ProviderAlias { get; set; } + } /// /// Gets an underlying (non-typed) filesystem supporting a strongly-typed filesystem. diff --git a/src/Umbraco.Core/IO/IOHelper.cs b/src/Umbraco.Core/IO/IOHelper.cs index 4ef240f73c..cb6fb5ccee 100644 --- a/src/Umbraco.Core/IO/IOHelper.cs +++ b/src/Umbraco.Core/IO/IOHelper.cs @@ -11,7 +11,7 @@ using ICSharpCode.SharpZipLib.Zip; namespace Umbraco.Core.IO { - public static class IOHelper + public static class IOHelper { private static string _rootDir = ""; @@ -21,14 +21,14 @@ namespace Umbraco.Core.IO public static char DirSepChar => Path.DirectorySeparatorChar; internal static void UnZip(string zipFilePath, string unPackDirectory, bool deleteZipFile) - { - // Unzip - string tempDir = unPackDirectory; - Directory.CreateDirectory(tempDir); + { + // Unzip + string tempDir = unPackDirectory; + Directory.CreateDirectory(tempDir); //TODO: Get rid of SharpZipLib library - using (ZipInputStream s = new ZipInputStream(File.OpenRead(zipFilePath))) - { + using (ZipInputStream s = new ZipInputStream(File.OpenRead(zipFilePath))) + { ZipEntry theEntry; while ((theEntry = s.GetNextEntry()) != null) { @@ -64,9 +64,9 @@ namespace Umbraco.Core.IO if (deleteZipFile) File.Delete(zipFilePath); } - } + } - //helper to try and match the old path to a new virtual one + //helper to try and match the old path to a new virtual one public static string FindFile(string virtualPath) { string retval = virtualPath; @@ -115,8 +115,8 @@ namespace Umbraco.Core.IO { return path; } - // Check that we even have an HttpContext! otherwise things will fail anyways - // http://umbraco.codeplex.com/workitem/30946 + // Check that we even have an HttpContext! otherwise things will fail anyways + // http://umbraco.codeplex.com/workitem/30946 if (useHttpContext && HttpContext.Current != null) { @@ -127,11 +127,11 @@ namespace Umbraco.Core.IO return HostingEnvironment.MapPath("~/" + path.TrimStart('/')); } - var root = GetRootDirectorySafe(); - var newPath = path.TrimStart('~', '/').Replace('/', IOHelper.DirSepChar); - var retval = root + IOHelper.DirSepChar.ToString(CultureInfo.InvariantCulture) + newPath; + var root = GetRootDirectorySafe(); + var newPath = path.TrimStart('~', '/').Replace('/', IOHelper.DirSepChar); + var retval = root + IOHelper.DirSepChar.ToString(CultureInfo.InvariantCulture) + newPath; - return retval; + return retval; } public static string MapPath(string path) @@ -140,7 +140,7 @@ namespace Umbraco.Core.IO } //use a tilde character instead of the complete path - internal static string ReturnPath(string settingsKey, string standardPath, bool useTilde) + internal static string ReturnPath(string settingsKey, string standardPath, bool useTilde) { string retval = ConfigurationManager.AppSettings[settingsKey]; @@ -270,10 +270,10 @@ namespace Umbraco.Core.IO return _rootDir; } - var codeBase = Assembly.GetExecutingAssembly().CodeBase; - var uri = new Uri(codeBase); - var path = uri.LocalPath; - var baseDirectory = Path.GetDirectoryName(path); + var codeBase = Assembly.GetExecutingAssembly().CodeBase; + var uri = new Uri(codeBase); + var path = uri.LocalPath; + var baseDirectory = Path.GetDirectoryName(path); if (String.IsNullOrEmpty(baseDirectory)) throw new Exception("No root directory could be resolved. Please ensure that your Umbraco solution is correctly configured."); @@ -317,9 +317,9 @@ namespace Umbraco.Core.IO /// The supplied path should be the absolute path to the root of the umbraco site. /// internal static void SetRootDirectory(string rootPath) - { + { _rootDir = rootPath; - } + } /// /// Check to see if filename passed has any special chars in it and strips them to create a safe filename. Used to overcome an issue when Umbraco is used in IE in an intranet environment. @@ -332,23 +332,23 @@ namespace Umbraco.Core.IO return filePath.ToSafeFileName(); } - public static void EnsurePathExists(string path) - { - var absolutePath = MapPath(path); - if (Directory.Exists(absolutePath) == false) - Directory.CreateDirectory(absolutePath); - } + public static void EnsurePathExists(string path) + { + var absolutePath = MapPath(path); + if (Directory.Exists(absolutePath) == false) + Directory.CreateDirectory(absolutePath); + } - public static void EnsureFileExists(string path, string contents) - { - var absolutePath = IOHelper.MapPath(path); - if (File.Exists(absolutePath)) return; + public static void EnsureFileExists(string path, string contents) + { + var absolutePath = IOHelper.MapPath(path); + if (File.Exists(absolutePath)) return; - using (var writer = File.CreateText(absolutePath)) - { - writer.Write(contents); - } - } + using (var writer = File.CreateText(absolutePath)) + { + writer.Write(contents); + } + } /// /// Checks if a given path is a full path including drive letter diff --git a/src/Umbraco.Core/IO/MasterPageHelper.cs b/src/Umbraco.Core/IO/MasterPageHelper.cs index 4870c7449a..e619ec98d8 100644 --- a/src/Umbraco.Core/IO/MasterPageHelper.cs +++ b/src/Umbraco.Core/IO/MasterPageHelper.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.IO; using System.Linq; @@ -58,8 +58,8 @@ namespace Umbraco.Core.IO using (var ms = new MemoryStream(withBom)) { - _masterPageFileSystem.AddFile(filePath, ms, true); - } + _masterPageFileSystem.AddFile(filePath, ms, true); + } } else { @@ -67,7 +67,7 @@ namespace Umbraco.Core.IO using (var tr = new StreamReader(s, Encoding.UTF8)) { masterpageContent = tr.ReadToEnd(); - tr.Close(); + tr.Close(); } } @@ -83,7 +83,7 @@ namespace Umbraco.Core.IO // using (var tr = new StreamReader(s)) // { // masterpageContent = tr.ReadToEnd(); - // tr.Close(); + // tr.Close(); // } // } @@ -197,7 +197,7 @@ namespace Umbraco.Core.IO private void UpdateChildTemplates(ITemplate template, string currentAlias, ITemplateRepository templateRepo) { //if we have a Old Alias if the alias and therefor the masterpage file name has changed... - //so before we save the new masterfile, we'll clear the old one, so we don't up with + //so before we save the new masterfile, we'll clear the old one, so we don't up with //Unused masterpage files if (string.IsNullOrEmpty(currentAlias) == false && currentAlias != template.Alias) { @@ -281,7 +281,7 @@ namespace Umbraco.Core.IO // } // //we have a Old Alias if the alias and therefor the masterpage file name has changed... - // //so before we save the new masterfile, we'll clear the old one, so we don't up with + // //so before we save the new masterfile, we'll clear the old one, so we don't up with // //Unused masterpage files // if (string.IsNullOrEmpty(currentAlias) == false && currentAlias != template.Alias) // { @@ -295,7 +295,7 @@ namespace Umbraco.Core.IO // UpdateMasterPageFile(t, null, templateRepo); // } - // //then kill the old file.. + // //then kill the old file.. // var oldFile = GetFilePath(currentAlias); // if (_masterPageFileSystem.FileExists(oldFile)) // _masterPageFileSystem.DeleteFile(oldFile); @@ -448,4 +448,4 @@ namespace Umbraco.Core.IO } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/IO/MediaFileSystem.cs b/src/Umbraco.Core/IO/MediaFileSystem.cs index c8264532ec..5f6e0e20d7 100644 --- a/src/Umbraco.Core/IO/MediaFileSystem.cs +++ b/src/Umbraco.Core/IO/MediaFileSystem.cs @@ -21,13 +21,13 @@ using Umbraco.Core.Services; namespace Umbraco.Core.IO { - /// - /// A custom file system provider for media - /// - [FileSystemProvider("media")] - public class MediaFileSystem : FileSystemWrapper - { - private readonly object _folderCounterLock = new object(); + /// + /// A custom file system provider for media + /// + [FileSystemProvider("media")] + public class MediaFileSystem : FileSystemWrapper + { + private readonly object _folderCounterLock = new object(); private long _folderCounter; private bool _folderCounterInitialized; @@ -38,7 +38,7 @@ namespace Umbraco.Core.IO // { 500, "big-thumb" } //}; - public MediaFileSystem(IFileSystem wrapped) + public MediaFileSystem(IFileSystem wrapped) : base(wrapped) { // due to how FileSystems is written at the moment, the ctor cannot be used to inject @@ -59,7 +59,7 @@ namespace Umbraco.Core.IO internal UploadAutoFillProperties UploadAutoFillProperties { get; } - // note - this is currently experimental / being developed + // note - this is currently experimental / being developed //public static bool UseTheNewMediaPathScheme { get; set; } public const bool UseTheNewMediaPathScheme = false; @@ -109,40 +109,40 @@ namespace Umbraco.Core.IO return allsuccess; } - public void DeleteMediaFiles(IEnumerable files) - { - files = files.Distinct(); + public void DeleteMediaFiles(IEnumerable files) + { + files = files.Distinct(); - Parallel.ForEach(files, file => - { - try - { - if (file.IsNullOrWhiteSpace()) return; - if (FileExists(file) == false) return; - DeleteFile(file); + Parallel.ForEach(files, file => + { + try + { + if (file.IsNullOrWhiteSpace()) return; + if (FileExists(file) == false) return; + DeleteFile(file); - if (UseTheNewMediaPathScheme == false) - { - // old scheme: filepath is "/" OR "-" - // remove the directory if any - var dir = Path.GetDirectoryName(file); - if (string.IsNullOrWhiteSpace(dir) == false) - DeleteDirectory(dir, true); - } - else - { - // new scheme: path is "/" where xuid is a combination of cuid and puid - // remove the directory - var dir = Path.GetDirectoryName(file); - DeleteDirectory(dir, true); - } - } - catch (Exception e) - { - Logger.Error("Failed to delete attached file \"" + file + "\".", e); - } - }); - } + if (UseTheNewMediaPathScheme == false) + { + // old scheme: filepath is "/" OR "-" + // remove the directory if any + var dir = Path.GetDirectoryName(file); + if (string.IsNullOrWhiteSpace(dir) == false) + DeleteDirectory(dir, true); + } + else + { + // new scheme: path is "/" where xuid is a combination of cuid and puid + // remove the directory + var dir = Path.GetDirectoryName(file); + DeleteDirectory(dir, true); + } + } + catch (Exception e) + { + Logger.Error("Failed to delete attached file \"" + file + "\".", e); + } + }); + } #region Media Path @@ -184,14 +184,14 @@ namespace Umbraco.Core.IO } private static byte[] Combine(Guid guid1, Guid guid2) - { - var bytes1 = guid1.ToByteArray(); - var bytes2 = guid2.ToByteArray(); - var bytes = new byte[bytes1.Length]; - for (var i = 0; i < bytes1.Length; i++) - bytes[i] = (byte) (bytes1[i] ^ bytes2[i]); - return bytes; - } + { + var bytes1 = guid1.ToByteArray(); + var bytes2 = guid2.ToByteArray(); + var bytes = new byte[bytes1.Length]; + for (var i = 0; i < bytes1.Length; i++) + bytes[i] = (byte) (bytes1[i] ^ bytes2[i]); + return bytes; + } /// /// Gets the file path of a media file. @@ -242,8 +242,8 @@ namespace Umbraco.Core.IO return Interlocked.Increment(ref _folderCounter).ToString(CultureInfo.InvariantCulture); } - private void EnsureFolderCounterIsInitialized() - { + private void EnsureFolderCounterIsInitialized() + { lock (_folderCounterLock) { if (_folderCounterInitialized) return; @@ -433,7 +433,7 @@ namespace Umbraco.Core.IO #endregion - // fixme - remove + // fixme - remove //#region Manage thumbnails diff --git a/src/Umbraco.Core/IO/PhysicalFileSystem.cs b/src/Umbraco.Core/IO/PhysicalFileSystem.cs index d9d6083dfb..3b9cac42a7 100644 --- a/src/Umbraco.Core/IO/PhysicalFileSystem.cs +++ b/src/Umbraco.Core/IO/PhysicalFileSystem.cs @@ -27,9 +27,9 @@ namespace Umbraco.Core.IO // the "~/" is mandatory. public PhysicalFileSystem(string virtualRoot) { - if (virtualRoot == null) throw new ArgumentNullException("virtualRoot"); - if (virtualRoot.StartsWith("~/") == false) - throw new ArgumentException("The virtualRoot argument must be a virtual path and start with '~/'"); + if (virtualRoot == null) throw new ArgumentNullException("virtualRoot"); + if (virtualRoot.StartsWith("~/") == false) + throw new ArgumentException("The virtualRoot argument must be a virtual path and start with '~/'"); _rootPath = EnsureDirectorySeparatorChar(IOHelper.MapPath(virtualRoot)).TrimEnd(Path.DirectorySeparatorChar); _rootPathFwd = EnsureUrlSeparatorChar(_rootPath); @@ -40,7 +40,7 @@ namespace Umbraco.Core.IO { if (string.IsNullOrEmpty(rootPath)) throw new ArgumentNullOrEmptyException(nameof(rootPath)); if (string.IsNullOrEmpty(rootUrl)) throw new ArgumentNullOrEmptyException(nameof(rootUrl)); - if (rootPath.StartsWith("~/")) throw new ArgumentException("The rootPath argument cannot be a virtual path and cannot start with '~/'"); + if (rootPath.StartsWith("~/")) throw new ArgumentException("The rootPath argument cannot be a virtual path and cannot start with '~/'"); // rootPath should be... rooted, as in, it's a root path! if (Path.IsPathRooted(rootPath) == false) diff --git a/src/Umbraco.Core/IO/ShadowWrapper.cs b/src/Umbraco.Core/IO/ShadowWrapper.cs index 7467f87135..94bd61b162 100644 --- a/src/Umbraco.Core/IO/ShadowWrapper.cs +++ b/src/Umbraco.Core/IO/ShadowWrapper.cs @@ -184,4 +184,4 @@ namespace Umbraco.Core.IO FileSystem.AddFile(path, physicalPath, overrideIfExists, copy); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/IO/SystemDirectories.cs b/src/Umbraco.Core/IO/SystemDirectories.cs index be04e7f94e..ee77ddeb54 100644 --- a/src/Umbraco.Core/IO/SystemDirectories.cs +++ b/src/Umbraco.Core/IO/SystemDirectories.cs @@ -10,9 +10,9 @@ using System.IO; namespace Umbraco.Core.IO { //all paths has a starting but no trailing / - public class SystemDirectories + public class SystemDirectories { - //TODO: Why on earth is this even configurable? You cannot change the /Bin folder in ASP.Net + //TODO: Why on earth is this even configurable? You cannot change the /Bin folder in ASP.Net public static string Bin { get @@ -36,7 +36,7 @@ namespace Umbraco.Core.IO return IOHelper.ReturnPath("umbracoConfigDirectory", "~/config"); } } - + public static string Css { get @@ -79,22 +79,22 @@ namespace Umbraco.Core.IO } public static string AppPlugins - { - get - { - //NOTE: this is not configurable and shouldn't need to be - return "~/App_Plugins"; - } - } + { + get + { + //NOTE: this is not configurable and shouldn't need to be + return "~/App_Plugins"; + } + } - public static string MvcViews - { - get - { - //NOTE: this is not configurable and shouldn't need to be - return "~/Views"; - } - } + public static string MvcViews + { + get + { + //NOTE: this is not configurable and shouldn't need to be + return "~/Views"; + } + } public static string PartialViews { @@ -108,8 +108,8 @@ namespace Umbraco.Core.IO { get { - return MvcViews + "/MacroPartials/"; - + return MvcViews + "/MacroPartials/"; + } } @@ -120,7 +120,7 @@ namespace Umbraco.Core.IO return IOHelper.ReturnPath("umbracoMediaPath", "~/media"); } } - + public static string Scripts { get @@ -186,7 +186,7 @@ namespace Umbraco.Core.IO } } - private static string _root; + private static string _root; /// /// Gets the root path of the application /// @@ -200,7 +200,7 @@ namespace Umbraco.Core.IO if (appPath == "/") appPath = string.Empty; - _root = appPath; + _root = appPath; } return _root; } @@ -210,5 +210,5 @@ namespace Umbraco.Core.IO } - + } diff --git a/src/Umbraco.Core/IO/SystemFiles.cs b/src/Umbraco.Core/IO/SystemFiles.cs index 85f0a1f42c..fa22a9a447 100644 --- a/src/Umbraco.Core/IO/SystemFiles.cs +++ b/src/Umbraco.Core/IO/SystemFiles.cs @@ -40,6 +40,6 @@ namespace Umbraco.Core.IO throw new ArgumentOutOfRangeException(); } } - } + } } } diff --git a/src/Umbraco.Core/IO/ViewHelper.cs b/src/Umbraco.Core/IO/ViewHelper.cs index 4772edcf9a..1645355b72 100644 --- a/src/Umbraco.Core/IO/ViewHelper.cs +++ b/src/Umbraco.Core/IO/ViewHelper.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.IO; using System.Linq; using System.Text; @@ -45,8 +45,8 @@ namespace Umbraco.Core.IO if (_viewFileSystem.FileExists(path) == false || overWrite) { - viewContent = SaveTemplateToFile(t); - } + viewContent = SaveTemplateToFile(t); + } else { using (var tr = new StreamReader(_viewFileSystem.OpenFile(path))) @@ -135,7 +135,7 @@ namespace Umbraco.Core.IO if (string.IsNullOrEmpty(currentAlias) == false && currentAlias != t.Alias) { - //then kill the old file.. + //then kill the old file.. var oldFile = ViewPath(currentAlias); if (_viewFileSystem.FileExists(oldFile)) _viewFileSystem.DeleteFile(oldFile); @@ -166,4 +166,4 @@ namespace Umbraco.Core.IO return design; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/IRuntime.cs b/src/Umbraco.Core/IRuntime.cs index 26ed4a9f14..37b265ad77 100644 --- a/src/Umbraco.Core/IRuntime.cs +++ b/src/Umbraco.Core/IRuntime.cs @@ -1,21 +1,21 @@ -using LightInject; +using LightInject; namespace Umbraco.Core { /// - /// Defines the Umbraco runtime. - /// - public interface IRuntime - { + /// Defines the Umbraco runtime. + /// + public interface IRuntime + { /// /// Boots the runtime. /// /// The application service container. - void Boot(ServiceContainer container); + void Boot(ServiceContainer container); /// /// Terminates the runtime. /// - void Terminate(); - } -} \ No newline at end of file + void Terminate(); + } +} diff --git a/src/Umbraco.Core/IRuntimeState.cs b/src/Umbraco.Core/IRuntimeState.cs index afee65c9aa..5c0c01ef3b 100644 --- a/src/Umbraco.Core/IRuntimeState.cs +++ b/src/Umbraco.Core/IRuntimeState.cs @@ -1,4 +1,4 @@ -using System; +using System; using Semver; using Umbraco.Core.Exceptions; using Umbraco.Core.Sync; @@ -62,4 +62,4 @@ namespace Umbraco.Core /// BootFailedException BootFailedException { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/IntExtensions.cs b/src/Umbraco.Core/IntExtensions.cs index ae2c01ef95..358c73ab8e 100644 --- a/src/Umbraco.Core/IntExtensions.cs +++ b/src/Umbraco.Core/IntExtensions.cs @@ -1,21 +1,21 @@ -using System; +using System; namespace Umbraco.Core { - public static class IntExtensions - { - /// - /// Does something 'x' amount of times - /// - /// - /// - public static void Times(this int n, Action action) - { - for (int i = 0; i < n; i++) - { - action(i); - } - } + public static class IntExtensions + { + /// + /// Does something 'x' amount of times + /// + /// + /// + public static void Times(this int n, Action action) + { + for (int i = 0; i < n; i++) + { + action(i); + } + } /// /// Creates a Guid based on an integer value @@ -28,5 +28,5 @@ namespace Umbraco.Core BitConverter.GetBytes(value).CopyTo(bytes, 0); return new Guid(bytes); } - } -} \ No newline at end of file + } +} diff --git a/src/Umbraco.Core/LambdaExpressionCacheKey.cs b/src/Umbraco.Core/LambdaExpressionCacheKey.cs index 9542b041c5..fdc69cde0f 100644 --- a/src/Umbraco.Core/LambdaExpressionCacheKey.cs +++ b/src/Umbraco.Core/LambdaExpressionCacheKey.cs @@ -1,83 +1,83 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; namespace Umbraco.Core { - /// - /// Represents a simple in a form which is suitable for using as a dictionary key - /// by exposing the return type, argument types and expression string form in a single concatenated string. - /// - internal struct LambdaExpressionCacheKey - { - public LambdaExpressionCacheKey(string returnType, string expression, params string[] argTypes) - { - ReturnType = returnType; - ExpressionAsString = expression; - ArgTypes = new HashSet(argTypes); - _toString = null; - } + /// + /// Represents a simple in a form which is suitable for using as a dictionary key + /// by exposing the return type, argument types and expression string form in a single concatenated string. + /// + internal struct LambdaExpressionCacheKey + { + public LambdaExpressionCacheKey(string returnType, string expression, params string[] argTypes) + { + ReturnType = returnType; + ExpressionAsString = expression; + ArgTypes = new HashSet(argTypes); + _toString = null; + } - public LambdaExpressionCacheKey(LambdaExpression obj) - { - ReturnType = obj.ReturnType.FullName; - ExpressionAsString = obj.ToString(); - ArgTypes = new HashSet(obj.Parameters.Select(x => x.Type.FullName)); - _toString = null; - } + public LambdaExpressionCacheKey(LambdaExpression obj) + { + ReturnType = obj.ReturnType.FullName; + ExpressionAsString = obj.ToString(); + ArgTypes = new HashSet(obj.Parameters.Select(x => x.Type.FullName)); + _toString = null; + } - /// - /// The argument type names of the - /// - public readonly HashSet ArgTypes; + /// + /// The argument type names of the + /// + public readonly HashSet ArgTypes; - /// - /// The return type of the - /// - public readonly string ReturnType; + /// + /// The return type of the + /// + public readonly string ReturnType; - /// - /// The original string representation of the - /// - public readonly string ExpressionAsString; + /// + /// The original string representation of the + /// + public readonly string ExpressionAsString; - private string _toString; + private string _toString; - /// - /// Returns a that represents this instance. - /// - /// - /// A that represents this instance. - /// - public override string ToString() - { - return _toString ?? (_toString = String.Concat(String.Join("|", ArgTypes), ",", ReturnType, ",", ExpressionAsString)); - } + /// + /// Returns a that represents this instance. + /// + /// + /// A that represents this instance. + /// + public override string ToString() + { + return _toString ?? (_toString = String.Concat(String.Join("|", ArgTypes), ",", ReturnType, ",", ExpressionAsString)); + } - /// - /// 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. - /// - public override bool Equals(object obj) - { - if (ReferenceEquals(obj, null)) return false; - var casted = (LambdaExpressionCacheKey)obj; - return casted.ToString() == ToString(); - } + /// + /// 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. + /// + public override bool Equals(object obj) + { + if (ReferenceEquals(obj, null)) return false; + var casted = (LambdaExpressionCacheKey)obj; + return casted.ToString() == ToString(); + } - /// - /// 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. - /// - public override int GetHashCode() - { - return ToString().GetHashCode(); - } - } -} \ No newline at end of file + /// + /// 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. + /// + public override int GetHashCode() + { + return ToString().GetHashCode(); + } + } +} diff --git a/src/Umbraco.Core/Logging/AsyncForwardingAppenderBase.cs b/src/Umbraco.Core/Logging/AsyncForwardingAppenderBase.cs index fcb0f183ec..3ebcfe458f 100644 --- a/src/Umbraco.Core/Logging/AsyncForwardingAppenderBase.cs +++ b/src/Umbraco.Core/Logging/AsyncForwardingAppenderBase.cs @@ -1,4 +1,4 @@ -using log4net.Appender; +using log4net.Appender; using log4net.Core; using log4net.Util; using System; @@ -118,4 +118,4 @@ namespace Umbraco.Core.Logging #endregion Forwarding } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Logging/AsynchronousRollingFileAppender.cs b/src/Umbraco.Core/Logging/AsynchronousRollingFileAppender.cs index cd62008cd4..5d314c19e0 100644 --- a/src/Umbraco.Core/Logging/AsynchronousRollingFileAppender.cs +++ b/src/Umbraco.Core/Logging/AsynchronousRollingFileAppender.cs @@ -1,4 +1,4 @@ -using log4net.Core; +using log4net.Core; using log4net.Util; using System; using System.ComponentModel; @@ -13,14 +13,14 @@ namespace Umbraco.Core.Logging /// /// Based on https://github.com/cjbhaines/Log4Net.Async /// which is based on code by Chris Haines http://cjbhaines.wordpress.com/2012/02/13/asynchronous-log4net-appenders/ - /// This is an old/deprecated logger and has been superceded by ParallelForwardingAppender which is included in Umbraco and + /// This is an old/deprecated logger and has been superceded by ParallelForwardingAppender which is included in Umbraco and /// also by AsyncForwardingAppender in the Log4Net.Async library. - /// - [Obsolete("This is superceded by the ParallelForwardingAppender, this will be removed in v8, do not use this")] + /// + [Obsolete("This is superceded by the ParallelForwardingAppender, this will be removed in v8, do not use this")] [EditorBrowsable(EditorBrowsableState.Never)] - public class AsynchronousRollingFileAppender : RollingFileAppender - { - private RingBuffer pendingAppends; + public class AsynchronousRollingFileAppender : RollingFileAppender + { + private RingBuffer pendingAppends; private readonly ManualResetEvent manualResetEvent; private bool shuttingDown; private bool hasFinished; @@ -203,4 +203,4 @@ namespace Umbraco.Core.Logging } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Logging/DebugDiagnosticsLogger.cs b/src/Umbraco.Core/Logging/DebugDiagnosticsLogger.cs index 4e7d1544df..4bb7aeb464 100644 --- a/src/Umbraco.Core/Logging/DebugDiagnosticsLogger.cs +++ b/src/Umbraco.Core/Logging/DebugDiagnosticsLogger.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; namespace Umbraco.Core.Logging @@ -110,4 +110,4 @@ namespace Umbraco.Core.Logging System.Diagnostics.Debug.WriteLine(string.Format(format, args.Select(x => x()).ToArray()), reporting.FullName); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Logging/ILogger.cs b/src/Umbraco.Core/Logging/ILogger.cs index 740c1c1317..e135d3547e 100644 --- a/src/Umbraco.Core/Logging/ILogger.cs +++ b/src/Umbraco.Core/Logging/ILogger.cs @@ -1,4 +1,4 @@ -using System; +using System; namespace Umbraco.Core.Logging { @@ -141,4 +141,4 @@ namespace Umbraco.Core.Logging /// An array of functions returning objects to format. void Debug(Type reporting, string format, params Func[] args); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Logging/IProfiler.cs b/src/Umbraco.Core/Logging/IProfiler.cs index 8768889799..53d1d96072 100644 --- a/src/Umbraco.Core/Logging/IProfiler.cs +++ b/src/Umbraco.Core/Logging/IProfiler.cs @@ -21,7 +21,7 @@ namespace Umbraco.Core.Logging /// A step. /// The returned is meant to be used within a using (...) {{ ... }} block. IDisposable Step(string name); - + /// /// Starts the profiler. /// @@ -35,4 +35,4 @@ namespace Umbraco.Core.Logging /// authenticated or you want to clear the results, based upon some other mechanism. void Stop(bool discardResults = false); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Logging/IQueue.cs b/src/Umbraco.Core/Logging/IQueue.cs index d063993ef6..db87cb7705 100644 --- a/src/Umbraco.Core/Logging/IQueue.cs +++ b/src/Umbraco.Core/Logging/IQueue.cs @@ -1,4 +1,4 @@ -namespace Umbraco.Core.Logging +namespace Umbraco.Core.Logging { /// /// Borrowed from https://github.com/cjbhaines/Log4Net.Async - will reference Nuget packages directly in v8 @@ -9,4 +9,4 @@ namespace Umbraco.Core.Logging void Enqueue(T item); bool TryDequeue(out T ret); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Logging/ImageProcessorLogger.cs b/src/Umbraco.Core/Logging/ImageProcessorLogger.cs index 760304f42c..02faac39aa 100644 --- a/src/Umbraco.Core/Logging/ImageProcessorLogger.cs +++ b/src/Umbraco.Core/Logging/ImageProcessorLogger.cs @@ -4,13 +4,13 @@ using ImageProcessor.Common.Exceptions; using Umbraco.Core.Composing; namespace Umbraco.Core.Logging -{ +{ /// /// A logger for explicitly logging ImageProcessor exceptions. /// /// Creating this logger is enough for ImageProcessor to find and replace its in-built debug logger - /// without any additional configuration required. This class currently has to be public in order + /// without any additional configuration required. This class currently has to be public in order /// to do so. /// /// diff --git a/src/Umbraco.Core/Logging/LogProfiler.cs b/src/Umbraco.Core/Logging/LogProfiler.cs index 72e1e891a0..b556a1b549 100644 --- a/src/Umbraco.Core/Logging/LogProfiler.cs +++ b/src/Umbraco.Core/Logging/LogProfiler.cs @@ -31,7 +31,7 @@ namespace Umbraco.Core.Logging /// public void Start() { - // the log will always be started + // the log will always be started } /// diff --git a/src/Umbraco.Core/Logging/Logger.cs b/src/Umbraco.Core/Logging/Logger.cs index 333ada047c..188cf01ac9 100644 --- a/src/Umbraco.Core/Logging/Logger.cs +++ b/src/Umbraco.Core/Logging/Logger.cs @@ -14,8 +14,8 @@ using log4net.Util; namespace Umbraco.Core.Logging { /// - /// Implements on top of log4net. - /// + /// Implements on top of log4net. + /// public class Logger : ILogger { /// @@ -44,28 +44,28 @@ namespace Umbraco.Core.Logging { return new Logger(); } - + /// - public void Error(Type reporting, string message, Exception exception = null) - { - var logger = LogManager.GetLogger(reporting); - if (logger == null) return; + public void Error(Type reporting, string message, Exception exception = null) + { + var logger = LogManager.GetLogger(reporting); + if (logger == null) return; - var dump = false; + var dump = false; - if (IsTimeoutThreadAbortException(exception)) - { - message += "\r\nThe thread has been aborted, because the request has timed out."; + if (IsTimeoutThreadAbortException(exception)) + { + message += "\r\nThe thread has been aborted, because the request has timed out."; // dump if configured, or if stacktrace contains Monitor.ReliableEnter - dump = UmbracoConfig.For.CoreDebug().DumpOnTimeoutThreadAbort || IsMonitorEnterThreadAbortException(exception); + dump = UmbracoConfig.For.CoreDebug().DumpOnTimeoutThreadAbort || IsMonitorEnterThreadAbortException(exception); // dump if it is ok to dump (might have a cap on number of dump...) - dump &= MiniDump.OkToDump(); - } + dump &= MiniDump.OkToDump(); + } if (dump) - { + { try { var dumped = MiniDump.Dump(withException: true); @@ -80,7 +80,7 @@ namespace Umbraco.Core.Logging } logger.Error(message, exception); - } + } private static bool IsMonitorEnterThreadAbortException(Exception exception) { @@ -133,11 +133,11 @@ namespace Umbraco.Core.Logging /// public void Warn(Type reporting, string format, params Func[] args) - { - var logger = LogManager.GetLogger(reporting); - if (logger == null || logger.IsWarnEnabled == false) return; - logger.WarnFormat(format, args.Select(x => x.Invoke()).ToArray()); - } + { + var logger = LogManager.GetLogger(reporting); + if (logger == null || logger.IsWarnEnabled == false) return; + logger.WarnFormat(format, args.Select(x => x.Invoke()).ToArray()); + } /// public void Warn(Type reporting, Exception exception, string message) @@ -187,11 +187,11 @@ namespace Umbraco.Core.Logging /// public void Info(Type reporting, Func generateMessage) - { - var logger = LogManager.GetLogger(reporting); - if (logger == null || logger.IsInfoEnabled == false) return; - logger.Info(generateMessage()); - } + { + var logger = LogManager.GetLogger(reporting); + if (logger == null || logger.IsInfoEnabled == false) return; + logger.Info(generateMessage()); + } /// public void Info(Type reporting, string format, params object[] args) @@ -203,14 +203,14 @@ namespace Umbraco.Core.Logging /// public void Info(Type reporting, string format, params Func[] args) - { - var logger = LogManager.GetLogger(reporting); - if (logger == null || logger.IsInfoEnabled == false) return; - logger.InfoFormat(format, args.Select(x => x.Invoke()).ToArray()); - } + { + var logger = LogManager.GetLogger(reporting); + if (logger == null || logger.IsInfoEnabled == false) return; + logger.InfoFormat(format, args.Select(x => x.Invoke()).ToArray()); + } /// - public void Debug(Type reporting, string message) + public void Debug(Type reporting, string message) { var logger = LogManager.GetLogger(reporting); if (logger == null || logger.IsDebugEnabled == false) return; @@ -218,15 +218,15 @@ namespace Umbraco.Core.Logging } /// - public void Debug(Type reporting, Func messageBuilder) - { - var logger = LogManager.GetLogger(reporting); - if (logger == null || logger.IsDebugEnabled == false) return; - logger.Debug(messageBuilder()); - } + public void Debug(Type reporting, Func messageBuilder) + { + var logger = LogManager.GetLogger(reporting); + if (logger == null || logger.IsDebugEnabled == false) return; + logger.Debug(messageBuilder()); + } /// - public void Debug(Type reporting, string format, params object[] args) + public void Debug(Type reporting, string format, params object[] args) { var logger = LogManager.GetLogger(reporting); if (logger == null || logger.IsDebugEnabled == false) return; @@ -234,11 +234,11 @@ namespace Umbraco.Core.Logging } /// - public void Debug(Type reporting, string format, params Func[] args) - { - var logger = LogManager.GetLogger(reporting); - if (logger == null || logger.IsDebugEnabled == false) return; - logger.DebugFormat(format, args.Select(x => x.Invoke()).ToArray()); - } - } + public void Debug(Type reporting, string format, params Func[] args) + { + var logger = LogManager.GetLogger(reporting); + if (logger == null || logger.IsDebugEnabled == false) return; + logger.DebugFormat(format, args.Select(x => x.Invoke()).ToArray()); + } + } } diff --git a/src/Umbraco.Core/Logging/LoggerExtensions.cs b/src/Umbraco.Core/Logging/LoggerExtensions.cs index 4e47afa4a1..045709d03e 100644 --- a/src/Umbraco.Core/Logging/LoggerExtensions.cs +++ b/src/Umbraco.Core/Logging/LoggerExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; namespace Umbraco.Core.Logging { @@ -207,4 +207,4 @@ namespace Umbraco.Core.Logging logger.Debug(typeof(T), format, args); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Logging/LoggingEventContext.cs b/src/Umbraco.Core/Logging/LoggingEventContext.cs index 88222e3c05..2dac3c4676 100644 --- a/src/Umbraco.Core/Logging/LoggingEventContext.cs +++ b/src/Umbraco.Core/Logging/LoggingEventContext.cs @@ -1,4 +1,4 @@ -using log4net.Core; +using log4net.Core; namespace Umbraco.Core.Logging { @@ -17,4 +17,4 @@ namespace Umbraco.Core.Logging public object HttpContext { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Logging/LoggingEventHelper.cs b/src/Umbraco.Core/Logging/LoggingEventHelper.cs index 129098279a..a92e557f34 100644 --- a/src/Umbraco.Core/Logging/LoggingEventHelper.cs +++ b/src/Umbraco.Core/Logging/LoggingEventHelper.cs @@ -1,4 +1,4 @@ -using System; +using System; using log4net.Core; namespace Umbraco.Core.Logging @@ -30,4 +30,4 @@ namespace Umbraco.Core.Logging return loggingEvent; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Logging/LoggingTaskExtension.cs b/src/Umbraco.Core/Logging/LoggingTaskExtension.cs index 98924b4bf5..614f1ce14c 100644 --- a/src/Umbraco.Core/Logging/LoggingTaskExtension.cs +++ b/src/Umbraco.Core/Logging/LoggingTaskExtension.cs @@ -1,44 +1,44 @@ -using System; +using System; using System.Threading.Tasks; namespace Umbraco.Core.Logging { - internal static class LoggingTaskExtension - { - /// - /// This task shouldn't be waited on (as it's not guaranteed to run), and you shouldn't wait on the parent task either (because it might throw an - /// exception that doesn't get handled). If you want to be waiting on something, use LogErrorsWaitable instead. - /// - /// None of these methods are suitable for tasks that return a value. If you're wanting a result, you should probably be handling - /// errors yourself. - /// - public static Task LogErrors(this Task task, Action logMethod) - { - return task.ContinueWith(t => LogErrorsInner(t, logMethod), TaskContinuationOptions.OnlyOnFaulted); - } + internal static class LoggingTaskExtension + { + /// + /// This task shouldn't be waited on (as it's not guaranteed to run), and you shouldn't wait on the parent task either (because it might throw an + /// exception that doesn't get handled). If you want to be waiting on something, use LogErrorsWaitable instead. + /// + /// None of these methods are suitable for tasks that return a value. If you're wanting a result, you should probably be handling + /// errors yourself. + /// + public static Task LogErrors(this Task task, Action logMethod) + { + return task.ContinueWith(t => LogErrorsInner(t, logMethod), TaskContinuationOptions.OnlyOnFaulted); + } - /// - /// This task can be waited on (as it's guaranteed to run), and you should wait on this rather than the parent task. Because it's - /// guaranteed to run, it may be slower than using LogErrors, and you should consider using that method if you don't want to wait. - /// - /// None of these methods are suitable for tasks that return a value. If you're wanting a result, you should probably be handling - /// errors yourself. - /// - public static Task LogErrorsWaitable(this Task task, Action logMethod) - { - return task.ContinueWith(t => LogErrorsInner(t, logMethod)); - } + /// + /// This task can be waited on (as it's guaranteed to run), and you should wait on this rather than the parent task. Because it's + /// guaranteed to run, it may be slower than using LogErrors, and you should consider using that method if you don't want to wait. + /// + /// None of these methods are suitable for tasks that return a value. If you're wanting a result, you should probably be handling + /// errors yourself. + /// + public static Task LogErrorsWaitable(this Task task, Action logMethod) + { + return task.ContinueWith(t => LogErrorsInner(t, logMethod)); + } - private static void LogErrorsInner(Task task, Action logAction) - { - if (task.Exception != null) - { - logAction("Aggregate Exception with " + task.Exception.InnerExceptions.Count + " inner exceptions: ", task.Exception); - foreach (var innerException in task.Exception.InnerExceptions) - { - logAction("Inner exception from aggregate exception: ", innerException); - } - } - } - } -} \ No newline at end of file + private static void LogErrorsInner(Task task, Action logAction) + { + if (task.Exception != null) + { + logAction("Aggregate Exception with " + task.Exception.InnerExceptions.Count + " inner exceptions: ", task.Exception); + foreach (var innerException in task.Exception.InnerExceptions) + { + logAction("Inner exception from aggregate exception: ", innerException); + } + } + } + } +} diff --git a/src/Umbraco.Core/Logging/OwinLogger.cs b/src/Umbraco.Core/Logging/OwinLogger.cs index f01c83b738..a6ae0c332a 100644 --- a/src/Umbraco.Core/Logging/OwinLogger.cs +++ b/src/Umbraco.Core/Logging/OwinLogger.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics; namespace Umbraco.Core.Logging @@ -60,4 +60,4 @@ namespace Umbraco.Core.Logging } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Logging/ParallelForwardingAppender.cs b/src/Umbraco.Core/Logging/ParallelForwardingAppender.cs index f582b84f67..e8dad743e1 100644 --- a/src/Umbraco.Core/Logging/ParallelForwardingAppender.cs +++ b/src/Umbraco.Core/Logging/ParallelForwardingAppender.cs @@ -1,4 +1,4 @@ -// fixme - remove this file +// fixme - remove this file //using log4net.Core; //using log4net.Util; //using System; @@ -18,4 +18,4 @@ // public class ParallelForwardingAppender : Log4Net.Async.ParallelForwardingAppender // { // } -//} \ No newline at end of file +//} diff --git a/src/Umbraco.Core/Logging/ProfilerExtensions.cs b/src/Umbraco.Core/Logging/ProfilerExtensions.cs index 70db34fc6d..533837b08b 100644 --- a/src/Umbraco.Core/Logging/ProfilerExtensions.cs +++ b/src/Umbraco.Core/Logging/ProfilerExtensions.cs @@ -36,4 +36,4 @@ namespace Umbraco.Core.Logging return profiler.Step($"[{reporting.Name}] {name}"); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Logging/ProfilingLogger.cs b/src/Umbraco.Core/Logging/ProfilingLogger.cs index 190876dea3..28d2494b0d 100644 --- a/src/Umbraco.Core/Logging/ProfilingLogger.cs +++ b/src/Umbraco.Core/Logging/ProfilingLogger.cs @@ -1,4 +1,4 @@ -using System; +using System; namespace Umbraco.Core.Logging { @@ -49,4 +49,4 @@ namespace Umbraco.Core.Logging return new DisposableTimer(Logger, DisposableTimer.LogType.Debug, Profiler, loggerType, startMessage, completeMessage, failMessage, thresholdMilliseconds); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Logging/RingBuffer.cs b/src/Umbraco.Core/Logging/RingBuffer.cs index 8dd78129b8..18f28faf6b 100644 --- a/src/Umbraco.Core/Logging/RingBuffer.cs +++ b/src/Umbraco.Core/Logging/RingBuffer.cs @@ -1,4 +1,4 @@ -using System; +using System; namespace Umbraco.Core.Logging { @@ -75,4 +75,4 @@ namespace Umbraco.Core.Logging } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Logging/WebProfiler.cs b/src/Umbraco.Core/Logging/WebProfiler.cs index 20670f0d00..71f1288fda 100644 --- a/src/Umbraco.Core/Logging/WebProfiler.cs +++ b/src/Umbraco.Core/Logging/WebProfiler.cs @@ -103,4 +103,4 @@ namespace Umbraco.Core.Logging } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Logging/WebProfilerComponent.cs b/src/Umbraco.Core/Logging/WebProfilerComponent.cs index 238173a935..338a7e72d6 100644 --- a/src/Umbraco.Core/Logging/WebProfilerComponent.cs +++ b/src/Umbraco.Core/Logging/WebProfilerComponent.cs @@ -19,7 +19,7 @@ namespace Umbraco.Core.Logging public void Initialize(IProfiler profiler, ILogger logger, IRuntimeState runtime) { - // although registered in WebRuntime.Compose, ensure that we have not + // although registered in WebRuntime.Compose, ensure that we have not // been replaced by another component, and we are still "the" profiler _profiler = profiler as WebProfiler; if (_profiler == null) @@ -46,4 +46,4 @@ namespace Umbraco.Core.Logging app.EndRequest += (s, a) => _profiler.UmbracoApplicationEndRequest(s, a); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Macros/MacroTagParser.cs b/src/Umbraco.Core/Macros/MacroTagParser.cs index ec88b1cce6..26f2b34ae5 100644 --- a/src/Umbraco.Core/Macros/MacroTagParser.cs +++ b/src/Umbraco.Core/Macros/MacroTagParser.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Text; using System.Text.RegularExpressions; @@ -7,35 +7,35 @@ using Umbraco.Core.Xml; namespace Umbraco.Core.Macros { - /// - /// Parses the macro syntax in a string and renders out it's contents - /// - internal class MacroTagParser - { - private static readonly Regex MacroRteContent = new Regex(@"()", - RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.CultureInvariant | RegexOptions.Singleline); + /// + /// Parses the macro syntax in a string and renders out it's contents + /// + internal class MacroTagParser + { + private static readonly Regex MacroRteContent = new Regex(@"()", + RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.CultureInvariant | RegexOptions.Singleline); - private static readonly Regex MacroPersistedFormat = - new Regex(@"(<\?UMBRACO_MACRO (?:.+?)??macroAlias=[""']([^""\'\n\r]+?)[""'].+?)(?:/>|>.*?)", - RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.CultureInvariant | RegexOptions.Singleline); + private static readonly Regex MacroPersistedFormat = + new Regex(@"(<\?UMBRACO_MACRO (?:.+?)??macroAlias=[""']([^""\'\n\r]+?)[""'].+?)(?:/>|>.*?)", + RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.CultureInvariant | RegexOptions.Singleline); - /// - /// This formats the persisted string to something useful for the rte so that the macro renders properly since we - /// persist all macro formats like {?UMBRACO_MACRO macroAlias=\"myMacro\" /} - /// - /// - /// The html attributes to be added to the div - /// - /// - /// This converts the persisted macro format to this: - /// - /// {div class='umb-macro-holder'} - /// - /// {ins}Macro alias: {strong}My Macro{/strong}{/ins} - /// {/div} - /// - /// - internal static string FormatRichTextPersistedDataForEditor(string persistedContent, IDictionary htmlAttributes) + /// + /// This formats the persisted string to something useful for the rte so that the macro renders properly since we + /// persist all macro formats like {?UMBRACO_MACRO macroAlias=\"myMacro\" /} + /// + /// + /// The html attributes to be added to the div + /// + /// + /// This converts the persisted macro format to this: + /// + /// {div class='umb-macro-holder'} + /// + /// {ins}Macro alias: {strong}My Macro{/strong}{/ins} + /// {/div} + /// + /// + internal static string FormatRichTextPersistedDataForEditor(string persistedContent, IDictionary htmlAttributes) { return MacroPersistedFormat.Replace(persistedContent, match => { @@ -76,21 +76,21 @@ namespace Umbraco.Core.Macros /// /// /// - /// - /// This is required because when editors are using the rte, the html that is contained in the editor might actually be displaying + /// + /// This is required because when editors are using the rte, the html that is contained in the editor might actually be displaying /// the entire macro content, when the data is submitted the editor will clear most of this data out but we'll still need to parse it properly /// and ensure the correct sytnax is persisted to the db. - /// + /// /// When a macro is inserted into the rte editor, the html will be: - /// + /// /// {div class='umb-macro-holder'} /// /// This could be some macro content /// {/div} - /// + /// /// What this method will do is remove the {div} and parse out the commented special macro syntax: {?UMBRACO_MACRO macroAlias=\"myMacro\" /} /// since this is exactly how we need to persist it to the db. - /// + /// /// internal static string FormatRichTextContentForPersistence(string rteContent) { @@ -110,7 +110,7 @@ namespace Umbraco.Core.Macros return rteContent; } - //replace each containing parent
with the comment node itself. + //replace each containing parent
with the comment node itself. foreach (var c in commentNodes) { var div = c.ParentNode; @@ -133,79 +133,79 @@ namespace Umbraco.Core.Macros }); } - /// - /// This will accept a text block and seach/parse it for macro markup. - /// When either a text block or a a macro is found, it will call the callback method. - /// - /// - /// - /// - /// - /// - /// This method simply parses the macro contents, it does not create a string or result, - /// this is up to the developer calling this method to implement this with the callbacks. - /// - internal static void ParseMacros( - string text, - Action textFoundCallback, - Action> macroFoundCallback ) - { - if (textFoundCallback == null) throw new ArgumentNullException("textFoundCallback"); - if (macroFoundCallback == null) throw new ArgumentNullException("macroFoundCallback"); + /// + /// This will accept a text block and seach/parse it for macro markup. + /// When either a text block or a a macro is found, it will call the callback method. + /// + /// + /// + /// + /// + /// + /// This method simply parses the macro contents, it does not create a string or result, + /// this is up to the developer calling this method to implement this with the callbacks. + /// + internal static void ParseMacros( + string text, + Action textFoundCallback, + Action> macroFoundCallback ) + { + if (textFoundCallback == null) throw new ArgumentNullException("textFoundCallback"); + if (macroFoundCallback == null) throw new ArgumentNullException("macroFoundCallback"); - string elementText = text; + string elementText = text; - var fieldResult = new StringBuilder(elementText); + var fieldResult = new StringBuilder(elementText); - //NOTE: This is legacy code, this is definitely not the correct way to do a while loop! :) - var stop = false; - while (!stop) - { - var tagIndex = fieldResult.ToString().ToLower().IndexOf(" -1) - { - var tempElementContent = ""; + //NOTE: This is legacy code, this is definitely not the correct way to do a while loop! :) + var stop = false; + while (!stop) + { + var tagIndex = fieldResult.ToString().ToLower().IndexOf(" -1) + { + var tempElementContent = ""; - //text block found, call the call back method - textFoundCallback(fieldResult.ToString().Substring(0, tagIndex)); + //text block found, call the call back method + textFoundCallback(fieldResult.ToString().Substring(0, tagIndex)); - fieldResult.Remove(0, tagIndex); + fieldResult.Remove(0, tagIndex); - var tag = fieldResult.ToString().Substring(0, fieldResult.ToString().IndexOf(">") + 1); - var attributes = XmlHelper.GetAttributesFromElement(tag); + var tag = fieldResult.ToString().Substring(0, fieldResult.ToString().IndexOf(">") + 1); + var attributes = XmlHelper.GetAttributesFromElement(tag); - // Check whether it's a single tag () or a tag with children (...) - if (tag.Substring(tag.Length - 2, 1) != "/" && tag.IndexOf(" ") > -1) - { - String closingTag = ""; - // Tag with children are only used when a macro is inserted by the umbraco-editor, in the - // following format: "", so we - // need to delete extra information inserted which is the image-tag and the closing - // umbraco_macro tag - if (fieldResult.ToString().IndexOf(closingTag) > -1) - { - fieldResult.Remove(0, fieldResult.ToString().IndexOf(closingTag)); - } - } + // Check whether it's a single tag () or a tag with children (...) + if (tag.Substring(tag.Length - 2, 1) != "/" && tag.IndexOf(" ") > -1) + { + String closingTag = ""; + // Tag with children are only used when a macro is inserted by the umbraco-editor, in the + // following format: "", so we + // need to delete extra information inserted which is the image-tag and the closing + // umbraco_macro tag + if (fieldResult.ToString().IndexOf(closingTag) > -1) + { + fieldResult.Remove(0, fieldResult.ToString().IndexOf(closingTag)); + } + } - var macroAlias = attributes.ContainsKey("macroalias") ? attributes["macroalias"] : attributes["alias"]; + var macroAlias = attributes.ContainsKey("macroalias") ? attributes["macroalias"] : attributes["alias"]; - //call the callback now that we have the macro parsed - macroFoundCallback(macroAlias, attributes); + //call the callback now that we have the macro parsed + macroFoundCallback(macroAlias, attributes); - fieldResult.Remove(0, fieldResult.ToString().IndexOf(">") + 1); - fieldResult.Insert(0, tempElementContent); - } - else - { - //text block found, call the call back method - textFoundCallback(fieldResult.ToString()); + fieldResult.Remove(0, fieldResult.ToString().IndexOf(">") + 1); + fieldResult.Insert(0, tempElementContent); + } + else + { + //text block found, call the call back method + textFoundCallback(fieldResult.ToString()); - stop = true; //break; - } - } - } - } -} \ No newline at end of file + stop = true; //break; + } + } + } + } +} diff --git a/src/Umbraco.Core/Macros/XsltExtension.cs b/src/Umbraco.Core/Macros/XsltExtension.cs index 1bc11b4618..7bc9277ac3 100644 --- a/src/Umbraco.Core/Macros/XsltExtension.cs +++ b/src/Umbraco.Core/Macros/XsltExtension.cs @@ -14,4 +14,4 @@ public string Namespace { get; private set; } public object ExtensionObject { get; private set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Macros/XsltExtensionAttribute.cs b/src/Umbraco.Core/Macros/XsltExtensionAttribute.cs index d316de8de6..8cde062046 100644 --- a/src/Umbraco.Core/Macros/XsltExtensionAttribute.cs +++ b/src/Umbraco.Core/Macros/XsltExtensionAttribute.cs @@ -30,4 +30,4 @@ namespace Umbraco.Core.Macros return Namespace; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Macros/XsltExtensionCollection.cs b/src/Umbraco.Core/Macros/XsltExtensionCollection.cs index da5de187d5..4d32382d06 100644 --- a/src/Umbraco.Core/Macros/XsltExtensionCollection.cs +++ b/src/Umbraco.Core/Macros/XsltExtensionCollection.cs @@ -5,7 +5,7 @@ namespace Umbraco.Core.Macros { internal class XsltExtensionCollection : BuilderCollectionBase { - public XsltExtensionCollection(IEnumerable items) + public XsltExtensionCollection(IEnumerable items) : base(items) { } } diff --git a/src/Umbraco.Core/Macros/XsltExtensionCollectionBuilder.cs b/src/Umbraco.Core/Macros/XsltExtensionCollectionBuilder.cs index b1d278e20f..45a7615e3d 100644 --- a/src/Umbraco.Core/Macros/XsltExtensionCollectionBuilder.cs +++ b/src/Umbraco.Core/Macros/XsltExtensionCollectionBuilder.cs @@ -7,7 +7,7 @@ using Umbraco.Core.Composing; namespace Umbraco.Core.Macros { // that one is special since it's not initialized with XsltExtension types, but with Xslt extension object types, - // which are then wrapped in an XsltExtension object when the collection is created. so, cannot really inherit + // which are then wrapped in an XsltExtension object when the collection is created. so, cannot really inherit // from (Lazy)CollectionBuilderBase and have to re-implement it. but almost everything is copied from CollectionBuilderBase. internal class XsltExtensionCollectionBuilder : ICollectionBuilder diff --git a/src/Umbraco.Core/Manifest/GridEditorConverter.cs b/src/Umbraco.Core/Manifest/GridEditorConverter.cs index 76aaf4fc16..4c1c21076e 100644 --- a/src/Umbraco.Core/Manifest/GridEditorConverter.cs +++ b/src/Umbraco.Core/Manifest/GridEditorConverter.cs @@ -29,7 +29,7 @@ namespace Umbraco.Core.Manifest if (target.Render.IsNullOrWhiteSpace() == false && target.Render.StartsWith("~/")) { target.Render = IOHelper.ResolveUrl(target.Render); - } + } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Manifest/ManifestBuilder.cs b/src/Umbraco.Core/Manifest/ManifestBuilder.cs index 189189638b..bebde823e8 100644 --- a/src/Umbraco.Core/Manifest/ManifestBuilder.cs +++ b/src/Umbraco.Core/Manifest/ManifestBuilder.cs @@ -68,7 +68,7 @@ namespace Umbraco.Core.Manifest { if (manifest.PropertyEditors != null) { - editors.AddRange(_parser.GetPropertyEditors(manifest.PropertyEditors)); + editors.AddRange(_parser.GetPropertyEditors(manifest.PropertyEditors)); } } @@ -93,13 +93,13 @@ namespace Umbraco.Core.Manifest { if (manifest.ParameterEditors != null) { - editors.AddRange(_parser.GetParameterEditors(manifest.ParameterEditors)); + editors.AddRange(_parser.GetParameterEditors(manifest.ParameterEditors)); } } return editors; }, new TimeSpan(0, 10, 0)); } - } - + } + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Manifest/ManifestParser.cs b/src/Umbraco.Core/Manifest/ManifestParser.cs index 7e7d9fe2b6..506ff97dd4 100644 --- a/src/Umbraco.Core/Manifest/ManifestParser.cs +++ b/src/Umbraco.Core/Manifest/ManifestParser.cs @@ -19,7 +19,7 @@ namespace Umbraco.Core.Manifest internal class ManifestParser { private readonly ILogger _logger; - + private readonly DirectoryInfo _pluginsDir; private readonly IRuntimeCacheProvider _cache; @@ -72,7 +72,7 @@ namespace Umbraco.Core.Manifest jsonEditors.ToString(), new ParameterEditorConverter()); } - + /// /// Get all registered manifests /// @@ -98,7 +98,7 @@ namespace Umbraco.Core.Manifest private IEnumerable GetAllManifestFileContents(DirectoryInfo currDir) { var depth = FolderDepth(_pluginsDir, currDir); - + if (depth < 1) { var result = new List(); @@ -109,7 +109,7 @@ namespace Umbraco.Core.Manifest foreach (var d in dirs) { result.AddRange(GetAllManifestFileContents(d)); - } + } } return result; } @@ -145,7 +145,7 @@ namespace Umbraco.Core.Manifest { var result = new List(); foreach (var m in manifestFileContents) - { + { var manifestContent = m; if (manifestContent.IsNullOrWhiteSpace()) continue; @@ -246,7 +246,7 @@ namespace Umbraco.Core.Manifest } } } - + var manifest = new PackageManifest() { JavaScriptInitialize = jConfig, @@ -319,7 +319,7 @@ namespace Umbraco.Core.Manifest /// /// set to true if we will keep the receiver value if the proeprty already exists /// - /// taken from + /// taken from /// http://stackoverflow.com/questions/4002508/does-c-sharp-have-a-library-for-parsing-multi-level-cascading-json/4002550#4002550 /// internal static void MergeJObjects(JObject receiver, JObject donor, bool keepOriginal = false) @@ -350,11 +350,11 @@ namespace Umbraco.Core.Manifest { if (!receiver.Any(x => x.Equals(item))) { - receiver.Add(item); + receiver.Add(item); } } } - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Manifest/ManifestValidatorConverter.cs b/src/Umbraco.Core/Manifest/ManifestValidatorConverter.cs index 41946908c4..e2ad9c6694 100644 --- a/src/Umbraco.Core/Manifest/ManifestValidatorConverter.cs +++ b/src/Umbraco.Core/Manifest/ManifestValidatorConverter.cs @@ -16,4 +16,4 @@ namespace Umbraco.Core.Manifest return new ManifestPropertyValidator(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Manifest/ManifestWatcher.cs b/src/Umbraco.Core/Manifest/ManifestWatcher.cs index 879e096e83..6a8ec0e6f3 100644 --- a/src/Umbraco.Core/Manifest/ManifestWatcher.cs +++ b/src/Umbraco.Core/Manifest/ManifestWatcher.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.IO; using System.Linq; @@ -29,7 +29,7 @@ namespace Umbraco.Core.Manifest var fsw = new FileSystemWatcher(packageFolder, "*package.*") { IncludeSubdirectories = false, - NotifyFilter = NotifyFilters.LastAccess | NotifyFilters.LastWrite + NotifyFilter = NotifyFilters.LastAccess | NotifyFilters.LastWrite }; _fws.Add(fsw); @@ -67,4 +67,4 @@ namespace Umbraco.Core.Manifest fw.Dispose(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Manifest/PackageManifest.cs b/src/Umbraco.Core/Manifest/PackageManifest.cs index dea1eb9877..0167cf1d5c 100644 --- a/src/Umbraco.Core/Manifest/PackageManifest.cs +++ b/src/Umbraco.Core/Manifest/PackageManifest.cs @@ -32,4 +32,4 @@ namespace Umbraco.Core.Manifest /// public JArray GridEditors { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Manifest/ParameterEditorConverter.cs b/src/Umbraco.Core/Manifest/ParameterEditorConverter.cs index 5f25f9ad81..a69e45b28c 100644 --- a/src/Umbraco.Core/Manifest/ParameterEditorConverter.cs +++ b/src/Umbraco.Core/Manifest/ParameterEditorConverter.cs @@ -28,4 +28,4 @@ namespace Umbraco.Core.Manifest base.Deserialize(jObject, target, serializer); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Manifest/PreValueFieldConverter.cs b/src/Umbraco.Core/Manifest/PreValueFieldConverter.cs index 529bcbe744..2e77a74d48 100644 --- a/src/Umbraco.Core/Manifest/PreValueFieldConverter.cs +++ b/src/Umbraco.Core/Manifest/PreValueFieldConverter.cs @@ -15,4 +15,4 @@ namespace Umbraco.Core.Manifest return new PreValueField(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Manifest/PropertyEditorConverter.cs b/src/Umbraco.Core/Manifest/PropertyEditorConverter.cs index 3a166c2c26..a4a542f05b 100644 --- a/src/Umbraco.Core/Manifest/PropertyEditorConverter.cs +++ b/src/Umbraco.Core/Manifest/PropertyEditorConverter.cs @@ -38,7 +38,7 @@ namespace Umbraco.Core.Manifest }; //the manifest JSON is a simplified json for the validators which is actually a dictionary, however, the - //c# model requires an array of validators not a dictionary so we need to change the json to an array + //c# model requires an array of validators not a dictionary so we need to change the json to an array //to deserialize properly. JArray converted; if (TryConvertValidatorDictionaryToArray(jObject["editor"]["validation"] as JObject, out converted)) @@ -52,7 +52,7 @@ namespace Umbraco.Core.Manifest target.ManifestDefinedPreValueEditor = new PreValueEditor(); //the manifest JSON is a simplified json for the validators which is actually a dictionary, however, the - //c# model requires an array of validators not a dictionary so we need to change the json to an array + //c# model requires an array of validators not a dictionary so we need to change the json to an array //to deserialize properly. var fields = jObject["prevalues"]["fields"] as JArray; if (fields != null) @@ -82,7 +82,7 @@ namespace Umbraco.Core.Manifest result = new JArray(); foreach (var entry in validation) { - //in a special case if the value is simply 'true' (boolean) this just indicates that the + //in a special case if the value is simply 'true' (boolean) this just indicates that the // validator is enabled, the config should just be empty. var formattedItem = JObject.FromObject(new { type = entry.Key, config = entry.Value }); if (entry.Value.Type == JTokenType.Boolean) @@ -95,4 +95,4 @@ namespace Umbraco.Core.Manifest return true; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Media/Exif/BitConverterEx.cs b/src/Umbraco.Core/Media/Exif/BitConverterEx.cs index 5a4e7f846b..9447b057b1 100644 --- a/src/Umbraco.Core/Media/Exif/BitConverterEx.cs +++ b/src/Umbraco.Core/Media/Exif/BitConverterEx.cs @@ -3,7 +3,7 @@ namespace Umbraco.Core.Media.Exif { /// - /// An endian-aware converter for converting between base data types + /// An endian-aware converter for converting between base data types /// and an array of bytes. /// internal class BitConverterEx diff --git a/src/Umbraco.Core/Media/Exif/ExifBitConverter.cs b/src/Umbraco.Core/Media/Exif/ExifBitConverter.cs index 779da321f5..6247929cf6 100644 --- a/src/Umbraco.Core/Media/Exif/ExifBitConverter.cs +++ b/src/Umbraco.Core/Media/Exif/ExifBitConverter.cs @@ -96,7 +96,7 @@ namespace Umbraco.Core.Media.Exif } /// - /// Returns an unsigned rational number converted from the first + /// Returns an unsigned rational number converted from the first /// eight bytes of the given byte array. The first four bytes are /// assumed to be the numerator and the next four bytes are the /// denumerator. @@ -112,7 +112,7 @@ namespace Umbraco.Core.Media.Exif } /// - /// Returns a signed rational number converted from the first + /// Returns a signed rational number converted from the first /// eight bytes of the given byte array. The first four bytes are /// assumed to be the numerator and the next four bytes are the /// denumerator. @@ -128,7 +128,7 @@ namespace Umbraco.Core.Media.Exif } /// - /// Returns an array of 16-bit unsigned integers converted from + /// Returns an array of 16-bit unsigned integers converted from /// the given byte array. /// Numbers are converted from the given byte-order to platform byte-order. /// @@ -145,7 +145,7 @@ namespace Umbraco.Core.Media.Exif } /// - /// Returns an array of 32-bit unsigned integers converted from + /// Returns an array of 32-bit unsigned integers converted from /// the given byte array. /// Numbers are converted from the given byte-order to platform byte-order. /// @@ -162,7 +162,7 @@ namespace Umbraco.Core.Media.Exif } /// - /// Returns an array of 32-bit signed integers converted from + /// Returns an array of 32-bit signed integers converted from /// the given byte array. /// Numbers are converted from the given byte-order to platform byte-order. /// @@ -179,7 +179,7 @@ namespace Umbraco.Core.Media.Exif } /// - /// Returns an array of unsigned rational numbers converted from + /// Returns an array of unsigned rational numbers converted from /// the given byte array. /// Numbers are converted from the given byte-order to platform byte-order. /// @@ -198,7 +198,7 @@ namespace Umbraco.Core.Media.Exif } /// - /// Returns an array of signed rational numbers converted from + /// Returns an array of signed rational numbers converted from /// the given byte array. /// Numbers are converted from the given byte-order to platform byte-order. /// diff --git a/src/Umbraco.Core/Media/Exif/ExifExceptions.cs b/src/Umbraco.Core/Media/Exif/ExifExceptions.cs index b51d77e309..b0301e951a 100644 --- a/src/Umbraco.Core/Media/Exif/ExifExceptions.cs +++ b/src/Umbraco.Core/Media/Exif/ExifExceptions.cs @@ -19,10 +19,10 @@ namespace Umbraco.Core.Media.Exif { ; } - } + } /// - /// The exception that is thrown when an invalid enum type is given to an + /// The exception that is thrown when an invalid enum type is given to an /// ExifEnumProperty. /// internal class UnknownEnumTypeException : Exception diff --git a/src/Umbraco.Core/Media/Exif/ExifExtendedProperty.cs b/src/Umbraco.Core/Media/Exif/ExifExtendedProperty.cs index 2c02663b1b..2a3ed38928 100644 --- a/src/Umbraco.Core/Media/Exif/ExifExtendedProperty.cs +++ b/src/Umbraco.Core/Media/Exif/ExifExtendedProperty.cs @@ -147,7 +147,7 @@ namespace Umbraco.Core.Media.Exif } /// - /// Represents the exif version as a 4 byte ASCII string. (EXIF Specification: UNDEFINED) + /// Represents the exif version as a 4 byte ASCII string. (EXIF Specification: UNDEFINED) /// Used for the ExifVersion, FlashpixVersion, InteroperabilityVersion and GPSVersionID fields. /// internal class ExifVersion : ExifProperty @@ -191,7 +191,7 @@ namespace Umbraco.Core.Media.Exif /// /// Represents the location and area of the subject (EXIF Specification: 2xSHORT) - /// The coordinate values, width, and height are expressed in relation to the + /// The coordinate values, width, and height are expressed in relation to the /// upper left as origin, prior to rotation processing as per the Rotation tag. /// internal class ExifPointSubjectArea : ExifUShortArray @@ -222,7 +222,7 @@ namespace Umbraco.Core.Media.Exif /// /// Represents the location and area of the subject (EXIF Specification: 3xSHORT) - /// The coordinate values, width, and height are expressed in relation to the + /// The coordinate values, width, and height are expressed in relation to the /// upper left as origin, prior to rotation processing as per the Rotation tag. /// internal class ExifCircularSubjectArea : ExifPointSubjectArea @@ -251,7 +251,7 @@ namespace Umbraco.Core.Media.Exif /// /// Represents the location and area of the subject (EXIF Specification: 4xSHORT) - /// The coordinate values, width, and height are expressed in relation to the + /// The coordinate values, width, and height are expressed in relation to the /// upper left as origin, prior to rotation processing as per the Rotation tag. /// internal class ExifRectangularSubjectArea : ExifPointSubjectArea @@ -342,7 +342,7 @@ namespace Umbraco.Core.Media.Exif } /// - /// Represents an ASCII string. (EXIF Specification: BYTE) + /// Represents an ASCII string. (EXIF Specification: BYTE) /// Used by Windows XP. /// internal class WindowsByteString : ExifProperty diff --git a/src/Umbraco.Core/Media/Exif/ExifProperty.cs b/src/Umbraco.Core/Media/Exif/ExifProperty.cs index 7ba32d4966..b05d88eb0a 100644 --- a/src/Umbraco.Core/Media/Exif/ExifProperty.cs +++ b/src/Umbraco.Core/Media/Exif/ExifProperty.cs @@ -130,7 +130,7 @@ namespace Umbraco.Core.Media.Exif protected string mValue; protected override object _Value { get { return Value; } set { Value = (string)value; } } public new string Value { get { return mValue; } set { mValue = value; } } - + public Encoding Encoding { get; private set; } static public implicit operator string(ExifAscii obj) { return obj.mValue; } @@ -182,7 +182,7 @@ namespace Umbraco.Core.Media.Exif } /// - /// Represents an array of 16-bit unsigned integers. + /// Represents an array of 16-bit unsigned integers. /// (EXIF Specification: SHORT with count > 1) /// internal class ExifUShortArray : ExifProperty @@ -251,7 +251,7 @@ namespace Umbraco.Core.Media.Exif } /// - /// Represents an array of 16-bit unsigned integers. + /// Represents an array of 16-bit unsigned integers. /// (EXIF Specification: LONG with count > 1) /// internal class ExifUIntArray : ExifProperty @@ -292,7 +292,7 @@ namespace Umbraco.Core.Media.Exif } /// - /// Represents a rational number defined with a 32-bit unsigned numerator + /// Represents a rational number defined with a 32-bit unsigned numerator /// and denominator. (EXIF Specification: RATIONAL) /// internal class ExifURational : ExifProperty @@ -333,7 +333,7 @@ namespace Umbraco.Core.Media.Exif } /// - /// Represents an array of unsigned rational numbers. + /// Represents an array of unsigned rational numbers. /// (EXIF Specification: RATIONAL with count > 1) /// internal class ExifURationalArray : ExifProperty @@ -448,7 +448,7 @@ namespace Umbraco.Core.Media.Exif } /// - /// Represents an array of 32-bit signed integers. + /// Represents an array of 32-bit signed integers. /// (EXIF Specification: SLONG with count > 1) /// internal class ExifSIntArray : ExifProperty @@ -489,7 +489,7 @@ namespace Umbraco.Core.Media.Exif } /// - /// Represents a rational number defined with a 32-bit signed numerator + /// Represents a rational number defined with a 32-bit signed numerator /// and denominator. (EXIF Specification: SRATIONAL) /// internal class ExifSRational : ExifProperty @@ -530,7 +530,7 @@ namespace Umbraco.Core.Media.Exif } /// - /// Represents an array of signed rational numbers. + /// Represents an array of signed rational numbers. /// (EXIF Specification: SRATIONAL with count > 1) /// internal class ExifSRationalArray : ExifProperty diff --git a/src/Umbraco.Core/Media/Exif/ExifPropertyCollection.cs b/src/Umbraco.Core/Media/Exif/ExifPropertyCollection.cs index 1be504ea45..233fe27a91 100644 --- a/src/Umbraco.Core/Media/Exif/ExifPropertyCollection.cs +++ b/src/Umbraco.Core/Media/Exif/ExifPropertyCollection.cs @@ -4,377 +4,377 @@ using System.Text; namespace Umbraco.Core.Media.Exif { - /// - /// Represents a collection of objects. - /// - internal class ExifPropertyCollection : IDictionary - { - #region Member Variables + /// + /// Represents a collection of objects. + /// + internal class ExifPropertyCollection : IDictionary + { + #region Member Variables private ImageFile parent; - private Dictionary items; - #endregion + private Dictionary items; + #endregion - #region Constructor - internal ExifPropertyCollection (ImageFile parentFile) - { + #region Constructor + internal ExifPropertyCollection (ImageFile parentFile) + { parent = parentFile; - items = new Dictionary (); - } - #endregion + items = new Dictionary (); + } + #endregion - #region Properties - /// - /// Gets the number of elements contained in the collection. - /// - public int Count { - get { return items.Count; } - } - /// - /// Gets a collection containing the keys in this collection. - /// - public ICollection Keys { - get { return items.Keys; } - } - /// - /// Gets a collection containing the values in this collection. - /// - public ICollection Values { - get { return items.Values; } - } - /// - /// Gets or sets the with the specified key. - /// - public ExifProperty this[ExifTag key] { - get { return items[key]; } - set { - if (items.ContainsKey (key)) - items.Remove (key); - items.Add (key, value); - } - } - #endregion + #region Properties + /// + /// Gets the number of elements contained in the collection. + /// + public int Count { + get { return items.Count; } + } + /// + /// Gets a collection containing the keys in this collection. + /// + public ICollection Keys { + get { return items.Keys; } + } + /// + /// Gets a collection containing the values in this collection. + /// + public ICollection Values { + get { return items.Values; } + } + /// + /// Gets or sets the with the specified key. + /// + public ExifProperty this[ExifTag key] { + get { return items[key]; } + set { + if (items.ContainsKey (key)) + items.Remove (key); + items.Add (key, value); + } + } + #endregion - #region ExifProperty Collection Setters - /// - /// Sets the with the specified key. - /// - /// The tag to set. - /// The value of tag. - public void Set (ExifTag key, byte value) - { - if (items.ContainsKey (key)) - items.Remove (key); - items.Add (key, new ExifByte (key, value)); - } - /// - /// Sets the with the specified key. - /// - /// The tag to set. - /// The value of tag. - public void Set (ExifTag key, string value) - { - if (items.ContainsKey (key)) - items.Remove (key); - if (key == ExifTag.WindowsTitle || key == ExifTag.WindowsComment || key == ExifTag.WindowsAuthor || key == ExifTag.WindowsKeywords || key == ExifTag.WindowsSubject) { - items.Add (key, new WindowsByteString (key, value)); - } else { - items.Add (key, new ExifAscii (key, value, parent.Encoding)); - } - } - /// - /// Sets the with the specified key. - /// - /// The tag to set. - /// The value of tag. - public void Set (ExifTag key, ushort value) - { - if (items.ContainsKey (key)) - items.Remove (key); - items.Add (key, new ExifUShort (key, value)); - } - /// - /// Sets the with the specified key. - /// - /// The tag to set. - /// The value of tag. - public void Set (ExifTag key, int value) - { - if (items.ContainsKey (key)) - items.Remove (key); - items.Add (key, new ExifSInt (key, value)); - } - /// - /// Sets the with the specified key. - /// - /// The tag to set. - /// The value of tag. - public void Set (ExifTag key, uint value) - { - if (items.ContainsKey (key)) - items.Remove (key); - items.Add (key, new ExifUInt (key, value)); - } - /// - /// Sets the with the specified key. - /// - /// The tag to set. - /// The value of tag. - public void Set (ExifTag key, float value) - { - if (items.ContainsKey (key)) - items.Remove (key); - items.Add (key, new ExifURational (key, new MathEx.UFraction32 (value))); - } - /// - /// Sets the with the specified key. - /// - /// The tag to set. - /// The value of tag. - public void Set (ExifTag key, double value) - { - if (items.ContainsKey (key)) - items.Remove (key); - items.Add (key, new ExifURational (key, new MathEx.UFraction32 (value))); - } - /// - /// Sets the with the specified key. - /// - /// The tag to set. - /// The value of tag. - public void Set (ExifTag key, object value) - { - Type type = value.GetType (); - if (type.IsEnum) { - Type etype = typeof(ExifEnumProperty<>).MakeGenericType (new Type[] { type }); - object prop = Activator.CreateInstance (etype, new object[] { key, value }); - if (items.ContainsKey (key)) - items.Remove (key); - items.Add (key, (ExifProperty)prop); - } else - throw new ArgumentException ("No exif property exists for this tag.", "value"); - } - /// - /// Sets the with the specified key. - /// - /// The tag to set. - /// The value of tag. - /// String encoding. - public void Set (ExifTag key, string value, Encoding encoding) - { - if (items.ContainsKey (key)) - items.Remove (key); - items.Add (key, new ExifEncodedString (key, value, encoding)); - } - /// - /// Sets the with the specified key. - /// - /// The tag to set. - /// The value of tag. - public void Set (ExifTag key, DateTime value) - { - if (items.ContainsKey (key)) - items.Remove (key); - items.Add (key, new ExifDateTime (key, value)); - } - /// - /// Sets the with the specified key. - /// - /// The tag to set. - /// Angular degrees (or clock hours for a timestamp). - /// Angular minutes (or clock minutes for a timestamp). - /// Angular seconds (or clock seconds for a timestamp). - public void Set (ExifTag key, float d, float m, float s) - { - if (items.ContainsKey (key)) - items.Remove (key); - items.Add (key, new ExifURationalArray (key, new MathEx.UFraction32[] { new MathEx.UFraction32 (d), new MathEx.UFraction32 (m), new MathEx.UFraction32 (s) })); - } - #endregion + #region ExifProperty Collection Setters + /// + /// Sets the with the specified key. + /// + /// The tag to set. + /// The value of tag. + public void Set (ExifTag key, byte value) + { + if (items.ContainsKey (key)) + items.Remove (key); + items.Add (key, new ExifByte (key, value)); + } + /// + /// Sets the with the specified key. + /// + /// The tag to set. + /// The value of tag. + public void Set (ExifTag key, string value) + { + if (items.ContainsKey (key)) + items.Remove (key); + if (key == ExifTag.WindowsTitle || key == ExifTag.WindowsComment || key == ExifTag.WindowsAuthor || key == ExifTag.WindowsKeywords || key == ExifTag.WindowsSubject) { + items.Add (key, new WindowsByteString (key, value)); + } else { + items.Add (key, new ExifAscii (key, value, parent.Encoding)); + } + } + /// + /// Sets the with the specified key. + /// + /// The tag to set. + /// The value of tag. + public void Set (ExifTag key, ushort value) + { + if (items.ContainsKey (key)) + items.Remove (key); + items.Add (key, new ExifUShort (key, value)); + } + /// + /// Sets the with the specified key. + /// + /// The tag to set. + /// The value of tag. + public void Set (ExifTag key, int value) + { + if (items.ContainsKey (key)) + items.Remove (key); + items.Add (key, new ExifSInt (key, value)); + } + /// + /// Sets the with the specified key. + /// + /// The tag to set. + /// The value of tag. + public void Set (ExifTag key, uint value) + { + if (items.ContainsKey (key)) + items.Remove (key); + items.Add (key, new ExifUInt (key, value)); + } + /// + /// Sets the with the specified key. + /// + /// The tag to set. + /// The value of tag. + public void Set (ExifTag key, float value) + { + if (items.ContainsKey (key)) + items.Remove (key); + items.Add (key, new ExifURational (key, new MathEx.UFraction32 (value))); + } + /// + /// Sets the with the specified key. + /// + /// The tag to set. + /// The value of tag. + public void Set (ExifTag key, double value) + { + if (items.ContainsKey (key)) + items.Remove (key); + items.Add (key, new ExifURational (key, new MathEx.UFraction32 (value))); + } + /// + /// Sets the with the specified key. + /// + /// The tag to set. + /// The value of tag. + public void Set (ExifTag key, object value) + { + Type type = value.GetType (); + if (type.IsEnum) { + Type etype = typeof(ExifEnumProperty<>).MakeGenericType (new Type[] { type }); + object prop = Activator.CreateInstance (etype, new object[] { key, value }); + if (items.ContainsKey (key)) + items.Remove (key); + items.Add (key, (ExifProperty)prop); + } else + throw new ArgumentException ("No exif property exists for this tag.", "value"); + } + /// + /// Sets the with the specified key. + /// + /// The tag to set. + /// The value of tag. + /// String encoding. + public void Set (ExifTag key, string value, Encoding encoding) + { + if (items.ContainsKey (key)) + items.Remove (key); + items.Add (key, new ExifEncodedString (key, value, encoding)); + } + /// + /// Sets the with the specified key. + /// + /// The tag to set. + /// The value of tag. + public void Set (ExifTag key, DateTime value) + { + if (items.ContainsKey (key)) + items.Remove (key); + items.Add (key, new ExifDateTime (key, value)); + } + /// + /// Sets the with the specified key. + /// + /// The tag to set. + /// Angular degrees (or clock hours for a timestamp). + /// Angular minutes (or clock minutes for a timestamp). + /// Angular seconds (or clock seconds for a timestamp). + public void Set (ExifTag key, float d, float m, float s) + { + if (items.ContainsKey (key)) + items.Remove (key); + items.Add (key, new ExifURationalArray (key, new MathEx.UFraction32[] { new MathEx.UFraction32 (d), new MathEx.UFraction32 (m), new MathEx.UFraction32 (s) })); + } + #endregion - #region Instance Methods - /// - /// Adds the specified item to the collection. - /// - /// The to add to the collection. - public void Add (ExifProperty item) - { - ExifProperty oldItem = null; - if (items.TryGetValue (item.Tag, out oldItem)) - items[item.Tag] = item; - else - items.Add (item.Tag, item); - } - /// - /// Removes all items from the collection. - /// - public void Clear () - { - items.Clear (); - } - /// - /// Determines whether the collection contains an element with the specified key. - /// - /// The key to locate in the collection. - /// - /// true if the collection contains an element with the key; otherwise, false. - /// - /// - /// is null. - public bool ContainsKey (ExifTag key) - { - return items.ContainsKey (key); - } - /// - /// Removes the element with the specified key from the collection. - /// - /// The key of the element to remove. - /// - /// true if the element is successfully removed; otherwise, false. This method also returns false if was not found in the original collection. - /// - /// - /// is null. - public bool Remove (ExifTag key) - { - return items.Remove (key); - } - /// - /// Removes all items with the given IFD from the collection. - /// - /// The IFD section to remove. - public void Remove (IFD ifd) - { - List toRemove = new List (); - foreach (KeyValuePair item in items) { - if (item.Value.IFD == ifd) - toRemove.Add (item.Key); - } - foreach (ExifTag tag in toRemove) - items.Remove (tag); - } - /// - /// Gets the value associated with the specified key. - /// - /// The key whose 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. - /// - /// true if the collection contains an element with the specified key; otherwise, false. - /// - /// - /// is null. - public bool TryGetValue (ExifTag key, out ExifProperty value) - { - return items.TryGetValue (key, out value); - } - /// - /// Returns an enumerator that iterates through a collection. - /// - /// - /// An object that can be used to iterate through the collection. - /// - public IEnumerator GetEnumerator () - { - return Values.GetEnumerator (); - } - #endregion + #region Instance Methods + /// + /// Adds the specified item to the collection. + /// + /// The to add to the collection. + public void Add (ExifProperty item) + { + ExifProperty oldItem = null; + if (items.TryGetValue (item.Tag, out oldItem)) + items[item.Tag] = item; + else + items.Add (item.Tag, item); + } + /// + /// Removes all items from the collection. + /// + public void Clear () + { + items.Clear (); + } + /// + /// Determines whether the collection contains an element with the specified key. + /// + /// The key to locate in the collection. + /// + /// true if the collection contains an element with the key; otherwise, false. + /// + /// + /// is null. + public bool ContainsKey (ExifTag key) + { + return items.ContainsKey (key); + } + /// + /// Removes the element with the specified key from the collection. + /// + /// The key of the element to remove. + /// + /// true if the element is successfully removed; otherwise, false. This method also returns false if was not found in the original collection. + /// + /// + /// is null. + public bool Remove (ExifTag key) + { + return items.Remove (key); + } + /// + /// Removes all items with the given IFD from the collection. + /// + /// The IFD section to remove. + public void Remove (IFD ifd) + { + List toRemove = new List (); + foreach (KeyValuePair item in items) { + if (item.Value.IFD == ifd) + toRemove.Add (item.Key); + } + foreach (ExifTag tag in toRemove) + items.Remove (tag); + } + /// + /// Gets the value associated with the specified key. + /// + /// The key whose 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. + /// + /// true if the collection contains an element with the specified key; otherwise, false. + /// + /// + /// is null. + public bool TryGetValue (ExifTag key, out ExifProperty value) + { + return items.TryGetValue (key, out value); + } + /// + /// Returns an enumerator that iterates through a collection. + /// + /// + /// An object that can be used to iterate through the collection. + /// + public IEnumerator GetEnumerator () + { + return Values.GetEnumerator (); + } + #endregion - #region Hidden Interface - /// - /// Adds an element with the provided key and value to the . - /// - /// The object to use as the key of the element to add. - /// The object to use as the value of the element to add. - /// - /// is null. - /// An element with the same key already exists in the . - /// The is read-only. - void IDictionary.Add (ExifTag key, ExifProperty value) - { - Add (value); - } - /// - /// Adds an item to the . - /// - /// The object to add to the . - /// The is read-only. - void ICollection>.Add (KeyValuePair item) - { - Add (item.Value); - } - bool ICollection>.Contains (KeyValuePair item) - { - throw new NotSupportedException (); - } - /// - /// 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- is equal to or greater than the length of .-or-The number of elements in the source is greater than the available space from to the end of the destination .-or-Type cannot be cast automatically to the type of the destination . - void ICollection>.CopyTo (KeyValuePair[] array, int arrayIndex) - { - if (array == null) - throw new ArgumentNullException ("array"); - if (arrayIndex < 0) - throw new ArgumentOutOfRangeException ("arrayIndex"); - if (array.Rank > 1) - throw new ArgumentException ("Destination array is multidimensional.", "array"); - if (arrayIndex >= array.Length) - throw new ArgumentException ("arrayIndex is equal to or greater than the length of destination array", "array"); - if (arrayIndex + items.Count > array.Length) - throw new ArgumentException ("There is not enough space in destination array.", "array"); - - int i = 0; - foreach (KeyValuePair item in items) { - if (i >= arrayIndex) { - array[i] = item; - } - i++; - } - } - /// - /// Gets a value indicating whether the is read-only. - /// - /// true if the is read-only; otherwise, false. - bool ICollection>.IsReadOnly { - get { return false; } - } - /// - /// 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. - bool ICollection>.Remove (KeyValuePair item) - { - throw new NotSupportedException (); - } - /// - /// Returns an enumerator that iterates through a collection. - /// - /// - /// An object that can be used to iterate through the collection. - /// - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator () - { - return GetEnumerator (); - } - /// - /// Returns an enumerator that iterates through the collection. - /// - /// - /// A that can be used to iterate through the collection. - /// - IEnumerator> IEnumerable>.GetEnumerator () - { - return items.GetEnumerator (); - } - #endregion - } + #region Hidden Interface + /// + /// Adds an element with the provided key and value to the . + /// + /// The object to use as the key of the element to add. + /// The object to use as the value of the element to add. + /// + /// is null. + /// An element with the same key already exists in the . + /// The is read-only. + void IDictionary.Add (ExifTag key, ExifProperty value) + { + Add (value); + } + /// + /// Adds an item to the . + /// + /// The object to add to the . + /// The is read-only. + void ICollection>.Add (KeyValuePair item) + { + Add (item.Value); + } + bool ICollection>.Contains (KeyValuePair item) + { + throw new NotSupportedException (); + } + /// + /// 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- is equal to or greater than the length of .-or-The number of elements in the source is greater than the available space from to the end of the destination .-or-Type cannot be cast automatically to the type of the destination . + void ICollection>.CopyTo (KeyValuePair[] array, int arrayIndex) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (arrayIndex < 0) + throw new ArgumentOutOfRangeException ("arrayIndex"); + if (array.Rank > 1) + throw new ArgumentException ("Destination array is multidimensional.", "array"); + if (arrayIndex >= array.Length) + throw new ArgumentException ("arrayIndex is equal to or greater than the length of destination array", "array"); + if (arrayIndex + items.Count > array.Length) + throw new ArgumentException ("There is not enough space in destination array.", "array"); + + int i = 0; + foreach (KeyValuePair item in items) { + if (i >= arrayIndex) { + array[i] = item; + } + i++; + } + } + /// + /// Gets a value indicating whether the is read-only. + /// + /// true if the is read-only; otherwise, false. + bool ICollection>.IsReadOnly { + get { return false; } + } + /// + /// 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. + bool ICollection>.Remove (KeyValuePair item) + { + throw new NotSupportedException (); + } + /// + /// Returns an enumerator that iterates through a collection. + /// + /// + /// An object that can be used to iterate through the collection. + /// + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator () + { + return GetEnumerator (); + } + /// + /// Returns an enumerator that iterates through the collection. + /// + /// + /// A that can be used to iterate through the collection. + /// + IEnumerator> IEnumerable>.GetEnumerator () + { + return items.GetEnumerator (); + } + #endregion + } } diff --git a/src/Umbraco.Core/Media/Exif/ExifPropertyFactory.cs b/src/Umbraco.Core/Media/Exif/ExifPropertyFactory.cs index dbcc2c5c1d..69efb809fc 100644 --- a/src/Umbraco.Core/Media/Exif/ExifPropertyFactory.cs +++ b/src/Umbraco.Core/Media/Exif/ExifPropertyFactory.cs @@ -204,7 +204,7 @@ namespace Umbraco.Core.Media.Exif else return new ExifByteArray(etag, value); } - else if (type == 2) // 2 = ASCII An 8-bit byte containing one 7-bit ASCII code. + else if (type == 2) // 2 = ASCII An 8-bit byte containing one 7-bit ASCII code. { return new ExifAscii(etag, ExifBitConverter.ToAscii(value, encoding), encoding); } diff --git a/src/Umbraco.Core/Media/Exif/ExifTag.cs b/src/Umbraco.Core/Media/Exif/ExifTag.cs index 270f884dc7..47facc28b8 100644 --- a/src/Umbraco.Core/Media/Exif/ExifTag.cs +++ b/src/Umbraco.Core/Media/Exif/ExifTag.cs @@ -282,7 +282,7 @@ namespace Umbraco.Core.Media.Exif /// JFXXPalette = IFD.JFXX + 201, /// - /// JFIF thumbnail. The thumbnail will be either a JPEG, + /// JFIF thumbnail. The thumbnail will be either a JPEG, /// a 256 color palette bitmap, or a 24-bit RGB bitmap. /// JFXXThumbnail = IFD.JFXX + 202, diff --git a/src/Umbraco.Core/Media/Exif/ExifTagFactory.cs b/src/Umbraco.Core/Media/Exif/ExifTagFactory.cs index fb8b6ba592..729ce9c345 100644 --- a/src/Umbraco.Core/Media/Exif/ExifTagFactory.cs +++ b/src/Umbraco.Core/Media/Exif/ExifTagFactory.cs @@ -51,7 +51,7 @@ namespace Umbraco.Core.Media.Exif } /// - /// Returns the string representation for the given exif tag including + /// Returns the string representation for the given exif tag including /// IFD section and tag id. /// public static string GetTagLongName(ExifTag tag) diff --git a/src/Umbraco.Core/Media/Exif/ImageFile.cs b/src/Umbraco.Core/Media/Exif/ImageFile.cs index 66350338e9..24eb780c9d 100644 --- a/src/Umbraco.Core/Media/Exif/ImageFile.cs +++ b/src/Umbraco.Core/Media/Exif/ImageFile.cs @@ -5,86 +5,86 @@ using System.Text; namespace Umbraco.Core.Media.Exif { - /// - /// Represents the base class for image files. - /// - [TypeDescriptionProvider(typeof(ExifFileTypeDescriptionProvider))] - internal abstract class ImageFile - { - #region Constructor - /// - /// Initializes a new instance of the class. - /// - protected ImageFile () - { - Format = ImageFileFormat.Unknown; - Properties = new ExifPropertyCollection (this); + /// + /// Represents the base class for image files. + /// + [TypeDescriptionProvider(typeof(ExifFileTypeDescriptionProvider))] + internal abstract class ImageFile + { + #region Constructor + /// + /// Initializes a new instance of the class. + /// + protected ImageFile () + { + Format = ImageFileFormat.Unknown; + Properties = new ExifPropertyCollection (this); Encoding = Encoding.Default; - } - #endregion + } + #endregion - #region Properties - /// - /// Returns the format of the . - /// - public ImageFileFormat Format { get; protected set; } - /// - /// Gets the collection of Exif properties contained in the . - /// - public ExifPropertyCollection Properties { get; private set; } - /// - /// Gets or sets the embedded thumbnail image. - /// - public ImageFile Thumbnail { get; set; } - /// - /// Gets or sets the Exif property with the given key. - /// - /// The Exif tag associated with the Exif property. - public ExifProperty this[ExifTag key] { - get { return Properties[key]; } - set { Properties[key] = value; } - } + #region Properties + /// + /// Returns the format of the . + /// + public ImageFileFormat Format { get; protected set; } + /// + /// Gets the collection of Exif properties contained in the . + /// + public ExifPropertyCollection Properties { get; private set; } + /// + /// Gets or sets the embedded thumbnail image. + /// + public ImageFile Thumbnail { get; set; } + /// + /// Gets or sets the Exif property with the given key. + /// + /// The Exif tag associated with the Exif property. + public ExifProperty this[ExifTag key] { + get { return Properties[key]; } + set { Properties[key] = value; } + } /// /// Gets the encoding used for text metadata when the source encoding is unknown. /// public Encoding Encoding { get; protected set; } - #endregion + #endregion - #region Instance Methods - /// - /// Converts the to a . - /// - /// Returns a containing image data. - public abstract Image ToImage (); + #region Instance Methods + /// + /// Converts the to a . + /// + /// Returns a containing image data. + public abstract Image ToImage (); - /// - /// Saves the to the specified file. - /// - /// A string that contains the name of the file. - public virtual void Save (string filename) - { - using (FileStream stream = new FileStream (filename, FileMode.Create, FileAccess.Write, FileShare.None)) { - Save (stream); - } - } + /// + /// Saves the to the specified file. + /// + /// A string that contains the name of the file. + public virtual void Save (string filename) + { + using (FileStream stream = new FileStream (filename, FileMode.Create, FileAccess.Write, FileShare.None)) { + Save (stream); + } + } - /// - /// Saves the to the specified stream. - /// - /// A to save image data to. - public abstract void Save (Stream stream); - #endregion + /// + /// Saves the to the specified stream. + /// + /// A to save image data to. + public abstract void Save (Stream stream); + #endregion - #region Static Methods - /// - /// Creates an from the specified file. - /// - /// A string that contains the name of the file. - /// The created from the file. - public static ImageFile FromFile (string filename) - { + #region Static Methods + /// + /// Creates an from the specified file. + /// + /// A string that contains the name of the file. + /// The created from the file. + public static ImageFile FromFile (string filename) + { return FromFile(filename, Encoding.Default); - } + } /// /// Creates an from the specified file. @@ -101,40 +101,40 @@ namespace Umbraco.Core.Media.Exif } /// - /// Creates an from the specified data stream. - /// - /// A that contains image data. - /// The created from the file. + /// Creates an from the specified data stream. + /// + /// A that contains image data. + /// The created from the file. public static ImageFile FromStream(Stream stream) { return FromStream(stream, Encoding.Default); } - /// - /// Creates an from the specified data stream. - /// - /// A that contains image data. + /// + /// Creates an from the specified data stream. + /// + /// A that contains image data. /// The encoding to be used for text metadata when the source encoding is unknown. - /// The created from the file. + /// The created from the file. public static ImageFile FromStream(Stream stream, Encoding encoding) - { - stream.Seek (0, SeekOrigin.Begin); - byte[] header = new byte[8]; - stream.Seek (0, SeekOrigin.Begin); - if (stream.Read (header, 0, header.Length) != header.Length) - throw new NotValidImageFileException (); - - // JPEG - if (header[0] == 0xFF && header[1] == 0xD8) - return new JPEGFile (stream, encoding); - - // TIFF - string tiffHeader = Encoding.ASCII.GetString (header, 0, 4); - if (tiffHeader == "MM\x00\x2a" || tiffHeader == "II\x2a\x00") - return new TIFFFile (stream, encoding); - - throw new NotValidImageFileException (); - } - #endregion - } + { + stream.Seek (0, SeekOrigin.Begin); + byte[] header = new byte[8]; + stream.Seek (0, SeekOrigin.Begin); + if (stream.Read (header, 0, header.Length) != header.Length) + throw new NotValidImageFileException (); + + // JPEG + if (header[0] == 0xFF && header[1] == 0xD8) + return new JPEGFile (stream, encoding); + + // TIFF + string tiffHeader = Encoding.ASCII.GetString (header, 0, 4); + if (tiffHeader == "MM\x00\x2a" || tiffHeader == "II\x2a\x00") + return new TIFFFile (stream, encoding); + + throw new NotValidImageFileException (); + } + #endregion + } } diff --git a/src/Umbraco.Core/Media/Exif/JFIFExtendedProperty.cs b/src/Umbraco.Core/Media/Exif/JFIFExtendedProperty.cs index a887b11511..573eedf146 100644 --- a/src/Umbraco.Core/Media/Exif/JFIFExtendedProperty.cs +++ b/src/Umbraco.Core/Media/Exif/JFIFExtendedProperty.cs @@ -3,7 +3,7 @@ namespace Umbraco.Core.Media.Exif { /// - /// Represents the JFIF version as a 16 bit unsigned integer. (EXIF Specification: SHORT) + /// Represents the JFIF version as a 16 bit unsigned integer. (EXIF Specification: SHORT) /// internal class JFIFVersion : ExifUShort { @@ -28,7 +28,7 @@ namespace Umbraco.Core.Media.Exif } } /// - /// Represents a JFIF thumbnail. (EXIF Specification: BYTE) + /// Represents a JFIF thumbnail. (EXIF Specification: BYTE) /// internal class JFIFThumbnailProperty : ExifProperty { diff --git a/src/Umbraco.Core/Media/Exif/JPEGFile.cs b/src/Umbraco.Core/Media/Exif/JPEGFile.cs index 2c1473da76..032668dc0a 100644 --- a/src/Umbraco.Core/Media/Exif/JPEGFile.cs +++ b/src/Umbraco.Core/Media/Exif/JPEGFile.cs @@ -62,7 +62,7 @@ namespace Umbraco.Core.Media.Exif // Search and read sections until we reach the end of file. while (stream.Position != stream.Length) { - // Read the next section marker. Section markers are two bytes + // Read the next section marker. Section markers are two bytes // with values 0xFF, 0x?? where ?? must not be 0x00 or 0xFF. if (stream.Read(markerbytes, 0, 2) != 2 || markerbytes[0] != 0xFF || markerbytes[1] == 0x00 || markerbytes[1] == 0xFF) throw new NotValidJPEGFileException(); @@ -74,7 +74,7 @@ namespace Umbraco.Core.Media.Exif if (marker != JPEGMarker.SOI && marker != JPEGMarker.EOI && !(marker >= JPEGMarker.RST0 && marker <= JPEGMarker.RST7)) { // Length of the header including the length bytes. - // This value is a 16-bit unsigned integer + // This value is a 16-bit unsigned integer // in big endian byte-order. byte[] lengthbytes = new byte[2]; if (stream.Read(lengthbytes, 0, 2) != 2) @@ -194,7 +194,7 @@ namespace Umbraco.Core.Media.Exif // Write sections foreach (JPEGSection section in Sections) { - // Section header (including length bytes and section marker) + // Section header (including length bytes and section marker) // must not exceed 64 kB. if (section.Header.Length + 2 + 2 > 64 * 1024) throw new SectionExceeds64KBException(); diff --git a/src/Umbraco.Core/Media/Exif/JPEGSection.cs b/src/Umbraco.Core/Media/Exif/JPEGSection.cs index 6e6804fb42..5062f05491 100644 --- a/src/Umbraco.Core/Media/Exif/JPEGSection.cs +++ b/src/Umbraco.Core/Media/Exif/JPEGSection.cs @@ -13,7 +13,7 @@ public JPEGMarker Marker { get; private set; } /// /// Section header as a byte array. This is different from the header - /// definition in JPEG specification in that it does not include the + /// definition in JPEG specification in that it does not include the /// two byte section length. /// public byte[] Header { get; set; } diff --git a/src/Umbraco.Core/Media/Exif/MathEx.cs b/src/Umbraco.Core/Media/Exif/MathEx.cs index d07f344476..5364d18d0f 100644 --- a/src/Umbraco.Core/Media/Exif/MathEx.cs +++ b/src/Umbraco.Core/Media/Exif/MathEx.cs @@ -191,7 +191,7 @@ namespace Umbraco.Core.Media.Exif /// s is null /// s is not in the correct format /// - /// s represents a number less than System.UInt32.MinValue or greater than + /// s represents a number less than System.UInt32.MinValue or greater than /// System.UInt32.MaxValue. /// public static Fraction32 Parse(string s) @@ -469,7 +469,7 @@ namespace Umbraco.Core.Media.Exif /// Indicates whether this instance and a specified object are equal value-wise. /// /// Another object to compare to. - /// true if obj and this instance are the same type and represent + /// true if obj and this instance are the same type and represent /// the same value; otherwise, false. public override bool Equals(object obj) { @@ -486,7 +486,7 @@ namespace Umbraco.Core.Media.Exif /// Indicates whether this instance and a specified object are equal value-wise. /// /// Another fraction object to compare to. - /// true if obj and this instance represent the same value; + /// true if obj and this instance represent the same value; /// otherwise, false. public bool Equals(Fraction32 obj) { @@ -507,11 +507,11 @@ namespace Umbraco.Core.Media.Exif /// /// A numeric format string. /// - /// An System.IFormatProvider that supplies culture-specific + /// An System.IFormatProvider that supplies culture-specific /// formatting information. /// /// - /// The string representation of the value of this instance as + /// The string representation of the value of this instance as /// specified by format and provider. /// /// @@ -531,7 +531,7 @@ namespace Umbraco.Core.Media.Exif /// /// A numeric format string. /// - /// The string representation of the value of this instance as + /// The string representation of the value of this instance as /// specified by format. /// /// @@ -550,11 +550,11 @@ namespace Umbraco.Core.Media.Exif /// Returns a string representation of the fraction. /// /// - /// An System.IFormatProvider that supplies culture-specific + /// An System.IFormatProvider that supplies culture-specific /// formatting information. /// /// - /// The string representation of the value of this instance as + /// The string representation of the value of this instance as /// specified by provider. /// public string ToString(IFormatProvider formatProvider) @@ -587,7 +587,7 @@ namespace Umbraco.Core.Media.Exif /// /// A signed number indicating the relative values of this instance and value. /// Less than zero: This instance is less than obj. - /// Zero: This instance is equal to obj. + /// Zero: This instance is equal to obj. /// Greater than zero: This instance is greater than obj or obj is null. /// /// obj is not a Fraction. @@ -607,7 +607,7 @@ namespace Umbraco.Core.Media.Exif /// /// A signed number indicating the relative values of this instance and value. /// Less than zero: This instance is less than obj. - /// Zero: This instance is equal to obj. + /// Zero: This instance is equal to obj. /// Greater than zero: This instance is greater than obj or obj is null. /// public int CompareTo(Fraction32 obj) @@ -686,7 +686,7 @@ namespace Umbraco.Core.Media.Exif /// s is null. /// s is not formatted as numerator/denominator. /// - /// s represents numbers less than System.Int32.MinValue or greater than + /// s represents numbers less than System.Int32.MinValue or greater than /// System.Int32.MaxValue. /// private static Fraction32 FromString(string s) @@ -833,7 +833,7 @@ namespace Umbraco.Core.Media.Exif /// s is null /// s is not in the correct format /// - /// s represents a number less than System.UInt32.MinValue or greater than + /// s represents a number less than System.UInt32.MinValue or greater than /// System.UInt32.MaxValue. /// public static UFraction32 Parse(string s) @@ -1097,7 +1097,7 @@ namespace Umbraco.Core.Media.Exif /// Indicates whether this instance and a specified object are equal value-wise. /// /// Another object to compare to. - /// true if obj and this instance are the same type and represent + /// true if obj and this instance are the same type and represent /// the same value; otherwise, false. public override bool Equals(object obj) { @@ -1114,7 +1114,7 @@ namespace Umbraco.Core.Media.Exif /// Indicates whether this instance and a specified object are equal value-wise. /// /// Another fraction object to compare to. - /// true if obj and this instance represent the same value; + /// true if obj and this instance represent the same value; /// otherwise, false. public bool Equals(UFraction32 obj) { @@ -1135,11 +1135,11 @@ namespace Umbraco.Core.Media.Exif /// /// A numeric format string. /// - /// An System.IFormatProvider that supplies culture-specific + /// An System.IFormatProvider that supplies culture-specific /// formatting information. /// /// - /// The string representation of the value of this instance as + /// The string representation of the value of this instance as /// specified by format and provider. /// /// @@ -1159,7 +1159,7 @@ namespace Umbraco.Core.Media.Exif /// /// A numeric format string. /// - /// The string representation of the value of this instance as + /// The string representation of the value of this instance as /// specified by format. /// /// @@ -1178,11 +1178,11 @@ namespace Umbraco.Core.Media.Exif /// Returns a string representation of the fraction. /// /// - /// An System.IFormatProvider that supplies culture-specific + /// An System.IFormatProvider that supplies culture-specific /// formatting information. /// /// - /// The string representation of the value of this instance as + /// The string representation of the value of this instance as /// specified by provider. /// public string ToString(IFormatProvider formatProvider) @@ -1215,7 +1215,7 @@ namespace Umbraco.Core.Media.Exif /// /// A signed number indicating the relative values of this instance and value. /// Less than zero: This instance is less than obj. - /// Zero: This instance is equal to obj. + /// Zero: This instance is equal to obj. /// Greater than zero: This instance is greater than obj or obj is null. /// /// obj is not a Fraction. @@ -1235,7 +1235,7 @@ namespace Umbraco.Core.Media.Exif /// /// A signed number indicating the relative values of this instance and value. /// Less than zero: This instance is less than obj. - /// Zero: This instance is equal to obj. + /// Zero: This instance is equal to obj. /// Greater than zero: This instance is greater than obj or obj is null. /// public int CompareTo(UFraction32 obj) @@ -1314,7 +1314,7 @@ namespace Umbraco.Core.Media.Exif /// s is null. /// s is not formatted as numerator/denominator. /// - /// s represents numbers less than System.UInt32.MinValue or greater than + /// s represents numbers less than System.UInt32.MinValue or greater than /// System.UInt32.MaxValue. /// private static UFraction32 FromString(string s) diff --git a/src/Umbraco.Core/Media/Exif/TIFFHeader.cs b/src/Umbraco.Core/Media/Exif/TIFFHeader.cs index 82959900be..89b0c02c2e 100644 --- a/src/Umbraco.Core/Media/Exif/TIFFHeader.cs +++ b/src/Umbraco.Core/Media/Exif/TIFFHeader.cs @@ -14,7 +14,7 @@ /// public byte ID; /// - /// The offset to the first IFD section from the + /// The offset to the first IFD section from the /// start of the TIFF header. /// public uint IFDOffset; @@ -28,7 +28,7 @@ /// /// The byte order. /// The TIFF ID. This value should always be 42. - /// The offset to the first IFD section from the + /// The offset to the first IFD section from the /// start of the TIFF header. /// The byte order of the TIFF header itself. public TIFFHeader(BitConverterEx.ByteOrder byteOrder, byte id, uint ifdOffset, BitConverterEx.ByteOrder headerByteOrder) diff --git a/src/Umbraco.Core/Media/IEmbedProvider.cs b/src/Umbraco.Core/Media/IEmbedProvider.cs index 73232d4637..3a95f2c58b 100644 --- a/src/Umbraco.Core/Media/IEmbedProvider.cs +++ b/src/Umbraco.Core/Media/IEmbedProvider.cs @@ -6,4 +6,4 @@ string GetMarkup(string url, int maxWidth = 0, int maxHeight = 0); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Media/IEmbedSettingProvider.cs b/src/Umbraco.Core/Media/IEmbedSettingProvider.cs index ab1979184b..18377fd6da 100644 --- a/src/Umbraco.Core/Media/IEmbedSettingProvider.cs +++ b/src/Umbraco.Core/Media/IEmbedSettingProvider.cs @@ -3,7 +3,7 @@ namespace Umbraco.Core.Media { public interface IEmbedSettingProvider - { + { object GetSetting(XmlNode settingNode); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Media/IImageUrlProvider.cs b/src/Umbraco.Core/Media/IImageUrlProvider.cs index f5e62baae9..4a51edd412 100644 --- a/src/Umbraco.Core/Media/IImageUrlProvider.cs +++ b/src/Umbraco.Core/Media/IImageUrlProvider.cs @@ -14,4 +14,4 @@ namespace Umbraco.Core.Media string GetImageUrlFromMedia(int mediaId, IDictionary parameters); string GetImageUrlFromFileName(string specifiedSrc, IDictionary parameters); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Media/IThumbnailProvider.cs b/src/Umbraco.Core/Media/IThumbnailProvider.cs index 0a9192b251..1e5a59bb39 100644 --- a/src/Umbraco.Core/Media/IThumbnailProvider.cs +++ b/src/Umbraco.Core/Media/IThumbnailProvider.cs @@ -7,7 +7,7 @@ namespace Umbraco.Core.Media // to a complete scan. [Obsolete("Thumbnails are generated by ImageProcessor, use that instead")] - public interface IThumbnailProvider // : IDiscoverable + public interface IThumbnailProvider // : IDiscoverable { bool CanProvideThumbnail(string fileUrl); string GetThumbnailUrl(string fileUrl); diff --git a/src/Umbraco.Core/Media/ProviderSetting.cs b/src/Umbraco.Core/Media/ProviderSetting.cs index bfd06203d4..d26ad6e616 100644 --- a/src/Umbraco.Core/Media/ProviderSetting.cs +++ b/src/Umbraco.Core/Media/ProviderSetting.cs @@ -5,4 +5,4 @@ namespace Umbraco.Core.Media public class ProviderSetting : Attribute { } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Media/Result.cs b/src/Umbraco.Core/Media/Result.cs index e8e3c6995c..ee86c02ea5 100644 --- a/src/Umbraco.Core/Media/Result.cs +++ b/src/Umbraco.Core/Media/Result.cs @@ -8,4 +8,4 @@ public bool SupportsDimensions { get; set; } public string Markup { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Media/Status.cs b/src/Umbraco.Core/Media/Status.cs index c0f448156e..5a815c3cf8 100644 --- a/src/Umbraco.Core/Media/Status.cs +++ b/src/Umbraco.Core/Media/Status.cs @@ -8,4 +8,4 @@ Error, Success } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/ApplicationTree.cs b/src/Umbraco.Core/Models/ApplicationTree.cs index b44db46795..53873b8b90 100644 --- a/src/Umbraco.Core/Models/ApplicationTree.cs +++ b/src/Umbraco.Core/Models/ApplicationTree.cs @@ -138,4 +138,4 @@ namespace Umbraco.Core.Models } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/AuditItem.cs b/src/Umbraco.Core/Models/AuditItem.cs index 7aff3a4f68..cd885724d0 100644 --- a/src/Umbraco.Core/Models/AuditItem.cs +++ b/src/Umbraco.Core/Models/AuditItem.cs @@ -16,4 +16,4 @@ namespace Umbraco.Core.Models public AuditType AuditType { get; private set; } public int UserId { get; private set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/AuditType.cs b/src/Umbraco.Core/Models/AuditType.cs index 7174bd28a2..da2c8e5d8e 100644 --- a/src/Umbraco.Core/Models/AuditType.cs +++ b/src/Umbraco.Core/Models/AuditType.cs @@ -82,4 +82,4 @@ /// Custom } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Content.cs b/src/Umbraco.Core/Models/Content.cs index f7ca42f2e3..94b102287e 100644 --- a/src/Umbraco.Core/Models/Content.cs +++ b/src/Umbraco.Core/Models/Content.cs @@ -30,8 +30,8 @@ namespace Umbraco.Core.Models /// Parent object /// ContentType for the current Content object public Content(string name, IContent parent, IContentType contentType) - : this(name, parent, contentType, new PropertyCollection()) - { } + : this(name, parent, contentType, new PropertyCollection()) + { } /// /// Constructor for creating a Content object @@ -40,12 +40,12 @@ namespace Umbraco.Core.Models /// Parent object /// ContentType for the current Content object /// Collection of properties - public Content(string name, IContent parent, IContentType contentType, PropertyCollection properties) - : base(name, parent, contentType, properties) - { - _contentType = contentType ?? throw new ArgumentNullException(nameof(contentType)); + public Content(string name, IContent parent, IContentType contentType, PropertyCollection properties) + : base(name, parent, contentType, properties) + { + _contentType = contentType ?? throw new ArgumentNullException(nameof(contentType)); PublishedState = PublishedState.Unpublished; - } + } /// /// Constructor for creating a Content object @@ -64,8 +64,8 @@ namespace Umbraco.Core.Models /// Id of the Parent content /// ContentType for the current Content object /// Collection of properties - public Content(string name, int parentId, IContentType contentType, PropertyCollection properties) - : base(name, parentId, contentType, properties) + public Content(string name, int parentId, IContentType contentType, PropertyCollection properties) + : base(name, parentId, contentType, properties) { _contentType = contentType ?? throw new ArgumentNullException(nameof(contentType)); PublishedState = PublishedState.Unpublished; @@ -90,7 +90,7 @@ namespace Umbraco.Core.Models /// This is used to override the default one from the ContentType. /// /// - /// If no template is explicitly set on the Content object, + /// If no template is explicitly set on the Content object, /// the Default template from the ContentType will be returned. /// [DataMember] @@ -362,4 +362,4 @@ namespace Umbraco.Core.Models } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/ContentBase.cs b/src/Umbraco.Core/Models/ContentBase.cs index 71c8e6af21..54540b6e08 100644 --- a/src/Umbraco.Core/Models/ContentBase.cs +++ b/src/Umbraco.Core/Models/ContentBase.cs @@ -64,19 +64,19 @@ namespace Umbraco.Core.Models /// /// protected ContentBase(string name, IContentBase parent, IContentTypeComposition contentType, PropertyCollection properties) - { - if (parent == null) throw new ArgumentNullException(nameof(parent)); + { + if (parent == null) throw new ArgumentNullException(nameof(parent)); - ContentTypeBase = contentType ?? throw new ArgumentNullException(nameof(contentType)); + ContentTypeBase = contentType ?? throw new ArgumentNullException(nameof(contentType)); Version = Guid.NewGuid(); - _parentId = new Lazy(() => parent.Id); + _parentId = new Lazy(() => parent.Id); _name = name; - _contentTypeId = contentType.Id; - _properties = properties ?? throw new ArgumentNullException(nameof(properties)); - _properties.EnsurePropertyTypes(PropertyTypes); + _contentTypeId = contentType.Id; + _properties = properties ?? throw new ArgumentNullException(nameof(properties)); + _properties.EnsurePropertyTypes(PropertyTypes); _additionalData = new Dictionary(); - } + } private static readonly Lazy Ps = new Lazy(); @@ -106,12 +106,12 @@ namespace Umbraco.Core.Models { get { - var val = _parentId.Value; - if (val == 0) - { - throw new InvalidOperationException("The ParentId cannot have a value of 0. Perhaps the parent object used to instantiate this object has not been persisted to the data store."); - } - return val; + var val = _parentId.Value; + if (val == 0) + { + throw new InvalidOperationException("The ParentId cannot have a value of 0. Perhaps the parent object used to instantiate this object has not been persisted to the data store."); + } + return val; } set { @@ -547,4 +547,4 @@ namespace Umbraco.Core.Models #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/ContentExtensions.cs b/src/Umbraco.Core/Models/ContentExtensions.cs index 0a78259f8d..ec57aaffc9 100644 --- a/src/Umbraco.Core/Models/ContentExtensions.cs +++ b/src/Umbraco.Core/Models/ContentExtensions.cs @@ -906,4 +906,4 @@ namespace Umbraco.Core.Models #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/ContentPreviewEntity.cs b/src/Umbraco.Core/Models/ContentPreviewEntity.cs index 2f843cf2a7..0ae4f4d3f6 100644 --- a/src/Umbraco.Core/Models/ContentPreviewEntity.cs +++ b/src/Umbraco.Core/Models/ContentPreviewEntity.cs @@ -7,7 +7,7 @@ namespace Umbraco.Core.Models /// Used content repository in order to add an entity to the persisted collection to be saved /// in a single transaction during saving an entity /// - internal class ContentPreviewEntity : ContentXmlEntity + internal class ContentPreviewEntity : ContentXmlEntity where TContent : IContentBase { public ContentPreviewEntity(TContent content, Func xml) @@ -20,4 +20,4 @@ namespace Umbraco.Core.Models get { return Content.Version; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/ContentStatus.cs b/src/Umbraco.Core/Models/ContentStatus.cs index 926a0fbc58..b31bf24f82 100644 --- a/src/Umbraco.Core/Models/ContentStatus.cs +++ b/src/Umbraco.Core/Models/ContentStatus.cs @@ -21,4 +21,4 @@ namespace Umbraco.Core.Models [EnumMember] AwaitingRelease } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/ContentType.cs b/src/Umbraco.Core/Models/ContentType.cs index 8590fc66d4..c831236fde 100644 --- a/src/Umbraco.Core/Models/ContentType.cs +++ b/src/Umbraco.Core/Models/ContentType.cs @@ -59,7 +59,7 @@ namespace Umbraco.Core.Models /// /// Gets or sets the alias of the default Template. /// TODO: This should be ignored from cloning!!!!!!!!!!!!!! - /// - but to do that we have to implement callback hacks, this needs to be fixed in v8, + /// - but to do that we have to implement callback hacks, this needs to be fixed in v8, /// we should not store direct entity /// [IgnoreDataMember] @@ -81,7 +81,7 @@ namespace Umbraco.Core.Models /// /// Gets or Sets a list of Templates which are allowed for the ContentType /// TODO: This should be ignored from cloning!!!!!!!!!!!!!! - /// - but to do that we have to implement callback hacks, this needs to be fixed in v8, + /// - but to do that we have to implement callback hacks, this needs to be fixed in v8, /// we should not store direct entity /// [DataMember] @@ -147,4 +147,4 @@ namespace Umbraco.Core.Models return DeepCloneWithResetIdentities(alias); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/ContentTypeAvailableCompositionsResult.cs b/src/Umbraco.Core/Models/ContentTypeAvailableCompositionsResult.cs index b1d2b45dc5..52214a9b38 100644 --- a/src/Umbraco.Core/Models/ContentTypeAvailableCompositionsResult.cs +++ b/src/Umbraco.Core/Models/ContentTypeAvailableCompositionsResult.cs @@ -1,4 +1,4 @@ -namespace Umbraco.Core.Models +namespace Umbraco.Core.Models { /// /// Used when determining available compositions for a given content type @@ -14,4 +14,4 @@ namespace Umbraco.Core.Models public IContentTypeComposition Composition { get; private set; } public bool Allowed { get; private set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/ContentTypeAvailableCompositionsResults.cs b/src/Umbraco.Core/Models/ContentTypeAvailableCompositionsResults.cs index 653d7a10a9..b4e038c14c 100644 --- a/src/Umbraco.Core/Models/ContentTypeAvailableCompositionsResults.cs +++ b/src/Umbraco.Core/Models/ContentTypeAvailableCompositionsResults.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; namespace Umbraco.Core.Models @@ -23,4 +23,4 @@ namespace Umbraco.Core.Models public IEnumerable Ancestors { get; private set; } public IEnumerable Results { get; private set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/ContentTypeBase.cs b/src/Umbraco.Core/Models/ContentTypeBase.cs index 9361dc40f3..e3d66e72ad 100644 --- a/src/Umbraco.Core/Models/ContentTypeBase.cs +++ b/src/Umbraco.Core/Models/ContentTypeBase.cs @@ -50,9 +50,9 @@ namespace Umbraco.Core.Models _additionalData = new Dictionary(); } - protected ContentTypeBase(IContentTypeBase parent) : this(parent, null) - { - } + protected ContentTypeBase(IContentTypeBase parent) : this(parent, null) + { + } protected ContentTypeBase(IContentTypeBase parent, string alias) { @@ -110,12 +110,12 @@ namespace Umbraco.Core.Models { get { - var val = _parentId.Value; - if (val == 0) - { - throw new InvalidOperationException("The ParentId cannot be a value of 0. Perhaps the parent object used to instantiate this object has not been persisted to the data store."); - } - return val; + var val = _parentId.Value; + if (val == 0) + { + throw new InvalidOperationException("The ParentId cannot be a value of 0. Perhaps the parent object used to instantiate this object has not been persisted to the data store."); + } + return val; } set { @@ -164,8 +164,8 @@ namespace Umbraco.Core.Models set { SetPropertyValueAndDetectChanges( - value.ToCleanString(CleanStringType.Alias | CleanStringType.UmbracoCase), - ref _alias, + value.ToCleanString(CleanStringType.Alias | CleanStringType.UmbracoCase), + ref _alias, Ps.Value.AliasSelector); } } @@ -277,7 +277,7 @@ namespace Umbraco.Core.Models //Custom comparer for enumerable new DelegateEqualityComparer>( (sorts, enumerable) => sorts.UnsortedSequenceEqual(enumerable), - sorts => sorts.GetHashCode())); + sorts => sorts.GetHashCode())); } } @@ -330,7 +330,7 @@ namespace Umbraco.Core.Models /// A boolean flag indicating if a property type has been removed from this instance. /// /// - /// This is currently (specifically) used in order to know that we need to refresh the content cache which + /// This is currently (specifically) used in order to know that we need to refresh the content cache which /// needs to occur when a property has been removed from a content type /// [IgnoreDataMember] @@ -376,7 +376,7 @@ namespace Umbraco.Core.Models { if (PropertyTypeExists(propertyType.Alias) == false) { - _propertyTypes.Add(propertyType); + _propertyTypes.Add(propertyType); return true; } @@ -389,7 +389,7 @@ namespace Umbraco.Core.Models /// Alias of the PropertyType to move /// Name of the PropertyGroup to move the PropertyType to /// - /// If is null then the property is moved back to + /// If is null then the property is moved back to /// "generic properties" ie does not have a tab anymore. public bool MovePropertyType(string propertyTypeAlias, string propertyGroupName) { @@ -406,7 +406,7 @@ namespace Umbraco.Core.Models if (propertyGroupName != null && newPropertyGroup == null) return false; // get old group - var oldPropertyGroup = PropertyGroups.FirstOrDefault(x => + var oldPropertyGroup = PropertyGroups.FirstOrDefault(x => x.PropertyTypes.Any(y => y.Alias == propertyTypeAlias)); // set new group @@ -442,7 +442,7 @@ namespace Umbraco.Core.Models if (_propertyTypes.Any(x => x.Alias == propertyTypeAlias)) { - _propertyTypes.RemoveItem(propertyTypeAlias); + _propertyTypes.RemoveItem(propertyTypeAlias); } } @@ -552,7 +552,7 @@ namespace Umbraco.Core.Models //turn off change tracking clone.DisableChangeTracking(); //need to manually wire up the event handlers for the property type collections - we've ensured - // its ignored from the auto-clone process because its return values are unions, not raw and + // its ignored from the auto-clone process because its return values are unions, not raw and // we end up with duplicates, see: http://issues.umbraco.org/issue/U4-4842 clone._propertyTypes = (PropertyTypeCollection)_propertyTypes.DeepClone(); @@ -586,4 +586,4 @@ namespace Umbraco.Core.Models return clone; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/ContentTypeCompositionBase.cs b/src/Umbraco.Core/Models/ContentTypeCompositionBase.cs index e53011cc51..0e69d0a719 100644 --- a/src/Umbraco.Core/Models/ContentTypeCompositionBase.cs +++ b/src/Umbraco.Core/Models/ContentTypeCompositionBase.cs @@ -233,7 +233,7 @@ namespace Umbraco.Core.Models } /// - /// Gets a list of ContentType aliases from the current composition + /// Gets a list of ContentType aliases from the current composition /// /// An enumerable list of string aliases /// Does not contain the alias of the Current ContentType @@ -245,7 +245,7 @@ namespace Umbraco.Core.Models } /// - /// Gets a list of ContentType Ids from the current composition + /// Gets a list of ContentType Ids from the current composition /// /// An enumerable list of integer ids /// Does not contain the Id of the Current ContentType @@ -272,4 +272,4 @@ namespace Umbraco.Core.Models return clone; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/ContentTypeSort.cs b/src/Umbraco.Core/Models/ContentTypeSort.cs index 40d0522b52..92984c2fad 100644 --- a/src/Umbraco.Core/Models/ContentTypeSort.cs +++ b/src/Umbraco.Core/Models/ContentTypeSort.cs @@ -55,7 +55,7 @@ namespace Umbraco.Core.Models protected bool Equals(ContentTypeSort other) { - return Id.Value.Equals(other.Id.Value) && string.Equals(Alias, other.Alias); + return Id.Value.Equals(other.Id.Value) && string.Equals(Alias, other.Alias); } public override bool Equals(object obj) @@ -77,4 +77,4 @@ namespace Umbraco.Core.Models } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/ContentXmlEntity.cs b/src/Umbraco.Core/Models/ContentXmlEntity.cs index 930ea47900..3dc9e93528 100644 --- a/src/Umbraco.Core/Models/ContentXmlEntity.cs +++ b/src/Umbraco.Core/Models/ContentXmlEntity.cs @@ -16,7 +16,7 @@ namespace Umbraco.Core.Models public ContentXmlEntity(TContent content, Func xml) { if (content == null) throw new ArgumentNullException("content"); - _xml = xml; + _xml = xml; Content = content; } @@ -45,13 +45,13 @@ namespace Umbraco.Core.Models public DateTime? DeletedDate { get; set; } /// - /// Special case, always return false, this will cause the repositories managing - /// this object to always do an 'insert' but these are special repositories that + /// Special case, always return false, this will cause the repositories managing + /// this object to always do an 'insert' but these are special repositories that /// do an InsertOrUpdate on insert since the data for this needs to be managed this way - /// + /// public bool HasIdentity { - get { return false; } + get { return false; } } public object DeepClone() @@ -62,4 +62,4 @@ namespace Umbraco.Core.Models return clone; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/DataTypeDatabaseType.cs b/src/Umbraco.Core/Models/DataTypeDatabaseType.cs index 2fccdc0645..39af53371e 100644 --- a/src/Umbraco.Core/Models/DataTypeDatabaseType.cs +++ b/src/Umbraco.Core/Models/DataTypeDatabaseType.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Runtime.Serialization; namespace Umbraco.Core.Models @@ -21,4 +21,4 @@ namespace Umbraco.Core.Models [EnumMember] Decimal } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/DataTypeDefinition.cs b/src/Umbraco.Core/Models/DataTypeDefinition.cs index bd2cf268da..eac6a7d5fd 100644 --- a/src/Umbraco.Core/Models/DataTypeDefinition.cs +++ b/src/Umbraco.Core/Models/DataTypeDefinition.cs @@ -15,7 +15,7 @@ namespace Umbraco.Core.Models /// Definition of a DataType/PropertyEditor /// /// - /// The definition exists as a database reference between an actual DataType/PropertyEditor + /// The definition exists as a database reference between an actual DataType/PropertyEditor /// (identified by its control id), its prevalues (configuration) and the named DataType in the backoffice UI. /// [Serializable] @@ -141,7 +141,7 @@ namespace Umbraco.Core.Models _additionalData["Trashed"] = value; } } - + [DataMember] public string PropertyEditorAlias { @@ -161,9 +161,9 @@ namespace Umbraco.Core.Models public DataTypeDatabaseType DatabaseType { get { return _databaseType; } - set + set { - SetPropertyValueAndDetectChanges(value, ref _databaseType, Ps.Value.DatabaseTypeSelector); + SetPropertyValueAndDetectChanges(value, ref _databaseType, Ps.Value.DatabaseTypeSelector); //This is a custom property that is not exposed in IUmbracoEntity so add it to the additional data _additionalData["DatabaseType"] = value; } diff --git a/src/Umbraco.Core/Models/DeepCloneHelper.cs b/src/Umbraco.Core/Models/DeepCloneHelper.cs index 2e930b1eac..44a714c2c1 100644 --- a/src/Umbraco.Core/Models/DeepCloneHelper.cs +++ b/src/Umbraco.Core/Models/DeepCloneHelper.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.Collections.Concurrent; using System.Collections.Generic; @@ -23,7 +23,7 @@ namespace Umbraco.Core.Models public PropertyInfo PropertyInfo { get; private set; } public bool IsDeepCloneable { get; set; } - public Type GenericListType { get; set; } + public Type GenericListType { get; set; } public bool IsList { get { return GenericListType != null; } @@ -40,7 +40,7 @@ namespace Umbraco.Core.Models /// /// /// - /// + /// public static void DeepCloneRefProperties(IDeepCloneable input, IDeepCloneable output) { var inputType = input.GetType(); @@ -68,7 +68,7 @@ namespace Umbraco.Core.Models { return null; } - + if (TypeHelper.IsTypeAssignableFrom(propertyInfo.PropertyType)) { @@ -157,7 +157,7 @@ namespace Umbraco.Core.Models } else if (o is string || o.GetType().IsValueType) { - //check if the item is a value type or a string, then we can just use it + //check if the item is a value type or a string, then we can just use it newList.Add(o); } else @@ -197,4 +197,4 @@ namespace Umbraco.Core.Models } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/DictionaryItem.cs b/src/Umbraco.Core/Models/DictionaryItem.cs index 42b047e35b..9e2b20eede 100644 --- a/src/Umbraco.Core/Models/DictionaryItem.cs +++ b/src/Umbraco.Core/Models/DictionaryItem.cs @@ -82,8 +82,8 @@ namespace Umbraco.Core.Models //Custom comparer for enumerable new DelegateEqualityComparer>( (enumerable, translations) => enumerable.UnsortedSequenceEqual(translations), - enumerable => enumerable.GetHashCode())); + enumerable => enumerable.GetHashCode())); } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/DictionaryItemExtensions.cs b/src/Umbraco.Core/Models/DictionaryItemExtensions.cs index 71bb663d2e..edcf15dd88 100644 --- a/src/Umbraco.Core/Models/DictionaryItemExtensions.cs +++ b/src/Umbraco.Core/Models/DictionaryItemExtensions.cs @@ -27,4 +27,4 @@ namespace Umbraco.Core.Models return defaultTranslation == null ? string.Empty : defaultTranslation.Value; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/DictionaryTranslation.cs b/src/Umbraco.Core/Models/DictionaryTranslation.cs index 4e5b1c2437..ebb24e3992 100644 --- a/src/Umbraco.Core/Models/DictionaryTranslation.cs +++ b/src/Umbraco.Core/Models/DictionaryTranslation.cs @@ -19,7 +19,7 @@ namespace Umbraco.Core.Models private string _value; //note: this will be memberwise cloned private int _languageId; - + public DictionaryTranslation(ILanguage language, string value) { if (language == null) throw new ArgumentNullException("language"); @@ -38,13 +38,13 @@ namespace Umbraco.Core.Models } internal DictionaryTranslation(int languageId, string value) - { + { _languageId = languageId; _value = value; } internal DictionaryTranslation(int languageId, string value, Guid uniqueId) - { + { _languageId = languageId; _value = value; Key = uniqueId; @@ -65,7 +65,7 @@ namespace Umbraco.Core.Models /// Marked as DoNotClone - TODO: this member shouldn't really exist here in the first place, the DictionaryItem /// class will have a deep hierarchy of objects which all get deep cloned which we don't want. This should have simply /// just referenced a language ID not the actual language object. In v8 we need to fix this. - /// We're going to have to do the same hacky stuff we had to do with the Template/File contents so that this is returned + /// We're going to have to do the same hacky stuff we had to do with the Template/File contents so that this is returned /// on a callback. /// [DataMember] @@ -85,7 +85,7 @@ namespace Umbraco.Core.Models set { SetPropertyValueAndDetectChanges(value, ref _language, Ps.Value.LanguageSelector); - _languageId = _language == null ? -1 : _language.Id; + _languageId = _language == null ? -1 : _language.Id; } } @@ -113,7 +113,7 @@ namespace Umbraco.Core.Models // turn off change tracking clone.DisableChangeTracking(); - + // this shouldn't really be needed since we're not tracking clone.ResetDirtyProperties(false); @@ -123,4 +123,4 @@ namespace Umbraco.Core.Models return clone; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/DoNotCloneAttribute.cs b/src/Umbraco.Core/Models/DoNotCloneAttribute.cs index a27df59b03..a827f7af14 100644 --- a/src/Umbraco.Core/Models/DoNotCloneAttribute.cs +++ b/src/Umbraco.Core/Models/DoNotCloneAttribute.cs @@ -1,4 +1,4 @@ -using System; +using System; namespace Umbraco.Core.Models { @@ -7,17 +7,17 @@ namespace Umbraco.Core.Models /// that should be ignored for cloning when using the DeepCloneHelper /// /// - /// + /// /// This attribute must be used: /// * when the property is backed by a field but the result of the property is the un-natural data stored in the field - /// + /// /// This attribute should not be used: /// * when the property is virtual /// * when the setter performs additional required logic other than just setting the underlying field - /// + /// /// internal class DoNotCloneAttribute : Attribute { - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/EntityBase/Entity.cs b/src/Umbraco.Core/Models/EntityBase/Entity.cs index 048b37ea2a..c583a13ee5 100644 --- a/src/Umbraco.Core/Models/EntityBase/Entity.cs +++ b/src/Umbraco.Core/Models/EntityBase/Entity.cs @@ -46,11 +46,11 @@ namespace Umbraco.Core.Models.EntityBase HasIdentity = true; //set the has Identity } } - + /// /// Guid based Id /// - /// The key is currectly used to store the Unique Id from the + /// The key is currectly used to store the Unique Id from the /// umbracoNode table, which many of the entities are based on. [DataMember] public Guid Key @@ -207,4 +207,4 @@ namespace Umbraco.Core.Models.EntityBase return clone; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/EntityBase/IAggregateRoot.cs b/src/Umbraco.Core/Models/EntityBase/IAggregateRoot.cs index ad81b67205..38f4cfbbd0 100644 --- a/src/Umbraco.Core/Models/EntityBase/IAggregateRoot.cs +++ b/src/Umbraco.Core/Models/EntityBase/IAggregateRoot.cs @@ -5,4 +5,4 @@ /// public interface IAggregateRoot : IDeletableEntity { } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/EntityBase/ICanBeDirty.cs b/src/Umbraco.Core/Models/EntityBase/ICanBeDirty.cs index 2f5a6725e1..9c6d062f55 100644 --- a/src/Umbraco.Core/Models/EntityBase/ICanBeDirty.cs +++ b/src/Umbraco.Core/Models/EntityBase/ICanBeDirty.cs @@ -9,4 +9,4 @@ bool IsPropertyDirty(string propName); void ResetDirtyProperties(); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/EntityBase/IDeletableEntity.cs b/src/Umbraco.Core/Models/EntityBase/IDeletableEntity.cs index 42f91b6a6c..910722c184 100644 --- a/src/Umbraco.Core/Models/EntityBase/IDeletableEntity.cs +++ b/src/Umbraco.Core/Models/EntityBase/IDeletableEntity.cs @@ -8,4 +8,4 @@ namespace Umbraco.Core.Models.EntityBase [DataMember] DateTime? DeletedDate { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/EntityBase/IEntity.cs b/src/Umbraco.Core/Models/EntityBase/IEntity.cs index 81f5f632ef..607b841a9e 100644 --- a/src/Umbraco.Core/Models/EntityBase/IEntity.cs +++ b/src/Umbraco.Core/Models/EntityBase/IEntity.cs @@ -20,7 +20,7 @@ namespace Umbraco.Core.Models.EntityBase /// /// Guid based Id /// - /// The key is currectly used to store the Unique Id from the + /// The key is currectly used to store the Unique Id from the /// umbracoNode table, which many of the entities are based on. [DataMember] Guid Key { get; set; } @@ -43,4 +43,4 @@ namespace Umbraco.Core.Models.EntityBase [IgnoreDataMember] bool HasIdentity { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/EntityBase/IRememberBeingDirty.cs b/src/Umbraco.Core/Models/EntityBase/IRememberBeingDirty.cs index efebbd7c74..64a2ded4e3 100644 --- a/src/Umbraco.Core/Models/EntityBase/IRememberBeingDirty.cs +++ b/src/Umbraco.Core/Models/EntityBase/IRememberBeingDirty.cs @@ -11,4 +11,4 @@ void ForgetPreviouslyDirtyProperties(); void ResetDirtyProperties(bool rememberPreviouslyChangedProperties); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/EntityBase/IUmbracoEntity.cs b/src/Umbraco.Core/Models/EntityBase/IUmbracoEntity.cs index 35f1955a61..d5d1fa2f78 100644 --- a/src/Umbraco.Core/Models/EntityBase/IUmbracoEntity.cs +++ b/src/Umbraco.Core/Models/EntityBase/IUmbracoEntity.cs @@ -49,4 +49,4 @@ namespace Umbraco.Core.Models.EntityBase /// IDictionary AdditionalData { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/EntityBase/IValueObject.cs b/src/Umbraco.Core/Models/EntityBase/IValueObject.cs index 3fb76e598e..a13cda2fa6 100644 --- a/src/Umbraco.Core/Models/EntityBase/IValueObject.cs +++ b/src/Umbraco.Core/Models/EntityBase/IValueObject.cs @@ -6,6 +6,6 @@ /// public interface IValueObject { - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/EntityBase/TracksChangesEntityBase.cs b/src/Umbraco.Core/Models/EntityBase/TracksChangesEntityBase.cs index 5432a4982a..8e0befbde9 100644 --- a/src/Umbraco.Core/Models/EntityBase/TracksChangesEntityBase.cs +++ b/src/Umbraco.Core/Models/EntityBase/TracksChangesEntityBase.cs @@ -222,4 +222,4 @@ namespace Umbraco.Core.Models.EntityBase } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/EntityContainer.cs b/src/Umbraco.Core/Models/EntityContainer.cs index 5b3051fcd0..5683287b0f 100644 --- a/src/Umbraco.Core/Models/EntityContainer.cs +++ b/src/Umbraco.Core/Models/EntityContainer.cs @@ -90,4 +90,4 @@ namespace Umbraco.Core.Models return contained; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/EntityExtensions.cs b/src/Umbraco.Core/Models/EntityExtensions.cs index 9fbd4ce592..1111130fde 100644 --- a/src/Umbraco.Core/Models/EntityExtensions.cs +++ b/src/Umbraco.Core/Models/EntityExtensions.cs @@ -21,4 +21,4 @@ namespace Umbraco.Core.Models return dirty.WasPropertyDirty("Id"); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/File.cs b/src/Umbraco.Core/Models/File.cs index 41838a3841..97469d8a49 100644 --- a/src/Umbraco.Core/Models/File.cs +++ b/src/Umbraco.Core/Models/File.cs @@ -73,7 +73,7 @@ namespace Umbraco.Core.Models get { if (_alias == null) - { + { var name = System.IO.Path.GetFileName(Path); if (name == null) return string.Empty; var lastIndexOf = name.LastIndexOf(".", StringComparison.InvariantCultureIgnoreCase); @@ -96,7 +96,7 @@ namespace Umbraco.Core.Models _alias = null; _name = null; - SetPropertyValueAndDetectChanges(SanitizePath(value), ref _path, Ps.Value.PathSelector); + SetPropertyValueAndDetectChanges(SanitizePath(value), ref _path, Ps.Value.PathSelector); } } @@ -138,7 +138,7 @@ namespace Umbraco.Core.Models { SetPropertyValueAndDetectChanges( value ?? string.Empty, // cannot set to null - ref _content, Ps.Value.ContentSelector); + ref _content, Ps.Value.ContentSelector); } } @@ -184,4 +184,4 @@ namespace Umbraco.Core.Models return clone; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Folder.cs b/src/Umbraco.Core/Models/Folder.cs index be8e9b6dc4..945a47eeb4 100644 --- a/src/Umbraco.Core/Models/Folder.cs +++ b/src/Umbraco.Core/Models/Folder.cs @@ -11,4 +11,4 @@ namespace Umbraco.Core.Models public string Path { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/GridValue.cs b/src/Umbraco.Core/Models/GridValue.cs index 87f6146af6..717fcd2f88 100644 --- a/src/Umbraco.Core/Models/GridValue.cs +++ b/src/Umbraco.Core/Models/GridValue.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using Newtonsoft.Json; using Newtonsoft.Json.Linq; @@ -82,4 +82,4 @@ namespace Umbraco.Core.Models public string View { get; set; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/IContent.cs b/src/Umbraco.Core/Models/IContent.cs index 7caefc1121..b33aa072bf 100644 --- a/src/Umbraco.Core/Models/IContent.cs +++ b/src/Umbraco.Core/Models/IContent.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.ComponentModel; using System.Diagnostics; using Umbraco.Core.Persistence.Mappers; @@ -7,7 +7,7 @@ namespace Umbraco.Core.Models { /// /// Defines a Content object - /// + /// public interface IContent : IContentBase { /// @@ -86,4 +86,4 @@ namespace Umbraco.Core.Models /// Guid PublishedVersionGuid { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/IContentBase.cs b/src/Umbraco.Core/Models/IContentBase.cs index d7e26808c8..1446606d19 100644 --- a/src/Umbraco.Core/Models/IContentBase.cs +++ b/src/Umbraco.Core/Models/IContentBase.cs @@ -73,4 +73,4 @@ namespace Umbraco.Core.Models /// True if content is valid otherwise false bool IsValid(); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/IContentType.cs b/src/Umbraco.Core/Models/IContentType.cs index 766a8eec81..66c4aed37a 100644 --- a/src/Umbraco.Core/Models/IContentType.cs +++ b/src/Umbraco.Core/Models/IContentType.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; namespace Umbraco.Core.Models { @@ -37,4 +37,4 @@ namespace Umbraco.Core.Models /// IContentType DeepCloneWithResetIdentities(string newAlias); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/IContentTypeBase.cs b/src/Umbraco.Core/Models/IContentTypeBase.cs index 80e62f50cf..c71e369b6f 100644 --- a/src/Umbraco.Core/Models/IContentTypeBase.cs +++ b/src/Umbraco.Core/Models/IContentTypeBase.cs @@ -119,4 +119,4 @@ namespace Umbraco.Core.Models /// bool MovePropertyType(string propertyTypeAlias, string propertyGroupName); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/IContentTypeComposition.cs b/src/Umbraco.Core/Models/IContentTypeComposition.cs index ab7e068fdd..3d206e4660 100644 --- a/src/Umbraco.Core/Models/IContentTypeComposition.cs +++ b/src/Umbraco.Core/Models/IContentTypeComposition.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; namespace Umbraco.Core.Models { @@ -44,15 +44,15 @@ namespace Umbraco.Core.Models bool ContentTypeCompositionExists(string alias); /// - /// Gets a list of ContentType aliases from the current composition + /// Gets a list of ContentType aliases from the current composition /// /// An enumerable list of string aliases IEnumerable CompositionAliases(); /// - /// Gets a list of ContentType Ids from the current composition + /// Gets a list of ContentType Ids from the current composition /// /// An enumerable list of integer ids IEnumerable CompositionIds(); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/IDataTypeDefinition.cs b/src/Umbraco.Core/Models/IDataTypeDefinition.cs index 0b5364620b..814512738a 100644 --- a/src/Umbraco.Core/Models/IDataTypeDefinition.cs +++ b/src/Umbraco.Core/Models/IDataTypeDefinition.cs @@ -1,4 +1,4 @@ -using System; +using System; using Umbraco.Core.Models.EntityBase; namespace Umbraco.Core.Models @@ -15,4 +15,4 @@ namespace Umbraco.Core.Models /// DataTypeDatabaseType DatabaseType { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/IDeepCloneable.cs b/src/Umbraco.Core/Models/IDeepCloneable.cs index 5f41f6d828..ea41d26dd1 100644 --- a/src/Umbraco.Core/Models/IDeepCloneable.cs +++ b/src/Umbraco.Core/Models/IDeepCloneable.cs @@ -1,4 +1,4 @@ -using System.Reflection; +using System.Reflection; namespace Umbraco.Core.Models { @@ -6,4 +6,4 @@ namespace Umbraco.Core.Models { object DeepClone(); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/IDictionaryItem.cs b/src/Umbraco.Core/Models/IDictionaryItem.cs index ed88acfbec..b4a1deea89 100644 --- a/src/Umbraco.Core/Models/IDictionaryItem.cs +++ b/src/Umbraco.Core/Models/IDictionaryItem.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Runtime.Serialization; using Umbraco.Core.Models.EntityBase; @@ -26,4 +26,4 @@ namespace Umbraco.Core.Models [DataMember] IEnumerable Translations { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/IDictionaryTranslation.cs b/src/Umbraco.Core/Models/IDictionaryTranslation.cs index 25aa1e4395..48badb570a 100644 --- a/src/Umbraco.Core/Models/IDictionaryTranslation.cs +++ b/src/Umbraco.Core/Models/IDictionaryTranslation.cs @@ -1,4 +1,4 @@ -using System.Runtime.Serialization; +using System.Runtime.Serialization; using Umbraco.Core.Models.EntityBase; using Umbraco.Core.Persistence.Mappers; @@ -20,4 +20,4 @@ namespace Umbraco.Core.Models [DataMember] string Value { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/IDomain.cs b/src/Umbraco.Core/Models/IDomain.cs index b9f6bc65ec..b33c987f9e 100644 --- a/src/Umbraco.Core/Models/IDomain.cs +++ b/src/Umbraco.Core/Models/IDomain.cs @@ -1,4 +1,4 @@ -using Umbraco.Core.Models.EntityBase; +using Umbraco.Core.Models.EntityBase; namespace Umbraco.Core.Models { @@ -14,4 +14,4 @@ namespace Umbraco.Core.Models /// string LanguageIsoCode { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/IFile.cs b/src/Umbraco.Core/Models/IFile.cs index de900c50ec..77cc21a49b 100644 --- a/src/Umbraco.Core/Models/IFile.cs +++ b/src/Umbraco.Core/Models/IFile.cs @@ -47,4 +47,4 @@ namespace Umbraco.Core.Models [Obsolete("This is no longer used and will be removed from the codebase in future versions")] bool IsValid(); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/ILanguage.cs b/src/Umbraco.Core/Models/ILanguage.cs index acd1de10c3..125bebf8e2 100644 --- a/src/Umbraco.Core/Models/ILanguage.cs +++ b/src/Umbraco.Core/Models/ILanguage.cs @@ -1,4 +1,4 @@ -using System.Globalization; +using System.Globalization; using System.Runtime.Serialization; using Umbraco.Core.Models.EntityBase; using Umbraco.Core.Persistence.Mappers; @@ -25,4 +25,4 @@ namespace Umbraco.Core.Models [IgnoreDataMember] CultureInfo CultureInfo { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/IMacro.cs b/src/Umbraco.Core/Models/IMacro.cs index f9091fc7dd..6aafba0a43 100644 --- a/src/Umbraco.Core/Models/IMacro.cs +++ b/src/Umbraco.Core/Models/IMacro.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Runtime.Serialization; using Umbraco.Core.Models.EntityBase; @@ -92,4 +92,4 @@ namespace Umbraco.Core.Models ///// //MacroTypes MacroType(); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/IMacroProperty.cs b/src/Umbraco.Core/Models/IMacroProperty.cs index 8726f51317..253e856a27 100644 --- a/src/Umbraco.Core/Models/IMacroProperty.cs +++ b/src/Umbraco.Core/Models/IMacroProperty.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Runtime.Serialization; using Umbraco.Core.Models.EntityBase; @@ -35,8 +35,8 @@ namespace Umbraco.Core.Models /// /// Gets or sets the parameter editor alias - /// + /// [DataMember] string EditorAlias { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/IMedia.cs b/src/Umbraco.Core/Models/IMedia.cs index 755d99eddb..02aa5db61c 100644 --- a/src/Umbraco.Core/Models/IMedia.cs +++ b/src/Umbraco.Core/Models/IMedia.cs @@ -24,4 +24,4 @@ namespace Umbraco.Core.Models /// Boolean indicating whether to clear PropertyTypes upon change void ChangeContentType(IMediaType contentType, bool clearProperties); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/IMediaType.cs b/src/Umbraco.Core/Models/IMediaType.cs index e8f7c16190..28c5e89f19 100644 --- a/src/Umbraco.Core/Models/IMediaType.cs +++ b/src/Umbraco.Core/Models/IMediaType.cs @@ -15,4 +15,4 @@ namespace Umbraco.Core.Models /// IMediaType DeepCloneWithResetIdentities(string newAlias); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/IMember.cs b/src/Umbraco.Core/Models/IMember.cs index d5838f30ff..28e011d7d0 100644 --- a/src/Umbraco.Core/Models/IMember.cs +++ b/src/Umbraco.Core/Models/IMember.cs @@ -15,4 +15,4 @@ namespace Umbraco.Core.Models /// IMemberType ContentType { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/IMemberGroup.cs b/src/Umbraco.Core/Models/IMemberGroup.cs index 89f1c6c1cf..0fcf20acb6 100644 --- a/src/Umbraco.Core/Models/IMemberGroup.cs +++ b/src/Umbraco.Core/Models/IMemberGroup.cs @@ -23,4 +23,4 @@ namespace Umbraco.Core.Models /// IDictionary AdditionalData { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/IMemberType.cs b/src/Umbraco.Core/Models/IMemberType.cs index 878cc24334..a1ce10dac8 100644 --- a/src/Umbraco.Core/Models/IMemberType.cs +++ b/src/Umbraco.Core/Models/IMemberType.cs @@ -33,4 +33,4 @@ /// Boolean value, true or false void SetMemberCanViewProperty(string propertyTypeAlias, bool value); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/IMigrationEntry.cs b/src/Umbraco.Core/Models/IMigrationEntry.cs index 65bb7bc1f3..0cc466f1cb 100644 --- a/src/Umbraco.Core/Models/IMigrationEntry.cs +++ b/src/Umbraco.Core/Models/IMigrationEntry.cs @@ -9,4 +9,4 @@ namespace Umbraco.Core.Models string MigrationName { get; set; } SemVersion Version { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/IPartialView.cs b/src/Umbraco.Core/Models/IPartialView.cs index 40a760427a..31099a1aae 100644 --- a/src/Umbraco.Core/Models/IPartialView.cs +++ b/src/Umbraco.Core/Models/IPartialView.cs @@ -4,4 +4,4 @@ { PartialViewType ViewType { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/IRelation.cs b/src/Umbraco.Core/Models/IRelation.cs index ac37d4293a..a80d6543a2 100644 --- a/src/Umbraco.Core/Models/IRelation.cs +++ b/src/Umbraco.Core/Models/IRelation.cs @@ -35,4 +35,4 @@ namespace Umbraco.Core.Models [IgnoreDataMember] int RelationTypeId { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/IRelationType.cs b/src/Umbraco.Core/Models/IRelationType.cs index 265e7723e5..913cee9590 100644 --- a/src/Umbraco.Core/Models/IRelationType.cs +++ b/src/Umbraco.Core/Models/IRelationType.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Runtime.Serialization; using Umbraco.Core.Models.EntityBase; @@ -38,4 +38,4 @@ namespace Umbraco.Core.Models [DataMember] Guid ChildObjectType { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/IServerRegistration.cs b/src/Umbraco.Core/Models/IServerRegistration.cs index 8053ea0a6e..20513339d8 100644 --- a/src/Umbraco.Core/Models/IServerRegistration.cs +++ b/src/Umbraco.Core/Models/IServerRegistration.cs @@ -1,4 +1,4 @@ -using System; +using System; using Umbraco.Core.Models.EntityBase; using Umbraco.Core.Sync; @@ -33,4 +33,4 @@ namespace Umbraco.Core.Models /// DateTime Accessed { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/ITag.cs b/src/Umbraco.Core/Models/ITag.cs index d132e0fbd7..2f05527ed9 100644 --- a/src/Umbraco.Core/Models/ITag.cs +++ b/src/Umbraco.Core/Models/ITag.cs @@ -1,4 +1,4 @@ -using System.Runtime.Serialization; +using System.Runtime.Serialization; using Umbraco.Core.Models.EntityBase; namespace Umbraco.Core.Models @@ -19,4 +19,4 @@ namespace Umbraco.Core.Models //TODO: enable this at some stage //int ParentId { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/ITemplate.cs b/src/Umbraco.Core/Models/ITemplate.cs index 4ca639dd81..49037e6804 100644 --- a/src/Umbraco.Core/Models/ITemplate.cs +++ b/src/Umbraco.Core/Models/ITemplate.cs @@ -28,11 +28,11 @@ namespace Umbraco.Core.Models /// returns the master template alias /// string MasterTemplateAlias { get; } - + /// /// Set the mastertemplate /// /// void SetMasterTemplate(ITemplate masterTemplate); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/IXsltFile.cs b/src/Umbraco.Core/Models/IXsltFile.cs index f6d4418f88..028b5581c9 100644 --- a/src/Umbraco.Core/Models/IXsltFile.cs +++ b/src/Umbraco.Core/Models/IXsltFile.cs @@ -2,6 +2,6 @@ { public interface IXsltFile : IFile { - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Identity/BackOfficeIdentityUser.cs b/src/Umbraco.Core/Models/Identity/BackOfficeIdentityUser.cs index 50dc7d06f8..cecfe7da9a 100644 --- a/src/Umbraco.Core/Models/Identity/BackOfficeIdentityUser.cs +++ b/src/Umbraco.Core/Models/Identity/BackOfficeIdentityUser.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Collections.Specialized; @@ -44,9 +44,9 @@ namespace Umbraco.Core.Models.Identity public override bool LockoutEnabled { get { return true; } - set + set { - //do nothing + //do nothing } } @@ -103,4 +103,4 @@ namespace Umbraco.Core.Models.Identity _getLogins = callback; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Identity/IIdentityUserLogin.cs b/src/Umbraco.Core/Models/Identity/IIdentityUserLogin.cs index c95722f4e3..d4d8e5e08e 100644 --- a/src/Umbraco.Core/Models/Identity/IIdentityUserLogin.cs +++ b/src/Umbraco.Core/Models/Identity/IIdentityUserLogin.cs @@ -1,4 +1,4 @@ -using Umbraco.Core.Models.EntityBase; +using Umbraco.Core.Models.EntityBase; namespace Umbraco.Core.Models.Identity { @@ -6,20 +6,20 @@ namespace Umbraco.Core.Models.Identity { /// /// The login provider for the login (i.e. facebook, google) - /// + /// /// string LoginProvider { get; set; } /// /// Key representing the login for the provider - /// + /// /// string ProviderKey { get; set; } /// /// User Id for the user who owns this login - /// + /// /// int UserId { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Identity/IdentityProfile.cs b/src/Umbraco.Core/Models/Identity/IdentityProfile.cs index ebeb77c4ea..931d023c65 100644 --- a/src/Umbraco.Core/Models/Identity/IdentityProfile.cs +++ b/src/Umbraco.Core/Models/Identity/IdentityProfile.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using AutoMapper; using Umbraco.Core.Models.Membership; @@ -53,4 +53,4 @@ namespace Umbraco.Core.Models.Identity return storedPass.StartsWith("___UIDEMPTYPWORD__") ? null : storedPass; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Identity/IdentityUser.cs b/src/Umbraco.Core/Models/Identity/IdentityUser.cs index 2e40d09cc1..69b9e26385 100644 --- a/src/Umbraco.Core/Models/Identity/IdentityUser.cs +++ b/src/Umbraco.Core/Models/Identity/IdentityUser.cs @@ -21,7 +21,7 @@ namespace Umbraco.Core.Models.Identity /// /// Constructor - /// + /// /// public IdentityUser() { @@ -110,4 +110,4 @@ namespace Umbraco.Core.Models.Identity /// public virtual string UserName { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Identity/IdentityUserClaim.cs b/src/Umbraco.Core/Models/Identity/IdentityUserClaim.cs index 832438f3c3..e117d2fd13 100644 --- a/src/Umbraco.Core/Models/Identity/IdentityUserClaim.cs +++ b/src/Umbraco.Core/Models/Identity/IdentityUserClaim.cs @@ -2,7 +2,7 @@ { /// /// EntityType that represents one specific user claim - /// + /// /// /// /// @@ -13,26 +13,26 @@ { /// /// Primary key - /// + /// /// public virtual int Id { get; set; } /// /// User Id for the user who owns this login - /// + /// /// public virtual TKey UserId { get; set; } /// /// Claim type - /// + /// /// public virtual string ClaimType { get; set; } /// /// Claim value - /// + /// /// public virtual string ClaimValue { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Identity/IdentityUserLogin.cs b/src/Umbraco.Core/Models/Identity/IdentityUserLogin.cs index efed4ce37c..89d20bc948 100644 --- a/src/Umbraco.Core/Models/Identity/IdentityUserLogin.cs +++ b/src/Umbraco.Core/Models/Identity/IdentityUserLogin.cs @@ -1,11 +1,11 @@ -using System; +using System; using Umbraco.Core.Models.EntityBase; namespace Umbraco.Core.Models.Identity { /// /// Entity type for a user's login (i.e. facebook, google) - /// + /// /// public class IdentityUserLogin : Entity, IIdentityUserLogin { @@ -27,20 +27,20 @@ namespace Umbraco.Core.Models.Identity /// /// The login provider for the login (i.e. facebook, google) - /// + /// /// public string LoginProvider { get; set; } /// /// Key representing the login for the provider - /// + /// /// public string ProviderKey { get; set; } /// /// User Id for the user who owns this login - /// + /// /// public int UserId { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Identity/IdentityUserRole.cs b/src/Umbraco.Core/Models/Identity/IdentityUserRole.cs index 5c68a97d86..ba9e87e46c 100644 --- a/src/Umbraco.Core/Models/Identity/IdentityUserRole.cs +++ b/src/Umbraco.Core/Models/Identity/IdentityUserRole.cs @@ -1,8 +1,8 @@ -namespace Umbraco.Core.Models.Identity +namespace Umbraco.Core.Models.Identity { /// /// EntityType that represents a user belonging to a role - /// + /// /// /// /// @@ -13,14 +13,14 @@ namespace Umbraco.Core.Models.Identity { /// /// UserId for the user that is in the role - /// + /// /// public virtual TKey UserId { get; set; } /// /// RoleId for the role - /// + /// /// public virtual TKey RoleId { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Language.cs b/src/Umbraco.Core/Models/Language.cs index d915bee85b..52257ef2f3 100644 --- a/src/Umbraco.Core/Models/Language.cs +++ b/src/Umbraco.Core/Models/Language.cs @@ -58,4 +58,4 @@ namespace Umbraco.Core.Models get { return CultureInfo.GetCultureInfo(IsoCode); } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Macro.cs b/src/Umbraco.Core/Models/Macro.cs index 58ee94bdc9..fdeebf3424 100644 --- a/src/Umbraco.Core/Models/Macro.cs +++ b/src/Umbraco.Core/Models/Macro.cs @@ -173,7 +173,7 @@ namespace Umbraco.Core.Models { OnPropertyChanged(Ps.Value.PropertiesSelector); } - + public override void ResetDirtyProperties(bool rememberPreviouslyChangedProperties) { _addedProperties.Clear(); @@ -320,7 +320,7 @@ namespace Umbraco.Core.Models [DataMember] public MacroPropertyCollection Properties { - get { return _properties; } + get { return _properties; } } public override object DeepClone() @@ -341,4 +341,4 @@ namespace Umbraco.Core.Models return clone; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/MacroProperty.cs b/src/Umbraco.Core/Models/MacroProperty.cs index d3d82d10ad..2aba3c05a1 100644 --- a/src/Umbraco.Core/Models/MacroProperty.cs +++ b/src/Umbraco.Core/Models/MacroProperty.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Reflection; using System.Runtime.Serialization; using Umbraco.Core.Models.EntityBase; @@ -154,7 +154,7 @@ namespace Umbraco.Core.Models //try to get the new mapped parameter editor var mapped = LegacyParameterEditorAliasConverter.GetNewAliasFromLegacyAlias(value, false); var newVal = mapped.IsNullOrWhiteSpace() == false ? mapped : value; - SetPropertyValueAndDetectChanges(newVal, ref _editorAlias, Ps.Value.PropertyTypeSelector); + SetPropertyValueAndDetectChanges(newVal, ref _editorAlias, Ps.Value.PropertyTypeSelector); } } @@ -190,4 +190,4 @@ namespace Umbraco.Core.Models } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/MacroPropertyCollection.cs b/src/Umbraco.Core/Models/MacroPropertyCollection.cs index 45b5f087cc..bf5b29be9a 100644 --- a/src/Umbraco.Core/Models/MacroPropertyCollection.cs +++ b/src/Umbraco.Core/Models/MacroPropertyCollection.cs @@ -11,7 +11,7 @@ namespace Umbraco.Core.Models /// public class MacroPropertyCollection : ObservableDictionary, IDeepCloneable { - public MacroPropertyCollection() + public MacroPropertyCollection() : base(property => property.Alias) { } @@ -35,7 +35,7 @@ namespace Umbraco.Core.Models /// /// The existing property alias /// - /// + /// public void UpdateProperty(string currentAlias, string name = null, int? sortOrder = null, string editorAlias = null, string newAlias = null) { var prop = this[currentAlias]; @@ -46,7 +46,7 @@ namespace Umbraco.Core.Models if (name.IsNullOrWhiteSpace() == false) { - prop.Name = name; + prop.Name = name; } if (sortOrder.HasValue) { @@ -65,4 +65,4 @@ namespace Umbraco.Core.Models } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/MacroTypes.cs b/src/Umbraco.Core/Models/MacroTypes.cs index 9625396f0c..90eacf5171 100644 --- a/src/Umbraco.Core/Models/MacroTypes.cs +++ b/src/Umbraco.Core/Models/MacroTypes.cs @@ -21,4 +21,4 @@ namespace Umbraco.Core.Models [EnumMember] PartialView = 7 } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Media.cs b/src/Umbraco.Core/Models/Media.cs index a67468def1..162e40a96e 100644 --- a/src/Umbraco.Core/Models/Media.cs +++ b/src/Umbraco.Core/Models/Media.cs @@ -20,9 +20,9 @@ namespace Umbraco.Core.Models /// Parent object /// MediaType for the current Media object public Media(string name, IMedia parent, IMediaType contentType) - : this(name, parent, contentType, new PropertyCollection()) - { - } + : this(name, parent, contentType, new PropertyCollection()) + { + } /// /// Constructor for creating a Media object @@ -32,10 +32,10 @@ namespace Umbraco.Core.Models /// MediaType for the current Media object /// Collection of properties public Media(string name, IMedia parent, IMediaType contentType, PropertyCollection properties) - : base(name, parent, contentType, properties) - { - _contentType = contentType ?? throw new ArgumentNullException(nameof(contentType)); - } + : base(name, parent, contentType, properties) + { + _contentType = contentType ?? throw new ArgumentNullException(nameof(contentType)); + } /// /// Constructor for creating a Media object @@ -55,7 +55,7 @@ namespace Umbraco.Core.Models /// Id of the Parent IMedia /// MediaType for the current Media object /// Collection of properties - public Media(string name, int parentId, IMediaType contentType, PropertyCollection properties) + public Media(string name, int parentId, IMediaType contentType, PropertyCollection properties) : base(name, parentId, contentType, properties) { _contentType = contentType ?? throw new ArgumentNullException(nameof(contentType)); @@ -114,4 +114,4 @@ namespace Umbraco.Core.Models ParentId = parentId == -20 ? -21 : parentId; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/MediaExtensions.cs b/src/Umbraco.Core/Models/MediaExtensions.cs index a006548773..6509926877 100644 --- a/src/Umbraco.Core/Models/MediaExtensions.cs +++ b/src/Umbraco.Core/Models/MediaExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using Newtonsoft.Json; using Newtonsoft.Json.Linq; @@ -60,4 +60,4 @@ namespace Umbraco.Core.Models .ToArray(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/MediaType.cs b/src/Umbraco.Core/Models/MediaType.cs index 8596cce910..e270306de5 100644 --- a/src/Umbraco.Core/Models/MediaType.cs +++ b/src/Umbraco.Core/Models/MediaType.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Runtime.Serialization; namespace Umbraco.Core.Models @@ -24,9 +24,9 @@ namespace Umbraco.Core.Models /// /// Use this to ensure inheritance from parent. /// - public MediaType(IMediaType parent) : this(parent, null) - { - } + public MediaType(IMediaType parent) : this(parent, null) + { + } /// /// Constuctor for creating a MediaType with the parent as an inherited type. @@ -64,4 +64,4 @@ namespace Umbraco.Core.Models return clone; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Member.cs b/src/Umbraco.Core/Models/Member.cs index 1574379179..589457f251 100644 --- a/src/Umbraco.Core/Models/Member.cs +++ b/src/Umbraco.Core/Models/Member.cs @@ -596,4 +596,4 @@ namespace Umbraco.Core.Models } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/MemberGroup.cs b/src/Umbraco.Core/Models/MemberGroup.cs index d6dc1be557..e7f6355ac2 100644 --- a/src/Umbraco.Core/Models/MemberGroup.cs +++ b/src/Umbraco.Core/Models/MemberGroup.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Reflection; using System.Runtime.Serialization; @@ -43,7 +43,7 @@ namespace Umbraco.Core.Models AdditionalData["previousName"] = _name; } - SetPropertyValueAndDetectChanges(value, ref _name, Ps.Value.NameSelector); + SetPropertyValueAndDetectChanges(value, ref _name, Ps.Value.NameSelector); } } @@ -55,4 +55,4 @@ namespace Umbraco.Core.Models public IDictionary AdditionalData { get; private set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/MemberType.cs b/src/Umbraco.Core/Models/MemberType.cs index 4f79e1d231..e09a743b66 100644 --- a/src/Umbraco.Core/Models/MemberType.cs +++ b/src/Umbraco.Core/Models/MemberType.cs @@ -135,4 +135,4 @@ namespace Umbraco.Core.Models } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/MemberTypePropertyProfileAccess.cs b/src/Umbraco.Core/Models/MemberTypePropertyProfileAccess.cs index fa9e0b7307..0f6b2a3dce 100644 --- a/src/Umbraco.Core/Models/MemberTypePropertyProfileAccess.cs +++ b/src/Umbraco.Core/Models/MemberTypePropertyProfileAccess.cs @@ -1,4 +1,4 @@ -namespace Umbraco.Core.Models +namespace Umbraco.Core.Models { /// /// Used to track the property types that are visible/editable on member profiles @@ -14,4 +14,4 @@ namespace Umbraco.Core.Models public bool IsVisible { get; set; } public bool IsEditable { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Membership/EntityPermission.cs b/src/Umbraco.Core/Models/Membership/EntityPermission.cs index 7ab1ddc817..205da81d5d 100644 --- a/src/Umbraco.Core/Models/Membership/EntityPermission.cs +++ b/src/Umbraco.Core/Models/Membership/EntityPermission.cs @@ -23,4 +23,4 @@ namespace Umbraco.Core.Models.Membership public string[] AssignedPermissions { get; private set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Membership/EntityPermissionSet.cs b/src/Umbraco.Core/Models/Membership/EntityPermissionSet.cs index c4669caf59..7bb3408412 100644 --- a/src/Umbraco.Core/Models/Membership/EntityPermissionSet.cs +++ b/src/Umbraco.Core/Models/Membership/EntityPermissionSet.cs @@ -56,4 +56,4 @@ namespace Umbraco.Core.Models.Membership } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Membership/IMembershipUser.cs b/src/Umbraco.Core/Models/Membership/IMembershipUser.cs index 1aead03726..5a63997795 100644 --- a/src/Umbraco.Core/Models/Membership/IMembershipUser.cs +++ b/src/Umbraco.Core/Models/Membership/IMembershipUser.cs @@ -7,7 +7,7 @@ namespace Umbraco.Core.Models.Membership /// Defines the base contract for and /// public interface IMembershipUser : IAggregateRoot - { + { object ProviderUserKey { get; set; } string Username { get; set; } string Email { get; set; } @@ -16,14 +16,14 @@ namespace Umbraco.Core.Models.Membership /// Gets or sets the raw password value /// string RawPasswordValue { get; set; } - + string PasswordQuestion { get; set; } - + /// /// Gets or sets the raw password answer value /// string RawPasswordAnswerValue { get; set; } - + string Comments { get; set; } bool IsApproved { get; set; } bool IsLockedOut { get; set; } @@ -44,4 +44,4 @@ namespace Umbraco.Core.Models.Membership //object ProfileId { get; set; } //IEnumerable Groups { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Membership/IProfile.cs b/src/Umbraco.Core/Models/Membership/IProfile.cs index 749c3371b8..820089c6d9 100644 --- a/src/Umbraco.Core/Models/Membership/IProfile.cs +++ b/src/Umbraco.Core/Models/Membership/IProfile.cs @@ -4,7 +4,7 @@ /// Defines the the Profile interface /// /// - /// This interface is pretty useless but has been exposed publicly from 6.x so we're stuck with it. It would make more sense + /// This interface is pretty useless but has been exposed publicly from 6.x so we're stuck with it. It would make more sense /// if the Id was an int but since it's not people have to cast it to int all of the time! /// public interface IProfile @@ -12,4 +12,4 @@ object Id { get; set; } string Name { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Membership/IUser.cs b/src/Umbraco.Core/Models/Membership/IUser.cs index f1f9c23971..4f2224a072 100644 --- a/src/Umbraco.Core/Models/Membership/IUser.cs +++ b/src/Umbraco.Core/Models/Membership/IUser.cs @@ -15,13 +15,13 @@ namespace Umbraco.Core.Models.Membership int StartContentId { get; set; } int StartMediaId { get; set; } string Language { get; set; } - + /// /// Gets/sets the user type for the user /// IUserType UserType { get; set; } - //TODO: This should be a private set + //TODO: This should be a private set /// /// The default permission set for the user /// @@ -44,4 +44,4 @@ namespace Umbraco.Core.Models.Membership /// string SecurityStamp { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Membership/IUserType.cs b/src/Umbraco.Core/Models/Membership/IUserType.cs index fe678afd2b..92cce3ecd4 100644 --- a/src/Umbraco.Core/Models/Membership/IUserType.cs +++ b/src/Umbraco.Core/Models/Membership/IUserType.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using Umbraco.Core.Models.EntityBase; using Umbraco.Core.Persistence.Mappers; @@ -25,4 +25,4 @@ namespace Umbraco.Core.Models.Membership /// IEnumerable Permissions { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Membership/MemberCountType.cs b/src/Umbraco.Core/Models/Membership/MemberCountType.cs index 89b428a827..dffa4766dc 100644 --- a/src/Umbraco.Core/Models/Membership/MemberCountType.cs +++ b/src/Umbraco.Core/Models/Membership/MemberCountType.cs @@ -10,4 +10,4 @@ LockedOut, Approved } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Membership/MembershipScenario.cs b/src/Umbraco.Core/Models/Membership/MembershipScenario.cs index d198501321..ec092f83c1 100644 --- a/src/Umbraco.Core/Models/Membership/MembershipScenario.cs +++ b/src/Umbraco.Core/Models/Membership/MembershipScenario.cs @@ -30,4 +30,4 @@ /// StandaloneCustomProvider } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Membership/MembershipUserExtensions.cs b/src/Umbraco.Core/Models/Membership/MembershipUserExtensions.cs index 2b0b6d3e0d..af3b2940d8 100644 --- a/src/Umbraco.Core/Models/Membership/MembershipUserExtensions.cs +++ b/src/Umbraco.Core/Models/Membership/MembershipUserExtensions.cs @@ -47,4 +47,4 @@ namespace Umbraco.Core.Models.Membership return _scenario.Value; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Membership/UmbracoMembershipMember.cs b/src/Umbraco.Core/Models/Membership/UmbracoMembershipMember.cs index 0f02f4f73b..0b189d70aa 100644 --- a/src/Umbraco.Core/Models/Membership/UmbracoMembershipMember.cs +++ b/src/Umbraco.Core/Models/Membership/UmbracoMembershipMember.cs @@ -49,7 +49,7 @@ namespace Umbraco.Core.Models.Membership _lastPasswordChangedDate = member.LastPasswordChangeDate.ToUniversalTime(); _lastLockoutDate = member.LastLockoutDate.ToUniversalTime(); } - + internal IMembershipUser Member { get { return _member; } @@ -125,4 +125,4 @@ namespace Umbraco.Core.Models.Membership get { return _providerName; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Membership/User.cs b/src/Umbraco.Core/Models/Membership/User.cs index cadda14508..55ba3d6ddb 100644 --- a/src/Umbraco.Core/Models/Membership/User.cs +++ b/src/Umbraco.Core/Models/Membership/User.cs @@ -13,7 +13,7 @@ namespace Umbraco.Core.Models.Membership { /// /// Represents a backoffice user - /// + /// [Serializable] [DataContract(IsReference = true)] public class User : Entity, IUser @@ -73,8 +73,8 @@ namespace Umbraco.Core.Models.Membership private DateTime _lastLoginDate; private DateTime _lastLockoutDate; - private IEnumerable _defaultPermissions; - + private IEnumerable _defaultPermissions; + private bool _defaultToLiveEditing; private static readonly Lazy Ps = new Lazy(); @@ -103,7 +103,7 @@ namespace Umbraco.Core.Models.Membership public readonly PropertyInfo DefaultToLiveEditingSelector = ExpressionHelper.GetPropertyInfo(x => x.DefaultToLiveEditing); public readonly PropertyInfo UserTypeSelector = ExpressionHelper.GetPropertyInfo(x => x.UserType); } - + #region Implementation of IMembershipUser [IgnoreDataMember] @@ -183,10 +183,10 @@ namespace Umbraco.Core.Models.Membership [IgnoreDataMember] public string RawPasswordAnswerValue { get; set; } [IgnoreDataMember] - public string Comments { get; set; } - + public string Comments { get; set; } + #endregion - + #region Implementation of IUser [DataMember] @@ -320,14 +320,14 @@ namespace Umbraco.Core.Models.Membership throw new InvalidOperationException("Cannot assign a User Type that has not been persisted"); } - SetPropertyValueAndDetectChanges(value, ref _userType, Ps.Value.UserTypeSelector); + SetPropertyValueAndDetectChanges(value, ref _userType, Ps.Value.UserTypeSelector); } } #endregion /// - /// Whenever resetting occurs, clear the remembered add/removed collections, even if + /// Whenever resetting occurs, clear the remembered add/removed collections, even if /// rememberPreviouslyChangedProperties is true, the AllowedSections property will still /// be flagged as dirty. /// @@ -363,7 +363,7 @@ namespace Umbraco.Core.Models.Membership if (_removedSections.Contains(item) == false) { - _removedSections.Add(item); + _removedSections.Add(item); } } @@ -432,4 +432,4 @@ namespace Umbraco.Core.Models.Membership } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Membership/UserType.cs b/src/Umbraco.Core/Models/Membership/UserType.cs index f519a484a0..29d6f3c8cc 100644 --- a/src/Umbraco.Core/Models/Membership/UserType.cs +++ b/src/Umbraco.Core/Models/Membership/UserType.cs @@ -11,7 +11,7 @@ namespace Umbraco.Core.Models.Membership { /// /// Represents the Type for a Backoffice User - /// + /// [Serializable] [DataContract(IsReference = true)] internal class UserType : Entity, IUserType @@ -46,9 +46,9 @@ namespace Umbraco.Core.Models.Membership set { SetPropertyValueAndDetectChanges( - value.ToCleanString(CleanStringType.Alias | CleanStringType.UmbracoCase), - ref _alias, - Ps.Value.AliasSelector); + value.ToCleanString(CleanStringType.Alias | CleanStringType.UmbracoCase), + ref _alias, + Ps.Value.AliasSelector); } } @@ -79,4 +79,4 @@ namespace Umbraco.Core.Models.Membership } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/MigrationEntry.cs b/src/Umbraco.Core/Models/MigrationEntry.cs index 575ee8efc3..f3f696fd71 100644 --- a/src/Umbraco.Core/Models/MigrationEntry.cs +++ b/src/Umbraco.Core/Models/MigrationEntry.cs @@ -42,4 +42,4 @@ namespace Umbraco.Core.Models set { SetPropertyValueAndDetectChanges(value, ref _version, Ps.Value.VersionSelector); } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Packaging/InstallationSummary.cs b/src/Umbraco.Core/Models/Packaging/InstallationSummary.cs index 46d454a2b9..ca05b4533f 100644 --- a/src/Umbraco.Core/Models/Packaging/InstallationSummary.cs +++ b/src/Umbraco.Core/Models/Packaging/InstallationSummary.cs @@ -21,7 +21,7 @@ namespace Umbraco.Core.Models.Packaging public IEnumerable Actions { get; set; } public bool PackageInstalled { get; set; } } - + internal static class InstallationSummaryExtentions { public static InstallationSummary InitEmpty(this InstallationSummary summary) @@ -40,4 +40,4 @@ namespace Umbraco.Core.Models.Packaging return summary; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Packaging/MetaData.cs b/src/Umbraco.Core/Models/Packaging/MetaData.cs index faa4cfa3df..32e3996794 100644 --- a/src/Umbraco.Core/Models/Packaging/MetaData.cs +++ b/src/Umbraco.Core/Models/Packaging/MetaData.cs @@ -20,4 +20,4 @@ namespace Umbraco.Core.Models.Packaging public string Readme { get; set; } public string Control { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Packaging/PackageAction.cs b/src/Umbraco.Core/Models/Packaging/PackageAction.cs index 507ece2b02..115899be8a 100644 --- a/src/Umbraco.Core/Models/Packaging/PackageAction.cs +++ b/src/Umbraco.Core/Models/Packaging/PackageAction.cs @@ -32,7 +32,7 @@ namespace Umbraco.Core.Models.Packaging get { return _undo ?? true; } set { _undo = value; } } - + public XElement XmlData { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Packaging/PreInstallWarnings.cs b/src/Umbraco.Core/Models/Packaging/PreInstallWarnings.cs index 25fd2b5585..5850e2321c 100644 --- a/src/Umbraco.Core/Models/Packaging/PreInstallWarnings.cs +++ b/src/Umbraco.Core/Models/Packaging/PreInstallWarnings.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Runtime.Serialization; @@ -14,4 +14,4 @@ namespace Umbraco.Core.Models.Packaging public IEnumerable ConflictingTemplateAliases { get; set; } public IEnumerable ConflictingStylesheetNames { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/PagedResult.cs b/src/Umbraco.Core/Models/PagedResult.cs index c7b91dd47a..88b2069ba4 100644 --- a/src/Umbraco.Core/Models/PagedResult.cs +++ b/src/Umbraco.Core/Models/PagedResult.cs @@ -57,4 +57,4 @@ namespace Umbraco.Core.Models return 0; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/PartialView.cs b/src/Umbraco.Core/Models/PartialView.cs index 3c7a3ee908..73ae8d83dd 100644 --- a/src/Umbraco.Core/Models/PartialView.cs +++ b/src/Umbraco.Core/Models/PartialView.cs @@ -27,4 +27,4 @@ namespace Umbraco.Core.Models public PartialViewType ViewType { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/PreValue.cs b/src/Umbraco.Core/Models/PreValue.cs index 61d127f50a..05572ee4d7 100644 --- a/src/Umbraco.Core/Models/PreValue.cs +++ b/src/Umbraco.Core/Models/PreValue.cs @@ -8,14 +8,14 @@ public PreValue(int id, string value, int sortOrder) { Id = id; - Value = value; + Value = value; SortOrder = sortOrder; } public PreValue(int id, string value) { - Id = id; - Value = value; + Id = id; + Value = value; } public PreValue(string value) @@ -41,8 +41,8 @@ public virtual object DeepClone() { //Memberwise clone on PreValue will work since it doesn't have any deep elements - var clone = (PreValue)MemberwiseClone(); + var clone = (PreValue)MemberwiseClone(); return clone; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/PreValueCollection.cs b/src/Umbraco.Core/Models/PreValueCollection.cs index 449eaaa3b7..bb0e71b3e8 100644 --- a/src/Umbraco.Core/Models/PreValueCollection.cs +++ b/src/Umbraco.Core/Models/PreValueCollection.cs @@ -10,7 +10,7 @@ namespace Umbraco.Core.Models /// /// Due to the legacy nature of the data that can be stored for pre-values, we have this class which encapsulates the 2 different /// ways that pre-values are stored: A string array or a Dictionary. - /// + /// /// Most legacy property editors won't support the dictionary format but new property editors should always use the dictionary format. /// In order to get overrideable pre-values working we need a dictionary since we'll have to reference a pre-value by a key. /// @@ -88,15 +88,15 @@ namespace Umbraco.Core.Models var clone = (PreValueCollection) MemberwiseClone(); if (_preValuesAsArray != null) { - clone._preValuesAsArray = _preValuesAsArray.Select(x => (PreValue)x.DeepClone()).ToArray(); + clone._preValuesAsArray = _preValuesAsArray.Select(x => (PreValue)x.DeepClone()).ToArray(); } if (_preValuesAsDictionary != null) { - clone._preValuesAsDictionary = _preValuesAsDictionary.ToDictionary(x => x.Key, x => (PreValue)x.Value.DeepClone()); + clone._preValuesAsDictionary = _preValuesAsDictionary.ToDictionary(x => x.Key, x => (PreValue)x.Value.DeepClone()); } - + return clone; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Property.cs b/src/Umbraco.Core/Models/Property.cs index dff6a712c7..5104f912ce 100644 --- a/src/Umbraco.Core/Models/Property.cs +++ b/src/Umbraco.Core/Models/Property.cs @@ -21,7 +21,7 @@ namespace Umbraco.Core.Models protected Property() { - + } public Property(PropertyType propertyType) @@ -56,7 +56,7 @@ namespace Umbraco.Core.Models { if (o == null && o1 == null) return true; - //custom comparer for strings. + //custom comparer for strings. if (o is string || o1 is string) { //if one is null and another is empty then they are the same @@ -79,7 +79,7 @@ namespace Umbraco.Core.Models } return o.Equals(o1); }, o => o.GetHashCode()); - + /// /// Returns the instance of the tag support, by default tags are not enabled /// @@ -117,12 +117,12 @@ namespace Umbraco.Core.Models /// [IgnoreDataMember] public PropertyType PropertyType { get { return _propertyType; } } - + /// /// Gets or Sets the version id for the Property /// /// - /// The version will be the same for all Property objects in a collection on a Content + /// The version will be the same for all Property objects in a collection on a Content /// object, so not sure how much this makes sense but adding it to align with: /// umbraco.interfaces.IProperty /// @@ -144,7 +144,7 @@ namespace Umbraco.Core.Models /// Gets or Sets the value of the Property /// /// - /// Setting the value will trigger a type validation. + /// Setting the value will trigger a type validation. /// The type of the value has to be valid in order to be saved. /// [DataMember] @@ -238,8 +238,8 @@ namespace Umbraco.Core.Models clone.ResetDirtyProperties(false); //re-enable tracking clone.EnableChangeTracking(); - + return clone; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/PropertyCollection.cs b/src/Umbraco.Core/Models/PropertyCollection.cs index 67a6914739..f206abbe7e 100644 --- a/src/Umbraco.Core/Models/PropertyCollection.cs +++ b/src/Umbraco.Core/Models/PropertyCollection.cs @@ -140,7 +140,7 @@ namespace Umbraco.Core.Models /// /// Gets the element with the specified PropertyType. /// - /// + /// /// /// The element with the specified PropertyType. If an element with the specified PropertyType is not found, an exception is thrown. /// @@ -215,4 +215,4 @@ namespace Umbraco.Core.Models return newList; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/PropertyExtensions.cs b/src/Umbraco.Core/Models/PropertyExtensions.cs index c88970668a..dff10f0c03 100644 --- a/src/Umbraco.Core/Models/PropertyExtensions.cs +++ b/src/Umbraco.Core/Models/PropertyExtensions.cs @@ -22,4 +22,4 @@ namespace Umbraco.Core.Models } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/PropertyGroup.cs b/src/Umbraco.Core/Models/PropertyGroup.cs index 68f6599e2e..76e0e98146 100644 --- a/src/Umbraco.Core/Models/PropertyGroup.cs +++ b/src/Umbraco.Core/Models/PropertyGroup.cs @@ -79,7 +79,7 @@ namespace Umbraco.Core.Models { propertyType.PropertyGroupId = new Lazy(() => this.Id); } - + _propertyTypes.CollectionChanged += PropertyTypesChanged; } } @@ -88,21 +88,21 @@ namespace Umbraco.Core.Models { if (base.Equals(other)) return true; - //Check whether the PropertyGroup's properties are equal. + //Check whether the PropertyGroup's properties are equal. return Name.InvariantEquals(other.Name); } public override int GetHashCode() { - //Get hash code for the Name field if it is not null. + //Get hash code for the Name field if it is not null. int baseHash = base.GetHashCode(); - //Get hash code for the Alias field. + //Get hash code for the Alias field. int nameHash = Name.ToLowerInvariant().GetHashCode(); - //Calculate the hash code for the product. + //Calculate the hash code for the product. return baseHash ^ nameHash; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/PropertyGroupCollection.cs b/src/Umbraco.Core/Models/PropertyGroupCollection.cs index 399fa22be6..7530208ada 100644 --- a/src/Umbraco.Core/Models/PropertyGroupCollection.cs +++ b/src/Umbraco.Core/Models/PropertyGroupCollection.cs @@ -17,12 +17,12 @@ namespace Umbraco.Core.Models public class PropertyGroupCollection : KeyedCollection, INotifyCollectionChanged, IDeepCloneable { private readonly ReaderWriterLockSlim _addLocker = new ReaderWriterLockSlim(); - + internal Action OnAdd; internal PropertyGroupCollection() { - + } public PropertyGroupCollection(IEnumerable groups) @@ -98,7 +98,7 @@ namespace Umbraco.Core.Models } } } - + base.Add(item); OnAdd.IfNotNull(x => x.Invoke());//Could this not be replaced by a Mandate/Contract for ensuring item is not null @@ -175,8 +175,8 @@ namespace Umbraco.Core.Models foreach (var p in this) { newGroup.Add((PropertyGroup)p.DeepClone()); - } + } return newGroup; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/PropertyTagBehavior.cs b/src/Umbraco.Core/Models/PropertyTagBehavior.cs index 0a435ebf95..f0a6d47fb5 100644 --- a/src/Umbraco.Core/Models/PropertyTagBehavior.cs +++ b/src/Umbraco.Core/Models/PropertyTagBehavior.cs @@ -6,4 +6,4 @@ Remove, Merge } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/PropertyTags.cs b/src/Umbraco.Core/Models/PropertyTags.cs index 6075502131..7af66401af 100644 --- a/src/Umbraco.Core/Models/PropertyTags.cs +++ b/src/Umbraco.Core/Models/PropertyTags.cs @@ -15,9 +15,9 @@ namespace Umbraco.Core.Models } /// - /// The behavior of how to save the tags assigned - - /// Merge (keep existing and append new), - /// Remove (remove any of the tags in the Tags property that are currently assigned, + /// The behavior of how to save the tags assigned - + /// Merge (keep existing and append new), + /// Remove (remove any of the tags in the Tags property that are currently assigned, /// Replace (replace the currently assigned tags with the ones specified) /// public PropertyTagBehavior Behavior { get; set; } @@ -33,4 +33,4 @@ namespace Umbraco.Core.Models public IEnumerable> Tags { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/PropertyType.cs b/src/Umbraco.Core/Models/PropertyType.cs index 0aebcb6544..25c45c5b0d 100644 --- a/src/Umbraco.Core/Models/PropertyType.cs +++ b/src/Umbraco.Core/Models/PropertyType.cs @@ -183,7 +183,7 @@ namespace Umbraco.Core.Models //don't allow setting this if an explicit declaration has been made in the ctor if (_isExplicitDbType) return; - SetPropertyValueAndDetectChanges(value, ref _dataTypeDatabaseType, Ps.Value.DataTypeDatabaseTypeSelector); + SetPropertyValueAndDetectChanges(value, ref _dataTypeDatabaseType, Ps.Value.DataTypeDatabaseTypeSelector); } } @@ -436,4 +436,4 @@ namespace Umbraco.Core.Models return clone; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/PropertyTypeCollection.cs b/src/Umbraco.Core/Models/PropertyTypeCollection.cs index a06e6d737d..d0962ca9c4 100644 --- a/src/Umbraco.Core/Models/PropertyTypeCollection.cs +++ b/src/Umbraco.Core/Models/PropertyTypeCollection.cs @@ -24,7 +24,7 @@ namespace Umbraco.Core.Models internal PropertyTypeCollection() { - + } public PropertyTypeCollection(IEnumerable properties) @@ -85,7 +85,7 @@ namespace Umbraco.Core.Models } } - //check if the item's sort order is already in use + //check if the item's sort order is already in use if (this.Any(x => x.SortOrder == item.SortOrder)) { //make it the next iteration @@ -155,4 +155,4 @@ namespace Umbraco.Core.Models return newGroup; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/PublicAccessEntry.cs b/src/Umbraco.Core/Models/PublicAccessEntry.cs index a458ce925a..81e71b5de3 100644 --- a/src/Umbraco.Core/Models/PublicAccessEntry.cs +++ b/src/Umbraco.Core/Models/PublicAccessEntry.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Collections.Specialized; @@ -153,4 +153,4 @@ namespace Umbraco.Core.Models } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/PublicAccessRule.cs b/src/Umbraco.Core/Models/PublicAccessRule.cs index ed2cbdbd48..fe7c4c5e4f 100644 --- a/src/Umbraco.Core/Models/PublicAccessRule.cs +++ b/src/Umbraco.Core/Models/PublicAccessRule.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Reflection; using System.Runtime.Serialization; using Umbraco.Core.Models.EntityBase; @@ -30,7 +30,7 @@ namespace Umbraco.Core.Models public readonly PropertyInfo RuleValueSelector = ExpressionHelper.GetPropertyInfo(x => x.RuleValue); public readonly PropertyInfo RuleTypeSelector = ExpressionHelper.GetPropertyInfo(x => x.RuleType); } - + public Guid AccessEntryId { get; internal set; } public string RuleValue @@ -45,6 +45,6 @@ namespace Umbraco.Core.Models set { SetPropertyValueAndDetectChanges(value, ref _ruleType, Ps.Value.RuleTypeSelector); } } - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/PublishedContent/IPublishedContent.cs b/src/Umbraco.Core/Models/PublishedContent/IPublishedContent.cs index 8d9e77ce2b..8f47922d07 100644 --- a/src/Umbraco.Core/Models/PublishedContent/IPublishedContent.cs +++ b/src/Umbraco.Core/Models/PublishedContent/IPublishedContent.cs @@ -1,44 +1,44 @@ -using System; +using System; using System.Collections.Generic; namespace Umbraco.Core.Models.PublishedContent { - /// - /// Represents a cached content. - /// - /// + /// + /// Represents a cached content. + /// + /// /// SD: A replacement for INode which needs to occur since INode doesn't contain the document type alias /// and INode is poorly formatted with mutable properties (i.e. Lists instead of IEnumerable). /// Stephan: initially, that was for cached published content only. Now, we're using it also for /// cached preview (so, maybe unpublished) content. A better name would therefore be ICachedContent, as /// has been suggested. However, can't change now. Maybe in v7? - /// + /// public interface IPublishedContent : IPublishedFragment { #region Content int Id { get; } int TemplateId { get; } - int SortOrder { get; } - string Name { get; } - string UrlName { get; } - string DocumentTypeAlias { get; } - int DocumentTypeId { get; } - string WriterName { get; } - string CreatorName { get; } - int WriterId { get; } - int CreatorId { get; } - string Path { get; } - DateTime CreateDate { get; } - DateTime UpdateDate { get; } - Guid Version { get; } - int Level { get; } - string Url { get; } + int SortOrder { get; } + string Name { get; } + string UrlName { get; } + string DocumentTypeAlias { get; } + int DocumentTypeId { get; } + string WriterName { get; } + string CreatorName { get; } + int WriterId { get; } + int CreatorId { get; } + string Path { get; } + DateTime CreateDate { get; } + DateTime UpdateDate { get; } + Guid Version { get; } + int Level { get; } + string Url { get; } /// /// Gets a value indicating whether the content is a content (aka a document) or a media. /// - PublishedItemType ItemType { get; } + PublishedItemType ItemType { get; } /// /// Gets a value indicating whether the content is draft. @@ -55,13 +55,13 @@ namespace Umbraco.Core.Models.PublishedContent /// Gets the parent of the content. /// /// The parent of root content is null. - IPublishedContent Parent { get; } + IPublishedContent Parent { get; } /// /// Gets the children of the content. /// /// Children are sorted by their sortOrder. - IEnumerable Children { get; } + IEnumerable Children { get; } #endregion @@ -83,4 +83,4 @@ namespace Umbraco.Core.Models.PublishedContent #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/PublishedContent/IPublishedContentModelFactory.cs b/src/Umbraco.Core/Models/PublishedContent/IPublishedContentModelFactory.cs index 87017d56b3..3e8edd4b74 100644 --- a/src/Umbraco.Core/Models/PublishedContent/IPublishedContentModelFactory.cs +++ b/src/Umbraco.Core/Models/PublishedContent/IPublishedContentModelFactory.cs @@ -30,4 +30,4 @@ // then // VARIANTS ARCHITECTURE FFS! } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/PublishedContent/IPublishedProperty.cs b/src/Umbraco.Core/Models/PublishedContent/IPublishedProperty.cs index da11a1b98f..83cd9d0dfe 100644 --- a/src/Umbraco.Core/Models/PublishedContent/IPublishedProperty.cs +++ b/src/Umbraco.Core/Models/PublishedContent/IPublishedProperty.cs @@ -1,14 +1,14 @@ -namespace Umbraco.Core.Models.PublishedContent +namespace Umbraco.Core.Models.PublishedContent { /// /// Represents a property of an IPublishedContent. /// - public interface IPublishedProperty - { + public interface IPublishedProperty + { /// /// Gets the alias of the property. /// - string PropertyTypeAlias { get; } + string PropertyTypeAlias { get; } /// /// Gets a value indicating whether the property has a value. @@ -56,5 +56,5 @@ namespace Umbraco.Core.Models.PublishedContent /// It has been fully prepared and processed by the appropriate converter. /// object XPathValue { get; } - } -} \ No newline at end of file + } +} diff --git a/src/Umbraco.Core/Models/PublishedContent/PropertyResult.cs b/src/Umbraco.Core/Models/PublishedContent/PropertyResult.cs index 4bf96eedea..c1a36d67bb 100644 --- a/src/Umbraco.Core/Models/PublishedContent/PropertyResult.cs +++ b/src/Umbraco.Core/Models/PublishedContent/PropertyResult.cs @@ -7,25 +7,25 @@ namespace Umbraco.Core.Models.PublishedContent internal class PropertyResult : IPublishedProperty, IHtmlString { private readonly IPublishedProperty _source; - private readonly string _alias; - private readonly object _value; + private readonly string _alias; + private readonly object _value; internal PropertyResult(IPublishedProperty source, PropertyResultType type) { - if (source == null) throw new ArgumentNullException(nameof(source)); - + if (source == null) throw new ArgumentNullException(nameof(source)); + PropertyType = type; _source = source; } - internal PropertyResult(string alias, object value, PropertyResultType type) + internal PropertyResult(string alias, object value, PropertyResultType type) { - if (alias == null) throw new ArgumentNullException(nameof(alias)); - if (value == null) throw new ArgumentNullException(nameof(value)); + if (alias == null) throw new ArgumentNullException(nameof(alias)); + if (value == null) throw new ArgumentNullException(nameof(value)); PropertyType = type; _alias = alias; - _value = value; + _value = value; } internal PropertyResultType PropertyType { get; } @@ -39,7 +39,7 @@ namespace Umbraco.Core.Models.PublishedContent public string ToHtmlString() { var value = Value; - return value?.ToString() ?? string.Empty; + return value?.ToString() ?? string.Empty; } } } diff --git a/src/Umbraco.Core/Models/PublishedContent/PropertyResultType.cs b/src/Umbraco.Core/Models/PublishedContent/PropertyResultType.cs index bf045ef517..86310ea6e6 100644 --- a/src/Umbraco.Core/Models/PublishedContent/PropertyResultType.cs +++ b/src/Umbraco.Core/Models/PublishedContent/PropertyResultType.cs @@ -3,18 +3,18 @@ internal enum PropertyResultType { /// - /// The property resolved was a normal document property - /// - UserProperty, + /// The property resolved was a normal document property + /// + UserProperty, - /// - /// The property resolved was a property defined as a member on the document object (IPublishedContent) itself - /// - ReflectedProperty, + /// + /// The property resolved was a property defined as a member on the document object (IPublishedContent) itself + /// + ReflectedProperty, - /// - /// The property was created manually for a custom purpose - /// - CustomProperty + /// + /// The property was created manually for a custom purpose + /// + CustomProperty } } diff --git a/src/Umbraco.Core/Models/PublishedContent/PublishedContentTypeConverter.cs b/src/Umbraco.Core/Models/PublishedContent/PublishedContentTypeConverter.cs index c8c331f0d0..e003926462 100644 --- a/src/Umbraco.Core/Models/PublishedContent/PublishedContentTypeConverter.cs +++ b/src/Umbraco.Core/Models/PublishedContent/PublishedContentTypeConverter.cs @@ -34,4 +34,4 @@ namespace Umbraco.Core.Models.PublishedContent return base.ConvertTo(context, culture, value, destinationType); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/PublishedContent/PublishedItemType.cs b/src/Umbraco.Core/Models/PublishedContent/PublishedItemType.cs index dbc5431855..a7829371d9 100644 --- a/src/Umbraco.Core/Models/PublishedContent/PublishedItemType.cs +++ b/src/Umbraco.Core/Models/PublishedContent/PublishedItemType.cs @@ -1,23 +1,23 @@ -namespace Umbraco.Core.Models.PublishedContent +namespace Umbraco.Core.Models.PublishedContent { /// - /// The type of published content, ie whether it is a content or a media. - /// - public enum PublishedItemType - { + /// The type of published content, ie whether it is a content or a media. + /// + public enum PublishedItemType + { /// /// A content, ie what was formerly known as a document. /// - Content, + Content, /// /// A media. /// - Media, + Media, /// /// A member. /// Member - } -} \ No newline at end of file + } +} diff --git a/src/Umbraco.Core/Models/PublishedState.cs b/src/Umbraco.Core/Models/PublishedState.cs index d169262802..374f47de7f 100644 --- a/src/Umbraco.Core/Models/PublishedState.cs +++ b/src/Umbraco.Core/Models/PublishedState.cs @@ -51,4 +51,4 @@ namespace Umbraco.Core.Models Unpublishing } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Range.cs b/src/Umbraco.Core/Models/Range.cs index 3095d6342d..83afa11658 100644 --- a/src/Umbraco.Core/Models/Range.cs +++ b/src/Umbraco.Core/Models/Range.cs @@ -49,4 +49,4 @@ namespace Umbraco.Core.Models return this.IsValid() && range.IsValid() && this.ContainsValue(range.Minimum) && this.ContainsValue(range.Maximum); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/AccessDto.cs b/src/Umbraco.Core/Models/Rdbms/AccessDto.cs index b9a512e027..2eaea31af1 100644 --- a/src/Umbraco.Core/Models/Rdbms/AccessDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/AccessDto.cs @@ -43,4 +43,4 @@ namespace Umbraco.Core.Models.Rdbms [Reference(ReferenceType.Many, ReferenceMemberName = "AccessId")] public List Rules { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/AccessRuleDto.cs b/src/Umbraco.Core/Models/Rdbms/AccessRuleDto.cs index 07f9d4f175..deaba75e6a 100644 --- a/src/Umbraco.Core/Models/Rdbms/AccessRuleDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/AccessRuleDto.cs @@ -1,4 +1,4 @@ -using System; +using System; using NPoco; using Umbraco.Core.Persistence; using Umbraco.Core.Persistence.DatabaseAnnotations; @@ -34,4 +34,4 @@ namespace Umbraco.Core.Models.Rdbms [Constraint(Default = SystemMethods.CurrentDateTime)] public DateTime UpdateDate { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/CacheInstructionDto.cs b/src/Umbraco.Core/Models/Rdbms/CacheInstructionDto.cs index 182b8c67b3..5cbd6bb37d 100644 --- a/src/Umbraco.Core/Models/Rdbms/CacheInstructionDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/CacheInstructionDto.cs @@ -29,4 +29,4 @@ namespace Umbraco.Core.Models.Rdbms [Length(500)] public string OriginIdentity { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/ContentDto.cs b/src/Umbraco.Core/Models/Rdbms/ContentDto.cs index 8cef85b998..1abca98fa2 100644 --- a/src/Umbraco.Core/Models/Rdbms/ContentDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/ContentDto.cs @@ -26,4 +26,4 @@ namespace Umbraco.Core.Models.Rdbms [Reference(ReferenceType.OneToOne, ColumnName = "NodeId")] public NodeDto NodeDto { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/ContentType2ContentTypeDto.cs b/src/Umbraco.Core/Models/Rdbms/ContentType2ContentTypeDto.cs index a4e5b6b71b..2fbf497b4f 100644 --- a/src/Umbraco.Core/Models/Rdbms/ContentType2ContentTypeDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/ContentType2ContentTypeDto.cs @@ -17,4 +17,4 @@ namespace Umbraco.Core.Models.Rdbms [ForeignKey(typeof(NodeDto), Name = "FK_cmsContentType2ContentType_umbracoNode_child")] public int ChildId { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/ContentTypeAllowedContentTypeDto.cs b/src/Umbraco.Core/Models/Rdbms/ContentTypeAllowedContentTypeDto.cs index 9c101ffda4..c385bd7020 100644 --- a/src/Umbraco.Core/Models/Rdbms/ContentTypeAllowedContentTypeDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/ContentTypeAllowedContentTypeDto.cs @@ -26,4 +26,4 @@ namespace Umbraco.Core.Models.Rdbms [Reference(ReferenceType.OneToOne)] public ContentTypeDto ContentTypeDto { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/ContentTypeDto.cs b/src/Umbraco.Core/Models/Rdbms/ContentTypeDto.cs index 483587cffc..2c42dd92c6 100644 --- a/src/Umbraco.Core/Models/Rdbms/ContentTypeDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/ContentTypeDto.cs @@ -47,4 +47,4 @@ namespace Umbraco.Core.Models.Rdbms [ResultColumn] public NodeDto NodeDto { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/ContentTypeTemplateDto.cs b/src/Umbraco.Core/Models/Rdbms/ContentTypeTemplateDto.cs index 5ebd97319a..f6d8535a24 100644 --- a/src/Umbraco.Core/Models/Rdbms/ContentTypeTemplateDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/ContentTypeTemplateDto.cs @@ -27,4 +27,4 @@ namespace Umbraco.Core.Models.Rdbms [Reference(ReferenceType.OneToOne)] public ContentTypeDto ContentTypeDto { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/ContentVersionDto.cs b/src/Umbraco.Core/Models/Rdbms/ContentVersionDto.cs index 715f9908e4..906e03b733 100644 --- a/src/Umbraco.Core/Models/Rdbms/ContentVersionDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/ContentVersionDto.cs @@ -32,4 +32,4 @@ namespace Umbraco.Core.Models.Rdbms [Reference(ReferenceType.OneToOne, ColumnName = "NodeId", ReferenceMemberName = "NodeId")] public ContentDto ContentDto { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/ContentXmlDto.cs b/src/Umbraco.Core/Models/Rdbms/ContentXmlDto.cs index 62420a100f..8d2eb3afb8 100644 --- a/src/Umbraco.Core/Models/Rdbms/ContentXmlDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/ContentXmlDto.cs @@ -20,4 +20,4 @@ namespace Umbraco.Core.Models.Rdbms [Column("rv")] public long Rv { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/DataTypeDto.cs b/src/Umbraco.Core/Models/Rdbms/DataTypeDto.cs index 16575d01c9..50aec2fadf 100644 --- a/src/Umbraco.Core/Models/Rdbms/DataTypeDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/DataTypeDto.cs @@ -30,4 +30,4 @@ namespace Umbraco.Core.Models.Rdbms [Reference(ReferenceType.OneToOne, ColumnName = "DataTypeId")] public NodeDto NodeDto { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/DataTypePreValueDto.cs b/src/Umbraco.Core/Models/Rdbms/DataTypePreValueDto.cs index 2d66ca918d..aee8b6c79b 100644 --- a/src/Umbraco.Core/Models/Rdbms/DataTypePreValueDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/DataTypePreValueDto.cs @@ -48,4 +48,4 @@ namespace Umbraco.Core.Models.Rdbms return Id; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/DictionaryDto.cs b/src/Umbraco.Core/Models/Rdbms/DictionaryDto.cs index 262c9f3c5b..be5f2a9495 100644 --- a/src/Umbraco.Core/Models/Rdbms/DictionaryDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/DictionaryDto.cs @@ -32,4 +32,4 @@ namespace Umbraco.Core.Models.Rdbms [Reference(ReferenceType.Many, ColumnName = "UniqueId", ReferenceMemberName = "UniqueId")] public List LanguageTextDtos { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/DocumentDto.cs b/src/Umbraco.Core/Models/Rdbms/DocumentDto.cs index 2ad44fbe58..2ac3e2ed2d 100644 --- a/src/Umbraco.Core/Models/Rdbms/DocumentDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/DocumentDto.cs @@ -61,4 +61,4 @@ namespace Umbraco.Core.Models.Rdbms [Reference(ReferenceType.OneToOne, ReferenceMemberName = "NodeId")] public DocumentPublishedReadOnlyDto DocumentPublishedReadOnlyDto { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/DocumentPublishedReadOnlyDto.cs b/src/Umbraco.Core/Models/Rdbms/DocumentPublishedReadOnlyDto.cs index 83c5c46f2b..b9c17dc93b 100644 --- a/src/Umbraco.Core/Models/Rdbms/DocumentPublishedReadOnlyDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/DocumentPublishedReadOnlyDto.cs @@ -23,4 +23,4 @@ namespace Umbraco.Core.Models.Rdbms [Column("updateDate")] public DateTime VersionDate { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/DomainDto.cs b/src/Umbraco.Core/Models/Rdbms/DomainDto.cs index e78c442184..003c48d006 100644 --- a/src/Umbraco.Core/Models/Rdbms/DomainDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/DomainDto.cs @@ -31,4 +31,4 @@ namespace Umbraco.Core.Models.Rdbms [ResultColumn("languageISOCode")] public string IsoCode { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/ExternalLoginDto.cs b/src/Umbraco.Core/Models/Rdbms/ExternalLoginDto.cs index 1f335ec6ce..b8f15c3a8d 100644 --- a/src/Umbraco.Core/Models/Rdbms/ExternalLoginDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/ExternalLoginDto.cs @@ -1,4 +1,4 @@ -using System; +using System; using NPoco; using Umbraco.Core.Persistence; using Umbraco.Core.Persistence.DatabaseAnnotations; @@ -34,4 +34,4 @@ namespace Umbraco.Core.Models.Rdbms } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/LanguageDto.cs b/src/Umbraco.Core/Models/Rdbms/LanguageDto.cs index 2e6a4fdae2..840b49f7d0 100644 --- a/src/Umbraco.Core/Models/Rdbms/LanguageDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/LanguageDto.cs @@ -24,4 +24,4 @@ namespace Umbraco.Core.Models.Rdbms [Length(100)] public string CultureName { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/LanguageTextDto.cs b/src/Umbraco.Core/Models/Rdbms/LanguageTextDto.cs index e14ffdb8a8..5deb74dfe2 100644 --- a/src/Umbraco.Core/Models/Rdbms/LanguageTextDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/LanguageTextDto.cs @@ -26,4 +26,4 @@ namespace Umbraco.Core.Models.Rdbms [Length(1000)] public string Value { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/LockDto.cs b/src/Umbraco.Core/Models/Rdbms/LockDto.cs index 5227c15c66..ead0450613 100644 --- a/src/Umbraco.Core/Models/Rdbms/LockDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/LockDto.cs @@ -21,4 +21,4 @@ namespace Umbraco.Core.Models.Rdbms [Length(64)] public string Name { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/LogDto.cs b/src/Umbraco.Core/Models/Rdbms/LogDto.cs index 277720d29b..a19d2a221c 100644 --- a/src/Umbraco.Core/Models/Rdbms/LogDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/LogDto.cs @@ -35,4 +35,4 @@ namespace Umbraco.Core.Models.Rdbms [Length(4000)] public string Comment { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/MacroDto.cs b/src/Umbraco.Core/Models/Rdbms/MacroDto.cs index 1c4f281bf5..cc971a56f4 100644 --- a/src/Umbraco.Core/Models/Rdbms/MacroDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/MacroDto.cs @@ -68,4 +68,4 @@ namespace Umbraco.Core.Models.Rdbms [Reference(ReferenceType.Many, ReferenceMemberName = "Macro")] public List MacroPropertyDtos { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/MacroPropertyDto.cs b/src/Umbraco.Core/Models/Rdbms/MacroPropertyDto.cs index f351618fbe..6b04f53df9 100644 --- a/src/Umbraco.Core/Models/Rdbms/MacroPropertyDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/MacroPropertyDto.cs @@ -37,4 +37,4 @@ namespace Umbraco.Core.Models.Rdbms [Column("macroPropertyName")] public string Name { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/Member2MemberGroupDto.cs b/src/Umbraco.Core/Models/Rdbms/Member2MemberGroupDto.cs index 653f4d3c87..cbf6542722 100644 --- a/src/Umbraco.Core/Models/Rdbms/Member2MemberGroupDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/Member2MemberGroupDto.cs @@ -18,4 +18,4 @@ namespace Umbraco.Core.Models.Rdbms [ForeignKey(typeof(NodeDto))] public int MemberGroup { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/MemberDto.cs b/src/Umbraco.Core/Models/Rdbms/MemberDto.cs index de4cc50382..6821713712 100644 --- a/src/Umbraco.Core/Models/Rdbms/MemberDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/MemberDto.cs @@ -35,4 +35,4 @@ namespace Umbraco.Core.Models.Rdbms [Reference(ReferenceType.OneToOne, ReferenceMemberName = "NodeId")] public ContentVersionDto ContentVersionDto { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/MemberTypeDto.cs b/src/Umbraco.Core/Models/Rdbms/MemberTypeDto.cs index 7d637e74c6..ed7819e8c0 100644 --- a/src/Umbraco.Core/Models/Rdbms/MemberTypeDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/MemberTypeDto.cs @@ -29,4 +29,4 @@ namespace Umbraco.Core.Models.Rdbms [Constraint(Default = "0")] public bool ViewOnProfile { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/MemberTypeReadOnlyDto.cs b/src/Umbraco.Core/Models/Rdbms/MemberTypeReadOnlyDto.cs index 4997134ccf..9fb028b5a6 100644 --- a/src/Umbraco.Core/Models/Rdbms/MemberTypeReadOnlyDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/MemberTypeReadOnlyDto.cs @@ -78,4 +78,4 @@ namespace Umbraco.Core.Models.Rdbms [Reference(ReferenceType.Many, ReferenceMemberName = "ContentTypeNodeId")] public List PropertyTypeGroups { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/MigrationDto.cs b/src/Umbraco.Core/Models/Rdbms/MigrationDto.cs index 2cff4f1c5a..4f2f80a0e5 100644 --- a/src/Umbraco.Core/Models/Rdbms/MigrationDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/MigrationDto.cs @@ -1,4 +1,4 @@ -using System; +using System; using NPoco; using Umbraco.Core.Persistence; using Umbraco.Core.Persistence.DatabaseAnnotations; @@ -28,4 +28,4 @@ namespace Umbraco.Core.Models.Rdbms [Length(50)] public string Version { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/NodeDto.cs b/src/Umbraco.Core/Models/Rdbms/NodeDto.cs index 26a97d251e..1acf0127cd 100644 --- a/src/Umbraco.Core/Models/Rdbms/NodeDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/NodeDto.cs @@ -61,4 +61,4 @@ namespace Umbraco.Core.Models.Rdbms [Constraint(Default = SystemMethods.CurrentDateTime)] public DateTime CreateDate { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/PreviewXmlDto.cs b/src/Umbraco.Core/Models/Rdbms/PreviewXmlDto.cs index 1fec47d646..ffab630934 100644 --- a/src/Umbraco.Core/Models/Rdbms/PreviewXmlDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/PreviewXmlDto.cs @@ -20,4 +20,4 @@ namespace Umbraco.Core.Models.Rdbms [Column("rv")] public long Rv { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/PropertyDataDto.cs b/src/Umbraco.Core/Models/Rdbms/PropertyDataDto.cs index 12ff203351..12438bfb71 100644 --- a/src/Umbraco.Core/Models/Rdbms/PropertyDataDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/PropertyDataDto.cs @@ -113,4 +113,4 @@ namespace Umbraco.Core.Models.Rdbms return Id; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/PropertyTypeDto.cs b/src/Umbraco.Core/Models/Rdbms/PropertyTypeDto.cs index cc74268c8a..73f69e0af7 100644 --- a/src/Umbraco.Core/Models/Rdbms/PropertyTypeDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/PropertyTypeDto.cs @@ -62,4 +62,4 @@ namespace Umbraco.Core.Models.Rdbms [Index(IndexTypes.UniqueNonClustered, Name = "IX_cmsPropertyTypeUniqueID")] public Guid UniqueId { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/PropertyTypeGroupDto.cs b/src/Umbraco.Core/Models/Rdbms/PropertyTypeGroupDto.cs index c560780dcf..4311b3ac41 100644 --- a/src/Umbraco.Core/Models/Rdbms/PropertyTypeGroupDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/PropertyTypeGroupDto.cs @@ -36,4 +36,4 @@ namespace Umbraco.Core.Models.Rdbms [Index(IndexTypes.UniqueNonClustered, Name = "IX_cmsPropertyTypeGroupUniqueID")] public Guid UniqueId { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/PropertyTypeGroupReadOnlyDto.cs b/src/Umbraco.Core/Models/Rdbms/PropertyTypeGroupReadOnlyDto.cs index fb5d833036..8107cc2abe 100644 --- a/src/Umbraco.Core/Models/Rdbms/PropertyTypeGroupReadOnlyDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/PropertyTypeGroupReadOnlyDto.cs @@ -24,4 +24,4 @@ namespace Umbraco.Core.Models.Rdbms [Column("PropertyGroupUniqueID")] public Guid UniqueId { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/PropertyTypeReadOnlyDto.cs b/src/Umbraco.Core/Models/Rdbms/PropertyTypeReadOnlyDto.cs index 36ac4e1c3c..1a9988c1b6 100644 --- a/src/Umbraco.Core/Models/Rdbms/PropertyTypeReadOnlyDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/PropertyTypeReadOnlyDto.cs @@ -53,7 +53,7 @@ namespace Umbraco.Core.Models.Rdbms [Column("dbType")] public string DbType { get; set; } - [Column("UniqueID")] + [Column("UniqueID")] public Guid UniqueId { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/RelationDto.cs b/src/Umbraco.Core/Models/Rdbms/RelationDto.cs index 0809dc0d1a..b0c55137be 100644 --- a/src/Umbraco.Core/Models/Rdbms/RelationDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/RelationDto.cs @@ -36,4 +36,4 @@ namespace Umbraco.Core.Models.Rdbms [Length(1000)] public string Comment { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/RelationTypeDto.cs b/src/Umbraco.Core/Models/Rdbms/RelationTypeDto.cs index d2a8086a5b..9ecdd17f66 100644 --- a/src/Umbraco.Core/Models/Rdbms/RelationTypeDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/RelationTypeDto.cs @@ -39,4 +39,4 @@ namespace Umbraco.Core.Models.Rdbms [Index(IndexTypes.UniqueNonClustered, Name = "IX_umbracoRelationType_alias")] public string Alias { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/ServerRegistrationDto.cs b/src/Umbraco.Core/Models/Rdbms/ServerRegistrationDto.cs index 55b6145a3a..57cc10d1cd 100644 --- a/src/Umbraco.Core/Models/Rdbms/ServerRegistrationDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/ServerRegistrationDto.cs @@ -38,4 +38,4 @@ namespace Umbraco.Core.Models.Rdbms [Column("isMaster")] public bool IsMaster { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/StylesheetDto.cs b/src/Umbraco.Core/Models/Rdbms/StylesheetDto.cs index 6ff7c0bc00..8800e4fe1c 100644 --- a/src/Umbraco.Core/Models/Rdbms/StylesheetDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/StylesheetDto.cs @@ -22,4 +22,4 @@ namespace Umbraco.Core.Models.Rdbms [NullSetting(NullSetting = NullSettings.Null)] public string Content { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/StylesheetPropertyDto.cs b/src/Umbraco.Core/Models/Rdbms/StylesheetPropertyDto.cs index 0d4c2ec3fa..43049e2811 100644 --- a/src/Umbraco.Core/Models/Rdbms/StylesheetPropertyDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/StylesheetPropertyDto.cs @@ -26,4 +26,4 @@ namespace Umbraco.Core.Models.Rdbms [Length(400)] public string Value { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/TagDto.cs b/src/Umbraco.Core/Models/Rdbms/TagDto.cs index cb37f2c723..681af40eb7 100644 --- a/src/Umbraco.Core/Models/Rdbms/TagDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/TagDto.cs @@ -29,7 +29,7 @@ namespace Umbraco.Core.Models.Rdbms [Length(100)] public string Group { get; set; }//NOTE Is set to [varchar] (100) in Sql Server script - [ResultColumn("NodeCount")] + [ResultColumn("NodeCount")] public int NodeCount { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/TagRelationshipDto.cs b/src/Umbraco.Core/Models/Rdbms/TagRelationshipDto.cs index d605530839..58b116d28f 100644 --- a/src/Umbraco.Core/Models/Rdbms/TagRelationshipDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/TagRelationshipDto.cs @@ -22,4 +22,4 @@ namespace Umbraco.Core.Models.Rdbms [ForeignKey(typeof(PropertyTypeDto), Name = "FK_cmsTagRelationship_cmsPropertyType")] public int PropertyTypeId { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/TaskDto.cs b/src/Umbraco.Core/Models/Rdbms/TaskDto.cs index 7ce24aa21e..c4ed4ec1c5 100644 --- a/src/Umbraco.Core/Models/Rdbms/TaskDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/TaskDto.cs @@ -48,4 +48,4 @@ namespace Umbraco.Core.Models.Rdbms [Reference(ReferenceType.OneToOne, ColumnName = "TaskTypeId")] public TaskTypeDto TaskTypeDto { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/TaskTypeDto.cs b/src/Umbraco.Core/Models/Rdbms/TaskTypeDto.cs index 113908a47c..a171844503 100644 --- a/src/Umbraco.Core/Models/Rdbms/TaskTypeDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/TaskTypeDto.cs @@ -17,4 +17,4 @@ namespace Umbraco.Core.Models.Rdbms [Index(IndexTypes.NonClustered)] public string Alias { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/TemplateDto.cs b/src/Umbraco.Core/Models/Rdbms/TemplateDto.cs index b0bdb17bba..9da7ab9462 100644 --- a/src/Umbraco.Core/Models/Rdbms/TemplateDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/TemplateDto.cs @@ -16,7 +16,7 @@ namespace Umbraco.Core.Models.Rdbms [Column("nodeId")] [Index(IndexTypes.UniqueNonClustered)] [ForeignKey(typeof(NodeDto), Name = "FK_cmsTemplate_umbracoNode")] - public int NodeId { get; set; } + public int NodeId { get; set; } [Column("alias")] [Length(100)] @@ -31,4 +31,4 @@ namespace Umbraco.Core.Models.Rdbms [Reference(ReferenceType.OneToOne, ColumnName = "NodeId")] public NodeDto NodeDto { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/User2AppDto.cs b/src/Umbraco.Core/Models/Rdbms/User2AppDto.cs index 5c80c6e117..eba72562ed 100644 --- a/src/Umbraco.Core/Models/Rdbms/User2AppDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/User2AppDto.cs @@ -18,4 +18,4 @@ namespace Umbraco.Core.Models.Rdbms [Length(50)] public string AppAlias { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/User2NodeNotifyDto.cs b/src/Umbraco.Core/Models/Rdbms/User2NodeNotifyDto.cs index e45c0a6ad8..c9f6b04efe 100644 --- a/src/Umbraco.Core/Models/Rdbms/User2NodeNotifyDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/User2NodeNotifyDto.cs @@ -23,4 +23,4 @@ namespace Umbraco.Core.Models.Rdbms [Length(1)] public string Action { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/User2NodePermissionDto.cs b/src/Umbraco.Core/Models/Rdbms/User2NodePermissionDto.cs index 8234c0973c..981481a7fe 100644 --- a/src/Umbraco.Core/Models/Rdbms/User2NodePermissionDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/User2NodePermissionDto.cs @@ -22,4 +22,4 @@ namespace Umbraco.Core.Models.Rdbms [Column("permission")] public string Permission { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/UserDto.cs b/src/Umbraco.Core/Models/Rdbms/UserDto.cs index 350f4b4a79..6214b0670b 100644 --- a/src/Umbraco.Core/Models/Rdbms/UserDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/UserDto.cs @@ -48,7 +48,7 @@ namespace Umbraco.Core.Models.Rdbms [Column("userEmail")] public string Email { get; set; } - + [Column("userLanguage")] [NullSetting(NullSetting = NullSettings.Null)] [Length(10)] @@ -74,9 +74,9 @@ namespace Umbraco.Core.Models.Rdbms [Column("lastLoginDate")] [NullSetting(NullSetting = NullSettings.Null)] public DateTime? LastLoginDate { get; set; } - + [ResultColumn] [Reference(ReferenceType.Many, ReferenceMemberName = "UserId")] public List User2AppDtos { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Rdbms/UserTypeDto.cs b/src/Umbraco.Core/Models/Rdbms/UserTypeDto.cs index 8b6d286073..80b588fec4 100644 --- a/src/Umbraco.Core/Models/Rdbms/UserTypeDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/UserTypeDto.cs @@ -26,4 +26,4 @@ namespace Umbraco.Core.Models.Rdbms [NullSetting(NullSetting = NullSettings.Null)] public string DefaultPermissions { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/RedirectUrl.cs b/src/Umbraco.Core/Models/RedirectUrl.cs index ff7746d0cf..752e2490ee 100644 --- a/src/Umbraco.Core/Models/RedirectUrl.cs +++ b/src/Umbraco.Core/Models/RedirectUrl.cs @@ -64,4 +64,4 @@ namespace Umbraco.Core.Models set { SetPropertyValueAndDetectChanges(value, ref _url, Ps.Value.UrlSelector); } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Relation.cs b/src/Umbraco.Core/Models/Relation.cs index 6d383f9884..e432c84fc2 100644 --- a/src/Umbraco.Core/Models/Relation.cs +++ b/src/Umbraco.Core/Models/Relation.cs @@ -86,4 +86,4 @@ namespace Umbraco.Core.Models } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/RelationType.cs b/src/Umbraco.Core/Models/RelationType.cs index adc5198f9c..0f6ce2ce69 100644 --- a/src/Umbraco.Core/Models/RelationType.cs +++ b/src/Umbraco.Core/Models/RelationType.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Reflection; using System.Runtime.Serialization; using Umbraco.Core.Exceptions; @@ -100,4 +100,4 @@ namespace Umbraco.Core.Models } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Script.cs b/src/Umbraco.Core/Models/Script.cs index 0c6eed39dd..ee481b7fe5 100644 --- a/src/Umbraco.Core/Models/Script.cs +++ b/src/Umbraco.Core/Models/Script.cs @@ -18,7 +18,7 @@ namespace Umbraco.Core.Models internal Script(string path, Func getFileContent) : base(path, getFileContent) - { } + { } /// /// Indicates whether the current entity has an identity, which in this case is a path/name. @@ -31,4 +31,4 @@ namespace Umbraco.Core.Models get { return string.IsNullOrEmpty(Path) == false; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Section.cs b/src/Umbraco.Core/Models/Section.cs index e3df5dbbbd..f1ca9c7a5d 100644 --- a/src/Umbraco.Core/Models/Section.cs +++ b/src/Umbraco.Core/Models/Section.cs @@ -15,7 +15,7 @@ public Section() { - + } public string Name { get; set; } @@ -23,4 +23,4 @@ public string Icon { get; set; } public int SortOrder { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/ServerRegistration.cs b/src/Umbraco.Core/Models/ServerRegistration.cs index f68f21d759..b6deafc242 100644 --- a/src/Umbraco.Core/Models/ServerRegistration.cs +++ b/src/Umbraco.Core/Models/ServerRegistration.cs @@ -123,4 +123,4 @@ namespace Umbraco.Core.Models return string.Format("{{\"{0}\", \"{1}\", {2}active, {3}master}}", ServerAddress, ServerIdentity, IsActive ? "" : "!", IsMaster ? "" : "!"); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Stylesheet.cs b/src/Umbraco.Core/Models/Stylesheet.cs index 060246df54..0c697eb51f 100644 --- a/src/Umbraco.Core/Models/Stylesheet.cs +++ b/src/Umbraco.Core/Models/Stylesheet.cs @@ -30,7 +30,7 @@ namespace Umbraco.Core.Models private void InitializeProperties() { - //if the value is already created, we need to be created and update the collection according to + //if the value is already created, we need to be created and update the collection according to //what is now in the content if (_properties != null && _properties.IsValueCreated) { @@ -63,7 +63,7 @@ namespace Umbraco.Core.Models var prop = new StylesheetProperty(stylesheetRule.Name, stylesheetRule.Selector, stylesheetRule.Styles); prop.PropertyChanged += Property_PropertyChanged; _properties.Value.Add(prop); - } + } } //we haven't read the properties yet so create the lazy delegate @@ -116,8 +116,8 @@ namespace Umbraco.Core.Models /// Returns a list of umbraco back office enabled stylesheet properties /// /// - /// An umbraco back office enabled stylesheet property has a special prefix, for example: - /// + /// An umbraco back office enabled stylesheet property has a special prefix, for example: + /// /// /** umb_name: MyPropertyName */ p { font-size: 1em; } /// [IgnoreDataMember] @@ -137,7 +137,7 @@ namespace Umbraco.Core.Models throw new DuplicateNameException("The property with the name " + property.Name + " already exists in the collection"); } - //now we need to serialize out the new property collection over-top of the string Content. + //now we need to serialize out the new property collection over-top of the string Content. Content = StylesheetHelper.AppendRule(Content, new StylesheetRule { Name = property.Name, @@ -160,7 +160,7 @@ namespace Umbraco.Core.Models Content = StylesheetHelper.ReplaceRule(Content, name, null); } } - + /// /// Indicates whether the current entity has an identity, which in this case is a path/name. /// @@ -172,4 +172,4 @@ namespace Umbraco.Core.Models get { return string.IsNullOrEmpty(Path) == false; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/StylesheetProperty.cs b/src/Umbraco.Core/Models/StylesheetProperty.cs index b0b2144044..41fbd8d2b4 100644 --- a/src/Umbraco.Core/Models/StylesheetProperty.cs +++ b/src/Umbraco.Core/Models/StylesheetProperty.cs @@ -57,4 +57,4 @@ namespace Umbraco.Core.Models } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Tag.cs b/src/Umbraco.Core/Models/Tag.cs index 92dfb9dee7..526ce9def4 100644 --- a/src/Umbraco.Core/Models/Tag.cs +++ b/src/Umbraco.Core/Models/Tag.cs @@ -11,7 +11,7 @@ namespace Umbraco.Core.Models public class Tag : Entity, ITag { public Tag() - { + { } public Tag(int id, string text, string @group) @@ -24,7 +24,7 @@ namespace Umbraco.Core.Models public Tag(int id, string text, string @group, int nodeCount) : this(id, text, @group) { - NodeCount = nodeCount; + NodeCount = nodeCount; } private static readonly Lazy Ps = new Lazy(); @@ -55,4 +55,4 @@ namespace Umbraco.Core.Models //TODO: enable this at some stage //public int ParentId { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/TagCacheStorageType.cs b/src/Umbraco.Core/Models/TagCacheStorageType.cs index 5078a44d85..c9258dc31c 100644 --- a/src/Umbraco.Core/Models/TagCacheStorageType.cs +++ b/src/Umbraco.Core/Models/TagCacheStorageType.cs @@ -5,4 +5,4 @@ Csv, Json } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/TaggableObjectTypes.cs b/src/Umbraco.Core/Models/TaggableObjectTypes.cs index ae54bc02bd..e669fc3af0 100644 --- a/src/Umbraco.Core/Models/TaggableObjectTypes.cs +++ b/src/Umbraco.Core/Models/TaggableObjectTypes.cs @@ -10,4 +10,4 @@ Media, Member } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/TaggedEntity.cs b/src/Umbraco.Core/Models/TaggedEntity.cs index 890412a6b6..ac194c15cd 100644 --- a/src/Umbraco.Core/Models/TaggedEntity.cs +++ b/src/Umbraco.Core/Models/TaggedEntity.cs @@ -5,7 +5,7 @@ namespace Umbraco.Core.Models /// /// Represents a tagged entity. /// - /// Note that it is the properties of an entity (like Content, Media, Members, etc.) that is tagged, + /// Note that it is the properties of an entity (like Content, Media, Members, etc.) that is tagged, /// which is why this class is composed of a list of tagged properties and an Id reference to the actual entity. public class TaggedEntity { @@ -25,4 +25,4 @@ namespace Umbraco.Core.Models /// public IEnumerable TaggedProperties { get; private set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/TaggedProperty.cs b/src/Umbraco.Core/Models/TaggedProperty.cs index 9013c25887..2b9650b432 100644 --- a/src/Umbraco.Core/Models/TaggedProperty.cs +++ b/src/Umbraco.Core/Models/TaggedProperty.cs @@ -29,4 +29,4 @@ namespace Umbraco.Core.Models /// public IEnumerable Tags { get; private set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Task.cs b/src/Umbraco.Core/Models/Task.cs index fc6350a13b..cbbe690288 100644 --- a/src/Umbraco.Core/Models/Task.cs +++ b/src/Umbraco.Core/Models/Task.cs @@ -97,4 +97,4 @@ namespace Umbraco.Core.Models } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/TaskType.cs b/src/Umbraco.Core/Models/TaskType.cs index 5a1e21e661..72b2e0f459 100644 --- a/src/Umbraco.Core/Models/TaskType.cs +++ b/src/Umbraco.Core/Models/TaskType.cs @@ -36,4 +36,4 @@ namespace Umbraco.Core.Models set { SetPropertyValueAndDetectChanges(value, ref _alias, Ps.Value.AliasSelector); } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Template.cs b/src/Umbraco.Core/Models/Template.cs index 5d7f4e552e..aafb36eaeb 100644 --- a/src/Umbraco.Core/Models/Template.cs +++ b/src/Umbraco.Core/Models/Template.cs @@ -78,7 +78,7 @@ namespace Umbraco.Core.Models /// /// Returns true if the template is used as a layout for other templates (i.e. it has 'children') /// - public bool IsMasterTemplate { get; internal set; } + public bool IsMasterTemplate { get; internal set; } public void SetMasterTemplate(ITemplate masterTemplate) { @@ -92,7 +92,7 @@ namespace Umbraco.Core.Models MasterTemplateId = new Lazy(() => masterTemplate.Id); MasterTemplateAlias = masterTemplate.Alias; } - + } protected override void DeepCloneNameAndAlias(File clone) diff --git a/src/Umbraco.Core/Models/TemplateNode.cs b/src/Umbraco.Core/Models/TemplateNode.cs index b792f6e8a7..13e5b22846 100644 --- a/src/Umbraco.Core/Models/TemplateNode.cs +++ b/src/Umbraco.Core/Models/TemplateNode.cs @@ -17,7 +17,7 @@ namespace Umbraco.Core.Models /// The current template /// public ITemplate Template { get; set; } - + /// /// The children of the current template /// @@ -31,4 +31,4 @@ namespace Umbraco.Core.Models /// public TemplateNode Parent { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/UmbracoDomain.cs b/src/Umbraco.Core/Models/UmbracoDomain.cs index 8a3ef94d5b..aee3896795 100644 --- a/src/Umbraco.Core/Models/UmbracoDomain.cs +++ b/src/Umbraco.Core/Models/UmbracoDomain.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Reflection; using System.Runtime.Serialization; using Umbraco.Core.Models.EntityBase; @@ -64,4 +64,4 @@ namespace Umbraco.Core.Models /// public string LanguageIsoCode { get; internal set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/UmbracoEntity.cs b/src/Umbraco.Core/Models/UmbracoEntity.cs index 48752468d5..f003323462 100644 --- a/src/Umbraco.Core/Models/UmbracoEntity.cs +++ b/src/Umbraco.Core/Models/UmbracoEntity.cs @@ -26,7 +26,7 @@ namespace Umbraco.Core.Models private bool _hasPendingChanges; private string _contentTypeAlias; private Guid _nodeObjectTypeId; - + private static readonly Lazy Ps = new Lazy(); private class PropertySelectors @@ -152,7 +152,7 @@ namespace Umbraco.Core.Models get { return _hasPendingChanges; } set { - SetPropertyValueAndDetectChanges(value, ref _hasPendingChanges, Ps.Value.HasPendingChangesSelector); + SetPropertyValueAndDetectChanges(value, ref _hasPendingChanges, Ps.Value.HasPendingChangesSelector); //This is a custom property that is not exposed in IUmbracoEntity so add it to the additional data AdditionalData["HasPendingChanges"] = value; } @@ -163,7 +163,7 @@ namespace Umbraco.Core.Models get { return _contentTypeAlias; } set { - SetPropertyValueAndDetectChanges(value, ref _contentTypeAlias, Ps.Value.ContentTypeAliasSelector); + SetPropertyValueAndDetectChanges(value, ref _contentTypeAlias, Ps.Value.ContentTypeAliasSelector); //This is a custom property that is not exposed in IUmbracoEntity so add it to the additional data AdditionalData["ContentTypeAlias"] = value; } @@ -174,7 +174,7 @@ namespace Umbraco.Core.Models get { return _contentTypeIcon; } set { - SetPropertyValueAndDetectChanges(value, ref _contentTypeIcon, Ps.Value.ContentTypeIconSelector); + SetPropertyValueAndDetectChanges(value, ref _contentTypeIcon, Ps.Value.ContentTypeIconSelector); //This is a custom property that is not exposed in IUmbracoEntity so add it to the additional data AdditionalData["ContentTypeIcon"] = value; } @@ -185,7 +185,7 @@ namespace Umbraco.Core.Models get { return _contentTypeThumbnail; } set { - SetPropertyValueAndDetectChanges(value, ref _contentTypeThumbnail, Ps.Value.ContentTypeThumbnailSelector); + SetPropertyValueAndDetectChanges(value, ref _contentTypeThumbnail, Ps.Value.ContentTypeThumbnailSelector); //This is a custom property that is not exposed in IUmbracoEntity so add it to the additional data AdditionalData["ContentTypeThumbnail"] = value; } @@ -224,7 +224,7 @@ namespace Umbraco.Core.Models } /// - /// A struction that can be contained in the additional data of an UmbracoEntity representing + /// A struction that can be contained in the additional data of an UmbracoEntity representing /// a user defined property /// public class EntityProperty : IDeepCloneable @@ -261,4 +261,4 @@ namespace Umbraco.Core.Models } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/UmbracoEntityExtensions.cs b/src/Umbraco.Core/Models/UmbracoEntityExtensions.cs index 1a0b3b2271..9444010177 100644 --- a/src/Umbraco.Core/Models/UmbracoEntityExtensions.cs +++ b/src/Umbraco.Core/Models/UmbracoEntityExtensions.cs @@ -67,15 +67,15 @@ namespace Umbraco.Core.Models } /// - /// This will validate the entity's path and if it's invalid it will fix it, if fixing is required it will recursively + /// This will validate the entity's path and if it's invalid it will fix it, if fixing is required it will recursively /// check and fix all ancestors if required. /// /// /// /// A callback specified to retrieve the parent entity of the entity /// A callback specified to update a fixed entity - public static void EnsureValidPath(this T entity, - ILogger logger, + public static void EnsureValidPath(this T entity, + ILogger logger, Func getParent, Action update) where T: IUmbracoEntity @@ -125,7 +125,7 @@ namespace Umbraco.Core.Models } return false; } - + public static object GetAdditionalDataValueIgnoreCase(this IUmbracoEntity entity, string key, object defaultVal) { if (entity.AdditionalData.ContainsKeyIgnoreCase(key) == false) return defaultVal; diff --git a/src/Umbraco.Core/Models/UmbracoObjectTypes.cs b/src/Umbraco.Core/Models/UmbracoObjectTypes.cs index 0df7a21e57..c1e9ba47b8 100644 --- a/src/Umbraco.Core/Models/UmbracoObjectTypes.cs +++ b/src/Umbraco.Core/Models/UmbracoObjectTypes.cs @@ -26,7 +26,7 @@ namespace Umbraco.Core.Models /// /// Root /// - [UmbracoObjectType(Constants.ObjectTypes.SystemRoot)] + [UmbracoObjectType(Constants.ObjectTypes.SystemRoot)] [FriendlyName("Root")] ROOT, @@ -100,7 +100,7 @@ namespace Umbraco.Core.Models /// Recycle Bin /// [UmbracoObjectType(Constants.ObjectTypes.ContentRecycleBin)] - [FriendlyName("Recycle Bin")] + [FriendlyName("Recycle Bin")] RecycleBin, /// @@ -180,4 +180,4 @@ namespace Umbraco.Core.Models [FriendlyName("DataSource")] FormsDataSource } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/UmbracoObjectTypesExtensions.cs b/src/Umbraco.Core/Models/UmbracoObjectTypesExtensions.cs index 5f92e6425e..e19f2efb09 100644 --- a/src/Umbraco.Core/Models/UmbracoObjectTypesExtensions.cs +++ b/src/Umbraco.Core/Models/UmbracoObjectTypesExtensions.cs @@ -136,4 +136,4 @@ namespace Umbraco.Core.Models return attribute.ToString(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/UserExtensions.cs b/src/Umbraco.Core/Models/UserExtensions.cs index 513ec7d9c5..43a4477894 100644 --- a/src/Umbraco.Core/Models/UserExtensions.cs +++ b/src/Umbraco.Core/Models/UserExtensions.cs @@ -13,7 +13,7 @@ namespace Umbraco.Core.Models /// Determines whether this user is an admin. /// /// - /// true if this user is admin; otherwise, false. + /// true if this user is admin; otherwise, false. /// public static bool IsAdmin(this IUser user) { @@ -35,7 +35,7 @@ namespace Umbraco.Core.Models /// /// /// - /// + /// public static CultureInfo GetUserCulture(this IUser user, ILocalizedTextService textService) { if (user == null) throw new ArgumentNullException(nameof(user)); @@ -48,7 +48,7 @@ namespace Umbraco.Core.Models try { var culture = CultureInfo.GetCultureInfo(userLanguage.Replace("_", "-")); - //TODO: This is a hack because we store the user language as 2 chars instead of the full culture + //TODO: This is a hack because we store the user language as 2 chars instead of the full culture // which is actually stored in the language files (which are also named with 2 chars!) so we need to attempt // to convert to a supported full culture var result = textService.ConvertToSupportedCultureWithRegionCode(culture); @@ -104,4 +104,4 @@ namespace Umbraco.Core.Models return HasPathAccess(media.Path, user.StartMediaId, Constants.System.RecycleBinMedia); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Validation/RequiredForPersistenceAttribute.cs b/src/Umbraco.Core/Models/Validation/RequiredForPersistenceAttribute.cs index b11ff67ead..d978d86556 100644 --- a/src/Umbraco.Core/Models/Validation/RequiredForPersistenceAttribute.cs +++ b/src/Umbraco.Core/Models/Validation/RequiredForPersistenceAttribute.cs @@ -3,7 +3,7 @@ namespace Umbraco.Core.Models.Validation { /// - /// A custom validation attribute which adds additional metadata to the property to indicate that + /// A custom validation attribute which adds additional metadata to the property to indicate that /// the value is required to be persisted. /// /// diff --git a/src/Umbraco.Core/Models/XsltFile.cs b/src/Umbraco.Core/Models/XsltFile.cs index 07f4d00084..a88cd2c127 100644 --- a/src/Umbraco.Core/Models/XsltFile.cs +++ b/src/Umbraco.Core/Models/XsltFile.cs @@ -29,4 +29,4 @@ namespace Umbraco.Core.Models get { return string.IsNullOrEmpty(Path) == false; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/NameValueCollectionExtensions.cs b/src/Umbraco.Core/NameValueCollectionExtensions.cs index 7b55d8131a..463d247f51 100644 --- a/src/Umbraco.Core/NameValueCollectionExtensions.cs +++ b/src/Umbraco.Core/NameValueCollectionExtensions.cs @@ -6,8 +6,8 @@ using System.Text; namespace Umbraco.Core { - internal static class NameValueCollectionExtensions - { + internal static class NameValueCollectionExtensions + { public static IEnumerable> AsEnumerable(this NameValueCollection nvc) { foreach (string key in nvc.AllKeys) @@ -16,10 +16,10 @@ namespace Umbraco.Core } } - public static bool ContainsKey(this NameValueCollection collection, string key) - { - return collection.Keys.Cast().Any(k => (string) k == key); - } + public static bool ContainsKey(this NameValueCollection collection, string key) + { + return collection.Keys.Cast().Any(k => (string) k == key); + } public static T GetValue(this NameValueCollection collection, string key, T defaultIfNotFound) { @@ -35,8 +35,8 @@ namespace Umbraco.Core } var result = val.TryConvertTo(); - + return result.Success ? result.Result : defaultIfNotFound; } - } + } } diff --git a/src/Umbraco.Core/NamedUdiRange.cs b/src/Umbraco.Core/NamedUdiRange.cs index c87e5db82e..f4c4066d61 100644 --- a/src/Umbraco.Core/NamedUdiRange.cs +++ b/src/Umbraco.Core/NamedUdiRange.cs @@ -1,4 +1,4 @@ -namespace Umbraco.Core +namespace Umbraco.Core { /// /// Represents a complemented with a name. @@ -31,4 +31,4 @@ namespace Umbraco.Core /// public string Name { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/NetworkHelper.cs b/src/Umbraco.Core/NetworkHelper.cs index 4719e03930..5f0bae70c4 100644 --- a/src/Umbraco.Core/NetworkHelper.cs +++ b/src/Umbraco.Core/NetworkHelper.cs @@ -47,4 +47,4 @@ namespace Umbraco.Core } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/ObjectExtensions.cs b/src/Umbraco.Core/ObjectExtensions.cs index 97936a1936..66db800920 100644 --- a/src/Umbraco.Core/ObjectExtensions.cs +++ b/src/Umbraco.Core/ObjectExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; @@ -10,57 +10,57 @@ using Umbraco.Core.Composing; namespace Umbraco.Core { - /// - /// Provides object extension methods. - /// - public static class ObjectExtensions - { - //private static readonly ConcurrentDictionary> ObjectFactoryCache = new ConcurrentDictionary>(); + /// + /// Provides object extension methods. + /// + public static class ObjectExtensions + { + //private static readonly ConcurrentDictionary> ObjectFactoryCache = new ConcurrentDictionary>(); - /// - /// - /// - /// - /// - /// - public static IEnumerable AsEnumerableOfOne(this T input) - { - return Enumerable.Repeat(input, 1); - } + /// + /// + /// + /// + /// + /// + public static IEnumerable AsEnumerableOfOne(this T input) + { + return Enumerable.Repeat(input, 1); + } - /// - /// - /// - /// - public static void DisposeIfDisposable(this object input) - { - var disposable = input as IDisposable; - if (disposable != null) disposable.Dispose(); - } + /// + /// + /// + /// + public static void DisposeIfDisposable(this object input) + { + var disposable = input as IDisposable; + if (disposable != null) disposable.Dispose(); + } - /// - /// Provides a shortcut way of safely casting an input when you cannot guarantee the is - /// an instance type (i.e., when the C# AS keyword is not applicable). - /// - /// - /// The input. - /// - internal static T SafeCast(this object input) - { - if (ReferenceEquals(null, input) || ReferenceEquals(default(T), input)) return default(T); - if (input is T) return (T)input; - return default(T); - } + /// + /// Provides a shortcut way of safely casting an input when you cannot guarantee the is + /// an instance type (i.e., when the C# AS keyword is not applicable). + /// + /// + /// The input. + /// + internal static T SafeCast(this object input) + { + if (ReferenceEquals(null, input) || ReferenceEquals(default(T), input)) return default(T); + if (input is T) return (T)input; + return default(T); + } - /// - /// Tries to convert the input object to the output type using TypeConverters - /// - /// - /// - /// - public static Attempt TryConvertTo(this object input) - { - var result = TryConvertTo(input, typeof(T)); + /// + /// Tries to convert the input object to the output type using TypeConverters + /// + /// + /// + /// + public static Attempt TryConvertTo(this object input) + { + var result = TryConvertTo(input, typeof(T)); if (result.Success == false) { //just try a straight up conversion @@ -74,76 +74,76 @@ namespace Umbraco.Core return Attempt.Fail(e); } } - return result.Success == false ? Attempt.Fail() : Attempt.Succeed((T)result.Result); - } + return result.Success == false ? Attempt.Fail() : Attempt.Succeed((T)result.Result); + } - /// - /// Tries to convert the input object to the output type using TypeConverters. If the destination - /// type is a superclass of the input type, if will use . - /// - /// The input. - /// Type of the destination. - /// - public static Attempt TryConvertTo(this object input, Type destinationType) - { + /// + /// Tries to convert the input object to the output type using TypeConverters. If the destination + /// type is a superclass of the input type, if will use . + /// + /// The input. + /// Type of the destination. + /// + public static Attempt TryConvertTo(this object input, Type destinationType) + { // if null... - if (input == null) - { - // nullable is ok + if (input == null) + { + // nullable is ok if (destinationType.IsGenericType && destinationType.GetGenericTypeDefinition() == typeof(Nullable<>)) return Attempt.Succeed(null); // value type is nok, else can be null, so is ok - return Attempt.If(destinationType.IsValueType == false, null); + return Attempt.If(destinationType.IsValueType == false, null); } // easy - if (destinationType == typeof(object)) return Attempt.Succeed(input); - if (input.GetType() == destinationType) return Attempt.Succeed(input); + if (destinationType == typeof(object)) return Attempt.Succeed(input); + if (input.GetType() == destinationType) return Attempt.Succeed(input); // check for string so that overloaders of ToString() can take advantage of the conversion. if (destinationType == typeof(string)) return Attempt.Succeed(input.ToString()); - // if we've got a nullable of something, we try to convert directly to that thing. - if (destinationType.IsGenericType && destinationType.GetGenericTypeDefinition() == typeof(Nullable<>)) - { - var underlyingType = Nullable.GetUnderlyingType(destinationType); + // if we've got a nullable of something, we try to convert directly to that thing. + if (destinationType.IsGenericType && destinationType.GetGenericTypeDefinition() == typeof(Nullable<>)) + { + var underlyingType = Nullable.GetUnderlyingType(destinationType); //special case for empty strings for bools/dates which should return null if an empty string - var asString = input as string; - if (asString != null && string.IsNullOrEmpty(asString) && (underlyingType == typeof(DateTime) || underlyingType == typeof(bool))) + var asString = input as string; + if (asString != null && string.IsNullOrEmpty(asString) && (underlyingType == typeof(DateTime) || underlyingType == typeof(bool))) { return Attempt.Succeed(null); } - // recursively call into myself with the inner (not-nullable) type and handle the outcome + // recursively call into myself with the inner (not-nullable) type and handle the outcome var nonNullable = input.TryConvertTo(underlyingType); - // and if sucessful, fall on through to rewrap in a nullable; if failed, pass on the exception - if (nonNullable.Success) - input = nonNullable.Result; // now fall on through... - else - return Attempt.Fail(nonNullable.Exception); - } + // and if sucessful, fall on through to rewrap in a nullable; if failed, pass on the exception + if (nonNullable.Success) + input = nonNullable.Result; // now fall on through... + else + return Attempt.Fail(nonNullable.Exception); + } - // we've already dealed with nullables, so any other generic types need to fall through - if (destinationType.IsGenericType == false) - { - if (input is string) - { + // we've already dealed with nullables, so any other generic types need to fall through + if (destinationType.IsGenericType == false) + { + if (input is string) + { // try convert from string, returns an Attempt if the string could be // processed (either succeeded or failed), else null if we need to try // other methods - var result = TryConvertToFromString(input as string, destinationType); - if (result.HasValue) return result.Value; - } + var result = TryConvertToFromString(input as string, destinationType); + if (result.HasValue) return result.Value; + } //TODO: Do a check for destination type being IEnumerable and source type implementing IEnumerable with // the same 'T', then we'd have to find the extension method for the type AsEnumerable() and execute it. - if (TypeHelper.IsTypeAssignableFrom(destinationType, input.GetType()) - && TypeHelper.IsTypeAssignableFrom(input)) - { + if (TypeHelper.IsTypeAssignableFrom(destinationType, input.GetType()) + && TypeHelper.IsTypeAssignableFrom(input)) + { try { var casted = Convert.ChangeType(input, destinationType); @@ -153,99 +153,99 @@ namespace Umbraco.Core { return Attempt.Fail(e); } - } - } + } + } - var inputConverter = TypeDescriptor.GetConverter(input); - if (inputConverter.CanConvertTo(destinationType)) - { - try - { - var converted = inputConverter.ConvertTo(input, destinationType); - return Attempt.Succeed(converted); - } - catch (Exception e) - { - return Attempt.Fail(e); - } - } + var inputConverter = TypeDescriptor.GetConverter(input); + if (inputConverter.CanConvertTo(destinationType)) + { + try + { + var converted = inputConverter.ConvertTo(input, destinationType); + return Attempt.Succeed(converted); + } + catch (Exception e) + { + return Attempt.Fail(e); + } + } - if (destinationType == typeof(bool)) - { - var boolConverter = new CustomBooleanTypeConverter(); - if (boolConverter.CanConvertFrom(input.GetType())) - { - try - { - var converted = boolConverter.ConvertFrom(input); - return Attempt.Succeed(converted); - } - catch (Exception e) - { - return Attempt.Fail(e); - } - } - } + if (destinationType == typeof(bool)) + { + var boolConverter = new CustomBooleanTypeConverter(); + if (boolConverter.CanConvertFrom(input.GetType())) + { + try + { + var converted = boolConverter.ConvertFrom(input); + return Attempt.Succeed(converted); + } + catch (Exception e) + { + return Attempt.Fail(e); + } + } + } - var outputConverter = TypeDescriptor.GetConverter(destinationType); - if (outputConverter.CanConvertFrom(input.GetType())) - { - try - { - var converted = outputConverter.ConvertFrom(input); - return Attempt.Succeed(converted); - } - catch (Exception e) - { - return Attempt.Fail(e); - } - } + var outputConverter = TypeDescriptor.GetConverter(destinationType); + if (outputConverter.CanConvertFrom(input.GetType())) + { + try + { + var converted = outputConverter.ConvertFrom(input); + return Attempt.Succeed(converted); + } + catch (Exception e) + { + return Attempt.Fail(e); + } + } - if (TypeHelper.IsTypeAssignableFrom(input)) - { - try - { - var casted = Convert.ChangeType(input, destinationType); - return Attempt.Succeed(casted); - } - catch (Exception e) - { - return Attempt.Fail(e); - } - } + if (TypeHelper.IsTypeAssignableFrom(input)) + { + try + { + var casted = Convert.ChangeType(input, destinationType); + return Attempt.Succeed(casted); + } + catch (Exception e) + { + return Attempt.Fail(e); + } + } - return Attempt.Fail(); - } + return Attempt.Fail(); + } // returns an attempt if the string has been processed (either succeeded or failed) // returns null if we need to try other methods - private static Attempt? TryConvertToFromString(this string input, Type destinationType) - { + private static Attempt? TryConvertToFromString(this string input, Type destinationType) + { // easy - if (destinationType == typeof(string)) - return Attempt.Succeed(input); + if (destinationType == typeof(string)) + return Attempt.Succeed(input); // null, empty, whitespaces - if (string.IsNullOrWhiteSpace(input)) - { - if (destinationType == typeof(bool)) // null/empty = bool false - return Attempt.Succeed(false); - if (destinationType == typeof(DateTime)) // null/empty = min DateTime value + if (string.IsNullOrWhiteSpace(input)) + { + if (destinationType == typeof(bool)) // null/empty = bool false + return Attempt.Succeed(false); + if (destinationType == typeof(DateTime)) // null/empty = min DateTime value return Attempt.Succeed(DateTime.MinValue); - // cannot decide here, + // cannot decide here, // any of the types below will fail parsing and will return a failed attempt // but anything else will not be processed and will return null // so even though the string is null/empty we have to proceed - } + } - // look for type conversions in the expected order of frequency of use... - if (destinationType.IsPrimitive) - { - if (destinationType == typeof(int)) // aka Int32 - { - int value; - if (int.TryParse(input, out value)) return Attempt.Succeed(value); + // look for type conversions in the expected order of frequency of use... + if (destinationType.IsPrimitive) + { + if (destinationType == typeof(int)) // aka Int32 + { + int value; + if (int.TryParse(input, out value)) return Attempt.Succeed(value); // because decimal 100.01m will happily convert to integer 100, it // makes sense that string "100.01" *also* converts to integer 100. @@ -255,225 +255,225 @@ namespace Umbraco.Core } if (destinationType == typeof(long)) // aka Int64 - { - long value; - if (long.TryParse(input, out value)) return Attempt.Succeed(value); + { + long value; + if (long.TryParse(input, out value)) return Attempt.Succeed(value); // same as int decimal value2; var input2 = NormalizeNumberDecimalSeparator(input); - return Attempt.If(decimal.TryParse(input2, out value2), Convert.ToInt64(value2)); - } + return Attempt.If(decimal.TryParse(input2, out value2), Convert.ToInt64(value2)); + } // fixme - should we do the decimal trick for short, byte, unsigned? - if (destinationType == typeof(bool)) // aka Boolean - { - bool value; - if (bool.TryParse(input, out value)) return Attempt.Succeed(value); + if (destinationType == typeof(bool)) // aka Boolean + { + bool value; + if (bool.TryParse(input, out value)) return Attempt.Succeed(value); // don't declare failure so the CustomBooleanTypeConverter can try return null; - } - - if (destinationType == typeof(short)) // aka Int16 - { - short value; - return Attempt.If(short.TryParse(input, out value), value); - } - - if (destinationType == typeof(double)) // aka Double - { - double value; - var input2 = NormalizeNumberDecimalSeparator(input); - return Attempt.If(double.TryParse(input2, out value), value); - } - - if (destinationType == typeof(float)) // aka Single - { - float value; - var input2 = NormalizeNumberDecimalSeparator(input); - return Attempt.If(float.TryParse(input2, out value), value); - } - - if (destinationType == typeof(char)) // aka Char - { - char value; - return Attempt.If(char.TryParse(input, out value), value); - } - - if (destinationType == typeof(byte)) // aka Byte - { - byte value; - return Attempt.If(byte.TryParse(input, out value), value); - } - - if (destinationType == typeof(sbyte)) // aka SByte - { - sbyte value; - return Attempt.If(sbyte.TryParse(input, out value), value); } - if (destinationType == typeof(uint)) // aka UInt32 + if (destinationType == typeof(short)) // aka Int16 { - uint value; - return Attempt.If(uint.TryParse(input, out value), value); + short value; + return Attempt.If(short.TryParse(input, out value), value); } - if (destinationType == typeof(ushort)) // aka UInt16 + if (destinationType == typeof(double)) // aka Double { - ushort value; - return Attempt.If(ushort.TryParse(input, out value), value); + double value; + var input2 = NormalizeNumberDecimalSeparator(input); + return Attempt.If(double.TryParse(input2, out value), value); } - if (destinationType == typeof(ulong)) // aka UInt64 + if (destinationType == typeof(float)) // aka Single { - ulong value; + float value; + var input2 = NormalizeNumberDecimalSeparator(input); + return Attempt.If(float.TryParse(input2, out value), value); + } + + if (destinationType == typeof(char)) // aka Char + { + char value; + return Attempt.If(char.TryParse(input, out value), value); + } + + if (destinationType == typeof(byte)) // aka Byte + { + byte value; + return Attempt.If(byte.TryParse(input, out value), value); + } + + if (destinationType == typeof(sbyte)) // aka SByte + { + sbyte value; + return Attempt.If(sbyte.TryParse(input, out value), value); + } + + if (destinationType == typeof(uint)) // aka UInt32 + { + uint value; + return Attempt.If(uint.TryParse(input, out value), value); + } + + if (destinationType == typeof(ushort)) // aka UInt16 + { + ushort value; + return Attempt.If(ushort.TryParse(input, out value), value); + } + + if (destinationType == typeof(ulong)) // aka UInt64 + { + ulong value; return Attempt.If(ulong.TryParse(input, out value), value); - } - } - else if (destinationType == typeof(Guid)) - { - Guid value; - return Attempt.If(Guid.TryParse(input, out value), value); - } - else if (destinationType == typeof(DateTime)) - { - DateTime value; - if (DateTime.TryParse(input, out value)) - { - switch (value.Kind) - { - case DateTimeKind.Unspecified: - case DateTimeKind.Utc: + } + } + else if (destinationType == typeof(Guid)) + { + Guid value; + return Attempt.If(Guid.TryParse(input, out value), value); + } + else if (destinationType == typeof(DateTime)) + { + DateTime value; + if (DateTime.TryParse(input, out value)) + { + switch (value.Kind) + { + case DateTimeKind.Unspecified: + case DateTimeKind.Utc: return Attempt.Succeed(value); - case DateTimeKind.Local: - return Attempt.Succeed(value.ToUniversalTime()); - default: - throw new ArgumentOutOfRangeException(); - } - } - return Attempt.Fail(); - } - else if (destinationType == typeof(DateTimeOffset)) - { - DateTimeOffset value; - return Attempt.If(DateTimeOffset.TryParse(input, out value), value); - } - else if (destinationType == typeof(TimeSpan)) - { - TimeSpan value; - return Attempt.If(TimeSpan.TryParse(input, out value), value); - } - else if (destinationType == typeof(decimal)) // aka Decimal - { - decimal value; + case DateTimeKind.Local: + return Attempt.Succeed(value.ToUniversalTime()); + default: + throw new ArgumentOutOfRangeException(); + } + } + return Attempt.Fail(); + } + else if (destinationType == typeof(DateTimeOffset)) + { + DateTimeOffset value; + return Attempt.If(DateTimeOffset.TryParse(input, out value), value); + } + else if (destinationType == typeof(TimeSpan)) + { + TimeSpan value; + return Attempt.If(TimeSpan.TryParse(input, out value), value); + } + else if (destinationType == typeof(decimal)) // aka Decimal + { + decimal value; var input2 = NormalizeNumberDecimalSeparator(input); return Attempt.If(decimal.TryParse(input2, out value), value); - } - else if (destinationType == typeof(Version)) - { - Version value; - return Attempt.If(Version.TryParse(input, out value), value); - } - // E_NOTIMPL IPAddress, BigInteger + } + else if (destinationType == typeof(Version)) + { + Version value; + return Attempt.If(Version.TryParse(input, out value), value); + } + // E_NOTIMPL IPAddress, BigInteger - return null; // we can't decide... - } + return null; // we can't decide... + } private static readonly char[] NumberDecimalSeparatorsToNormalize = {'.', ','}; - private static string NormalizeNumberDecimalSeparator(string s) - { - var normalized = System.Threading.Thread.CurrentThread.CurrentCulture.NumberFormat.NumberDecimalSeparator[0]; + private static string NormalizeNumberDecimalSeparator(string s) + { + var normalized = System.Threading.Thread.CurrentThread.CurrentCulture.NumberFormat.NumberDecimalSeparator[0]; return s.ReplaceMany(NumberDecimalSeparatorsToNormalize, normalized); - } + } - internal static void CheckThrowObjectDisposed(this IDisposable disposable, bool isDisposed, string objectname) - { - //TODO: Localise this exception - if (isDisposed) - throw new ObjectDisposedException(objectname); - } + internal static void CheckThrowObjectDisposed(this IDisposable disposable, bool isDisposed, string objectname) + { + //TODO: Localise this exception + if (isDisposed) + throw new ObjectDisposedException(objectname); + } - //public enum PropertyNamesCaseType - //{ - // CamelCase, - // CaseInsensitive - //} + //public enum PropertyNamesCaseType + //{ + // CamelCase, + // CaseInsensitive + //} - ///// - ///// Convert an object to a JSON string with camelCase formatting - ///// - ///// - ///// - //public static string ToJsonString(this object obj) - //{ - // return obj.ToJsonString(PropertyNamesCaseType.CamelCase); - //} + ///// + ///// Convert an object to a JSON string with camelCase formatting + ///// + ///// + ///// + //public static string ToJsonString(this object obj) + //{ + // return obj.ToJsonString(PropertyNamesCaseType.CamelCase); + //} - ///// - ///// Convert an object to a JSON string with the specified formatting - ///// - ///// The obj. - ///// Type of the property names case. - ///// - //public static string ToJsonString(this object obj, PropertyNamesCaseType propertyNamesCaseType) - //{ - // var type = obj.GetType(); - // var dateTimeStyle = "yyyy-MM-dd HH:mm:ss"; + ///// + ///// Convert an object to a JSON string with the specified formatting + ///// + ///// The obj. + ///// Type of the property names case. + ///// + //public static string ToJsonString(this object obj, PropertyNamesCaseType propertyNamesCaseType) + //{ + // var type = obj.GetType(); + // var dateTimeStyle = "yyyy-MM-dd HH:mm:ss"; - // if (type.IsPrimitive || typeof(string).IsAssignableFrom(type)) - // { - // return obj.ToString(); - // } + // if (type.IsPrimitive || typeof(string).IsAssignableFrom(type)) + // { + // return obj.ToString(); + // } - // if (typeof(DateTime).IsAssignableFrom(type) || typeof(DateTimeOffset).IsAssignableFrom(type)) - // { - // return Convert.ToDateTime(obj).ToString(dateTimeStyle); - // } + // if (typeof(DateTime).IsAssignableFrom(type) || typeof(DateTimeOffset).IsAssignableFrom(type)) + // { + // return Convert.ToDateTime(obj).ToString(dateTimeStyle); + // } - // var serializer = new JsonSerializer(); + // var serializer = new JsonSerializer(); - // switch (propertyNamesCaseType) - // { - // case PropertyNamesCaseType.CamelCase: - // serializer.ContractResolver = new CamelCasePropertyNamesContractResolver(); - // break; - // } + // switch (propertyNamesCaseType) + // { + // case PropertyNamesCaseType.CamelCase: + // serializer.ContractResolver = new CamelCasePropertyNamesContractResolver(); + // break; + // } - // var dateTimeConverter = new IsoDateTimeConverter - // { - // DateTimeStyles = System.Globalization.DateTimeStyles.None, - // DateTimeFormat = dateTimeStyle - // }; + // var dateTimeConverter = new IsoDateTimeConverter + // { + // DateTimeStyles = System.Globalization.DateTimeStyles.None, + // DateTimeFormat = dateTimeStyle + // }; - // if (typeof(IDictionary).IsAssignableFrom(type)) - // { - // return JObject.FromObject(obj, serializer).ToString(Formatting.None, dateTimeConverter); - // } + // if (typeof(IDictionary).IsAssignableFrom(type)) + // { + // return JObject.FromObject(obj, serializer).ToString(Formatting.None, dateTimeConverter); + // } - // if (type.IsArray || (typeof(IEnumerable).IsAssignableFrom(type))) - // { - // return JArray.FromObject(obj, serializer).ToString(Formatting.None, dateTimeConverter); - // } + // if (type.IsArray || (typeof(IEnumerable).IsAssignableFrom(type))) + // { + // return JArray.FromObject(obj, serializer).ToString(Formatting.None, dateTimeConverter); + // } - // return JObject.FromObject(obj, serializer).ToString(Formatting.None, dateTimeConverter); - //} + // return JObject.FromObject(obj, serializer).ToString(Formatting.None, dateTimeConverter); + //} - /// - /// Converts an object into a dictionary - /// - /// - /// - /// - /// - /// - /// + /// + /// Converts an object into a dictionary + /// + /// + /// + /// + /// + /// + /// public static IDictionary ToDictionary(this T o, - params Expression>[] ignoreProperties) - { - return o.ToDictionary(ignoreProperties.Select(e => o.GetPropertyInfo(e)).Select(propInfo => propInfo.Name).ToArray()); - } + params Expression>[] ignoreProperties) + { + return o.ToDictionary(ignoreProperties.Select(e => o.GetPropertyInfo(e)).Select(propInfo => propInfo.Name).ToArray()); + } /// /// Turns object into dictionary @@ -482,137 +482,137 @@ namespace Umbraco.Core /// Properties to ignore /// public static IDictionary ToDictionary(this object o, params string[] ignoreProperties) - { - if (o != null) - { - var props = TypeDescriptor.GetProperties(o); - var d = new Dictionary(); - foreach (var prop in props.Cast().Where(x => ignoreProperties.Contains(x.Name) == false)) - { - var val = prop.GetValue(o); - if (val != null) - { - d.Add(prop.Name, (TVal)val); - } - } - return d; - } - return new Dictionary(); - } + { + if (o != null) + { + var props = TypeDescriptor.GetProperties(o); + var d = new Dictionary(); + foreach (var prop in props.Cast().Where(x => ignoreProperties.Contains(x.Name) == false)) + { + var val = prop.GetValue(o); + if (val != null) + { + d.Add(prop.Name, (TVal)val); + } + } + return d; + } + return new Dictionary(); + } - internal static string ToDebugString(this object obj, int levels = 0) - { - if (obj == null) return "{null}"; - try - { - if (obj is string) - { - return "\"{0}\"".InvariantFormat(obj); - } + internal static string ToDebugString(this object obj, int levels = 0) + { + if (obj == null) return "{null}"; + try + { + if (obj is string) + { + return "\"{0}\"".InvariantFormat(obj); + } if (obj is int || obj is Int16 || obj is Int64 || obj is float || obj is double || obj is bool || obj is int? || obj is Int16? || obj is Int64? || obj is float? || obj is double? || obj is bool?) - { - return "{0}".InvariantFormat(obj); - } - if (obj is Enum) - { - return "[{0}]".InvariantFormat(obj); - } - if (obj is IEnumerable) - { - var enumerable = (obj as IEnumerable); + { + return "{0}".InvariantFormat(obj); + } + if (obj is Enum) + { + return "[{0}]".InvariantFormat(obj); + } + if (obj is IEnumerable) + { + var enumerable = (obj as IEnumerable); - var items = (from object enumItem in enumerable let value = GetEnumPropertyDebugString(enumItem, levels) where value != null select value).Take(10).ToList(); + var items = (from object enumItem in enumerable let value = GetEnumPropertyDebugString(enumItem, levels) where value != null select value).Take(10).ToList(); - return items.Any() - ? "{{ {0} }}".InvariantFormat(String.Join(", ", items)) - : null; - } + return items.Any() + ? "{{ {0} }}".InvariantFormat(String.Join(", ", items)) + : null; + } - var props = obj.GetType().GetProperties(); - if ((props.Length == 2) && props[0].Name == "Key" && props[1].Name == "Value" && levels > -2) - { - try - { - var key = props[0].GetValue(obj, null) as string; - var value = props[1].GetValue(obj, null).ToDebugString(levels - 1); - return "{0}={1}".InvariantFormat(key, value); - } - catch (Exception) - { - return "[KeyValuePropertyException]"; - } - } - if (levels > -1) - { - var items = - (from propertyInfo in props - let value = GetPropertyDebugString(propertyInfo, obj, levels) - where value != null - select "{0}={1}".InvariantFormat(propertyInfo.Name, value)).ToArray(); + var props = obj.GetType().GetProperties(); + if ((props.Length == 2) && props[0].Name == "Key" && props[1].Name == "Value" && levels > -2) + { + try + { + var key = props[0].GetValue(obj, null) as string; + var value = props[1].GetValue(obj, null).ToDebugString(levels - 1); + return "{0}={1}".InvariantFormat(key, value); + } + catch (Exception) + { + return "[KeyValuePropertyException]"; + } + } + if (levels > -1) + { + var items = + (from propertyInfo in props + let value = GetPropertyDebugString(propertyInfo, obj, levels) + where value != null + select "{0}={1}".InvariantFormat(propertyInfo.Name, value)).ToArray(); - return items.Any() - ? "[{0}]:{{ {1} }}".InvariantFormat(obj.GetType().Name, String.Join(", ", items)) - : null; - } - } - catch (Exception ex) - { - return "[Exception:{0}]".InvariantFormat(ex.Message); - } - return null; - } + return items.Any() + ? "[{0}]:{{ {1} }}".InvariantFormat(obj.GetType().Name, String.Join(", ", items)) + : null; + } + } + catch (Exception ex) + { + return "[Exception:{0}]".InvariantFormat(ex.Message); + } + return null; + } - /// - /// Attempts to serialize the value to an XmlString using ToXmlString - /// - /// - /// - /// - internal static Attempt TryConvertToXmlString(this object value, Type type) - { - try - { - var output = value.ToXmlString(type); - return Attempt.Succeed(output); - } - catch (NotSupportedException ex) - { - return Attempt.Fail(ex); - } - } + /// + /// Attempts to serialize the value to an XmlString using ToXmlString + /// + /// + /// + /// + internal static Attempt TryConvertToXmlString(this object value, Type type) + { + try + { + var output = value.ToXmlString(type); + return Attempt.Succeed(output); + } + catch (NotSupportedException ex) + { + return Attempt.Fail(ex); + } + } - /// - /// Returns an XmlSerialized safe string representation for the value - /// - /// - /// The Type can only be a primitive type or Guid and byte[] otherwise an exception is thrown - /// - internal static string ToXmlString(this object value, Type type) - { - if (value == null) return string.Empty; - if (type == typeof(string)) return (value.ToString().IsNullOrWhiteSpace() ? "" : value.ToString()); - if (type == typeof(bool)) return XmlConvert.ToString((bool)value); - if (type == typeof(byte)) return XmlConvert.ToString((byte)value); - if (type == typeof(char)) return XmlConvert.ToString((char)value); + /// + /// Returns an XmlSerialized safe string representation for the value + /// + /// + /// The Type can only be a primitive type or Guid and byte[] otherwise an exception is thrown + /// + internal static string ToXmlString(this object value, Type type) + { + if (value == null) return string.Empty; + if (type == typeof(string)) return (value.ToString().IsNullOrWhiteSpace() ? "" : value.ToString()); + if (type == typeof(bool)) return XmlConvert.ToString((bool)value); + if (type == typeof(byte)) return XmlConvert.ToString((byte)value); + if (type == typeof(char)) return XmlConvert.ToString((char)value); if (type == typeof(DateTime)) return XmlConvert.ToString((DateTime)value, XmlDateTimeSerializationMode.Unspecified); - if (type == typeof(DateTimeOffset)) return XmlConvert.ToString((DateTimeOffset)value); - if (type == typeof(decimal)) return XmlConvert.ToString((decimal)value); - if (type == typeof(double)) return XmlConvert.ToString((double)value); - if (type == typeof(float)) return XmlConvert.ToString((float)value); - if (type == typeof(Guid)) return XmlConvert.ToString((Guid)value); - if (type == typeof(int)) return XmlConvert.ToString((int)value); - if (type == typeof(long)) return XmlConvert.ToString((long)value); - if (type == typeof(sbyte)) return XmlConvert.ToString((sbyte)value); - if (type == typeof(short)) return XmlConvert.ToString((short)value); - if (type == typeof(TimeSpan)) return XmlConvert.ToString((TimeSpan)value); - if (type == typeof(bool)) return XmlConvert.ToString((bool)value); - if (type == typeof(uint)) return XmlConvert.ToString((uint)value); - if (type == typeof(ulong)) return XmlConvert.ToString((ulong)value); - if (type == typeof(ushort)) return XmlConvert.ToString((ushort)value); + if (type == typeof(DateTimeOffset)) return XmlConvert.ToString((DateTimeOffset)value); + if (type == typeof(decimal)) return XmlConvert.ToString((decimal)value); + if (type == typeof(double)) return XmlConvert.ToString((double)value); + if (type == typeof(float)) return XmlConvert.ToString((float)value); + if (type == typeof(Guid)) return XmlConvert.ToString((Guid)value); + if (type == typeof(int)) return XmlConvert.ToString((int)value); + if (type == typeof(long)) return XmlConvert.ToString((long)value); + if (type == typeof(sbyte)) return XmlConvert.ToString((sbyte)value); + if (type == typeof(short)) return XmlConvert.ToString((short)value); + if (type == typeof(TimeSpan)) return XmlConvert.ToString((TimeSpan)value); + if (type == typeof(bool)) return XmlConvert.ToString((bool)value); + if (type == typeof(uint)) return XmlConvert.ToString((uint)value); + if (type == typeof(ulong)) return XmlConvert.ToString((ulong)value); + if (type == typeof(ushort)) return XmlConvert.ToString((ushort)value); - throw new NotSupportedException("Cannot convert type " + type.FullName + " to a string using ToXmlString as it is not supported by XmlConvert"); - } + throw new NotSupportedException("Cannot convert type " + type.FullName + " to a string using ToXmlString as it is not supported by XmlConvert"); + } /// /// Returns an XmlSerialized safe string representation for the value and type @@ -620,38 +620,38 @@ namespace Umbraco.Core /// /// /// - internal static string ToXmlString(this object value) - { - return value.ToXmlString(typeof (T)); - } + internal static string ToXmlString(this object value) + { + return value.ToXmlString(typeof (T)); + } - private static string GetEnumPropertyDebugString(object enumItem, int levels) - { - try - { - return enumItem.ToDebugString(levels - 1); - } - catch (Exception) - { - return "[GetEnumPartException]"; - } - } + private static string GetEnumPropertyDebugString(object enumItem, int levels) + { + try + { + return enumItem.ToDebugString(levels - 1); + } + catch (Exception) + { + return "[GetEnumPartException]"; + } + } - private static string GetPropertyDebugString(PropertyInfo propertyInfo, object obj, int levels) - { - try - { - return propertyInfo.GetValue(obj, null).ToDebugString(levels - 1); - } - catch (Exception) - { - return "[GetPropertyValueException]"; - } - } + private static string GetPropertyDebugString(PropertyInfo propertyInfo, object obj, int levels) + { + try + { + return propertyInfo.GetValue(obj, null).ToDebugString(levels - 1); + } + catch (Exception) + { + return "[GetPropertyValueException]"; + } + } - internal static Guid AsGuid(this object value) - { - return value is Guid ? (Guid) value : Guid.Empty; - } - } -} \ No newline at end of file + internal static Guid AsGuid(this object value) + { + return value is Guid ? (Guid) value : Guid.Empty; + } + } +} diff --git a/src/Umbraco.Core/OrderedHashSet.cs b/src/Umbraco.Core/OrderedHashSet.cs index 801f1a9a41..9a9d304459 100644 --- a/src/Umbraco.Core/OrderedHashSet.cs +++ b/src/Umbraco.Core/OrderedHashSet.cs @@ -1,17 +1,17 @@ -using System.Collections.ObjectModel; +using System.Collections.ObjectModel; namespace Umbraco.Core { /// /// A custom collection similar to HashSet{T} which only contains unique items, however this collection keeps items in order - /// and is customizable to keep the newest or oldest equatable item + /// and is customizable to keep the newest or oldest equatable item /// /// internal class OrderedHashSet : KeyedCollection { private readonly bool _keepOldest; - public OrderedHashSet(bool keepOldest = true) + public OrderedHashSet(bool keepOldest = true) { _keepOldest = keepOldest; } @@ -39,7 +39,7 @@ namespace Umbraco.Core } base.InsertItem(index, item); } - } + } } protected override T GetKeyForItem(T item) @@ -47,4 +47,4 @@ namespace Umbraco.Core return item; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Packaging/ConflictingPackageData.cs b/src/Umbraco.Core/Packaging/ConflictingPackageData.cs index 9c80b53008..b0424067bf 100644 --- a/src/Umbraco.Core/Packaging/ConflictingPackageData.cs +++ b/src/Umbraco.Core/Packaging/ConflictingPackageData.cs @@ -20,7 +20,7 @@ namespace Umbraco.Core.Packaging if (macroService != null) _macroService = macroService; else throw new ArgumentNullException("macroService"); } - + public IEnumerable FindConflictingStylesheets(XElement stylesheetNotes) { if (string.Equals(Constants.Packaging.StylesheetsNodeName, stylesheetNotes.Name.LocalName) == false) @@ -73,7 +73,7 @@ namespace Umbraco.Core.Packaging throw new ArgumentException("Node must be a \"" + Constants.Packaging.MacrosNodeName + "\" node", "macroNodes"); } - + return macroNodes.Elements(Constants.Packaging.MacroNodeName) .Select(n => { @@ -89,4 +89,4 @@ namespace Umbraco.Core.Packaging .Where(v => v != null); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Packaging/DefaultPackageContext.cs b/src/Umbraco.Core/Packaging/DefaultPackageContext.cs index 3598f0f292..c08418ec86 100644 --- a/src/Umbraco.Core/Packaging/DefaultPackageContext.cs +++ b/src/Umbraco.Core/Packaging/DefaultPackageContext.cs @@ -42,4 +42,4 @@ namespace Umbraco.Core.Packaging get { return _publicPackageManager.Value; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Packaging/IConflictingPackageData.cs b/src/Umbraco.Core/Packaging/IConflictingPackageData.cs index bd28b5e94f..12f3e8f8a4 100644 --- a/src/Umbraco.Core/Packaging/IConflictingPackageData.cs +++ b/src/Umbraco.Core/Packaging/IConflictingPackageData.cs @@ -10,4 +10,4 @@ namespace Umbraco.Core.Packaging IEnumerable FindConflictingTemplates(XElement templateNotes); IEnumerable FindConflictingMacros(XElement macroNodes); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Packaging/IPackageContext.cs b/src/Umbraco.Core/Packaging/IPackageContext.cs index f1420d1654..41cf372ce6 100644 --- a/src/Umbraco.Core/Packaging/IPackageContext.cs +++ b/src/Umbraco.Core/Packaging/IPackageContext.cs @@ -6,6 +6,6 @@ namespace Umbraco.Core.Packaging { IPackageManager LocalPackageManager { get; } IPackageManager PublicPackageManager { get; } - IPackagePathResolver LocalPathResolver { get; } + IPackagePathResolver LocalPathResolver { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Packaging/IPackageExtraction.cs b/src/Umbraco.Core/Packaging/IPackageExtraction.cs index 1ee88925d3..c19ea733df 100644 --- a/src/Umbraco.Core/Packaging/IPackageExtraction.cs +++ b/src/Umbraco.Core/Packaging/IPackageExtraction.cs @@ -59,4 +59,4 @@ namespace Umbraco.Core.Packaging /// IEnumerable ReadFilesFromArchive(string packageFilePath, IEnumerable filesToGet); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Packaging/IPackageInstallation.cs b/src/Umbraco.Core/Packaging/IPackageInstallation.cs index cee8d6251c..dac05c47f1 100644 --- a/src/Umbraco.Core/Packaging/IPackageInstallation.cs +++ b/src/Umbraco.Core/Packaging/IPackageInstallation.cs @@ -10,4 +10,4 @@ namespace Umbraco.Core.Packaging PreInstallWarnings GetPreInstallWarnings(string packageFilePath); XElement GetConfigXmlElement(string packageFilePath); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Packaging/Models/UninstallationSummary.cs b/src/Umbraco.Core/Packaging/Models/UninstallationSummary.cs index e40d453fdf..9ec8f773db 100644 --- a/src/Umbraco.Core/Packaging/Models/UninstallationSummary.cs +++ b/src/Umbraco.Core/Packaging/Models/UninstallationSummary.cs @@ -22,7 +22,7 @@ namespace Umbraco.Core.Packaging.Models public IEnumerable ContentUninstalled { get; set; } public bool PackageUninstalled { get; set; } } - + internal static class UninstallationSummaryExtentions { public static UninstallationSummary InitEmpty(this UninstallationSummary summary) @@ -40,4 +40,4 @@ namespace Umbraco.Core.Packaging.Models return summary; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Packaging/PackageExtraction.cs b/src/Umbraco.Core/Packaging/PackageExtraction.cs index 1f34933020..cbbc3d3fa6 100644 --- a/src/Umbraco.Core/Packaging/PackageExtraction.cs +++ b/src/Umbraco.Core/Packaging/PackageExtraction.cs @@ -66,7 +66,7 @@ namespace Umbraco.Core.Packaging string.Format("Error - file isn't a package. only extentions: \"{0}\" is allowed", string.Join(", ", alowedExtension))); } } - + public void CopyFileFromArchive(string packageFilePath, string fileInPackageName, string destinationfilePath) { CopyFilesFromArchive(packageFilePath, new[]{new KeyValuePair(fileInPackageName, destinationfilePath) } ); @@ -157,7 +157,7 @@ namespace Umbraco.Core.Packaging ZipEntry zipEntry; while ((zipEntry = zipInputStream.GetNextEntry()) != null) { - + if (zipEntry.IsDirectory) continue; if (files.Contains(zipEntry.Name)) @@ -198,4 +198,4 @@ namespace Umbraco.Core.Packaging } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Packaging/PackageInstallation.cs b/src/Umbraco.Core/Packaging/PackageInstallation.cs index 6c8b4cc43e..48f303d31d 100644 --- a/src/Umbraco.Core/Packaging/PackageInstallation.cs +++ b/src/Umbraco.Core/Packaging/PackageInstallation.cs @@ -31,12 +31,12 @@ namespace Umbraco.Core.Packaging public PackageInstallation(IPackagingService packagingService, IMacroService macroService, IFileService fileService, IPackageExtraction packageExtraction, string fullPathToRoot) { - if (packageExtraction != null) _packageExtraction = packageExtraction; + if (packageExtraction != null) _packageExtraction = packageExtraction; else throw new ArgumentNullException("packageExtraction"); - + if (macroService != null) _macroService = macroService; else throw new ArgumentNullException("macroService"); - + if (fileService != null) _fileService = fileService; else throw new ArgumentNullException("fileService"); @@ -45,7 +45,7 @@ namespace Umbraco.Core.Packaging _fullPathToRoot = fullPathToRoot; } - + public IConflictingPackageData ConflictingPackageData { private get @@ -77,7 +77,7 @@ namespace Umbraco.Core.Packaging _fullPathToRoot = value; } } - + public MetaData GetMetaData(string packageFilePath) { try @@ -119,7 +119,7 @@ namespace Umbraco.Core.Packaging XElement actions; MetaData metaData; InstallationSummary installationSummary; - + try { XElement rootElement = GetConfigXmlElement(packageFile); @@ -171,8 +171,8 @@ namespace Umbraco.Core.Packaging var stylesheetsInstalled = EmptyEnumerableIfNull(styleSheets) ?? InstallStylesheets(styleSheets); installationSummary.StylesheetsInstalled = stylesheetsInstalled; - var documentsInstalled = documents != null ? InstallDocuments(documents, userId) - : EmptyEnumerableIfNull(documentSet) + var documentsInstalled = documents != null ? InstallDocuments(documents, userId) + : EmptyEnumerableIfNull(documentSet) ?? InstallDocuments(documentSet, userId); installationSummary.ContentInstalled = documentsInstalled; @@ -288,7 +288,7 @@ namespace Umbraco.Core.Packaging var packageAction = new PackageAction { - XmlData = elemet, + XmlData = elemet, Alias = aliasAttr.Value, PackageName = packageName, }; @@ -371,7 +371,7 @@ namespace Umbraco.Core.Packaging sourceDestination = AppendRootToDestination(FullPathToRoot, sourceDestination); _packageExtraction.CopyFilesFromArchive(packageFilePath, sourceDestination); - + return sourceDestination.Select(sd => sd.Value).ToArray(); } @@ -430,7 +430,7 @@ namespace Umbraco.Core.Packaging XElement styleSheets = rootElement.Element(Constants.Packaging.StylesheetsNodeName); XElement templates = rootElement.Element(Constants.Packaging.TemplatesNodeName); XElement alias = rootElement.Element(Constants.Packaging.MacrosNodeName); - + var sourceDestination = EmptyArrayIfNull>(files) ?? ExtractSourceDestinationFileInformation(files); var installWarnings = new PreInstallWarnings(); @@ -443,10 +443,10 @@ namespace Umbraco.Core.Packaging var stylesheetNames = EmptyEnumerableIfNull(styleSheets) ?? ConflictingPackageData.FindConflictingStylesheets(styleSheets); installWarnings.ConflictingStylesheetNames = stylesheetNames; - + installWarnings.UnsecureFiles = FindUnsecureFiles(sourceDestination); installWarnings.FilesReplaced = FindFilesToBeReplaced(sourceDestination); - + return installWarnings; } @@ -454,7 +454,7 @@ namespace Umbraco.Core.Packaging { return sourceDestination.Where(sd => File.Exists(Path.Combine(FullPathToRoot, sd.Value))).ToArray(); } - + private KeyValuePair[] FindUnsecureFiles(IEnumerable> sourceDestinationPair) { return sourceDestinationPair.Where(sd => IsFileDestinationUnsecure(sd.Value)).ToArray(); @@ -469,7 +469,7 @@ namespace Umbraco.Core.Packaging string extension = Path.GetExtension(destination); return extension != null && extension.Equals(".dll", StringComparison.InvariantCultureIgnoreCase); } - + private KeyValuePair[] ExtractSourceDestinationFileInformation(XElement filesElement) { if (string.Equals(Constants.Packaging.FilesNodeName, filesElement.Name.LocalName) == false) @@ -505,7 +505,7 @@ namespace Umbraco.Core.Packaging var relativeDir = UpdatePathPlaceholders(PrepareAsFilePathElement(orgPathElement.Value)); var relativePath = Path.Combine(relativeDir, fileName); - + return new KeyValuePair(guidElement.Value, relativePath); }).ToArray(); @@ -573,7 +573,7 @@ namespace Umbraco.Core.Packaging int val; return xElement == null ? defaultValue : int.TryParse(xElement.Value, out val) ? val : defaultValue; } - + private static string UpdatePathPlaceholders(string path) { if (path.Contains("[$")) @@ -587,4 +587,4 @@ namespace Umbraco.Core.Packaging return path; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/BulkDataReader.cs b/src/Umbraco.Core/Persistence/BulkDataReader.cs index 8df4dd536e..6ede6a1859 100644 --- a/src/Umbraco.Core/Persistence/BulkDataReader.cs +++ b/src/Umbraco.Core/Persistence/BulkDataReader.cs @@ -17,23 +17,23 @@ namespace Umbraco.Core.Persistence /// A base implementation of that is suitable for . /// /// - /// + /// /// Borrowed from Microsoft: /// See: https://blogs.msdn.microsoft.com/anthonybloesch/2013/01/23/bulk-loading-data-with-idatareader-and-sqlbulkcopy/ - /// + /// /// This implementation is designed to be very memory efficient requiring few memory resources and to support /// rapid transfer of data to SQL Server. /// /// Subclasses should implement , , /// , , . /// If they contain disposable resources they should override . - /// + /// /// SD: Alternatively, we could have used a LinqEntityDataReader which is nicer to use but it uses quite a lot of reflection and /// I thought this would just be quicker. /// Simple example of that: https://github.com/gridsum/DataflowEx/blob/master/Gridsum.DataflowEx/Databases/BulkDataReader.cs /// Full example of that: https://github.com/matthewschrager/Repository/blob/master/Repository.EntityFramework/EntityDataReader.cs /// So we know where to find that if we ever need it, these would convert any Linq data source to an IDataReader - /// + /// /// internal abstract class BulkDataReader : IDataReader { diff --git a/src/Umbraco.Core/Persistence/DatabaseAnnotations/ConstraintAttribute.cs b/src/Umbraco.Core/Persistence/DatabaseAnnotations/ConstraintAttribute.cs index 33c7616687..529fb54ec7 100644 --- a/src/Umbraco.Core/Persistence/DatabaseAnnotations/ConstraintAttribute.cs +++ b/src/Umbraco.Core/Persistence/DatabaseAnnotations/ConstraintAttribute.cs @@ -22,4 +22,4 @@ namespace Umbraco.Core.Persistence.DatabaseAnnotations /// public object Default { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/DatabaseAnnotations/ForeignKeyAttribute.cs b/src/Umbraco.Core/Persistence/DatabaseAnnotations/ForeignKeyAttribute.cs index a4797a9088..dc80cd5925 100644 --- a/src/Umbraco.Core/Persistence/DatabaseAnnotations/ForeignKeyAttribute.cs +++ b/src/Umbraco.Core/Persistence/DatabaseAnnotations/ForeignKeyAttribute.cs @@ -30,4 +30,4 @@ namespace Umbraco.Core.Persistence.DatabaseAnnotations /// PrimaryKey column is used by default public string Column { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/DatabaseAnnotations/IndexAttribute.cs b/src/Umbraco.Core/Persistence/DatabaseAnnotations/IndexAttribute.cs index 9152384ffa..fd4a4026f2 100644 --- a/src/Umbraco.Core/Persistence/DatabaseAnnotations/IndexAttribute.cs +++ b/src/Umbraco.Core/Persistence/DatabaseAnnotations/IndexAttribute.cs @@ -12,12 +12,12 @@ namespace Umbraco.Core.Persistence.DatabaseAnnotations { IndexType = indexType; } - + /// /// Gets or sets the name of the Index /// /// - /// Overrides default naming of indexes: + /// Overrides default naming of indexes: /// IX_tableName /// public string Name { get; set; }//Overrides default naming of indexes: IX_tableName @@ -32,4 +32,4 @@ namespace Umbraco.Core.Persistence.DatabaseAnnotations /// public string ForColumns { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/DatabaseAnnotations/IndexTypes.cs b/src/Umbraco.Core/Persistence/DatabaseAnnotations/IndexTypes.cs index 9e6b3af8c6..b99e18f96a 100644 --- a/src/Umbraco.Core/Persistence/DatabaseAnnotations/IndexTypes.cs +++ b/src/Umbraco.Core/Persistence/DatabaseAnnotations/IndexTypes.cs @@ -9,4 +9,4 @@ NonClustered, UniqueNonClustered } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/DatabaseAnnotations/LengthAttribute.cs b/src/Umbraco.Core/Persistence/DatabaseAnnotations/LengthAttribute.cs index dd977aeb43..a82f66ea64 100644 --- a/src/Umbraco.Core/Persistence/DatabaseAnnotations/LengthAttribute.cs +++ b/src/Umbraco.Core/Persistence/DatabaseAnnotations/LengthAttribute.cs @@ -19,4 +19,4 @@ namespace Umbraco.Core.Persistence.DatabaseAnnotations /// public int Length { get; private set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/DatabaseAnnotations/NullSettingAttribute.cs b/src/Umbraco.Core/Persistence/DatabaseAnnotations/NullSettingAttribute.cs index af6df1613a..b75b8650c7 100644 --- a/src/Umbraco.Core/Persistence/DatabaseAnnotations/NullSettingAttribute.cs +++ b/src/Umbraco.Core/Persistence/DatabaseAnnotations/NullSettingAttribute.cs @@ -17,4 +17,4 @@ namespace Umbraco.Core.Persistence.DatabaseAnnotations /// public NullSettings NullSetting { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/DatabaseAnnotations/NullSettings.cs b/src/Umbraco.Core/Persistence/DatabaseAnnotations/NullSettings.cs index 3901cc9101..d07b0ebf85 100644 --- a/src/Umbraco.Core/Persistence/DatabaseAnnotations/NullSettings.cs +++ b/src/Umbraco.Core/Persistence/DatabaseAnnotations/NullSettings.cs @@ -8,4 +8,4 @@ Null, NotNull } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/DatabaseAnnotations/PrimaryKeyColumnAttribute.cs b/src/Umbraco.Core/Persistence/DatabaseAnnotations/PrimaryKeyColumnAttribute.cs index 62db23e3cc..b8cbf27c77 100644 --- a/src/Umbraco.Core/Persistence/DatabaseAnnotations/PrimaryKeyColumnAttribute.cs +++ b/src/Umbraco.Core/Persistence/DatabaseAnnotations/PrimaryKeyColumnAttribute.cs @@ -33,7 +33,7 @@ namespace Umbraco.Core.Persistence.DatabaseAnnotations /// Gets or sets the name of the PrimaryKey. /// /// - /// Overrides the default naming of a PrimaryKey constraint: + /// Overrides the default naming of a PrimaryKey constraint: /// PK_tableName /// public string Name { get; set; } @@ -56,4 +56,4 @@ namespace Umbraco.Core.Persistence.DatabaseAnnotations /// public int IdentitySeed { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/DatabaseAnnotations/ReferencesAttribute.cs b/src/Umbraco.Core/Persistence/DatabaseAnnotations/ReferencesAttribute.cs index d6c2611990..cd700cc8ba 100644 --- a/src/Umbraco.Core/Persistence/DatabaseAnnotations/ReferencesAttribute.cs +++ b/src/Umbraco.Core/Persistence/DatabaseAnnotations/ReferencesAttribute.cs @@ -18,4 +18,4 @@ namespace Umbraco.Core.Persistence.DatabaseAnnotations /// public Type Type { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/DatabaseAnnotations/SpecialDbTypeAttribute.cs b/src/Umbraco.Core/Persistence/DatabaseAnnotations/SpecialDbTypeAttribute.cs index 44333da0bc..a54925dfc3 100644 --- a/src/Umbraco.Core/Persistence/DatabaseAnnotations/SpecialDbTypeAttribute.cs +++ b/src/Umbraco.Core/Persistence/DatabaseAnnotations/SpecialDbTypeAttribute.cs @@ -21,4 +21,4 @@ namespace Umbraco.Core.Persistence.DatabaseAnnotations /// public SpecialDbTypes DatabaseType { get; private set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/DatabaseAnnotations/SpecialDbTypes.cs b/src/Umbraco.Core/Persistence/DatabaseAnnotations/SpecialDbTypes.cs index af3a1d8d76..efb9fc6ea1 100644 --- a/src/Umbraco.Core/Persistence/DatabaseAnnotations/SpecialDbTypes.cs +++ b/src/Umbraco.Core/Persistence/DatabaseAnnotations/SpecialDbTypes.cs @@ -9,4 +9,4 @@ NTEXT, NCHAR } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/ColumnDefinition.cs b/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/ColumnDefinition.cs index 05db31640d..de29c25314 100644 --- a/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/ColumnDefinition.cs +++ b/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/ColumnDefinition.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Data; using Umbraco.Core.Persistence.DatabaseAnnotations; @@ -32,4 +32,4 @@ namespace Umbraco.Core.Persistence.DatabaseModelDefinitions public virtual string TableName { get; set; } public virtual ModificationType ModificationType { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/ConstraintDefinition.cs b/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/ConstraintDefinition.cs index a3b7d99802..8cda7e1a28 100644 --- a/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/ConstraintDefinition.cs +++ b/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/ConstraintDefinition.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; namespace Umbraco.Core.Persistence.DatabaseModelDefinitions { @@ -19,4 +19,4 @@ namespace Umbraco.Core.Persistence.DatabaseModelDefinitions public string TableName { get; set; } public ICollection Columns = new HashSet(); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/ConstraintType.cs b/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/ConstraintType.cs index 63d979ecb4..b47500f265 100644 --- a/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/ConstraintType.cs +++ b/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/ConstraintType.cs @@ -1,4 +1,4 @@ -namespace Umbraco.Core.Persistence.DatabaseModelDefinitions +namespace Umbraco.Core.Persistence.DatabaseModelDefinitions { public enum ConstraintType { @@ -6,4 +6,4 @@ namespace Umbraco.Core.Persistence.DatabaseModelDefinitions Unique, NonUnique } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/DbIndexDefinition.cs b/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/DbIndexDefinition.cs index e495d61550..33d9e20311 100644 --- a/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/DbIndexDefinition.cs +++ b/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/DbIndexDefinition.cs @@ -1,4 +1,4 @@ -namespace Umbraco.Core.Persistence.DatabaseModelDefinitions +namespace Umbraco.Core.Persistence.DatabaseModelDefinitions { /// /// Represents a database index definition retreived by querying the database @@ -10,4 +10,4 @@ namespace Umbraco.Core.Persistence.DatabaseModelDefinitions public virtual string ColumnName { get; set; } public virtual bool IsUnique { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/DefinitionFactory.cs b/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/DefinitionFactory.cs index 7936ac0fa8..b1ae542659 100644 --- a/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/DefinitionFactory.cs +++ b/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/DefinitionFactory.cs @@ -175,4 +175,4 @@ namespace Umbraco.Core.Persistence.DatabaseModelDefinitions return definition; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/DeletionDataDefinition.cs b/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/DeletionDataDefinition.cs index f4610e7841..5afd18d6ff 100644 --- a/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/DeletionDataDefinition.cs +++ b/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/DeletionDataDefinition.cs @@ -1,9 +1,9 @@ -using System.Collections.Generic; +using System.Collections.Generic; namespace Umbraco.Core.Persistence.DatabaseModelDefinitions { public class DeletionDataDefinition : List> { - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/Direction.cs b/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/Direction.cs index 2e98185ce9..1425cf1dc9 100644 --- a/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/Direction.cs +++ b/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/Direction.cs @@ -1,8 +1,8 @@ -namespace Umbraco.Core.Persistence.DatabaseModelDefinitions +namespace Umbraco.Core.Persistence.DatabaseModelDefinitions { public enum Direction { Ascending = 0, Descending = 1 } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/ForeignKeyDefinition.cs b/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/ForeignKeyDefinition.cs index 3012c57b0e..b6233b5517 100644 --- a/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/ForeignKeyDefinition.cs +++ b/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/ForeignKeyDefinition.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Data; namespace Umbraco.Core.Persistence.DatabaseModelDefinitions @@ -24,4 +24,4 @@ namespace Umbraco.Core.Persistence.DatabaseModelDefinitions public virtual ICollection ForeignColumns { get; set; } public virtual ICollection PrimaryColumns { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/IndexColumnDefinition.cs b/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/IndexColumnDefinition.cs index b2bb090ac1..039c1cc312 100644 --- a/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/IndexColumnDefinition.cs +++ b/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/IndexColumnDefinition.cs @@ -1,8 +1,8 @@ -namespace Umbraco.Core.Persistence.DatabaseModelDefinitions +namespace Umbraco.Core.Persistence.DatabaseModelDefinitions { public class IndexColumnDefinition { public virtual string Name { get; set; } public virtual Direction Direction { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/IndexDefinition.cs b/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/IndexDefinition.cs index ec46d35780..8ae67c3b75 100644 --- a/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/IndexDefinition.cs +++ b/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/IndexDefinition.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using Umbraco.Core.Persistence.DatabaseAnnotations; namespace Umbraco.Core.Persistence.DatabaseModelDefinitions @@ -19,4 +19,4 @@ namespace Umbraco.Core.Persistence.DatabaseModelDefinitions public virtual ICollection Columns { get; set; } public IndexTypes IndexType { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/InsertionDataDefinition.cs b/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/InsertionDataDefinition.cs index ae49ab224d..3405853cce 100644 --- a/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/InsertionDataDefinition.cs +++ b/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/InsertionDataDefinition.cs @@ -1,9 +1,9 @@ -using System.Collections.Generic; +using System.Collections.Generic; namespace Umbraco.Core.Persistence.DatabaseModelDefinitions { public class InsertionDataDefinition : List> { - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/ModificationType.cs b/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/ModificationType.cs index 1ab4e17dcf..c6e2b52306 100644 --- a/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/ModificationType.cs +++ b/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/ModificationType.cs @@ -1,4 +1,4 @@ -namespace Umbraco.Core.Persistence.DatabaseModelDefinitions +namespace Umbraco.Core.Persistence.DatabaseModelDefinitions { public enum ModificationType { @@ -10,4 +10,4 @@ namespace Umbraco.Core.Persistence.DatabaseModelDefinitions Update, Delete } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/SystemMethods.cs b/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/SystemMethods.cs index 24c2294b59..3415ad71dd 100644 --- a/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/SystemMethods.cs +++ b/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/SystemMethods.cs @@ -1,4 +1,4 @@ -namespace Umbraco.Core.Persistence.DatabaseModelDefinitions +namespace Umbraco.Core.Persistence.DatabaseModelDefinitions { public enum SystemMethods { @@ -7,4 +7,4 @@ namespace Umbraco.Core.Persistence.DatabaseModelDefinitions //NewSequentialId, //CurrentUTCDateTime } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/TableDefinition.cs b/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/TableDefinition.cs index 18180049e9..afb7ca3d8e 100644 --- a/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/TableDefinition.cs +++ b/src/Umbraco.Core/Persistence/DatabaseModelDefinitions/TableDefinition.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; namespace Umbraco.Core.Persistence.DatabaseModelDefinitions { @@ -17,4 +17,4 @@ namespace Umbraco.Core.Persistence.DatabaseModelDefinitions public virtual ICollection ForeignKeys { get; set; } public virtual ICollection Indexes { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/DatabaseSchemaHelper.cs b/src/Umbraco.Core/Persistence/DatabaseSchemaHelper.cs index a0766d9e7b..6201ab9244 100644 --- a/src/Umbraco.Core/Persistence/DatabaseSchemaHelper.cs +++ b/src/Umbraco.Core/Persistence/DatabaseSchemaHelper.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using NPoco; using Umbraco.Core.Logging; @@ -185,4 +185,4 @@ namespace Umbraco.Core.Persistence _database.Execute(sql); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/DatabasenodeLockExtensions.cs b/src/Umbraco.Core/Persistence/DatabasenodeLockExtensions.cs index ae53178563..48edee3c94 100644 --- a/src/Umbraco.Core/Persistence/DatabasenodeLockExtensions.cs +++ b/src/Umbraco.Core/Persistence/DatabasenodeLockExtensions.cs @@ -40,4 +40,4 @@ namespace Umbraco.Core.Persistence new { @id = nodeId }); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/EntityNotFoundException.cs b/src/Umbraco.Core/Persistence/EntityNotFoundException.cs index 1cc66a2ba2..49e85046a0 100644 --- a/src/Umbraco.Core/Persistence/EntityNotFoundException.cs +++ b/src/Umbraco.Core/Persistence/EntityNotFoundException.cs @@ -39,7 +39,7 @@ namespace Umbraco.Core.Persistence if (Id != null) { - return "Umbraco entity (id: " + Id + ") not found. " + result; + return "Umbraco entity (id: " + Id + ") not found. " + result; } return result; diff --git a/src/Umbraco.Core/Persistence/Factories/ContentFactory.cs b/src/Umbraco.Core/Persistence/Factories/ContentFactory.cs index 075f008393..dd925656bc 100644 --- a/src/Umbraco.Core/Persistence/Factories/ContentFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/ContentFactory.cs @@ -32,7 +32,7 @@ namespace Umbraco.Core.Persistence.Factories /// /// /// This DTO can contain all of the information to build an IContent item, however in cases where multiple entities are being built, - /// a separate publishedDto entity will be supplied in place of the 's own + /// a separate publishedDto entity will be supplied in place of the 's own /// ResultColumn DocumentPublishedReadOnlyDto /// /// @@ -164,7 +164,7 @@ namespace Umbraco.Core.Persistence.Factories private NodeDto BuildNodeDto(IContent entity) { - //TODO: Change this once the Language property is public on IContent + //TODO: Change this once the Language property is public on IContent var nodeName = entity.Name; var nodeDto = new NodeDto @@ -185,4 +185,4 @@ namespace Umbraco.Core.Persistence.Factories return nodeDto; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Factories/ContentTypeFactory.cs b/src/Umbraco.Core/Persistence/Factories/ContentTypeFactory.cs index 3672f80873..b345285a0f 100644 --- a/src/Umbraco.Core/Persistence/Factories/ContentTypeFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/ContentTypeFactory.cs @@ -14,7 +14,7 @@ namespace Umbraco.Core.Persistence.Factories // IMediaType (media types) // IMemberType (member types) // - internal class ContentTypeFactory + internal class ContentTypeFactory { #region IContentType @@ -159,4 +159,4 @@ namespace Umbraco.Core.Persistence.Factories #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Factories/DataTypeDefinitionFactory.cs b/src/Umbraco.Core/Persistence/Factories/DataTypeDefinitionFactory.cs index cf487fa1a2..c2ed31cae1 100644 --- a/src/Umbraco.Core/Persistence/Factories/DataTypeDefinitionFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/DataTypeDefinitionFactory.cs @@ -95,4 +95,4 @@ namespace Umbraco.Core.Persistence.Factories return nodeDto; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Factories/DictionaryItemFactory.cs b/src/Umbraco.Core/Persistence/Factories/DictionaryItemFactory.cs index 4bcfea58ca..6284aa3be8 100644 --- a/src/Umbraco.Core/Persistence/Factories/DictionaryItemFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/DictionaryItemFactory.cs @@ -4,7 +4,7 @@ using Umbraco.Core.Models.Rdbms; namespace Umbraco.Core.Persistence.Factories { - internal class DictionaryItemFactory + internal class DictionaryItemFactory { #region Implementation of IEntityFactory @@ -63,4 +63,4 @@ namespace Umbraco.Core.Persistence.Factories return list; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Factories/DictionaryTranslationFactory.cs b/src/Umbraco.Core/Persistence/Factories/DictionaryTranslationFactory.cs index 2a931f6069..49ed6d717f 100644 --- a/src/Umbraco.Core/Persistence/Factories/DictionaryTranslationFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/DictionaryTranslationFactory.cs @@ -4,7 +4,7 @@ using Umbraco.Core.Models.Rdbms; namespace Umbraco.Core.Persistence.Factories { - internal class DictionaryTranslationFactory + internal class DictionaryTranslationFactory { private readonly Guid _uniqueId; @@ -53,4 +53,4 @@ namespace Umbraco.Core.Persistence.Factories #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Factories/ExternalLoginFactory.cs b/src/Umbraco.Core/Persistence/Factories/ExternalLoginFactory.cs index 4882df3202..c256fc66cc 100644 --- a/src/Umbraco.Core/Persistence/Factories/ExternalLoginFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/ExternalLoginFactory.cs @@ -1,4 +1,4 @@ -using Umbraco.Core.Models.Identity; +using Umbraco.Core.Models.Identity; using Umbraco.Core.Models.Rdbms; namespace Umbraco.Core.Persistence.Factories @@ -23,10 +23,10 @@ namespace Umbraco.Core.Persistence.Factories CreateDate = entity.CreateDate, LoginProvider = entity.LoginProvider, ProviderKey = entity.ProviderKey, - UserId = entity.UserId + UserId = entity.UserId }; return dto; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Factories/LanguageFactory.cs b/src/Umbraco.Core/Persistence/Factories/LanguageFactory.cs index 54c8aa30a8..57e792fe4a 100644 --- a/src/Umbraco.Core/Persistence/Factories/LanguageFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/LanguageFactory.cs @@ -4,7 +4,7 @@ using Umbraco.Core.Models.Rdbms; namespace Umbraco.Core.Persistence.Factories { - internal class LanguageFactory + internal class LanguageFactory { public ILanguage BuildEntity(LanguageDto dto) { @@ -24,4 +24,4 @@ namespace Umbraco.Core.Persistence.Factories return dto; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Factories/MacroFactory.cs b/src/Umbraco.Core/Persistence/Factories/MacroFactory.cs index c3acd7ff29..5dbec9741b 100644 --- a/src/Umbraco.Core/Persistence/Factories/MacroFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/MacroFactory.cs @@ -5,7 +5,7 @@ using Umbraco.Core.Models.Rdbms; namespace Umbraco.Core.Persistence.Factories { - internal class MacroFactory + internal class MacroFactory { public IMacro BuildEntity(MacroDto dto) { diff --git a/src/Umbraco.Core/Persistence/Factories/MediaFactory.cs b/src/Umbraco.Core/Persistence/Factories/MediaFactory.cs index 5729bb125e..74254dcc8c 100644 --- a/src/Umbraco.Core/Persistence/Factories/MediaFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/MediaFactory.cs @@ -5,7 +5,7 @@ using Umbraco.Core.Models.Rdbms; namespace Umbraco.Core.Persistence.Factories { - internal class MediaFactory + internal class MediaFactory { private readonly IMediaType _contentType; private readonly Guid _nodeObjectTypeId; @@ -120,4 +120,4 @@ namespace Umbraco.Core.Persistence.Factories return nodeDto; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Factories/MemberFactory.cs b/src/Umbraco.Core/Persistence/Factories/MemberFactory.cs index 7b28808429..2dbfa7ac51 100644 --- a/src/Umbraco.Core/Persistence/Factories/MemberFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/MemberFactory.cs @@ -132,4 +132,4 @@ namespace Umbraco.Core.Persistence.Factories } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Factories/MemberGroupFactory.cs b/src/Umbraco.Core/Persistence/Factories/MemberGroupFactory.cs index a4e069e85c..5f4fe6da84 100644 --- a/src/Umbraco.Core/Persistence/Factories/MemberGroupFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/MemberGroupFactory.cs @@ -4,9 +4,9 @@ using Umbraco.Core.Models.Rdbms; namespace Umbraco.Core.Persistence.Factories { - internal class MemberGroupFactory + internal class MemberGroupFactory { - + private readonly Guid _nodeObjectTypeId; public MemberGroupFactory() @@ -19,7 +19,7 @@ namespace Umbraco.Core.Persistence.Factories public IMemberGroup BuildEntity(NodeDto dto) { var group = new MemberGroup(); - + try { group.DisableChangeTracking(); @@ -69,4 +69,4 @@ namespace Umbraco.Core.Persistence.Factories #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Factories/MemberTypeReadOnlyFactory.cs b/src/Umbraco.Core/Persistence/Factories/MemberTypeReadOnlyFactory.cs index ba7a47165b..9596862401 100644 --- a/src/Umbraco.Core/Persistence/Factories/MemberTypeReadOnlyFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/MemberTypeReadOnlyFactory.cs @@ -7,7 +7,7 @@ using Umbraco.Core.Persistence.Repositories; namespace Umbraco.Core.Persistence.Factories { - internal class MemberTypeReadOnlyFactory + internal class MemberTypeReadOnlyFactory { public IMemberType BuildEntity(MemberTypeReadOnlyDto dto, out bool needsSaving) { @@ -43,7 +43,7 @@ namespace Umbraco.Core.Persistence.Factories var propertyTypes = GetPropertyTypes(dto, memberType, standardPropertyTypes); - //By Convention we add 9 stnd PropertyTypes - This is only here to support loading of types that didn't have these conventions before. + //By Convention we add 9 stnd PropertyTypes - This is only here to support loading of types that didn't have these conventions before. foreach (var standardPropertyType in standardPropertyTypes) { if (dto.PropertyTypes.Any(x => x.Alias.Equals(standardPropertyType.Key))) continue; @@ -112,7 +112,7 @@ namespace Umbraco.Core.Persistence.Factories typeDto.Alias, typeDto.DbType.EnumParse(true), standardProps); - + var propertyType = new PropertyType( typeDto.PropertyEditorAlias, propDbType.Result, @@ -186,7 +186,7 @@ namespace Umbraco.Core.Persistence.Factories UpdateDate = dto.CreateDate, Key = typeDto.UniqueId }; - + propertyTypes.Add(propertyType); } return propertyTypes; @@ -196,6 +196,6 @@ namespace Umbraco.Core.Persistence.Factories { throw new System.NotImplementedException(); } - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Factories/MigrationEntryFactory.cs b/src/Umbraco.Core/Persistence/Factories/MigrationEntryFactory.cs index 1cb7000293..145505f629 100644 --- a/src/Umbraco.Core/Persistence/Factories/MigrationEntryFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/MigrationEntryFactory.cs @@ -37,4 +37,4 @@ namespace Umbraco.Core.Persistence.Factories return dto; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Factories/ModelFactoryConfiguration.cs b/src/Umbraco.Core/Persistence/Factories/ModelFactoryConfiguration.cs index c003b26a98..0a7372087d 100644 --- a/src/Umbraco.Core/Persistence/Factories/ModelFactoryConfiguration.cs +++ b/src/Umbraco.Core/Persistence/Factories/ModelFactoryConfiguration.cs @@ -13,8 +13,8 @@ namespace Umbraco.Core.Persistence.Factories //{ // public override void ConfigureMappings(IConfiguration config) // { - + // UserSectionFactory.ConfigureMappings(config); // } //} -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Factories/PropertyFactory.cs b/src/Umbraco.Core/Persistence/Factories/PropertyFactory.cs index f202d8c321..7af14fd156 100644 --- a/src/Umbraco.Core/Persistence/Factories/PropertyFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/PropertyFactory.cs @@ -131,4 +131,4 @@ namespace Umbraco.Core.Persistence.Factories } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Factories/PropertyGroupFactory.cs b/src/Umbraco.Core/Persistence/Factories/PropertyGroupFactory.cs index e1db8dcebf..1d2fa4071b 100644 --- a/src/Umbraco.Core/Persistence/Factories/PropertyGroupFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/PropertyGroupFactory.cs @@ -6,7 +6,7 @@ using Umbraco.Core.Models.Rdbms; namespace Umbraco.Core.Persistence.Factories { - internal class PropertyGroupFactory + internal class PropertyGroupFactory { private readonly int _contentTypeId; private readonly DateTime _createDate; @@ -158,4 +158,4 @@ namespace Umbraco.Core.Persistence.Factories return propertyTypeDto; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Factories/PublicAccessEntryFactory.cs b/src/Umbraco.Core/Persistence/Factories/PublicAccessEntryFactory.cs index a576ef31c4..73c4fdaf78 100644 --- a/src/Umbraco.Core/Persistence/Factories/PublicAccessEntryFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/PublicAccessEntryFactory.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using Umbraco.Core.Models; using Umbraco.Core.Models.Rdbms; @@ -9,7 +9,7 @@ namespace Umbraco.Core.Persistence.Factories { public PublicAccessEntry BuildEntity(AccessDto dto) { - var entity = new PublicAccessEntry(dto.Id, dto.NodeId, dto.LoginNodeId, dto.NoAccessNodeId, + var entity = new PublicAccessEntry(dto.Id, dto.NodeId, dto.LoginNodeId, dto.NoAccessNodeId, dto.Rules.Select(x => new PublicAccessRule(x.Id, x.AccessId) { RuleValue = x.RuleValue, @@ -52,4 +52,4 @@ namespace Umbraco.Core.Persistence.Factories return dto; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Factories/RelationFactory.cs b/src/Umbraco.Core/Persistence/Factories/RelationFactory.cs index 47adf75d89..1ebba27150 100644 --- a/src/Umbraco.Core/Persistence/Factories/RelationFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/RelationFactory.cs @@ -3,7 +3,7 @@ using Umbraco.Core.Models.Rdbms; namespace Umbraco.Core.Persistence.Factories { - internal class RelationFactory + internal class RelationFactory { private readonly IRelationType _relationType; @@ -57,4 +57,4 @@ namespace Umbraco.Core.Persistence.Factories #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Factories/RelationTypeFactory.cs b/src/Umbraco.Core/Persistence/Factories/RelationTypeFactory.cs index b112535817..86f06f45e0 100644 --- a/src/Umbraco.Core/Persistence/Factories/RelationTypeFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/RelationTypeFactory.cs @@ -3,7 +3,7 @@ using Umbraco.Core.Models.Rdbms; namespace Umbraco.Core.Persistence.Factories { - internal class RelationTypeFactory + internal class RelationTypeFactory { #region Implementation of IEntityFactory @@ -52,4 +52,4 @@ namespace Umbraco.Core.Persistence.Factories #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Factories/ServerRegistrationFactory.cs b/src/Umbraco.Core/Persistence/Factories/ServerRegistrationFactory.cs index 9c315aef46..20236e8f8c 100644 --- a/src/Umbraco.Core/Persistence/Factories/ServerRegistrationFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/ServerRegistrationFactory.cs @@ -3,7 +3,7 @@ using Umbraco.Core.Models.Rdbms; namespace Umbraco.Core.Persistence.Factories { - internal class ServerRegistrationFactory + internal class ServerRegistrationFactory { public ServerRegistration BuildEntity(ServerRegistrationDto dto) { @@ -32,4 +32,4 @@ namespace Umbraco.Core.Persistence.Factories return dto; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Factories/TagFactory.cs b/src/Umbraco.Core/Persistence/Factories/TagFactory.cs index 0aa60733de..5193bd58fb 100644 --- a/src/Umbraco.Core/Persistence/Factories/TagFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/TagFactory.cs @@ -3,11 +3,11 @@ using Umbraco.Core.Models.Rdbms; namespace Umbraco.Core.Persistence.Factories { - internal class TagFactory + internal class TagFactory { public ITag BuildEntity(TagDto dto) { - var model = new Tag(dto.Id, dto.Tag, dto.Group, dto.NodeCount); + var model = new Tag(dto.Id, dto.Tag, dto.Group, dto.NodeCount); //on initial construction we don't want to have dirty properties tracked // http://issues.umbraco.org/issue/U4-1946 model.ResetDirtyProperties(false); @@ -25,4 +25,4 @@ namespace Umbraco.Core.Persistence.Factories }; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Factories/TaskFactory.cs b/src/Umbraco.Core/Persistence/Factories/TaskFactory.cs index 6a8292579d..0b3ee24951 100644 --- a/src/Umbraco.Core/Persistence/Factories/TaskFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/TaskFactory.cs @@ -1,4 +1,4 @@ -using Umbraco.Core.Models; +using Umbraco.Core.Models; using Umbraco.Core.Models.Rdbms; namespace Umbraco.Core.Persistence.Factories @@ -47,8 +47,8 @@ namespace Umbraco.Core.Persistence.Factories TaskTypeId = (byte)entity.TaskType.Id, UserId = entity.AssigneeUserId }; - + return dto; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Factories/TaskTypeFactory.cs b/src/Umbraco.Core/Persistence/Factories/TaskTypeFactory.cs index a17abebad6..c092390c28 100644 --- a/src/Umbraco.Core/Persistence/Factories/TaskTypeFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/TaskTypeFactory.cs @@ -1,4 +1,4 @@ -using Umbraco.Core.Models; +using Umbraco.Core.Models; using Umbraco.Core.Models.Rdbms; namespace Umbraco.Core.Persistence.Factories @@ -24,4 +24,4 @@ namespace Umbraco.Core.Persistence.Factories return dto; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Factories/TemplateFactory.cs b/src/Umbraco.Core/Persistence/Factories/TemplateFactory.cs index ecff14d99c..34c51ff078 100644 --- a/src/Umbraco.Core/Persistence/Factories/TemplateFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/TemplateFactory.cs @@ -17,7 +17,7 @@ namespace Umbraco.Core.Persistence.Factories public TemplateFactory() { - + } public TemplateFactory(Guid nodeObjectTypeId) @@ -105,4 +105,4 @@ namespace Umbraco.Core.Persistence.Factories return nodeDto; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Factories/UmbracoEntityFactory.cs b/src/Umbraco.Core/Persistence/Factories/UmbracoEntityFactory.cs index ded7c60676..07d4171b7d 100644 --- a/src/Umbraco.Core/Persistence/Factories/UmbracoEntityFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/UmbracoEntityFactory.cs @@ -10,12 +10,12 @@ using Umbraco.Core.Strings; namespace Umbraco.Core.Persistence.Factories { - internal class UmbracoEntityFactory + internal class UmbracoEntityFactory { internal void AddAdditionalData(UmbracoEntity entity, IDictionary originalEntityProperties) { var entityProps = typeof(IUmbracoEntity).GetPublicProperties().Select(x => x.Name).ToArray(); - + //figure out what extra properties we have that are not on the IUmbracoEntity and add them to additional data foreach (var k in originalEntityProperties.Keys .Select(x => new { orig = x, title = x.ToCleanString(CleanStringType.PascalCase | CleanStringType.Ascii | CleanStringType.ConvertCase) }) @@ -66,7 +66,7 @@ namespace Umbraco.Core.Persistence.Factories entity.IsDraft = newestVersion != default(Guid) && (publishedVersion == default(Guid) || publishedVersion != newestVersion); entity.HasPendingChanges = (publishedVersion != default(Guid) && newestVersion != default(Guid)) && publishedVersion != newestVersion; - //Now we can assign the additional data! + //Now we can assign the additional data! AddAdditionalData(entity, asDictionary); return entity; @@ -76,6 +76,6 @@ namespace Umbraco.Core.Persistence.Factories entity.EnableChangeTracking(); } } - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Factories/UserFactory.cs b/src/Umbraco.Core/Persistence/Factories/UserFactory.cs index 5f0784d934..670530768f 100644 --- a/src/Umbraco.Core/Persistence/Factories/UserFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/UserFactory.cs @@ -7,7 +7,7 @@ using Umbraco.Core.Models.Rdbms; namespace Umbraco.Core.Persistence.Factories { - internal class UserFactory + internal class UserFactory { private readonly IUserType _userType; @@ -105,4 +105,4 @@ namespace Umbraco.Core.Persistence.Factories #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Factories/UserTypeFactory.cs b/src/Umbraco.Core/Persistence/Factories/UserTypeFactory.cs index 5f9cfac994..33272b7352 100644 --- a/src/Umbraco.Core/Persistence/Factories/UserTypeFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/UserTypeFactory.cs @@ -51,4 +51,4 @@ namespace Umbraco.Core.Persistence.Factories #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/FaultHandling/ITransientErrorDetectionStrategy.cs b/src/Umbraco.Core/Persistence/FaultHandling/ITransientErrorDetectionStrategy.cs index 1dd558f3d4..3c76d46f6a 100644 --- a/src/Umbraco.Core/Persistence/FaultHandling/ITransientErrorDetectionStrategy.cs +++ b/src/Umbraco.Core/Persistence/FaultHandling/ITransientErrorDetectionStrategy.cs @@ -14,4 +14,4 @@ namespace Umbraco.Core.Persistence.FaultHandling /// True if the specified exception is considered as transient, otherwise false. bool IsTransient(Exception ex); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/FaultHandling/RetryLimitExceededException.cs b/src/Umbraco.Core/Persistence/FaultHandling/RetryLimitExceededException.cs index 90b7f2902c..e3a72313f0 100644 --- a/src/Umbraco.Core/Persistence/FaultHandling/RetryLimitExceededException.cs +++ b/src/Umbraco.Core/Persistence/FaultHandling/RetryLimitExceededException.cs @@ -59,4 +59,4 @@ namespace Umbraco.Core.Persistence.FaultHandling { } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/FaultHandling/RetryPolicy.cs b/src/Umbraco.Core/Persistence/FaultHandling/RetryPolicy.cs index 2f8a37dc41..6d99f9f1e5 100644 --- a/src/Umbraco.Core/Persistence/FaultHandling/RetryPolicy.cs +++ b/src/Umbraco.Core/Persistence/FaultHandling/RetryPolicy.cs @@ -173,7 +173,7 @@ namespace Umbraco.Core.Persistence.FaultHandling } } - // Perform an extra check in the delay interval. Should prevent from accidentally ending up with the value of -1 that will block a thread indefinitely. + // Perform an extra check in the delay interval. Should prevent from accidentally ending up with the value of -1 that will block a thread indefinitely. // In addition, any other negative numbers will cause an ArgumentOutOfRangeException fault that will be thrown by Thread.Sleep. if (delay.TotalMilliseconds < 0) { @@ -198,7 +198,7 @@ namespace Umbraco.Core.Persistence.FaultHandling protected virtual void OnRetrying(int retryCount, Exception lastError, TimeSpan delay) { if (this.Retrying != null) - { + { this.Retrying(this, new RetryingEventArgs(retryCount, delay, lastError)); } } @@ -237,4 +237,4 @@ namespace Umbraco.Core.Persistence.FaultHandling } #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/FaultHandling/RetryPolicyFactory.cs b/src/Umbraco.Core/Persistence/FaultHandling/RetryPolicyFactory.cs index cacb46b580..0729d67ee0 100644 --- a/src/Umbraco.Core/Persistence/FaultHandling/RetryPolicyFactory.cs +++ b/src/Umbraco.Core/Persistence/FaultHandling/RetryPolicyFactory.cs @@ -54,4 +54,4 @@ namespace Umbraco.Core.Persistence.FaultHandling return retryPolicy; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/FaultHandling/RetryStrategy.cs b/src/Umbraco.Core/Persistence/FaultHandling/RetryStrategy.cs index 1cf6029984..0f79e78a7f 100644 --- a/src/Umbraco.Core/Persistence/FaultHandling/RetryStrategy.cs +++ b/src/Umbraco.Core/Persistence/FaultHandling/RetryStrategy.cs @@ -80,7 +80,7 @@ namespace Umbraco.Core.Persistence.FaultHandling public static readonly RetryStrategy DefaultExponential = new ExponentialBackoff(DefaultClientRetryCount, DefaultMinBackoff, DefaultMaxBackoff, DefaultClientBackoff); /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The name of the retry strategy. /// a value indicating whether or not the very first retry attempt will be made immediately @@ -108,4 +108,4 @@ namespace Umbraco.Core.Persistence.FaultHandling /// The ShouldRetry delegate. public abstract ShouldRetry GetShouldRetry(); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/FaultHandling/RetryingEventArgs.cs b/src/Umbraco.Core/Persistence/FaultHandling/RetryingEventArgs.cs index 2767249f31..99eeb29688 100644 --- a/src/Umbraco.Core/Persistence/FaultHandling/RetryingEventArgs.cs +++ b/src/Umbraco.Core/Persistence/FaultHandling/RetryingEventArgs.cs @@ -37,4 +37,4 @@ namespace Umbraco.Core.Persistence.FaultHandling /// public Exception LastException { get; private set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/FaultHandling/Strategies/ExponentialBackoff.cs b/src/Umbraco.Core/Persistence/FaultHandling/Strategies/ExponentialBackoff.cs index d5c43f798c..e8954d334a 100644 --- a/src/Umbraco.Core/Persistence/FaultHandling/Strategies/ExponentialBackoff.cs +++ b/src/Umbraco.Core/Persistence/FaultHandling/Strategies/ExponentialBackoff.cs @@ -13,7 +13,7 @@ namespace Umbraco.Core.Persistence.FaultHandling.Strategies private readonly TimeSpan deltaBackoff; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// public ExponentialBackoff() : this(DefaultClientRetryCount, DefaultMinBackoff, DefaultMaxBackoff, DefaultClientBackoff) @@ -21,7 +21,7 @@ namespace Umbraco.Core.Persistence.FaultHandling.Strategies } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The maximum number of retry attempts. /// The minimum back-off time @@ -33,7 +33,7 @@ namespace Umbraco.Core.Persistence.FaultHandling.Strategies } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The name of the retry strategy. /// The maximum number of retry attempts. @@ -46,7 +46,7 @@ namespace Umbraco.Core.Persistence.FaultHandling.Strategies } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The name of the retry strategy. /// The maximum number of retry attempts. @@ -54,7 +54,7 @@ namespace Umbraco.Core.Persistence.FaultHandling.Strategies /// The maximum back-off time. /// The value that will be used for calculating a random delta in the exponential delay between retries. /// - /// Indicates whether or not the very first retry attempt will be made immediately + /// Indicates whether or not the very first retry attempt will be made immediately /// whereas the subsequent retries will remain subject to retry interval. /// public ExponentialBackoff(string name, int retryCount, TimeSpan minBackoff, TimeSpan maxBackoff, TimeSpan deltaBackoff, bool firstFastRetry) @@ -97,4 +97,4 @@ namespace Umbraco.Core.Persistence.FaultHandling.Strategies }; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/FaultHandling/Strategies/FixedInterval.cs b/src/Umbraco.Core/Persistence/FaultHandling/Strategies/FixedInterval.cs index 5c75aef559..289d9d7a90 100644 --- a/src/Umbraco.Core/Persistence/FaultHandling/Strategies/FixedInterval.cs +++ b/src/Umbraco.Core/Persistence/FaultHandling/Strategies/FixedInterval.cs @@ -11,7 +11,7 @@ namespace Umbraco.Core.Persistence.FaultHandling.Strategies private readonly TimeSpan retryInterval; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// public FixedInterval() : this(DefaultClientRetryCount) @@ -19,7 +19,7 @@ namespace Umbraco.Core.Persistence.FaultHandling.Strategies } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The number of retry attempts. public FixedInterval(int retryCount) @@ -28,7 +28,7 @@ namespace Umbraco.Core.Persistence.FaultHandling.Strategies } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The number of retry attempts. /// The time interval between retries. @@ -38,7 +38,7 @@ namespace Umbraco.Core.Persistence.FaultHandling.Strategies } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The retry strategy name. /// The number of retry attempts. @@ -49,7 +49,7 @@ namespace Umbraco.Core.Persistence.FaultHandling.Strategies } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The retry strategy name. /// The number of retry attempts. @@ -93,4 +93,4 @@ namespace Umbraco.Core.Persistence.FaultHandling.Strategies }; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/FaultHandling/Strategies/Incremental.cs b/src/Umbraco.Core/Persistence/FaultHandling/Strategies/Incremental.cs index b3ab72b6a3..18f2575fea 100644 --- a/src/Umbraco.Core/Persistence/FaultHandling/Strategies/Incremental.cs +++ b/src/Umbraco.Core/Persistence/FaultHandling/Strategies/Incremental.cs @@ -12,7 +12,7 @@ namespace Umbraco.Core.Persistence.FaultHandling.Strategies private readonly TimeSpan increment; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// public Incremental() : this(DefaultClientRetryCount, DefaultRetryInterval, DefaultRetryIncrement) @@ -20,7 +20,7 @@ namespace Umbraco.Core.Persistence.FaultHandling.Strategies } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The number of retry attempts. /// The initial interval that will apply for the first retry. @@ -31,7 +31,7 @@ namespace Umbraco.Core.Persistence.FaultHandling.Strategies } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The retry strategy name. /// The number of retry attempts. @@ -43,7 +43,7 @@ namespace Umbraco.Core.Persistence.FaultHandling.Strategies } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The retry strategy name. /// The number of retry attempts. @@ -83,4 +83,4 @@ namespace Umbraco.Core.Persistence.FaultHandling.Strategies }; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/FaultHandling/Strategies/NetworkConnectivityErrorDetectionStrategy.cs b/src/Umbraco.Core/Persistence/FaultHandling/Strategies/NetworkConnectivityErrorDetectionStrategy.cs index 152d1388f8..ea28f5f8b7 100644 --- a/src/Umbraco.Core/Persistence/FaultHandling/Strategies/NetworkConnectivityErrorDetectionStrategy.cs +++ b/src/Umbraco.Core/Persistence/FaultHandling/Strategies/NetworkConnectivityErrorDetectionStrategy.cs @@ -17,8 +17,8 @@ namespace Umbraco.Core.Persistence.FaultHandling.Strategies switch (sqlException.Number) { // SQL Error Code: 11001 - // A network-related or instance-specific error occurred while establishing a connection to SQL Server. - // The server was not found or was not accessible. Verify that the instance name is correct and that SQL + // A network-related or instance-specific error occurred while establishing a connection to SQL Server. + // The server was not found or was not accessible. Verify that the instance name is correct and that SQL // Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - No such host is known.) case 11001: return true; @@ -28,4 +28,4 @@ namespace Umbraco.Core.Persistence.FaultHandling.Strategies return false; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/FaultHandling/Strategies/SqlAzureTransientErrorDetectionStrategy.cs b/src/Umbraco.Core/Persistence/FaultHandling/Strategies/SqlAzureTransientErrorDetectionStrategy.cs index 190b33c3de..1164719538 100644 --- a/src/Umbraco.Core/Persistence/FaultHandling/Strategies/SqlAzureTransientErrorDetectionStrategy.cs +++ b/src/Umbraco.Core/Persistence/FaultHandling/Strategies/SqlAzureTransientErrorDetectionStrategy.cs @@ -105,32 +105,32 @@ namespace Umbraco.Core.Persistence.FaultHandling.Strategies // An established connection was aborted by the software in your host machine. case 10053: // SQL Error Code: 10054 - // A transport-level error has occurred when sending the request to the server. + // A transport-level error has occurred when sending the request to the server. // (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.) case 10054: // SQL Error Code: 10060 - // A network-related or instance-specific error occurred while establishing a connection to SQL Server. - // The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server - // is configured to allow remote connections. (provider: TCP Provider, error: 0 - A connection attempt failed - // because the connected party did not properly respond after a period of time, or established connection failed + // A network-related or instance-specific error occurred while establishing a connection to SQL Server. + // The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server + // is configured to allow remote connections. (provider: TCP Provider, error: 0 - A connection attempt failed + // because the connected party did not properly respond after a period of time, or established connection failed // because connected host has failed to respond.)"} case 10060: // SQL Error Code: 40613 - // Database XXXX on server YYYY is not currently available. Please retry the connection later. If the problem persists, contact customer + // Database XXXX on server YYYY is not currently available. Please retry the connection later. If the problem persists, contact customer // support, and provide them the session tracing ID of ZZZZZ. case 40613: // SQL Error Code: 40143 // The service has encountered an error processing your request. Please try again. case 40143: // SQL Error Code: 233 - // The client was unable to establish a connection because of an error during connection initialization process before login. - // Possible causes include the following: the client tried to connect to an unsupported version of SQL Server; the server was too busy - // to accept new connections; or there was a resource limitation (insufficient memory or maximum allowed connections) on the server. + // The client was unable to establish a connection because of an error during connection initialization process before login. + // Possible causes include the following: the client tried to connect to an unsupported version of SQL Server; the server was too busy + // to accept new connections; or there was a resource limitation (insufficient memory or maximum allowed connections) on the server. // (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.) case 233: // SQL Error Code: 64 - // A connection was successfully established with the server, but then an error occurred during the login process. - // (provider: TCP Provider, error: 0 - The specified network name is no longer available.) + // A connection was successfully established with the server, but then an error occurred during the login process. + // (provider: TCP Provider, error: 0 - The specified network name is no longer available.) case 64: // DBNETLIB Error Code: 20 // The instance of SQL Server you attempted to connect to does not support encryption. @@ -158,4 +158,4 @@ namespace Umbraco.Core.Persistence.FaultHandling.Strategies #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/FaultHandling/ThrottlingCondition.cs b/src/Umbraco.Core/Persistence/FaultHandling/ThrottlingCondition.cs index 678ec12f10..6b623cd5ce 100644 --- a/src/Umbraco.Core/Persistence/FaultHandling/ThrottlingCondition.cs +++ b/src/Umbraco.Core/Persistence/FaultHandling/ThrottlingCondition.cs @@ -50,8 +50,8 @@ namespace Umbraco.Core.Persistence.FaultHandling None = 0, /// - /// Corresponds to a Soft throttling type. Soft throttling is applied when machine resources such as, CPU, IO, storage, and worker threads exceed - /// predefined safety thresholds despite the load balancer’s best efforts. + /// Corresponds to a Soft throttling type. Soft throttling is applied when machine resources such as, CPU, IO, storage, and worker threads exceed + /// predefined safety thresholds despite the load balancer’s best efforts. /// Soft = 1, @@ -327,4 +327,4 @@ namespace Umbraco.Core.Persistence.FaultHandling return result.ToString(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/IDatabaseContext.cs b/src/Umbraco.Core/Persistence/IDatabaseContext.cs index bd77ca54c5..9d1370d8f5 100644 --- a/src/Umbraco.Core/Persistence/IDatabaseContext.cs +++ b/src/Umbraco.Core/Persistence/IDatabaseContext.cs @@ -1,4 +1,4 @@ -using NPoco; +using NPoco; using Umbraco.Core.Persistence.Querying; using Umbraco.Core.Persistence.SqlSyntax; @@ -37,4 +37,4 @@ namespace Umbraco.Core.Persistence /// IQuery Query(); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/IUmbracoDatabase.cs b/src/Umbraco.Core/Persistence/IUmbracoDatabase.cs index 37977b4d56..7603c43541 100644 --- a/src/Umbraco.Core/Persistence/IUmbracoDatabase.cs +++ b/src/Umbraco.Core/Persistence/IUmbracoDatabase.cs @@ -18,7 +18,7 @@ namespace Umbraco.Core.Persistence /// /// Gets the database instance unique identifier as a string. /// - /// UmbracoDatabase returns the first eight digits of its unique Guid and, in some + /// UmbracoDatabase returns the first eight digits of its unique Guid and, in some /// debug mode, the underlying database connection identifier (if any). string InstanceId { get; } diff --git a/src/Umbraco.Core/Persistence/IUmbracoDatabaseFactory.cs b/src/Umbraco.Core/Persistence/IUmbracoDatabaseFactory.cs index d9cb46333d..6a8b0121f3 100644 --- a/src/Umbraco.Core/Persistence/IUmbracoDatabaseFactory.cs +++ b/src/Umbraco.Core/Persistence/IUmbracoDatabaseFactory.cs @@ -1,17 +1,17 @@ -using System; +using System; namespace Umbraco.Core.Persistence { - /// - /// Creates and manages the "ambient" database. - /// - public interface IUmbracoDatabaseFactory : IDatabaseContext, IDisposable - { + /// + /// Creates and manages the "ambient" database. + /// + public interface IUmbracoDatabaseFactory : IDatabaseContext, IDisposable + { /// /// Creates a new database. /// /// The new database must be disposed after being used. - IUmbracoDatabase CreateDatabase(); + IUmbracoDatabase CreateDatabase(); /// /// Gets a value indicating whether the database factory is configured. @@ -28,4 +28,4 @@ namespace Umbraco.Core.Persistence /// void Configure(string connectionString, string providerName); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Mappers/AccessMapper.cs b/src/Umbraco.Core/Persistence/Mappers/AccessMapper.cs index c715a5e059..059a27cbc7 100644 --- a/src/Umbraco.Core/Persistence/Mappers/AccessMapper.cs +++ b/src/Umbraco.Core/Persistence/Mappers/AccessMapper.cs @@ -21,4 +21,4 @@ namespace Umbraco.Core.Persistence.Mappers CacheMap(src => src.UpdateDate, dto => dto.UpdateDate); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Mappers/AuditItemMapper.cs b/src/Umbraco.Core/Persistence/Mappers/AuditItemMapper.cs index 9928f13d75..78ce63f438 100644 --- a/src/Umbraco.Core/Persistence/Mappers/AuditItemMapper.cs +++ b/src/Umbraco.Core/Persistence/Mappers/AuditItemMapper.cs @@ -1,4 +1,4 @@ -using System.Collections.Concurrent; +using System.Collections.Concurrent; using Umbraco.Core.Models; using Umbraco.Core.Models.Rdbms; @@ -18,6 +18,6 @@ namespace Umbraco.Core.Persistence.Mappers CacheMap(src => src.AuditType, dto => dto.Header); CacheMap(src => src.UserId, dto => dto.UserId); CacheMap(src => src.CreateDate, dto => dto.Datestamp); - } + } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Mappers/BaseMapper.cs b/src/Umbraco.Core/Persistence/Mappers/BaseMapper.cs index 11caf03446..ed44c6400c 100644 --- a/src/Umbraco.Core/Persistence/Mappers/BaseMapper.cs +++ b/src/Umbraco.Core/Persistence/Mappers/BaseMapper.cs @@ -68,4 +68,4 @@ namespace Umbraco.Core.Persistence.Mappers return columnMap; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Mappers/ContentMapper.cs b/src/Umbraco.Core/Persistence/Mappers/ContentMapper.cs index 19048f7edf..4f8ea60e9d 100644 --- a/src/Umbraco.Core/Persistence/Mappers/ContentMapper.cs +++ b/src/Umbraco.Core/Persistence/Mappers/ContentMapper.cs @@ -5,7 +5,7 @@ using Umbraco.Core.Models.Rdbms; namespace Umbraco.Core.Persistence.Mappers { /// - /// Represents a to DTO mapper used to translate the properties of the public api + /// Represents a to DTO mapper used to translate the properties of the public api /// implementation to that of the database's DTO as sql: [tableName].[columnName]. /// [MapperFor(typeof(Content))] @@ -42,4 +42,4 @@ namespace Umbraco.Core.Persistence.Mappers //CacheMap(src => src.Template, dto => dto.TemplateId); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Mappers/ContentTypeMapper.cs b/src/Umbraco.Core/Persistence/Mappers/ContentTypeMapper.cs index e193900e35..ad34b95295 100644 --- a/src/Umbraco.Core/Persistence/Mappers/ContentTypeMapper.cs +++ b/src/Umbraco.Core/Persistence/Mappers/ContentTypeMapper.cs @@ -5,7 +5,7 @@ using Umbraco.Core.Models.Rdbms; namespace Umbraco.Core.Persistence.Mappers { /// - /// Represents a to DTO mapper used to translate the properties of the public api + /// Represents a to DTO mapper used to translate the properties of the public api /// implementation to that of the database's DTO as sql: [tableName].[columnName]. /// [MapperFor(typeof(ContentType))] @@ -38,4 +38,4 @@ namespace Umbraco.Core.Persistence.Mappers CacheMap(src => src.Thumbnail, dto => dto.Thumbnail); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Mappers/DataTypeDefinitionMapper.cs b/src/Umbraco.Core/Persistence/Mappers/DataTypeDefinitionMapper.cs index 4a88d3c32a..b09d8be81e 100644 --- a/src/Umbraco.Core/Persistence/Mappers/DataTypeDefinitionMapper.cs +++ b/src/Umbraco.Core/Persistence/Mappers/DataTypeDefinitionMapper.cs @@ -5,7 +5,7 @@ using Umbraco.Core.Models.Rdbms; namespace Umbraco.Core.Persistence.Mappers { /// - /// Represents a to DTO mapper used to translate the properties of the public api + /// Represents a to DTO mapper used to translate the properties of the public api /// implementation to that of the database's DTO as sql: [tableName].[columnName]. /// [MapperFor(typeof(DataTypeDefinition))] @@ -33,4 +33,4 @@ namespace Umbraco.Core.Persistence.Mappers } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Mappers/DictionaryMapper.cs b/src/Umbraco.Core/Persistence/Mappers/DictionaryMapper.cs index fde10efa73..af490dd1cd 100644 --- a/src/Umbraco.Core/Persistence/Mappers/DictionaryMapper.cs +++ b/src/Umbraco.Core/Persistence/Mappers/DictionaryMapper.cs @@ -5,7 +5,7 @@ using Umbraco.Core.Models.Rdbms; namespace Umbraco.Core.Persistence.Mappers { /// - /// Represents a to DTO mapper used to translate the properties of the public api + /// Represents a to DTO mapper used to translate the properties of the public api /// implementation to that of the database's DTO as sql: [tableName].[columnName]. /// [MapperFor(typeof(DictionaryItem))] @@ -24,4 +24,4 @@ namespace Umbraco.Core.Persistence.Mappers CacheMap(src => src.ParentId, dto => dto.Parent); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Mappers/DictionaryTranslationMapper.cs b/src/Umbraco.Core/Persistence/Mappers/DictionaryTranslationMapper.cs index 21f9b7f15a..a6f30a07bf 100644 --- a/src/Umbraco.Core/Persistence/Mappers/DictionaryTranslationMapper.cs +++ b/src/Umbraco.Core/Persistence/Mappers/DictionaryTranslationMapper.cs @@ -5,7 +5,7 @@ using Umbraco.Core.Models.Rdbms; namespace Umbraco.Core.Persistence.Mappers { /// - /// Represents a to DTO mapper used to translate the properties of the public api + /// Represents a to DTO mapper used to translate the properties of the public api /// implementation to that of the database's DTO as sql: [tableName].[columnName]. /// [MapperFor(typeof(DictionaryTranslation))] @@ -24,4 +24,4 @@ namespace Umbraco.Core.Persistence.Mappers CacheMap(src => src.Value, dto => dto.Value); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Mappers/DomainMapper.cs b/src/Umbraco.Core/Persistence/Mappers/DomainMapper.cs index b51f51e8d1..7a14a5b70e 100644 --- a/src/Umbraco.Core/Persistence/Mappers/DomainMapper.cs +++ b/src/Umbraco.Core/Persistence/Mappers/DomainMapper.cs @@ -20,4 +20,4 @@ namespace Umbraco.Core.Persistence.Mappers CacheMap(src => src.DomainName, dto => dto.DomainName); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Mappers/DtoMapModel.cs b/src/Umbraco.Core/Persistence/Mappers/DtoMapModel.cs index d351b8abb3..51c6520b7f 100644 --- a/src/Umbraco.Core/Persistence/Mappers/DtoMapModel.cs +++ b/src/Umbraco.Core/Persistence/Mappers/DtoMapModel.cs @@ -16,4 +16,4 @@ namespace Umbraco.Core.Persistence.Mappers public Type Type { get; private set; } public PropertyInfo PropertyInfo { get; private set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Mappers/LanguageMapper.cs b/src/Umbraco.Core/Persistence/Mappers/LanguageMapper.cs index 3d35e767ad..9a0275e1a6 100644 --- a/src/Umbraco.Core/Persistence/Mappers/LanguageMapper.cs +++ b/src/Umbraco.Core/Persistence/Mappers/LanguageMapper.cs @@ -5,7 +5,7 @@ using Umbraco.Core.Models.Rdbms; namespace Umbraco.Core.Persistence.Mappers { /// - /// Represents a to DTO mapper used to translate the properties of the public api + /// Represents a to DTO mapper used to translate the properties of the public api /// implementation to that of the database's DTO as sql: [tableName].[columnName]. /// [MapperFor(typeof(ILanguage))] @@ -23,4 +23,4 @@ namespace Umbraco.Core.Persistence.Mappers CacheMap(src => src.CultureName, dto => dto.CultureName); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Mappers/MacroMapper.cs b/src/Umbraco.Core/Persistence/Mappers/MacroMapper.cs index 868ce283f5..33647dd640 100644 --- a/src/Umbraco.Core/Persistence/Mappers/MacroMapper.cs +++ b/src/Umbraco.Core/Persistence/Mappers/MacroMapper.cs @@ -28,4 +28,4 @@ namespace Umbraco.Core.Persistence.Mappers CacheMap(src => src.XsltPath, dto => dto.Xslt); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Mappers/MapperCollection.cs b/src/Umbraco.Core/Persistence/Mappers/MapperCollection.cs index f1badefc2d..343406378a 100644 --- a/src/Umbraco.Core/Persistence/Mappers/MapperCollection.cs +++ b/src/Umbraco.Core/Persistence/Mappers/MapperCollection.cs @@ -8,7 +8,7 @@ namespace Umbraco.Core.Persistence.Mappers { public class MapperCollection : BuilderCollectionBase, IMapperCollection { - public MapperCollection(IEnumerable items) + public MapperCollection(IEnumerable items) : base(items) { } diff --git a/src/Umbraco.Core/Persistence/Mappers/MapperCollectionBuilder.cs b/src/Umbraco.Core/Persistence/Mappers/MapperCollectionBuilder.cs index 1210cda63a..76bcb58115 100644 --- a/src/Umbraco.Core/Persistence/Mappers/MapperCollectionBuilder.cs +++ b/src/Umbraco.Core/Persistence/Mappers/MapperCollectionBuilder.cs @@ -5,7 +5,7 @@ namespace Umbraco.Core.Persistence.Mappers { public class MapperCollectionBuilder : LazyCollectionBuilderBase { - public MapperCollectionBuilder(IServiceContainer container) + public MapperCollectionBuilder(IServiceContainer container) : base(container) { } diff --git a/src/Umbraco.Core/Persistence/Mappers/MapperForAttribute.cs b/src/Umbraco.Core/Persistence/Mappers/MapperForAttribute.cs index 44ee135b07..63686f2476 100644 --- a/src/Umbraco.Core/Persistence/Mappers/MapperForAttribute.cs +++ b/src/Umbraco.Core/Persistence/Mappers/MapperForAttribute.cs @@ -16,4 +16,4 @@ namespace Umbraco.Core.Persistence.Mappers } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Mappers/MediaMapper.cs b/src/Umbraco.Core/Persistence/Mappers/MediaMapper.cs index 1394e83f6d..f3945a688f 100644 --- a/src/Umbraco.Core/Persistence/Mappers/MediaMapper.cs +++ b/src/Umbraco.Core/Persistence/Mappers/MediaMapper.cs @@ -5,7 +5,7 @@ using Umbraco.Core.Models.Rdbms; namespace Umbraco.Core.Persistence.Mappers { /// - /// Represents a to DTO mapper used to translate the properties of the public api + /// Represents a to DTO mapper used to translate the properties of the public api /// implementation to that of the database's DTO as sql: [tableName].[columnName]. /// [MapperFor(typeof(IMedia))] @@ -35,4 +35,4 @@ namespace Umbraco.Core.Persistence.Mappers CacheMap(src => src.Version, dto => dto.VersionId); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Mappers/MediaTypeMapper.cs b/src/Umbraco.Core/Persistence/Mappers/MediaTypeMapper.cs index 49ee56157e..a91539446f 100644 --- a/src/Umbraco.Core/Persistence/Mappers/MediaTypeMapper.cs +++ b/src/Umbraco.Core/Persistence/Mappers/MediaTypeMapper.cs @@ -5,7 +5,7 @@ using Umbraco.Core.Models.Rdbms; namespace Umbraco.Core.Persistence.Mappers { /// - /// Represents a to DTO mapper used to translate the properties of the public api + /// Represents a to DTO mapper used to translate the properties of the public api /// implementation to that of the database's DTO as sql: [tableName].[columnName]. /// [MapperFor(typeof(IMediaType))] @@ -38,4 +38,4 @@ namespace Umbraco.Core.Persistence.Mappers CacheMap(src => src.Thumbnail, dto => dto.Thumbnail); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Mappers/MemberGroupMapper.cs b/src/Umbraco.Core/Persistence/Mappers/MemberGroupMapper.cs index 1b60d8cfe8..e30461b20f 100644 --- a/src/Umbraco.Core/Persistence/Mappers/MemberGroupMapper.cs +++ b/src/Umbraco.Core/Persistence/Mappers/MemberGroupMapper.cs @@ -1,4 +1,4 @@ -using System.Collections.Concurrent; +using System.Collections.Concurrent; using Umbraco.Core.Models; using Umbraco.Core.Models.Rdbms; @@ -21,4 +21,4 @@ namespace Umbraco.Core.Persistence.Mappers CacheMap(src => src.Key, dto => dto.UniqueId); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Mappers/MemberMapper.cs b/src/Umbraco.Core/Persistence/Mappers/MemberMapper.cs index 1f425cd8f7..ae7f54de41 100644 --- a/src/Umbraco.Core/Persistence/Mappers/MemberMapper.cs +++ b/src/Umbraco.Core/Persistence/Mappers/MemberMapper.cs @@ -6,7 +6,7 @@ using Umbraco.Core.Models.Rdbms; namespace Umbraco.Core.Persistence.Mappers { /// - /// Represents a to DTO mapper used to translate the properties of the public api + /// Represents a to DTO mapper used to translate the properties of the public api /// implementation to that of the database's DTO as sql: [tableName].[columnName]. /// [MapperFor(typeof(IMember))] @@ -57,4 +57,4 @@ namespace Umbraco.Core.Persistence.Mappers CacheMap(src => src.PropertyTypeAlias, dto => dto.Alias); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Mappers/MemberTypeMapper.cs b/src/Umbraco.Core/Persistence/Mappers/MemberTypeMapper.cs index e54c46dbfe..125027e47d 100644 --- a/src/Umbraco.Core/Persistence/Mappers/MemberTypeMapper.cs +++ b/src/Umbraco.Core/Persistence/Mappers/MemberTypeMapper.cs @@ -5,7 +5,7 @@ using Umbraco.Core.Models.Rdbms; namespace Umbraco.Core.Persistence.Mappers { /// - /// Represents a to DTO mapper used to translate the properties of the public api + /// Represents a to DTO mapper used to translate the properties of the public api /// implementation to that of the database's DTO as sql: [tableName].[columnName]. /// [MapperFor(typeof (MemberType))] @@ -38,4 +38,4 @@ namespace Umbraco.Core.Persistence.Mappers CacheMap(src => src.Thumbnail, dto => dto.Thumbnail); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Mappers/MigrationEntryMapper.cs b/src/Umbraco.Core/Persistence/Mappers/MigrationEntryMapper.cs index 9eed5897c2..1d5418973b 100644 --- a/src/Umbraco.Core/Persistence/Mappers/MigrationEntryMapper.cs +++ b/src/Umbraco.Core/Persistence/Mappers/MigrationEntryMapper.cs @@ -1,4 +1,4 @@ -using System.Collections.Concurrent; +using System.Collections.Concurrent; using Umbraco.Core.Models; using Umbraco.Core.Models.Rdbms; @@ -14,11 +14,11 @@ namespace Umbraco.Core.Persistence.Mappers protected override void BuildMap() { - CacheMap(src => src.Id, dto => dto.Id); + CacheMap(src => src.Id, dto => dto.Id); CacheMap(src => src.CreateDate, dto => dto.CreateDate); CacheMap(src => src.UpdateDate, dto => dto.CreateDate); CacheMap(src => src.Version, dto => dto.Version); CacheMap(src => src.MigrationName, dto => dto.Name); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Mappers/PocoMapper.cs b/src/Umbraco.Core/Persistence/Mappers/PocoMapper.cs index 281e05499c..f531a684d7 100644 --- a/src/Umbraco.Core/Persistence/Mappers/PocoMapper.cs +++ b/src/Umbraco.Core/Persistence/Mappers/PocoMapper.cs @@ -28,4 +28,4 @@ namespace Umbraco.Core.Persistence.Mappers return null; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Mappers/PropertyGroupMapper.cs b/src/Umbraco.Core/Persistence/Mappers/PropertyGroupMapper.cs index fe88f7ddf3..ed2e5468c6 100644 --- a/src/Umbraco.Core/Persistence/Mappers/PropertyGroupMapper.cs +++ b/src/Umbraco.Core/Persistence/Mappers/PropertyGroupMapper.cs @@ -5,7 +5,7 @@ using Umbraco.Core.Models.Rdbms; namespace Umbraco.Core.Persistence.Mappers { /// - /// Represents a to DTO mapper used to translate the properties of the public api + /// Represents a to DTO mapper used to translate the properties of the public api /// implementation to that of the database's DTO as sql: [tableName].[columnName]. /// [MapperFor(typeof(PropertyGroup))] @@ -23,4 +23,4 @@ namespace Umbraco.Core.Persistence.Mappers CacheMap(src => src.Name, dto => dto.Text); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Mappers/PropertyMapper.cs b/src/Umbraco.Core/Persistence/Mappers/PropertyMapper.cs index 9241ca558b..3a69564c92 100644 --- a/src/Umbraco.Core/Persistence/Mappers/PropertyMapper.cs +++ b/src/Umbraco.Core/Persistence/Mappers/PropertyMapper.cs @@ -18,4 +18,4 @@ namespace Umbraco.Core.Persistence.Mappers CacheMap(src => src.PropertyTypeId, dto => dto.PropertyTypeId); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Mappers/PropertyTypeMapper.cs b/src/Umbraco.Core/Persistence/Mappers/PropertyTypeMapper.cs index c780dc8482..37616205f0 100644 --- a/src/Umbraco.Core/Persistence/Mappers/PropertyTypeMapper.cs +++ b/src/Umbraco.Core/Persistence/Mappers/PropertyTypeMapper.cs @@ -5,7 +5,7 @@ using Umbraco.Core.Models.Rdbms; namespace Umbraco.Core.Persistence.Mappers { /// - /// Represents a to DTO mapper used to translate the properties of the public api + /// Represents a to DTO mapper used to translate the properties of the public api /// implementation to that of the database's DTO as sql: [tableName].[columnName]. /// [MapperFor(typeof(PropertyType))] @@ -32,4 +32,4 @@ namespace Umbraco.Core.Persistence.Mappers CacheMap(src => src.DataTypeDatabaseType, dto => dto.DbType); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Mappers/RelationMapper.cs b/src/Umbraco.Core/Persistence/Mappers/RelationMapper.cs index 19f49efd63..5eedd53f6a 100644 --- a/src/Umbraco.Core/Persistence/Mappers/RelationMapper.cs +++ b/src/Umbraco.Core/Persistence/Mappers/RelationMapper.cs @@ -5,7 +5,7 @@ using Umbraco.Core.Models.Rdbms; namespace Umbraco.Core.Persistence.Mappers { /// - /// Represents a to DTO mapper used to translate the properties of the public api + /// Represents a to DTO mapper used to translate the properties of the public api /// implementation to that of the database's DTO as sql: [tableName].[columnName]. /// [MapperFor(typeof(IRelation))] @@ -26,4 +26,4 @@ namespace Umbraco.Core.Persistence.Mappers CacheMap(src => src.RelationTypeId, dto => dto.RelationType); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Mappers/RelationTypeMapper.cs b/src/Umbraco.Core/Persistence/Mappers/RelationTypeMapper.cs index 723890a503..1666996052 100644 --- a/src/Umbraco.Core/Persistence/Mappers/RelationTypeMapper.cs +++ b/src/Umbraco.Core/Persistence/Mappers/RelationTypeMapper.cs @@ -5,7 +5,7 @@ using Umbraco.Core.Models.Rdbms; namespace Umbraco.Core.Persistence.Mappers { /// - /// Represents a to DTO mapper used to translate the properties of the public api + /// Represents a to DTO mapper used to translate the properties of the public api /// implementation to that of the database's DTO as sql: [tableName].[columnName]. /// [MapperFor(typeof(RelationType))] @@ -26,4 +26,4 @@ namespace Umbraco.Core.Persistence.Mappers CacheMap(src => src.ParentObjectType, dto => dto.ParentObjectType); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Mappers/ServerRegistrationMapper.cs b/src/Umbraco.Core/Persistence/Mappers/ServerRegistrationMapper.cs index cbcab5fc83..951d90ed53 100644 --- a/src/Umbraco.Core/Persistence/Mappers/ServerRegistrationMapper.cs +++ b/src/Umbraco.Core/Persistence/Mappers/ServerRegistrationMapper.cs @@ -23,4 +23,4 @@ namespace Umbraco.Core.Persistence.Mappers CacheMap(src => src.ServerIdentity, dto => dto.ServerIdentity); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Mappers/TagMapper.cs b/src/Umbraco.Core/Persistence/Mappers/TagMapper.cs index e6edb9b64d..3cbe1ff621 100644 --- a/src/Umbraco.Core/Persistence/Mappers/TagMapper.cs +++ b/src/Umbraco.Core/Persistence/Mappers/TagMapper.cs @@ -5,7 +5,7 @@ using Umbraco.Core.Models.Rdbms; namespace Umbraco.Core.Persistence.Mappers { /// - /// Represents a to DTO mapper used to translate the properties of the public api + /// Represents a to DTO mapper used to translate the properties of the public api /// implementation to that of the database's DTO as sql: [tableName].[columnName]. /// [MapperFor(typeof(Tag))] diff --git a/src/Umbraco.Core/Persistence/Mappers/TaskTypeMapper.cs b/src/Umbraco.Core/Persistence/Mappers/TaskTypeMapper.cs index 78b2f29782..04f66c9c25 100644 --- a/src/Umbraco.Core/Persistence/Mappers/TaskTypeMapper.cs +++ b/src/Umbraco.Core/Persistence/Mappers/TaskTypeMapper.cs @@ -5,7 +5,7 @@ using Umbraco.Core.Models.Rdbms; namespace Umbraco.Core.Persistence.Mappers { /// - /// Represents a to DTO mapper used to translate the properties of the public api + /// Represents a to DTO mapper used to translate the properties of the public api /// implementation to that of the database's DTO as sql: [tableName].[columnName]. /// [MapperFor(typeof(TaskType))] @@ -21,4 +21,4 @@ namespace Umbraco.Core.Persistence.Mappers CacheMap(src => src.Alias, dto => dto.Alias); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Mappers/TemplateMapper.cs b/src/Umbraco.Core/Persistence/Mappers/TemplateMapper.cs index 3e0d46eca4..312976db26 100644 --- a/src/Umbraco.Core/Persistence/Mappers/TemplateMapper.cs +++ b/src/Umbraco.Core/Persistence/Mappers/TemplateMapper.cs @@ -5,7 +5,7 @@ using Umbraco.Core.Models.Rdbms; namespace Umbraco.Core.Persistence.Mappers { /// - /// Represents a to DTO mapper used to translate the properties of the public api + /// Represents a to DTO mapper used to translate the properties of the public api /// implementation to that of the database's DTO as sql: [tableName].[columnName]. /// [MapperFor(typeof(Template))] diff --git a/src/Umbraco.Core/Persistence/Mappers/UmbracoEntityMapper.cs b/src/Umbraco.Core/Persistence/Mappers/UmbracoEntityMapper.cs index 14f1c95ff9..f39ab49f00 100644 --- a/src/Umbraco.Core/Persistence/Mappers/UmbracoEntityMapper.cs +++ b/src/Umbraco.Core/Persistence/Mappers/UmbracoEntityMapper.cs @@ -25,4 +25,4 @@ namespace Umbraco.Core.Persistence.Mappers CacheMap(src => src.CreatorId, dto => dto.UserId); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Mappers/UserMapper.cs b/src/Umbraco.Core/Persistence/Mappers/UserMapper.cs index 3162354c3f..5964499f18 100644 --- a/src/Umbraco.Core/Persistence/Mappers/UserMapper.cs +++ b/src/Umbraco.Core/Persistence/Mappers/UserMapper.cs @@ -48,4 +48,4 @@ namespace Umbraco.Core.Persistence.Mappers CacheMap(src => src.Language, dto => dto.UserLanguage); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Mappers/UserSectionMapper.cs b/src/Umbraco.Core/Persistence/Mappers/UserSectionMapper.cs index 29b739df2a..6138ecb3ae 100644 --- a/src/Umbraco.Core/Persistence/Mappers/UserSectionMapper.cs +++ b/src/Umbraco.Core/Persistence/Mappers/UserSectionMapper.cs @@ -31,4 +31,4 @@ namespace Umbraco.Core.Persistence.Mappers // #endregion //} -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Mappers/UserTypeMapper.cs b/src/Umbraco.Core/Persistence/Mappers/UserTypeMapper.cs index 358266f3ca..332964aff7 100644 --- a/src/Umbraco.Core/Persistence/Mappers/UserTypeMapper.cs +++ b/src/Umbraco.Core/Persistence/Mappers/UserTypeMapper.cs @@ -5,7 +5,7 @@ using Umbraco.Core.Models.Rdbms; namespace Umbraco.Core.Persistence.Mappers { /// - /// Represents a to DTO mapper used to translate the properties of the public api + /// Represents a to DTO mapper used to translate the properties of the public api /// implementation to that of the database's DTO as sql: [tableName].[columnName]. /// [MapperFor(typeof(IUserType))] @@ -24,4 +24,4 @@ namespace Umbraco.Core.Persistence.Mappers CacheMap(src => src.Permissions, dto => dto.DefaultPermissions); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/DataLossException.cs b/src/Umbraco.Core/Persistence/Migrations/DataLossException.cs index cb4ea9120a..4a9c526f45 100644 --- a/src/Umbraco.Core/Persistence/Migrations/DataLossException.cs +++ b/src/Umbraco.Core/Persistence/Migrations/DataLossException.cs @@ -1,4 +1,4 @@ -using System; +using System; namespace Umbraco.Core.Persistence.Migrations { @@ -10,13 +10,13 @@ namespace Umbraco.Core.Persistence.Migrations public DataLossException(string msg) : base(msg) { - + } public DataLossException(string msg, Exception inner) : base(msg, inner) { - + } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/ILocalMigration.cs b/src/Umbraco.Core/Persistence/Migrations/ILocalMigration.cs index c15b7fdf66..ef0d9dcbce 100644 --- a/src/Umbraco.Core/Persistence/Migrations/ILocalMigration.cs +++ b/src/Umbraco.Core/Persistence/Migrations/ILocalMigration.cs @@ -13,4 +13,4 @@ namespace Umbraco.Core.Persistence.Migrations ICreateBuilder Create { get; } string GetSql(); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/IMigration.cs b/src/Umbraco.Core/Persistence/Migrations/IMigration.cs index 9eb96316f4..1afa732aed 100644 --- a/src/Umbraco.Core/Persistence/Migrations/IMigration.cs +++ b/src/Umbraco.Core/Persistence/Migrations/IMigration.cs @@ -10,4 +10,4 @@ namespace Umbraco.Core.Persistence.Migrations void Up(); void Down(); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/IMigrationContext.cs b/src/Umbraco.Core/Persistence/Migrations/IMigrationContext.cs index 44f758faea..ceb64f2e39 100644 --- a/src/Umbraco.Core/Persistence/Migrations/IMigrationContext.cs +++ b/src/Umbraco.Core/Persistence/Migrations/IMigrationContext.cs @@ -13,4 +13,4 @@ namespace Umbraco.Core.Persistence.Migrations ILocalMigration GetLocalMigration(); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/IMigrationExpression.cs b/src/Umbraco.Core/Persistence/Migrations/IMigrationExpression.cs index 97a3f09fad..8955ff318c 100644 --- a/src/Umbraco.Core/Persistence/Migrations/IMigrationExpression.cs +++ b/src/Umbraco.Core/Persistence/Migrations/IMigrationExpression.cs @@ -9,4 +9,4 @@ namespace Umbraco.Core.Persistence.Migrations { string Process(IUmbracoDatabase database); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Initial/BaseDataCreation.cs b/src/Umbraco.Core/Persistence/Migrations/Initial/BaseDataCreation.cs index f89bb6c795..13fc723553 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Initial/BaseDataCreation.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Initial/BaseDataCreation.cs @@ -123,15 +123,15 @@ namespace Umbraco.Core.Persistence.Migrations.Initial _database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = -42, Trashed = false, ParentId = -1, UserId = 0, Level = 1, Path = "-1,-42", SortOrder = 2, UniqueId = new Guid("0b6a45e7-44ba-430d-9da5-4e46060b9e03"), Text = "Dropdown", NodeObjectType = new Guid(Constants.ObjectTypes.DataType), CreateDate = DateTime.Now }); _database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = -41, Trashed = false, ParentId = -1, UserId = 0, Level = 1, Path = "-1,-41", SortOrder = 2, UniqueId = new Guid("5046194e-4237-453c-a547-15db3a07c4e1"), Text = "Date Picker", NodeObjectType = new Guid(Constants.ObjectTypes.DataType), CreateDate = DateTime.Now }); _database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = -40, Trashed = false, ParentId = -1, UserId = 0, Level = 1, Path = "-1,-40", SortOrder = 2, UniqueId = new Guid("bb5f57c9-ce2b-4bb9-b697-4caca783a805"), Text = "Radiobox", NodeObjectType = new Guid(Constants.ObjectTypes.DataType), CreateDate = DateTime.Now }); - _database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = -39, Trashed = false, ParentId = -1, UserId = 0, Level = 1, Path = "-1,-39", SortOrder = 2, UniqueId = new Guid("f38f0ac7-1d27-439c-9f3f-089cd8825a53"), Text = "Dropdown multiple", NodeObjectType = new Guid(Constants.ObjectTypes.DataType), CreateDate = DateTime.Now }); + _database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = -39, Trashed = false, ParentId = -1, UserId = 0, Level = 1, Path = "-1,-39", SortOrder = 2, UniqueId = new Guid("f38f0ac7-1d27-439c-9f3f-089cd8825a53"), Text = "Dropdown multiple", NodeObjectType = new Guid(Constants.ObjectTypes.DataType), CreateDate = DateTime.Now }); _database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = -37, Trashed = false, ParentId = -1, UserId = 0, Level = 1, Path = "-1,-37", SortOrder = 2, UniqueId = new Guid("0225af17-b302-49cb-9176-b9f35cab9c17"), Text = "Approved Color", NodeObjectType = new Guid(Constants.ObjectTypes.DataType), CreateDate = DateTime.Now }); _database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = -36, Trashed = false, ParentId = -1, UserId = 0, Level = 1, Path = "-1,-36", SortOrder = 2, UniqueId = new Guid("e4d66c0f-b935-4200-81f0-025f7256b89a"), Text = "Date Picker with time", NodeObjectType = new Guid(Constants.ObjectTypes.DataType), CreateDate = DateTime.Now }); _database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = Constants.DataTypes.DefaultContentListView, Trashed = false, ParentId = -1, UserId = 0, Level = 1, Path = "-1,-95", SortOrder = 2, UniqueId = new Guid("C0808DD3-8133-4E4B-8CE8-E2BEA84A96A4"), Text = Constants.Conventions.DataTypes.ListViewPrefix + "Content", NodeObjectType = new Guid(Constants.ObjectTypes.DataType), CreateDate = DateTime.Now }); _database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = Constants.DataTypes.DefaultMediaListView, Trashed = false, ParentId = -1, UserId = 0, Level = 1, Path = "-1,-96", SortOrder = 2, UniqueId = new Guid("3A0156C4-3B8C-4803-BDC1-6871FAA83FFF"), Text = Constants.Conventions.DataTypes.ListViewPrefix + "Media", NodeObjectType = new Guid(Constants.ObjectTypes.DataType), CreateDate = DateTime.Now }); - _database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = Constants.DataTypes.DefaultMembersListView, Trashed = false, ParentId = -1, UserId = 0, Level = 1, Path = "-1,-97", SortOrder = 2, UniqueId = new Guid("AA2C52A0-CE87-4E65-A47C-7DF09358585D"), Text = Constants.Conventions.DataTypes.ListViewPrefix + "Members", NodeObjectType = new Guid(Constants.ObjectTypes.DataType), CreateDate = DateTime.Now }); + _database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = Constants.DataTypes.DefaultMembersListView, Trashed = false, ParentId = -1, UserId = 0, Level = 1, Path = "-1,-97", SortOrder = 2, UniqueId = new Guid("AA2C52A0-CE87-4E65-A47C-7DF09358585D"), Text = Constants.Conventions.DataTypes.ListViewPrefix + "Members", NodeObjectType = new Guid(Constants.ObjectTypes.DataType), CreateDate = DateTime.Now }); _database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = 1031, Trashed = false, ParentId = -1, UserId = 0, Level = 1, Path = "-1,1031", SortOrder = 2, UniqueId = new Guid("f38bd2d7-65d0-48e6-95dc-87ce06ec2d3d"), Text = Constants.Conventions.MediaTypes.Folder, NodeObjectType = new Guid(Constants.ObjectTypes.MediaType), CreateDate = DateTime.Now }); _database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = 1032, Trashed = false, ParentId = -1, UserId = 0, Level = 1, Path = "-1,1032", SortOrder = 2, UniqueId = new Guid("cc07b313-0843-4aa8-bbda-871c8da728c8"), Text = Constants.Conventions.MediaTypes.Image, NodeObjectType = new Guid(Constants.ObjectTypes.MediaType), CreateDate = DateTime.Now }); - _database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = 1033, Trashed = false, ParentId = -1, UserId = 0, Level = 1, Path = "-1,1033", SortOrder = 2, UniqueId = new Guid("4c52d8ab-54e6-40cd-999c-7a5f24903e4d"), Text = Constants.Conventions.MediaTypes.File, NodeObjectType = new Guid(Constants.ObjectTypes.MediaType), CreateDate = DateTime.Now }); + _database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = 1033, Trashed = false, ParentId = -1, UserId = 0, Level = 1, Path = "-1,1033", SortOrder = 2, UniqueId = new Guid("4c52d8ab-54e6-40cd-999c-7a5f24903e4d"), Text = Constants.Conventions.MediaTypes.File, NodeObjectType = new Guid(Constants.ObjectTypes.MediaType), CreateDate = DateTime.Now }); _database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = 1041, Trashed = false, ParentId = -1, UserId = 0, Level = 1, Path = "-1,1041", SortOrder = 2, UniqueId = new Guid("b6b73142-b9c1-4bf8-a16d-e1c23320b549"), Text = "Tags", NodeObjectType = new Guid(Constants.ObjectTypes.DataType), CreateDate = DateTime.Now }); _database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = 1043, Trashed = false, ParentId = -1, UserId = 0, Level = 1, Path = "-1,1043", SortOrder = 2, UniqueId = new Guid("1df9f033-e6d4-451f-b8d2-e0cbc50a836f"), Text = "Image Cropper", NodeObjectType = new Guid(Constants.ObjectTypes.DataType), CreateDate = DateTime.Now }); _database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = 1044, Trashed = false, ParentId = -1, UserId = 0, Level = 1, Path = "-1,1044", SortOrder = 0, UniqueId = new Guid("d59be02f-1df9-4228-aa1e-01917d806cda"), Text = Constants.Conventions.MemberTypes.DefaultAlias, NodeObjectType = new Guid(Constants.ObjectTypes.MemberType), CreateDate = DateTime.Now }); @@ -146,7 +146,7 @@ namespace Umbraco.Core.Persistence.Migrations.Initial //TODO: We're not creating these for 7.0 //_database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = 1039, Trashed = false, ParentId = -1, UserId = 0, Level = 1, Path = "-1,1039", SortOrder = 2, UniqueId = new Guid("06f349a9-c949-4b6a-8660-59c10451af42"), Text = "Ultimate Picker", NodeObjectType = new Guid(Constants.ObjectTypes.DataType), CreateDate = DateTime.Now }); //_database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = 1038, Trashed = false, ParentId = -1, UserId = 0, Level = 1, Path = "-1,1038", SortOrder = 2, UniqueId = new Guid("1251c96c-185c-4e9b-93f4-b48205573cbd"), Text = "Simple Editor", NodeObjectType = new Guid(Constants.ObjectTypes.DataType), CreateDate = DateTime.Now }); - //_database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = 1042, Trashed = false, ParentId = -1, UserId = 0, Level = 1, Path = "-1,1042", SortOrder = 2, UniqueId = new Guid("0a452bd5-83f9-4bc3-8403-1286e13fb77e"), Text = "Macro Container", NodeObjectType = new Guid(Constants.ObjectTypes.DataType), CreateDate = DateTime.Now }); + //_database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = 1042, Trashed = false, ParentId = -1, UserId = 0, Level = 1, Path = "-1,1042", SortOrder = 2, UniqueId = new Guid("0a452bd5-83f9-4bc3-8403-1286e13fb77e"), Text = "Macro Container", NodeObjectType = new Guid(Constants.ObjectTypes.DataType), CreateDate = DateTime.Now }); } private void CreateUmbracoLockData() @@ -175,7 +175,7 @@ namespace Umbraco.Core.Persistence.Migrations.Initial _database.Insert("umbracoUser", "id", false, new UserDto { Id = 0, Disabled = false, NoConsole = false, Type = 1, ContentStartId = -1, MediaStartId = -1, UserName = "Administrator", Login = "admin", Password = "default", Email = "", UserLanguage = "en" }); //_database.Update("SET id = @IdAfter WHERE id = @IdBefore AND userLogin = @Login", new { IdAfter = 0, IdBefore = 1, Login = "admin" }); } - + private void CreateUmbracoUserTypeData() { _database.Insert("umbracoUserType", "id", false, new UserTypeDto { Id = 1, Alias = "admin", Name = "Administrators", DefaultPermissions = "CADMOSKTPIURZ:5F7" }); @@ -195,9 +195,9 @@ namespace Umbraco.Core.Persistence.Migrations.Initial _database.Insert("umbracoUser2app", "user", false, new User2AppDto { UserId = 0, AppAlias = Constants.Applications.Forms }); _database.Insert("umbracoUser2app", "user", false, new User2AppDto { UserId = 0, AppAlias = Constants.Applications.Translation }); } - + private void CreateCmsPropertyTypeGroupData() - { + { _database.Insert("cmsPropertyTypeGroup", "id", false, new PropertyTypeGroupDto { Id = 3, ContentTypeNodeId = 1032, Text = "Image", SortOrder = 1, UniqueId = new Guid(Constants.PropertyTypeGroups.Image) }); _database.Insert("cmsPropertyTypeGroup", "id", false, new PropertyTypeGroupDto { Id = 4, ContentTypeNodeId = 1033, Text = "File", SortOrder = 1, UniqueId = new Guid(Constants.PropertyTypeGroups.File) }); _database.Insert("cmsPropertyTypeGroup", "id", false, new PropertyTypeGroupDto { Id = 5, ContentTypeNodeId = 1031, Text = "Contents", SortOrder = 1, UniqueId = new Guid(Constants.PropertyTypeGroups.Contents) }); @@ -224,7 +224,7 @@ namespace Umbraco.Core.Persistence.Migrations.Initial _database.Insert("cmsPropertyType", "id", false, new PropertyTypeDto { Id = 32, UniqueId = 32.ToGuid(), DataTypeId = -92, ContentTypeId = 1044, PropertyTypeGroupId = 11, Alias = Constants.Conventions.Member.LastLockoutDate, Name = Constants.Conventions.Member.LastLockoutDateLabel, SortOrder = 4, Mandatory = false, ValidationRegExp = null, Description = null }); _database.Insert("cmsPropertyType", "id", false, new PropertyTypeDto { Id = 33, UniqueId = 33.ToGuid(), DataTypeId = -92, ContentTypeId = 1044, PropertyTypeGroupId = 11, Alias = Constants.Conventions.Member.LastLoginDate, Name = Constants.Conventions.Member.LastLoginDateLabel, SortOrder = 5, Mandatory = false, ValidationRegExp = null, Description = null }); _database.Insert("cmsPropertyType", "id", false, new PropertyTypeDto { Id = 34, UniqueId = 34.ToGuid(), DataTypeId = -92, ContentTypeId = 1044, PropertyTypeGroupId = 11, Alias = Constants.Conventions.Member.LastPasswordChangeDate, Name = Constants.Conventions.Member.LastPasswordChangeDateLabel, SortOrder = 6, Mandatory = false, ValidationRegExp = null, Description = null }); - + } private void CreateUmbracoLanguageData() @@ -250,17 +250,17 @@ namespace Umbraco.Core.Persistence.Migrations.Initial _database.Insert("cmsDataType", "pk", false, new DataTypeDto { PrimaryKey = 6, DataTypeId = -90, PropertyEditorAlias = Constants.PropertyEditors.UploadFieldAlias, DbType = "Nvarchar" }); _database.Insert("cmsDataType", "pk", false, new DataTypeDto { PrimaryKey = 7, DataTypeId = -92, PropertyEditorAlias = Constants.PropertyEditors.NoEditAlias, DbType = "Nvarchar" }); _database.Insert("cmsDataType", "pk", false, new DataTypeDto { PrimaryKey = 8, DataTypeId = -36, PropertyEditorAlias = Constants.PropertyEditors.DateTimeAlias, DbType = "Date" }); - _database.Insert("cmsDataType", "pk", false, new DataTypeDto { PrimaryKey = 9, DataTypeId = -37, PropertyEditorAlias = Constants.PropertyEditors.ColorPickerAlias, DbType = "Nvarchar" }); + _database.Insert("cmsDataType", "pk", false, new DataTypeDto { PrimaryKey = 9, DataTypeId = -37, PropertyEditorAlias = Constants.PropertyEditors.ColorPickerAlias, DbType = "Nvarchar" }); _database.Insert("cmsDataType", "pk", false, new DataTypeDto { PrimaryKey = 11, DataTypeId = -39, PropertyEditorAlias = Constants.PropertyEditors.DropDownListMultipleAlias, DbType = "Nvarchar" }); _database.Insert("cmsDataType", "pk", false, new DataTypeDto { PrimaryKey = 12, DataTypeId = -40, PropertyEditorAlias = Constants.PropertyEditors.RadioButtonListAlias, DbType = "Nvarchar" }); _database.Insert("cmsDataType", "pk", false, new DataTypeDto { PrimaryKey = 13, DataTypeId = -41, PropertyEditorAlias = Constants.PropertyEditors.DateAlias, DbType = "Date" }); _database.Insert("cmsDataType", "pk", false, new DataTypeDto { PrimaryKey = 14, DataTypeId = -42, PropertyEditorAlias = Constants.PropertyEditors.DropDownListAlias, DbType = "Integer" }); - _database.Insert("cmsDataType", "pk", false, new DataTypeDto { PrimaryKey = 15, DataTypeId = -43, PropertyEditorAlias = Constants.PropertyEditors.CheckBoxListAlias, DbType = "Nvarchar" }); + _database.Insert("cmsDataType", "pk", false, new DataTypeDto { PrimaryKey = 15, DataTypeId = -43, PropertyEditorAlias = Constants.PropertyEditors.CheckBoxListAlias, DbType = "Nvarchar" }); _database.Insert("cmsDataType", "pk", false, new DataTypeDto { PrimaryKey = 22, DataTypeId = 1041, PropertyEditorAlias = Constants.PropertyEditors.TagsAlias, DbType = "Ntext" }); _database.Insert("cmsDataType", "pk", false, new DataTypeDto { PrimaryKey = 24, DataTypeId = 1043, PropertyEditorAlias = Constants.PropertyEditors.ImageCropperAlias, DbType = "Ntext" }); _database.Insert("cmsDataType", "pk", false, new DataTypeDto { PrimaryKey = -26, DataTypeId = Constants.DataTypes.DefaultContentListView, PropertyEditorAlias = Constants.PropertyEditors.ListViewAlias, DbType = "Nvarchar" }); _database.Insert("cmsDataType", "pk", false, new DataTypeDto { PrimaryKey = -27, DataTypeId = Constants.DataTypes.DefaultMediaListView, PropertyEditorAlias = Constants.PropertyEditors.ListViewAlias, DbType = "Nvarchar" }); - _database.Insert("cmsDataType", "pk", false, new DataTypeDto { PrimaryKey = -28, DataTypeId = Constants.DataTypes.DefaultMembersListView, PropertyEditorAlias = Constants.PropertyEditors.ListViewAlias, DbType = "Nvarchar" }); + _database.Insert("cmsDataType", "pk", false, new DataTypeDto { PrimaryKey = -28, DataTypeId = Constants.DataTypes.DefaultMembersListView, PropertyEditorAlias = Constants.PropertyEditors.ListViewAlias, DbType = "Nvarchar" }); //New UDI pickers with newer Ids _database.Insert("cmsDataType", "pk", false, new DataTypeDto { PrimaryKey = 26, DataTypeId = 1046, PropertyEditorAlias = Constants.PropertyEditors.ContentPicker2Alias, DbType = "Nvarchar" }); @@ -270,7 +270,7 @@ namespace Umbraco.Core.Persistence.Migrations.Initial _database.Insert("cmsDataType", "pk", false, new DataTypeDto { PrimaryKey = 30, DataTypeId = 1050, PropertyEditorAlias = Constants.PropertyEditors.RelatedLinks2Alias, DbType = "Ntext" }); //TODO: We're not creating these for 7.0 - //_database.Insert("cmsDataType", "pk", false, new DataTypeDto { PrimaryKey = 19, DataTypeId = 1038, PropertyEditorAlias = Constants.PropertyEditors.MarkdownEditorAlias, DbType = "Ntext" }); + //_database.Insert("cmsDataType", "pk", false, new DataTypeDto { PrimaryKey = 19, DataTypeId = 1038, PropertyEditorAlias = Constants.PropertyEditors.MarkdownEditorAlias, DbType = "Ntext" }); //_database.Insert("cmsDataType", "pk", false, new DataTypeDto { PrimaryKey = 20, DataTypeId = 1039, PropertyEditorAlias = Constants.PropertyEditors.UltimatePickerAlias, DbType = "Ntext" }); //_database.Insert("cmsDataType", "pk", false, new DataTypeDto { PrimaryKey = 23, DataTypeId = 1042, PropertyEditorAlias = Constants.PropertyEditors.MacroContainerAlias, DbType = "Ntext" }); } @@ -279,7 +279,7 @@ namespace Umbraco.Core.Persistence.Migrations.Initial { _database.Insert("cmsDataTypePreValues", "id", false, new DataTypePreValueDto { Id = 3, Alias = "", SortOrder = 0, DataTypeNodeId = -87, Value = ",code,undo,redo,cut,copy,mcepasteword,stylepicker,bold,italic,bullist,numlist,outdent,indent,mcelink,unlink,mceinsertanchor,mceimage,umbracomacro,mceinserttable,umbracoembed,mcecharmap,|1|1,2,3,|0|500,400|1049,|true|" }); _database.Insert("cmsDataTypePreValues", "id", false, new DataTypePreValueDto { Id = 4, Alias = "group", SortOrder = 0, DataTypeNodeId = 1041, Value = "default" }); - + //defaults for the member list _database.Insert("cmsDataTypePreValues", "id", false, new DataTypePreValueDto { Id = -1, Alias = "pageSize", SortOrder = 1, DataTypeNodeId = Constants.DataTypes.DefaultMembersListView, Value = "10" }); _database.Insert("cmsDataTypePreValues", "id", false, new DataTypePreValueDto { Id = -2, Alias = "orderBy", SortOrder = 2, DataTypeNodeId = Constants.DataTypes.DefaultMembersListView, Value = "username" }); @@ -329,4 +329,4 @@ namespace Umbraco.Core.Persistence.Migrations.Initial _database.Insert("umbracoMigration", "pk", false, dto); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Initial/DatabaseSchemaCreation.cs b/src/Umbraco.Core/Persistence/Migrations/Initial/DatabaseSchemaCreation.cs index 1a67b0e52e..57057c97ab 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Initial/DatabaseSchemaCreation.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Initial/DatabaseSchemaCreation.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using NPoco; @@ -365,4 +365,4 @@ namespace Umbraco.Core.Persistence.Migrations.Initial #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Initial/DatabaseSchemaResult.cs b/src/Umbraco.Core/Persistence/Migrations/Initial/DatabaseSchemaResult.cs index b04d010570..7e439c6dcd 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Initial/DatabaseSchemaResult.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Initial/DatabaseSchemaResult.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -61,7 +61,7 @@ namespace Umbraco.Core.Persistence.Migrations.Initial /// Determines the version of the currently installed database by detecting the current database structure /// /// - /// A with Major and Minor values for + /// A with Major and Minor values for /// non-empty database, otherwise "0.0.0" for empty databases. /// public Version DetermineInstalledVersion() @@ -102,7 +102,7 @@ namespace Umbraco.Core.Persistence.Migrations.Initial return new Version(6, 0, 0); } - //if the error indicates a problem with the column cmsMacroProperty.macroPropertyType then it is not version 7 + //if the error indicates a problem with the column cmsMacroProperty.macroPropertyType then it is not version 7 // since these columns get removed in v7 if (Errors.Any(x => x.Item1.Equals("Column") && (x.Item2.InvariantEquals("cmsMacroProperty,macroPropertyType")))) { @@ -119,7 +119,7 @@ namespace Umbraco.Core.Persistence.Migrations.Initial } } - //if the error indicates a problem with the constraint FK_cmsContent_cmsContentType_nodeId then it is not version 7.2 + //if the error indicates a problem with the constraint FK_cmsContent_cmsContentType_nodeId then it is not version 7.2 // since this gets added in 7.2.0 so it must be the previous version if (Errors.Any(x => x.Item1.Equals("Constraint") && (x.Item2.InvariantEquals("FK_cmsContent_cmsContentType_nodeId")))) { @@ -210,4 +210,4 @@ namespace Umbraco.Core.Persistence.Migrations.Initial return sb.ToString(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/MigrationAttribute.cs b/src/Umbraco.Core/Persistence/Migrations/MigrationAttribute.cs index b42b4aa6b8..8fc3a06498 100644 --- a/src/Umbraco.Core/Persistence/Migrations/MigrationAttribute.cs +++ b/src/Umbraco.Core/Persistence/Migrations/MigrationAttribute.cs @@ -44,4 +44,4 @@ namespace Umbraco.Core.Persistence.Migrations /// public string ProductName { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/MigrationBase.cs b/src/Umbraco.Core/Persistence/Migrations/MigrationBase.cs index 840bb95bda..5135b4f3ac 100644 --- a/src/Umbraco.Core/Persistence/Migrations/MigrationBase.cs +++ b/src/Umbraco.Core/Persistence/Migrations/MigrationBase.cs @@ -61,4 +61,4 @@ namespace Umbraco.Core.Persistence.Migrations return new IfDatabaseBuilder(Context, supportedDatabaseTypes); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/MigrationCollection.cs b/src/Umbraco.Core/Persistence/Migrations/MigrationCollection.cs index e1029fa5a3..2650e6c8e6 100644 --- a/src/Umbraco.Core/Persistence/Migrations/MigrationCollection.cs +++ b/src/Umbraco.Core/Persistence/Migrations/MigrationCollection.cs @@ -5,7 +5,7 @@ namespace Umbraco.Core.Persistence.Migrations { public class MigrationCollection : BuilderCollectionBase { - public MigrationCollection(IEnumerable items) + public MigrationCollection(IEnumerable items) : base(items) { } } diff --git a/src/Umbraco.Core/Persistence/Migrations/MigrationCollectionBuilder.cs b/src/Umbraco.Core/Persistence/Migrations/MigrationCollectionBuilder.cs index 6f36074ad2..daefcec6a2 100644 --- a/src/Umbraco.Core/Persistence/Migrations/MigrationCollectionBuilder.cs +++ b/src/Umbraco.Core/Persistence/Migrations/MigrationCollectionBuilder.cs @@ -23,7 +23,7 @@ namespace Umbraco.Core.Persistence.Migrations protected override void Initialize() { - // nothing - do not register the collection + // nothing - do not register the collection } protected override MigrationCollectionBuilder This => this; diff --git a/src/Umbraco.Core/Persistence/Migrations/MigrationContext.cs b/src/Umbraco.Core/Persistence/Migrations/MigrationContext.cs index 850672a969..762b0e78c6 100644 --- a/src/Umbraco.Core/Persistence/Migrations/MigrationContext.cs +++ b/src/Umbraco.Core/Persistence/Migrations/MigrationContext.cs @@ -35,4 +35,4 @@ namespace Umbraco.Core.Persistence.Migrations public ILocalMigration GetLocalMigration() => new LocalMigration(Database, Logger); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/MigrationExpressionBase.cs b/src/Umbraco.Core/Persistence/Migrations/MigrationExpressionBase.cs index b2cea511a4..632486d0a3 100644 --- a/src/Umbraco.Core/Persistence/Migrations/MigrationExpressionBase.cs +++ b/src/Umbraco.Core/Persistence/Migrations/MigrationExpressionBase.cs @@ -76,4 +76,4 @@ namespace Umbraco.Core.Persistence.Migrations } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/MigrationRunner.cs b/src/Umbraco.Core/Persistence/Migrations/MigrationRunner.cs index b6c5281442..a43f212ab1 100644 --- a/src/Umbraco.Core/Persistence/Migrations/MigrationRunner.cs +++ b/src/Umbraco.Core/Persistence/Migrations/MigrationRunner.cs @@ -54,7 +54,7 @@ namespace Umbraco.Core.Persistence.Migrations public bool Execute(IMigrationContext migrationContext, bool isUpgrade = true) { _logger.Info("Initializing database migrations"); - + var foundMigrations = FindMigrations(migrationContext); //filter all non-schema migrations @@ -175,7 +175,7 @@ namespace Umbraco.Core.Persistence.Migrations _logger.Info($"Added DOWNGRADE migration '{migration.GetType().Name}' to context"); } } - + } private void ExecuteMigrations(IMigrationContext context) diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/AlterSyntaxBuilder.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/AlterSyntaxBuilder.cs index 4cbb628477..32665a4586 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/AlterSyntaxBuilder.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/AlterSyntaxBuilder.cs @@ -40,4 +40,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Alter return new AlterColumnBuilder(_context, _supportedDatabaseTypes, expression); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Column/AlterColumnBuilder.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Column/AlterColumnBuilder.cs index 683674da8f..be3264db98 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Column/AlterColumnBuilder.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Column/AlterColumnBuilder.cs @@ -51,7 +51,7 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Alter.Column return this; } - + public IAlterColumnOptionSyntax WithDefaultValue(object value) { @@ -243,4 +243,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Alter.Column return this; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Column/IAlterColumnOptionForeignKeyCascadeSyntax.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Column/IAlterColumnOptionForeignKeyCascadeSyntax.cs index c6c3aae29e..361cd07374 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Column/IAlterColumnOptionForeignKeyCascadeSyntax.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Column/IAlterColumnOptionForeignKeyCascadeSyntax.cs @@ -1,9 +1,9 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Alter.Column { - public interface IAlterColumnOptionForeignKeyCascadeSyntax : + public interface IAlterColumnOptionForeignKeyCascadeSyntax : IAlterColumnOptionSyntax, IForeignKeyCascadeSyntax { - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Column/IAlterColumnOptionSyntax.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Column/IAlterColumnOptionSyntax.cs index 2dd4578f1d..c9798581af 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Column/IAlterColumnOptionSyntax.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Column/IAlterColumnOptionSyntax.cs @@ -2,6 +2,6 @@ { public interface IAlterColumnOptionSyntax : IColumnOptionSyntax { - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Column/IAlterColumnSyntax.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Column/IAlterColumnSyntax.cs index 194db11ba3..53b9d6864f 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Column/IAlterColumnSyntax.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Column/IAlterColumnSyntax.cs @@ -4,4 +4,4 @@ { IAlterColumnTypeSyntax OnTable(string name); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Column/IAlterColumnTypeSyntax.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Column/IAlterColumnTypeSyntax.cs index 0a621ed7d7..79379d1469 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Column/IAlterColumnTypeSyntax.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Column/IAlterColumnTypeSyntax.cs @@ -2,6 +2,6 @@ { public interface IAlterColumnTypeSyntax : IColumnTypeSyntax { - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Expressions/AlterColumnExpression.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Expressions/AlterColumnExpression.cs index 8b9d01513c..2cb873e547 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Expressions/AlterColumnExpression.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Expressions/AlterColumnExpression.cs @@ -13,7 +13,7 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Alter.Expressions } - + public virtual string SchemaName { get; set; } public virtual string TableName { get; set; } @@ -28,4 +28,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Alter.Expressions } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Expressions/AlterDefaultConstraintExpression.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Expressions/AlterDefaultConstraintExpression.cs index c32ec6fd50..88ac7709f2 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Expressions/AlterDefaultConstraintExpression.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Expressions/AlterDefaultConstraintExpression.cs @@ -1,10 +1,10 @@ -using NPoco; +using NPoco; namespace Umbraco.Core.Persistence.Migrations.Syntax.Alter.Expressions { public class AlterDefaultConstraintExpression : MigrationExpressionBase { - public AlterDefaultConstraintExpression(IMigrationContext context, DatabaseType[] supportedDatabaseTypes) + public AlterDefaultConstraintExpression(IMigrationContext context, DatabaseType[] supportedDatabaseTypes) : base(context, supportedDatabaseTypes) { } @@ -27,4 +27,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Alter.Expressions SqlSyntax.GetQuotedName(ConstraintName)); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Expressions/AlterTableExpression.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Expressions/AlterTableExpression.cs index fc1e0a8015..3fc442609f 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Expressions/AlterTableExpression.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Expressions/AlterTableExpression.cs @@ -4,7 +4,7 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Alter.Expressions { public class AlterTableExpression : MigrationExpressionBase { - public AlterTableExpression(IMigrationContext context, DatabaseType[] supportedDatabaseTypes) + public AlterTableExpression(IMigrationContext context, DatabaseType[] supportedDatabaseTypes) : base(context, supportedDatabaseTypes) { } @@ -17,4 +17,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Alter.Expressions return $"ALTER TABLE {TableName}"; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/IAlterSyntaxBuilder.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/IAlterSyntaxBuilder.cs index 77db6b8cde..34b1c4ab05 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/IAlterSyntaxBuilder.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/IAlterSyntaxBuilder.cs @@ -6,7 +6,7 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Alter { public interface IAlterSyntaxBuilder : IFluentSyntax { - IAlterTableSyntax Table(string tableName); + IAlterTableSyntax Table(string tableName); /// /// The problem with this is that only under particular circumstances is the expression added to the context @@ -15,8 +15,8 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Alter /// the expression to the context. /// /// - /// + /// [Obsolete("Use the IAlterTableSyntax to modify a column instead, this will be removed in future versions")] IAlterColumnSyntax Column(string columnName); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Table/AlterTableBuilder.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Table/AlterTableBuilder.cs index bc11fb1099..d5eb0c15ea 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Table/AlterTableBuilder.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Table/AlterTableBuilder.cs @@ -260,4 +260,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Alter.Table return this; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Table/IAlterTableColumnOptionForeignKeyCascadeSyntax.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Table/IAlterTableColumnOptionForeignKeyCascadeSyntax.cs index e9035c195c..562ca96e83 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Table/IAlterTableColumnOptionForeignKeyCascadeSyntax.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Table/IAlterTableColumnOptionForeignKeyCascadeSyntax.cs @@ -4,6 +4,6 @@ IAlterTableColumnOptionSyntax, IForeignKeyCascadeSyntax { - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Table/IAlterTableColumnOptionSyntax.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Table/IAlterTableColumnOptionSyntax.cs index 956f9ee999..242363a43a 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Table/IAlterTableColumnOptionSyntax.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Table/IAlterTableColumnOptionSyntax.cs @@ -1,9 +1,9 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Alter.Table { - public interface IAlterTableColumnOptionSyntax : + public interface IAlterTableColumnOptionSyntax : IColumnOptionSyntax, IAlterTableSyntax { - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Table/IAlterTableColumnTypeSyntax.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Table/IAlterTableColumnTypeSyntax.cs index b744836c1b..df09942d6b 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Table/IAlterTableColumnTypeSyntax.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Table/IAlterTableColumnTypeSyntax.cs @@ -2,6 +2,6 @@ { public interface IAlterTableColumnTypeSyntax : IColumnTypeSyntax { - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Table/IAlterTableSyntax.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Table/IAlterTableSyntax.cs index 3692e2d07a..3fd50bd46e 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Table/IAlterTableSyntax.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Alter/Table/IAlterTableSyntax.cs @@ -5,4 +5,4 @@ IAlterTableColumnTypeSyntax AddColumn(string name); IAlterTableColumnTypeSyntax AlterColumn(string name); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Column/CreateColumnBuilder.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Column/CreateColumnBuilder.cs index 2bed05e786..d782396e54 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Column/CreateColumnBuilder.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Column/CreateColumnBuilder.cs @@ -218,4 +218,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Create.Column return this; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Column/ICreateColumnOnTableSyntax.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Column/ICreateColumnOnTableSyntax.cs index 530cd9740a..099be3cad6 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Column/ICreateColumnOnTableSyntax.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Column/ICreateColumnOnTableSyntax.cs @@ -4,4 +4,4 @@ { ICreateColumnTypeSyntax OnTable(string name); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Column/ICreateColumnOptionForeignKeyCascadeSyntax.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Column/ICreateColumnOptionForeignKeyCascadeSyntax.cs index 7f30ff4f7a..4ded8def39 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Column/ICreateColumnOptionForeignKeyCascadeSyntax.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Column/ICreateColumnOptionForeignKeyCascadeSyntax.cs @@ -3,6 +3,6 @@ public interface ICreateColumnOptionForeignKeyCascadeSyntax : ICreateColumnOptionSyntax, IForeignKeyCascadeSyntax { - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Column/ICreateColumnOptionSyntax.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Column/ICreateColumnOptionSyntax.cs index 3699dcda89..a8924f5bbe 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Column/ICreateColumnOptionSyntax.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Column/ICreateColumnOptionSyntax.cs @@ -2,6 +2,6 @@ { public interface ICreateColumnOptionSyntax : IColumnOptionSyntax { - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Column/ICreateColumnTypeSyntax.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Column/ICreateColumnTypeSyntax.cs index 97ef046b8b..15562f9a58 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Column/ICreateColumnTypeSyntax.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Column/ICreateColumnTypeSyntax.cs @@ -2,6 +2,6 @@ { public interface ICreateColumnTypeSyntax : IColumnTypeSyntax { - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Constraint/CreateConstraintBuilder.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Constraint/CreateConstraintBuilder.cs index acb1a3d392..049124411d 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Constraint/CreateConstraintBuilder.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Constraint/CreateConstraintBuilder.cs @@ -29,4 +29,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Create.Constraint } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Constraint/ICreateConstraintColumnsSyntax.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Constraint/ICreateConstraintColumnsSyntax.cs index a037b40605..0aebd42550 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Constraint/ICreateConstraintColumnsSyntax.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Constraint/ICreateConstraintColumnsSyntax.cs @@ -5,4 +5,4 @@ void Column(string columnName); void Columns(string[] columnNames); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Constraint/ICreateConstraintOnTableSyntax.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Constraint/ICreateConstraintOnTableSyntax.cs index f42d2fcc74..d565f56c4e 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Constraint/ICreateConstraintOnTableSyntax.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Constraint/ICreateConstraintOnTableSyntax.cs @@ -4,4 +4,4 @@ { ICreateConstraintColumnsSyntax OnTable(string tableName); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/CreateBuilder.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/CreateBuilder.cs index 9af4c19d98..a719f79197 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/CreateBuilder.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/CreateBuilder.cs @@ -124,4 +124,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Create return new CreateConstraintBuilder(expression); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Expressions/CreateConstraintExpression.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Expressions/CreateConstraintExpression.cs index 893239e822..42fe29ae1f 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Expressions/CreateConstraintExpression.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Expressions/CreateConstraintExpression.cs @@ -6,12 +6,12 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Create.Expressions { public class CreateConstraintExpression : MigrationExpressionBase { - public CreateConstraintExpression(IMigrationContext context, DatabaseType[] supportedDatabaseTypes, ConstraintType constraint) + public CreateConstraintExpression(IMigrationContext context, DatabaseType[] supportedDatabaseTypes, ConstraintType constraint) : base(context, supportedDatabaseTypes) { Constraint = new ConstraintDefinition(constraint); } - + public ConstraintDefinition Constraint { get; private set; } @@ -39,4 +39,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Create.Expressions string.Join(", ", columns)); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Expressions/CreateTableExpression.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Expressions/CreateTableExpression.cs index af9247f8f2..628c0710ed 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Expressions/CreateTableExpression.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Expressions/CreateTableExpression.cs @@ -23,4 +23,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Create.Expressions return string.Format(SqlSyntax.Format(table)); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/ForeignKey/CreateForeignKeyBuilder.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/ForeignKey/CreateForeignKeyBuilder.cs index 73fcb9571f..8742e99ad4 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/ForeignKey/CreateForeignKeyBuilder.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/ForeignKey/CreateForeignKeyBuilder.cs @@ -70,4 +70,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Create.ForeignKey Expression.ForeignKey.OnUpdate = rule; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/ForeignKey/ICreateForeignKeyCascadeSyntax.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/ForeignKey/ICreateForeignKeyCascadeSyntax.cs index 7671249c2e..915968773f 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/ForeignKey/ICreateForeignKeyCascadeSyntax.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/ForeignKey/ICreateForeignKeyCascadeSyntax.cs @@ -8,4 +8,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Create.ForeignKey ICreateForeignKeyCascadeSyntax OnUpdate(Rule rule); void OnDeleteOrUpdate(Rule rule); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/ForeignKey/ICreateForeignKeyForeignColumnSyntax.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/ForeignKey/ICreateForeignKeyForeignColumnSyntax.cs index 92a7769f8d..1bc60e311e 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/ForeignKey/ICreateForeignKeyForeignColumnSyntax.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/ForeignKey/ICreateForeignKeyForeignColumnSyntax.cs @@ -5,4 +5,4 @@ ICreateForeignKeyToTableSyntax ForeignColumn(string column); ICreateForeignKeyToTableSyntax ForeignColumns(params string[] columns); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/ForeignKey/ICreateForeignKeyFromTableSyntax.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/ForeignKey/ICreateForeignKeyFromTableSyntax.cs index 36be02faae..cf420487c5 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/ForeignKey/ICreateForeignKeyFromTableSyntax.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/ForeignKey/ICreateForeignKeyFromTableSyntax.cs @@ -4,4 +4,4 @@ { ICreateForeignKeyForeignColumnSyntax FromTable(string table); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/ForeignKey/ICreateForeignKeyPrimaryColumnSyntax.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/ForeignKey/ICreateForeignKeyPrimaryColumnSyntax.cs index bad288b81e..02e449b8a1 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/ForeignKey/ICreateForeignKeyPrimaryColumnSyntax.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/ForeignKey/ICreateForeignKeyPrimaryColumnSyntax.cs @@ -5,4 +5,4 @@ ICreateForeignKeyCascadeSyntax PrimaryColumn(string column); ICreateForeignKeyCascadeSyntax PrimaryColumns(params string[] columns); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/ForeignKey/ICreateForeignKeyToTableSyntax.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/ForeignKey/ICreateForeignKeyToTableSyntax.cs index ea2589a2c2..d2d614feb6 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/ForeignKey/ICreateForeignKeyToTableSyntax.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/ForeignKey/ICreateForeignKeyToTableSyntax.cs @@ -4,4 +4,4 @@ { ICreateForeignKeyPrimaryColumnSyntax ToTable(string table); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/ICreateBuilder.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/ICreateBuilder.cs index 3cb2fe7e9f..48eaccd3b2 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/ICreateBuilder.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/ICreateBuilder.cs @@ -26,4 +26,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Create ICreateConstraintOnTableSyntax UniqueConstraint(string constraintName); ICreateConstraintOnTableSyntax Constraint(string constraintName); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Index/CreateIndexBuilder.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Index/CreateIndexBuilder.cs index 4d1396ff79..49d6c81be9 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Index/CreateIndexBuilder.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Index/CreateIndexBuilder.cs @@ -82,4 +82,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Create.Index return this; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Index/ICreateIndexColumnOptionsSyntax.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Index/ICreateIndexColumnOptionsSyntax.cs index f8055376aa..9b344d1ba6 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Index/ICreateIndexColumnOptionsSyntax.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Index/ICreateIndexColumnOptionsSyntax.cs @@ -6,4 +6,4 @@ ICreateIndexOnColumnSyntax Descending(); ICreateIndexOnColumnSyntax Unique(); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Index/ICreateIndexForTableSyntax.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Index/ICreateIndexForTableSyntax.cs index 0ac954990b..2a424450fa 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Index/ICreateIndexForTableSyntax.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Index/ICreateIndexForTableSyntax.cs @@ -4,4 +4,4 @@ { ICreateIndexOnColumnSyntax OnTable(string tableName); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Index/ICreateIndexOnColumnSyntax.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Index/ICreateIndexOnColumnSyntax.cs index 0c829aa4ef..5868f5c253 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Index/ICreateIndexOnColumnSyntax.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Index/ICreateIndexOnColumnSyntax.cs @@ -5,4 +5,4 @@ ICreateIndexColumnOptionsSyntax OnColumn(string columnName); ICreateIndexOptionsSyntax WithOptions(); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Index/ICreateIndexOptionsSyntax.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Index/ICreateIndexOptionsSyntax.cs index 4253b48088..68bbfd5518 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Index/ICreateIndexOptionsSyntax.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Index/ICreateIndexOptionsSyntax.cs @@ -6,4 +6,4 @@ ICreateIndexOnColumnSyntax NonClustered(); ICreateIndexOnColumnSyntax Clustered(); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Table/CreateTableBuilder.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Table/CreateTableBuilder.cs index 3d34cb9e51..591a378848 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Table/CreateTableBuilder.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Table/CreateTableBuilder.cs @@ -87,7 +87,7 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Create.Table { CurrentColumn.IsPrimaryKey = true; - //For MySQL, the PK will be created WITH the create table expression, however for + //For MySQL, the PK will be created WITH the create table expression, however for // SQL Server, the PK get's created in a different Alter table expression afterwords. // MySQL will choke if the same constraint is again added afterword // TODO: This is a super hack, I'd rather not add another property like 'CreatesPkInCreateTableDefinition' to check @@ -115,7 +115,7 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Create.Table CurrentColumn.IsPrimaryKey = true; CurrentColumn.PrimaryKeyName = primaryKeyName; - //For MySQL, the PK will be created WITH the create table expression, however for + //For MySQL, the PK will be created WITH the create table expression, however for // SQL Server, the PK get's created in a different Alter table expression afterwords. // MySQL will choke if the same constraint is again added afterword // TODO: This is a super hack, I'd rather not add another property like 'CreatesPkInCreateTableDefinition' to check @@ -136,7 +136,7 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Create.Table }; _context.Expressions.Add(expression); } - + return this; } @@ -268,4 +268,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Create.Table return this; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Table/ICreateTableColumnAsTypeSyntax.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Table/ICreateTableColumnAsTypeSyntax.cs index 26e65eb73f..fa3b89183f 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Table/ICreateTableColumnAsTypeSyntax.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Table/ICreateTableColumnAsTypeSyntax.cs @@ -4,4 +4,4 @@ { } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Table/ICreateTableColumnOptionForeignKeyCascadeSyntax.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Table/ICreateTableColumnOptionForeignKeyCascadeSyntax.cs index fa6af935d9..f4748f1861 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Table/ICreateTableColumnOptionForeignKeyCascadeSyntax.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Table/ICreateTableColumnOptionForeignKeyCascadeSyntax.cs @@ -6,4 +6,4 @@ { } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Table/ICreateTableColumnOptionSyntax.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Table/ICreateTableColumnOptionSyntax.cs index 68b1aff248..2f52836f1c 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Table/ICreateTableColumnOptionSyntax.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Table/ICreateTableColumnOptionSyntax.cs @@ -6,4 +6,4 @@ { } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Table/ICreateTableWithColumnSyntax.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Table/ICreateTableWithColumnSyntax.cs index 1edf13e847..a5dc4d2523 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Table/ICreateTableWithColumnSyntax.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Create/Table/ICreateTableWithColumnSyntax.cs @@ -4,4 +4,4 @@ { ICreateTableColumnAsTypeSyntax WithColumn(string name); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Column/DeleteColumnBuilder.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Column/DeleteColumnBuilder.cs index c8d13b97cd..150f1b4a72 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Column/DeleteColumnBuilder.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Column/DeleteColumnBuilder.cs @@ -19,4 +19,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Delete.Column return this; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Column/IDeleteColumnFromTableSyntax.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Column/IDeleteColumnFromTableSyntax.cs index cdeb259e25..ec95e384b5 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Column/IDeleteColumnFromTableSyntax.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Column/IDeleteColumnFromTableSyntax.cs @@ -5,4 +5,4 @@ void FromTable(string tableName); IDeleteColumnFromTableSyntax Column(string columnName); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Constraint/DeleteConstraintBuilder.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Constraint/DeleteConstraintBuilder.cs index 49aa1ed0e0..ac3cd6e714 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Constraint/DeleteConstraintBuilder.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Constraint/DeleteConstraintBuilder.cs @@ -13,4 +13,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Delete.Constraint Expression.Constraint.TableName = tableName; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Constraint/IDeleteConstraintOnTableSyntax.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Constraint/IDeleteConstraintOnTableSyntax.cs index bcbb886ccb..891693696c 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Constraint/IDeleteConstraintOnTableSyntax.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Constraint/IDeleteConstraintOnTableSyntax.cs @@ -4,4 +4,4 @@ { void FromTable(string tableName); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/DefaultConstraint/DeleteDefaultConstraintBuilder.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/DefaultConstraint/DeleteDefaultConstraintBuilder.cs index c2af83ad9b..e5f99b67a1 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/DefaultConstraint/DeleteDefaultConstraintBuilder.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/DefaultConstraint/DeleteDefaultConstraintBuilder.cs @@ -22,4 +22,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Delete.DefaultConstraint Expression.ColumnName = columnName; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/DefaultConstraint/IDeleteDefaultConstraintOnColumnSyntax.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/DefaultConstraint/IDeleteDefaultConstraintOnColumnSyntax.cs index a8055d55e0..ecf04b1e69 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/DefaultConstraint/IDeleteDefaultConstraintOnColumnSyntax.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/DefaultConstraint/IDeleteDefaultConstraintOnColumnSyntax.cs @@ -4,4 +4,4 @@ { void OnColumn(string columnName); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/DefaultConstraint/IDeleteDefaultConstraintOnTableSyntax.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/DefaultConstraint/IDeleteDefaultConstraintOnTableSyntax.cs index 95eb4675b1..288bf5ba0f 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/DefaultConstraint/IDeleteDefaultConstraintOnTableSyntax.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/DefaultConstraint/IDeleteDefaultConstraintOnTableSyntax.cs @@ -4,4 +4,4 @@ { IDeleteDefaultConstraintOnColumnSyntax OnTable(string tableName); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/DeleteBuilder.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/DeleteBuilder.cs index 2cb2ed833c..c23d88eb43 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/DeleteBuilder.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/DeleteBuilder.cs @@ -95,4 +95,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Delete return new DeleteDefaultConstraintBuilder(expression); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/DeleteDataBuilder.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/DeleteDataBuilder.cs index 149e73b078..451d2592f3 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/DeleteDataBuilder.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/DeleteDataBuilder.cs @@ -52,4 +52,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Delete return data; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Expressions/DeleteColumnExpression.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Expressions/DeleteColumnExpression.cs index 6ebbb1353a..1ad7b47de1 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Expressions/DeleteColumnExpression.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Expressions/DeleteColumnExpression.cs @@ -34,4 +34,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Delete.Expressions return sb.ToString(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Expressions/DeleteConstraintExpression.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Expressions/DeleteConstraintExpression.cs index 39a13ad83d..5af4406928 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Expressions/DeleteConstraintExpression.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Expressions/DeleteConstraintExpression.cs @@ -41,4 +41,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Delete.Expressions } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Expressions/DeleteDataExpression.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Expressions/DeleteDataExpression.cs index b48067e255..192c4d542c 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Expressions/DeleteDataExpression.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Expressions/DeleteDataExpression.cs @@ -8,8 +8,8 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Delete.Expressions public class DeleteDataExpression : MigrationExpressionBase { private readonly List _rows = new List(); - - public DeleteDataExpression(IMigrationContext context, DatabaseType[] supportedDatabaseTypes) + + public DeleteDataExpression(IMigrationContext context, DatabaseType[] supportedDatabaseTypes) : base(context, supportedDatabaseTypes) { } @@ -49,4 +49,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Delete.Expressions return String.Join("; ", deleteItems.ToArray()); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Expressions/DeleteDefaultConstraintExpression.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Expressions/DeleteDefaultConstraintExpression.cs index 4c48847fd4..9053aa6ac6 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Expressions/DeleteDefaultConstraintExpression.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Expressions/DeleteDefaultConstraintExpression.cs @@ -22,4 +22,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Delete.Expressions ColumnName); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Expressions/DeleteForeignKeyExpression.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Expressions/DeleteForeignKeyExpression.cs index f66622dd1c..d4b196cfa1 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Expressions/DeleteForeignKeyExpression.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Expressions/DeleteForeignKeyExpression.cs @@ -9,7 +9,7 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Delete.Expressions { public DeleteForeignKeyExpression(IMigrationContext context, DatabaseType[] supportedDatabaseTypes) : base(context, supportedDatabaseTypes) - { + { ForeignKey = new ForeignKeyDefinition(); } @@ -25,7 +25,7 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Delete.Expressions if (CurrentDatabaseType.IsMySql()) { - //MySql naming "convention" for foreignkeys, which aren't explicitly named + //MySql naming "convention" for foreignkeys, which aren't explicitly named if (string.IsNullOrEmpty(ForeignKey.Name)) ForeignKey.Name = string.Format("{0}_ibfk_1", ForeignKey.ForeignTable.ToLower()); @@ -45,4 +45,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Delete.Expressions SqlSyntax.GetQuotedName(ForeignKey.Name)); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Expressions/DeleteIndexExpression.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Expressions/DeleteIndexExpression.cs index eb900d8cf0..9c3eca9f60 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Expressions/DeleteIndexExpression.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Expressions/DeleteIndexExpression.cs @@ -11,7 +11,7 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Delete.Expressions Index = new IndexDefinition(); } - public DeleteIndexExpression(IMigrationContext context, DatabaseType[] supportedDatabaseTypes, IndexDefinition index) + public DeleteIndexExpression(IMigrationContext context, DatabaseType[] supportedDatabaseTypes, IndexDefinition index) : base(context, supportedDatabaseTypes) { Index = index; @@ -26,4 +26,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Delete.Expressions SqlSyntax.GetQuotedTableName(Index.TableName)); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Expressions/DeleteTableExpression.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Expressions/DeleteTableExpression.cs index 5a6e8dd8db..c4f7e753db 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Expressions/DeleteTableExpression.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Expressions/DeleteTableExpression.cs @@ -3,8 +3,8 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Delete.Expressions { public class DeleteTableExpression : MigrationExpressionBase - { - public DeleteTableExpression(IMigrationContext context, DatabaseType[] supportedDatabaseTypes) + { + public DeleteTableExpression(IMigrationContext context, DatabaseType[] supportedDatabaseTypes) : base(context, supportedDatabaseTypes) { } @@ -17,4 +17,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Delete.Expressions SqlSyntax.GetQuotedTableName(TableName)); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/ForeignKey/DeleteForeignKeyBuilder.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/ForeignKey/DeleteForeignKeyBuilder.cs index f6c9ee6c07..6f5c1a2284 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/ForeignKey/DeleteForeignKeyBuilder.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/ForeignKey/DeleteForeignKeyBuilder.cs @@ -59,4 +59,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Delete.ForeignKey Expression.ForeignKey.ForeignTable = foreignTableName; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/ForeignKey/IDeleteForeignKeyForeignColumnSyntax.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/ForeignKey/IDeleteForeignKeyForeignColumnSyntax.cs index ae2fbfb70e..3fc27948db 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/ForeignKey/IDeleteForeignKeyForeignColumnSyntax.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/ForeignKey/IDeleteForeignKeyForeignColumnSyntax.cs @@ -5,4 +5,4 @@ IDeleteForeignKeyToTableSyntax ForeignColumn(string column); IDeleteForeignKeyToTableSyntax ForeignColumns(params string[] columns); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/ForeignKey/IDeleteForeignKeyFromTableSyntax.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/ForeignKey/IDeleteForeignKeyFromTableSyntax.cs index aa8de0673e..4ec1e789e0 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/ForeignKey/IDeleteForeignKeyFromTableSyntax.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/ForeignKey/IDeleteForeignKeyFromTableSyntax.cs @@ -4,4 +4,4 @@ { IDeleteForeignKeyForeignColumnSyntax FromTable(string foreignTableName); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/ForeignKey/IDeleteForeignKeyOnTableSyntax.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/ForeignKey/IDeleteForeignKeyOnTableSyntax.cs index 91e26d38b4..c69addd5a8 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/ForeignKey/IDeleteForeignKeyOnTableSyntax.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/ForeignKey/IDeleteForeignKeyOnTableSyntax.cs @@ -4,4 +4,4 @@ { void OnTable(string foreignTableName); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/ForeignKey/IDeleteForeignKeyPrimaryColumnSyntax.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/ForeignKey/IDeleteForeignKeyPrimaryColumnSyntax.cs index a2f256e644..a7d8477132 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/ForeignKey/IDeleteForeignKeyPrimaryColumnSyntax.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/ForeignKey/IDeleteForeignKeyPrimaryColumnSyntax.cs @@ -5,4 +5,4 @@ void PrimaryColumn(string column); void PrimaryColumns(params string[] columns); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/ForeignKey/IDeleteForeignKeyToTableSyntax.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/ForeignKey/IDeleteForeignKeyToTableSyntax.cs index 46b32c6237..95526b19be 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/ForeignKey/IDeleteForeignKeyToTableSyntax.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/ForeignKey/IDeleteForeignKeyToTableSyntax.cs @@ -4,4 +4,4 @@ { IDeleteForeignKeyPrimaryColumnSyntax ToTable(string table); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/IDeleteBuilder.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/IDeleteBuilder.cs index df70d81b0a..28f2bbd30d 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/IDeleteBuilder.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/IDeleteBuilder.cs @@ -19,4 +19,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Delete IDeleteConstraintOnTableSyntax UniqueConstraint(string constraintName); IDeleteDefaultConstraintOnTableSyntax DefaultConstraint(); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/IDeleteDataSyntax.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/IDeleteDataSyntax.cs index c17ba0f212..ea9bbab45e 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/IDeleteDataSyntax.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/IDeleteDataSyntax.cs @@ -6,4 +6,4 @@ void AllRows(); void IsNull(string columnName); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Index/DeleteIndexBuilder.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Index/DeleteIndexBuilder.cs index 93661c9ece..146f486675 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Index/DeleteIndexBuilder.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Index/DeleteIndexBuilder.cs @@ -34,4 +34,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Delete.Index } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Index/IDeleteIndexForTableSyntax.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Index/IDeleteIndexForTableSyntax.cs index c6d7a227cb..fc9e272c4d 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Index/IDeleteIndexForTableSyntax.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Index/IDeleteIndexForTableSyntax.cs @@ -4,4 +4,4 @@ { IDeleteIndexOnColumnSyntax OnTable(string tableName); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Index/IDeleteIndexOnColumnSyntax.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Index/IDeleteIndexOnColumnSyntax.cs index fcf5038a86..b8e0776aa4 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Index/IDeleteIndexOnColumnSyntax.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Index/IDeleteIndexOnColumnSyntax.cs @@ -10,4 +10,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Delete.Index [Obsolete("I don't think this would ever be used when dropping an index, see DeleteIndexExpression.ToString")] void OnColumns(params string[] columnNames); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Table/DeleteTableBuilder.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Table/DeleteTableBuilder.cs index 01f94201b4..c76a5a061e 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Table/DeleteTableBuilder.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Delete/Table/DeleteTableBuilder.cs @@ -8,4 +8,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Delete.Table { } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Execute/ExecuteBuilder.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Execute/ExecuteBuilder.cs index ef33968709..e8c11f2966 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Execute/ExecuteBuilder.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Execute/ExecuteBuilder.cs @@ -28,4 +28,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Execute _context.Expressions.Add(expression); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Execute/Expressions/ExecuteCodeStatementExpression.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Execute/Expressions/ExecuteCodeStatementExpression.cs index aec042298d..e7cd02c9f3 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Execute/Expressions/ExecuteCodeStatementExpression.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Execute/Expressions/ExecuteCodeStatementExpression.cs @@ -19,4 +19,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Execute.Expressions return base.Process(database); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Execute/Expressions/ExecuteSqlStatementExpression.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Execute/Expressions/ExecuteSqlStatementExpression.cs index c52323a4a1..db36f0887b 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Execute/Expressions/ExecuteSqlStatementExpression.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Execute/Expressions/ExecuteSqlStatementExpression.cs @@ -18,4 +18,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Execute.Expressions return SqlStatement; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Execute/IExecuteBuilder.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Execute/IExecuteBuilder.cs index cf81266caf..66d30d0b17 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Execute/IExecuteBuilder.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Execute/IExecuteBuilder.cs @@ -7,4 +7,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Execute void Sql(string sqlStatement); void Code(Func codeStatement); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/ExpressionBuilder.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/ExpressionBuilder.cs index 1d2c76b6a7..5ea9559167 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/ExpressionBuilder.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/ExpressionBuilder.cs @@ -178,4 +178,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax return (NextT)(object)this; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/ExpressionBuilderBase.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/ExpressionBuilderBase.cs index da75ab8541..3418ed5a28 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/ExpressionBuilderBase.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/ExpressionBuilderBase.cs @@ -10,4 +10,4 @@ Expression = expression; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Expressions/CreateColumnExpression.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Expressions/CreateColumnExpression.cs index 3bc467214d..9ba7787f26 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Expressions/CreateColumnExpression.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Expressions/CreateColumnExpression.cs @@ -28,4 +28,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Expressions SqlSyntax.Format(Column)); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Expressions/CreateForeignKeyExpression.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Expressions/CreateForeignKeyExpression.cs index 03eac1dcbf..215a494697 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Expressions/CreateForeignKeyExpression.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Expressions/CreateForeignKeyExpression.cs @@ -27,4 +27,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Expressions return SqlSyntax.Format(ForeignKey); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Expressions/CreateIndexExpression.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Expressions/CreateIndexExpression.cs index 707ea637c6..f56a9ba4a3 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Expressions/CreateIndexExpression.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Expressions/CreateIndexExpression.cs @@ -17,7 +17,7 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Expressions { Index = new IndexDefinition(); } - + public IndexDefinition Index { get; set; } public override string ToString() @@ -25,4 +25,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Expressions return SqlSyntax.Format(Index); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/IColumnOptionSyntax.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/IColumnOptionSyntax.cs index 5d96a7ca17..8721f90b87 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/IColumnOptionSyntax.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/IColumnOptionSyntax.cs @@ -28,4 +28,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax TNextFk ReferencedBy(string foreignKeyName, string foreignTableName, string foreignColumnName); TNextFk ReferencedBy(string foreignKeyName, string foreignTableSchema, string foreignTableName, string foreignColumnName); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/IColumnTypeSyntax.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/IColumnTypeSyntax.cs index 406e6962bb..fc07933a41 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/IColumnTypeSyntax.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/IColumnTypeSyntax.cs @@ -29,4 +29,4 @@ TNext AsXml(int size); TNext AsCustom(string customType); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/IFluentSyntax.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/IFluentSyntax.cs index f6d1f67f2b..313606dbea 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/IFluentSyntax.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/IFluentSyntax.cs @@ -2,6 +2,6 @@ { public interface IFluentSyntax { - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/IForeignKeyCascadeSyntax.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/IForeignKeyCascadeSyntax.cs index eb75ef7c3d..ff254a8a18 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/IForeignKeyCascadeSyntax.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/IForeignKeyCascadeSyntax.cs @@ -10,4 +10,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax TNextFk OnUpdate(Rule rule); TNext OnDeleteOrUpdate(Rule rule); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/IfDatabase/IIfDatabaseBuilder.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/IfDatabase/IIfDatabaseBuilder.cs index b274c215ea..f685f17b53 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/IfDatabase/IIfDatabaseBuilder.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/IfDatabase/IIfDatabaseBuilder.cs @@ -14,4 +14,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.IfDatabase IRenameBuilder Rename { get; } IUpdateBuilder Update { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/IfDatabase/IfDatabaseBuilder.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/IfDatabase/IfDatabaseBuilder.cs index 670dc16f69..ba0134cef4 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/IfDatabase/IfDatabaseBuilder.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/IfDatabase/IfDatabaseBuilder.cs @@ -29,4 +29,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.IfDatabase public IUpdateBuilder Update => new UpdateBuilder(_context, _supportedDatabaseTypes); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Insert/Expressions/InsertDataExpression.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Insert/Expressions/InsertDataExpression.cs index 59f1bc87e3..08eb2ead05 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Insert/Expressions/InsertDataExpression.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Insert/Expressions/InsertDataExpression.cs @@ -8,8 +8,8 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Insert.Expressions public class InsertDataExpression : MigrationExpressionBase { private readonly List _rows = new List(); - - public InsertDataExpression(IMigrationContext context, DatabaseType[] supportedDatabaseTypes) + + public InsertDataExpression(IMigrationContext context, DatabaseType[] supportedDatabaseTypes) : base(context, supportedDatabaseTypes) { } @@ -23,7 +23,7 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Insert.Expressions { if (IsExpressionSupported() == false) return string.Empty; - + var sb = new StringBuilder(); if (EnabledIdentityInsert && SqlSyntax.SupportsIdentityInsert()) @@ -76,6 +76,6 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Insert.Expressions return sb.ToString(); } - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Insert/IInsertBuilder.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Insert/IInsertBuilder.cs index f57d28e2f4..e2a97a01c8 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Insert/IInsertBuilder.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Insert/IInsertBuilder.cs @@ -4,4 +4,4 @@ { IInsertDataSyntax IntoTable(string tableName); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Insert/IInsertDataSyntax.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Insert/IInsertDataSyntax.cs index 5791f0cb83..0bdc4a5cd5 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Insert/IInsertDataSyntax.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Insert/IInsertDataSyntax.cs @@ -5,4 +5,4 @@ IInsertDataSyntax EnableIdentityInsert(); IInsertDataSyntax Row(object dataAsAnonymousType); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Insert/InsertBuilder.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Insert/InsertBuilder.cs index 4e2b89b958..1f4dad0c99 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Insert/InsertBuilder.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Insert/InsertBuilder.cs @@ -23,4 +23,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Insert return new InsertDataBuilder(expression); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Insert/InsertDataBuilder.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Insert/InsertDataBuilder.cs index 4f8bf2dfcc..8a8ce11e15 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Insert/InsertDataBuilder.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Insert/InsertDataBuilder.cs @@ -39,4 +39,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Insert return data; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Rename/Column/IRenameColumnTableSyntax.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Rename/Column/IRenameColumnTableSyntax.cs index 5792ac8756..5456483efc 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Rename/Column/IRenameColumnTableSyntax.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Rename/Column/IRenameColumnTableSyntax.cs @@ -4,4 +4,4 @@ { IRenameColumnToSyntax OnTable(string tableName); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Rename/Column/IRenameColumnToSyntax.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Rename/Column/IRenameColumnToSyntax.cs index 10a0f5cee5..d78b6cb540 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Rename/Column/IRenameColumnToSyntax.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Rename/Column/IRenameColumnToSyntax.cs @@ -4,4 +4,4 @@ { void To(string name); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Rename/Column/RenameColumnBuilder.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Rename/Column/RenameColumnBuilder.cs index 4f001a76fd..05146bee66 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Rename/Column/RenameColumnBuilder.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Rename/Column/RenameColumnBuilder.cs @@ -19,4 +19,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Rename.Column return this; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Rename/Expressions/RenameColumnExpression.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Rename/Expressions/RenameColumnExpression.cs index fe620fbe9e..5bebe98dd7 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Rename/Expressions/RenameColumnExpression.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Rename/Expressions/RenameColumnExpression.cs @@ -3,7 +3,7 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Rename.Expressions { public class RenameColumnExpression : MigrationExpressionBase - { + { public RenameColumnExpression(IMigrationContext context, DatabaseType[] supportedDatabaseTypes) : base(context, supportedDatabaseTypes) { } @@ -50,4 +50,4 @@ SELECT CONCAT( return SqlSyntax.FormatColumnRename(TableName, OldName, NewName); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Rename/Expressions/RenameTableExpression.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Rename/Expressions/RenameTableExpression.cs index e8fe0ffa8b..6608882566 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Rename/Expressions/RenameTableExpression.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Rename/Expressions/RenameTableExpression.cs @@ -16,8 +16,8 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Rename.Expressions { if (IsExpressionSupported() == false) return string.Empty; - + return SqlSyntax.FormatTableRename(OldName, NewName); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Rename/IRenameBuilder.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Rename/IRenameBuilder.cs index 7a52d2647e..fb721909af 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Rename/IRenameBuilder.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Rename/IRenameBuilder.cs @@ -8,4 +8,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Rename IRenameTableSyntax Table(string oldName); IRenameColumnTableSyntax Column(string oldName); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Rename/RenameBuilder.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Rename/RenameBuilder.cs index ac8a7d725c..36e96df5f0 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Rename/RenameBuilder.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Rename/RenameBuilder.cs @@ -31,4 +31,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Rename return new RenameColumnBuilder(expression); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Rename/Table/IRenameTableSyntax.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Rename/Table/IRenameTableSyntax.cs index f44fdea9da..220990b8c2 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Rename/Table/IRenameTableSyntax.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Rename/Table/IRenameTableSyntax.cs @@ -4,4 +4,4 @@ { void To(string name); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Rename/Table/RenameTableBuilder.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Rename/Table/RenameTableBuilder.cs index c5e493fb4a..e40a41d305 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Rename/Table/RenameTableBuilder.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Rename/Table/RenameTableBuilder.cs @@ -13,4 +13,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Rename.Table Expression.NewName = name; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Update/Expressions/UpdateDataExpression.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Update/Expressions/UpdateDataExpression.cs index 94dd544e56..1141e29472 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Update/Expressions/UpdateDataExpression.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Update/Expressions/UpdateDataExpression.cs @@ -5,7 +5,7 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Update.Expressions { public class UpdateDataExpression : MigrationExpressionBase { - public UpdateDataExpression(IMigrationContext context, DatabaseType[] supportedDatabaseTypes) + public UpdateDataExpression(IMigrationContext context, DatabaseType[] supportedDatabaseTypes) : base(context, supportedDatabaseTypes) { } @@ -47,8 +47,8 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Update.Expressions } return string.Format(SqlSyntax.UpdateData, SqlSyntax.GetQuotedTableName(TableName), - string.Join(", ", updateItems.ToArray()), + string.Join(", ", updateItems.ToArray()), string.Join(" AND ", whereClauses.ToArray())); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Update/IUpdateBuilder.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Update/IUpdateBuilder.cs index 9b94af958e..f1ea46bc7c 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Update/IUpdateBuilder.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Update/IUpdateBuilder.cs @@ -4,4 +4,4 @@ { IUpdateSetSyntax Table(string tableName); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Update/IUpdateSetSyntax.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Update/IUpdateSetSyntax.cs index 2c1d8a1c9f..27e4e7f3d5 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Update/IUpdateSetSyntax.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Update/IUpdateSetSyntax.cs @@ -4,4 +4,4 @@ { IUpdateWhereSyntax Set(object dataAsAnonymousType); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Update/IUpdateWhereSyntax.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Update/IUpdateWhereSyntax.cs index 2d318a02bf..cc5fe196e8 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Update/IUpdateWhereSyntax.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Update/IUpdateWhereSyntax.cs @@ -5,4 +5,4 @@ void Where(object dataAsAnonymousType); void AllRows(); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Update/UpdateBuilder.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Update/UpdateBuilder.cs index e5d198d9a6..ba5b4fe9fe 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Update/UpdateBuilder.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Update/UpdateBuilder.cs @@ -22,4 +22,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Update return new UpdateDataBuilder(expression, _context); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Syntax/Update/UpdateDataBuilder.cs b/src/Umbraco.Core/Persistence/Migrations/Syntax/Update/UpdateDataBuilder.cs index 47eff5c2a3..40b4aa7555 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Syntax/Update/UpdateDataBuilder.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Syntax/Update/UpdateDataBuilder.cs @@ -44,4 +44,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Update return data; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionEight/Seven1.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionEight/Seven1.cs index 8010a5fe25..faaef2b31f 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionEight/Seven1.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionEight/Seven1.cs @@ -27,14 +27,14 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionEight // 7.6.0 new AddIndexesToUmbracoRelationTables(Context), - new AddIndexToCmsMemberLoginName(Context), - new AddIndexToUmbracoNodePath(Context), - new AddMacroUniqueIdColumn(Context), + new AddIndexToCmsMemberLoginName(Context), + new AddIndexToUmbracoNodePath(Context), + new AddMacroUniqueIdColumn(Context), new AddRelationTypeUniqueIdColumn(Context), - new NormalizeTemplateGuids(Context), - new ReduceLoginNameColumnsSize(Context), + new NormalizeTemplateGuids(Context), + new ReduceLoginNameColumnsSize(Context), new TargetVersionSevenSixZero.UpdateUniqueIndexOnCmsPropertyData(Context), - new RemoveUmbracoDeployTables(Context), + new RemoveUmbracoDeployTables(Context), }; foreach (var migration in migrations) diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionFourNineZero/RemoveUmbracoAppConstraints.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionFourNineZero/RemoveUmbracoAppConstraints.cs index 3732cef74b..a2adbd863a 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionFourNineZero/RemoveUmbracoAppConstraints.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionFourNineZero/RemoveUmbracoAppConstraints.cs @@ -8,14 +8,14 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionFourNineZero [MigrationAttribute("4.9.0", 0, Constants.System.UmbracoMigrationName)] public class RemoveUmbracoAppConstraints : MigrationBase { - public RemoveUmbracoAppConstraints(IMigrationContext context) + public RemoveUmbracoAppConstraints(IMigrationContext context) : base(context) { } public override void Up() { - //This will work on mysql and should work on mssql however the old keys were not named consistently with how the keys are + //This will work on mysql and should work on mssql however the old keys were not named consistently with how the keys are // structured now. So we need to do a check and manually remove them based on their old aliases. if (DatabaseType.IsMySql()) @@ -52,4 +52,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionFourNineZero .ToTable("umbracoApp").PrimaryColumn("appAlias").OnDeleteOrUpdate(Rule.None); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionFourOneZero/AddPreviewXmlTable.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionFourOneZero/AddPreviewXmlTable.cs index 991d136867..161f5780a6 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionFourOneZero/AddPreviewXmlTable.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionFourOneZero/AddPreviewXmlTable.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; using Umbraco.Core.Configuration; using Umbraco.Core.Persistence.SqlSyntax; @@ -28,4 +28,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionFourOneZero public override void Down() { } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AddIndexToCmsMacroPropertyTable.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AddIndexToCmsMacroPropertyTable.cs index 358149a729..d3711f40b7 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AddIndexToCmsMacroPropertyTable.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AddIndexToCmsMacroPropertyTable.cs @@ -20,7 +20,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven _skipIndexCheck = skipIndexCheck; } - public AddIndexToCmsMacroPropertyTable(IMigrationContext context) + public AddIndexToCmsMacroPropertyTable(IMigrationContext context) : base(context) { } @@ -53,4 +53,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven Delete.Index("IX_cmsMacroProperty_Alias").OnTable("cmsMacroProperty"); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AddIndexToCmsMacroTable.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AddIndexToCmsMacroTable.cs index 0fc251dca6..7c1f9bd5a2 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AddIndexToCmsMacroTable.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AddIndexToCmsMacroTable.cs @@ -23,7 +23,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven _forTesting = forTesting; } - public AddIndexToCmsMacroTable(IMigrationContext context) + public AddIndexToCmsMacroTable(IMigrationContext context) : base(context) { } @@ -63,11 +63,11 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven } } } - - Create.Index("IX_cmsMacro_Alias").OnTable("cmsMacro").OnColumn("macroAlias").Unique(); + + Create.Index("IX_cmsMacro_Alias").OnTable("cmsMacro").OnColumn("macroAlias").Unique(); } - + } public override void Down() @@ -75,4 +75,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven Delete.Index("IX_cmsMacro_Alias").OnTable("cmsMacro"); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AddPropertyEditorAliasColumn.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AddPropertyEditorAliasColumn.cs index 42586ad342..242fa1c2c6 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AddPropertyEditorAliasColumn.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AddPropertyEditorAliasColumn.cs @@ -8,7 +8,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven [Migration("7.0.0", 0, Constants.System.UmbracoMigrationName)] public class AddPropertyEditorAliasColumn : MigrationBase { - public AddPropertyEditorAliasColumn(IMigrationContext context) + public AddPropertyEditorAliasColumn(IMigrationContext context) : base(context) { } @@ -23,4 +23,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven Delete.Column("propertyEditorAlias").FromTable("cmsDataType"); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AlterCmsMacroPropertyTable.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AlterCmsMacroPropertyTable.cs index ce94e5415d..3e57d70830 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AlterCmsMacroPropertyTable.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AlterCmsMacroPropertyTable.cs @@ -105,4 +105,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven throw new DataLossException("Cannot downgrade from a version 7 database to a prior version, the database schema has already been modified"); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AlterTagRelationsTable.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AlterTagRelationsTable.cs index f4bc5b0a36..6e2cc1f2be 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AlterTagRelationsTable.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AlterTagRelationsTable.cs @@ -12,7 +12,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven [Migration("7.0.0", 8, Constants.System.UmbracoMigrationName)] public class AlterTagRelationsTable : MigrationBase { - public AlterTagRelationsTable(IMigrationContext context) + public AlterTagRelationsTable(IMigrationContext context) : base(context) { } @@ -88,7 +88,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven //get all node id -> property type id references for nodes that are in a tag relations and for properties that are of those nodes that are of the tag data type var propertyTypeIdRef = Context.Database.Fetch(@"SELECT DISTINCT cmsTagRelationship.nodeId as NodeId, cmsPropertyType.id as PropertyTypeId - FROM cmsTags + FROM cmsTags INNER JOIN cmsTagRelationship ON cmsTagRelationship.tagId = cmsTags.id INNER JOIN umbracoNode ON umbracoNode.id = cmsTagRelationship.nodeId INNER JOIN cmsContent ON cmsContent.nodeId = umbracoNode.id @@ -99,7 +99,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven foreach (var tr in tagRelations) { - //for each tag relation we need to assign it a property type id which must exist in our references, if it doesn't it means that + //for each tag relation we need to assign it a property type id which must exist in our references, if it doesn't it means that // someone has tag data that relates to node that is not in the cmsContent table - we'll have to delete it and log it if that is the case. var propertyTypes = propertyTypeIdRef.Where(x => x.NodeId == tr.NodeId).ToArray(); @@ -175,4 +175,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven public int PropertyTypeId { get; set; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AlterTagsTable.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AlterTagsTable.cs index a3c3d9fde5..b2732c8243 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AlterTagsTable.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AlterTagsTable.cs @@ -10,7 +10,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven [Migration("7.0.0", 9, Constants.System.UmbracoMigrationName)] public class AlterTagsTable : MigrationBase { - public AlterTagsTable(IMigrationContext context) + public AlterTagsTable(IMigrationContext context) : base(context) { } @@ -54,4 +54,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven throw new DataLossException("Cannot downgrade from a version 7 database to a prior version, the database schema has already been modified"); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AlterUserTable.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AlterUserTable.cs index 7b95ab4be2..4d312606be 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AlterUserTable.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AlterUserTable.cs @@ -26,4 +26,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven throw new DataLossException("Cannot downgrade from a version 7 database to a prior version, the database schema has already been modified"); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AssignMissingKeysAndIndexes.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AssignMissingKeysAndIndexes.cs index 8fe4800337..2218275161 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AssignMissingKeysAndIndexes.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AssignMissingKeysAndIndexes.cs @@ -1,4 +1,4 @@ -using System.Data; +using System.Data; using System.Linq; using Umbraco.Core.Configuration; using Umbraco.Core.Persistence.DatabaseModelDefinitions; @@ -8,13 +8,13 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven { /// /// I'm not actually sure how this is possible but I've come across one install that was missing these PKs - /// and it wasn't a MySQL install. + /// and it wasn't a MySQL install. /// see: http://issues.umbraco.org/issue/U4-5707 /// [Migration("7.0.0", 0, Constants.System.UmbracoMigrationName)] public class AssignMissingKeysAndIndexes : MigrationBase { - public AssignMissingKeysAndIndexes(IMigrationContext context) + public AssignMissingKeysAndIndexes(IMigrationContext context) : base(context) { } @@ -22,7 +22,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven public override void Up() { - //Some very old schemas don't have an index on the cmsContent.nodeId column, I'm not actually sure when it was added but + //Some very old schemas don't have an index on the cmsContent.nodeId column, I'm not actually sure when it was added but // it is absolutely required to exist in order to have it as a foreign key reference, so we'll need to check it's existence // this came to light from this issue: http://issues.umbraco.org/issue/U4-4133 var dbIndexes = SqlSyntax.GetDefinedIndexes(Context.Database) @@ -94,4 +94,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven //don't do anything, these keys should have always existed! } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/DropControlIdColumn.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/DropControlIdColumn.cs index f51289ae1b..873edacf2f 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/DropControlIdColumn.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/DropControlIdColumn.cs @@ -7,7 +7,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven [Migration("7.0.0", 2, Constants.System.UmbracoMigrationName)] public class DropControlIdColumn : MigrationBase { - public DropControlIdColumn(IMigrationContext context) + public DropControlIdColumn(IMigrationContext context) : base(context) { } @@ -24,4 +24,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven throw new DataLossException("Cannot downgrade from a version 7 database to a prior version, the database schema has already been modified"); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/RemoveCmsMacroPropertyTypeTable.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/RemoveCmsMacroPropertyTypeTable.cs index 37a34cf7e2..67b51a5a03 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/RemoveCmsMacroPropertyTypeTable.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/RemoveCmsMacroPropertyTypeTable.cs @@ -7,7 +7,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven [Migration("7.0.0", 7, Constants.System.UmbracoMigrationName)] public class RemoveCmsMacroPropertyTypeTable : MigrationBase { - public RemoveCmsMacroPropertyTypeTable(IMigrationContext context) + public RemoveCmsMacroPropertyTypeTable(IMigrationContext context) : base(context) { } @@ -22,4 +22,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven throw new DataLossException("Cannot downgrade from a version 7 database to a prior version, the database schema has already been modified"); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/UpdateControlIdToPropertyEditorAlias.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/UpdateControlIdToPropertyEditorAlias.cs index 76c3de62a1..387153f4bc 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/UpdateControlIdToPropertyEditorAlias.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/UpdateControlIdToPropertyEditorAlias.cs @@ -12,7 +12,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven [Migration("7.0.0", 1, Constants.System.UmbracoMigrationName)] public class UpdateControlIdToPropertyEditorAlias : MigrationBase { - public UpdateControlIdToPropertyEditorAlias(IMigrationContext context) + public UpdateControlIdToPropertyEditorAlias(IMigrationContext context) : base(context) { } @@ -65,4 +65,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven throw new DataLossException("Cannot downgrade from a version 7 database to a prior version, the database schema has already been modified"); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/UpdateRelatedLinksData.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/UpdateRelatedLinksData.cs index e6a5888552..ebf825c4bd 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/UpdateRelatedLinksData.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/UpdateRelatedLinksData.cs @@ -20,7 +20,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven [Migration("7.0.0", 10, Constants.System.UmbracoMigrationName)] public class UpdateRelatedLinksData : MigrationBase { - public UpdateRelatedLinksData(IMigrationContext context) + public UpdateRelatedLinksData(IMigrationContext context) : base(context) { } diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFiveZero/RemoveStylesheetDataAndTablesAgain.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFiveZero/RemoveStylesheetDataAndTablesAgain.cs index 091c44c1a9..185093897f 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFiveZero/RemoveStylesheetDataAndTablesAgain.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFiveZero/RemoveStylesheetDataAndTablesAgain.cs @@ -26,7 +26,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenFiveZer private string MigrationCode(IUmbracoDatabase database) { var local = Context.GetLocalMigration(); - + //Clear all stylesheet data if the tables exist var tables = SqlSyntax.GetTablesInSchema(Context.Database).ToArray(); if (tables.InvariantContains("cmsStylesheetProperty")) @@ -50,4 +50,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenFiveZer public override void Down() { } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFiveZero/UpdateUniqueIndexOnCmsPropertyData.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFiveZero/UpdateUniqueIndexOnCmsPropertyData.cs index ed6f6b73f2..9e444e87f3 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFiveZero/UpdateUniqueIndexOnCmsPropertyData.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFiveZero/UpdateUniqueIndexOnCmsPropertyData.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; @@ -48,12 +48,12 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenFiveZer else { //NOTE: Even though the above will work for MSSQL, we are not going to execute the - // nested delete sub query logic since it will be slower and there could be a ton of property + // nested delete sub query logic since it will be slower and there could be a ton of property // data here so needs to be as fast as possible. Execute.Sql("DELETE FROM cmsPropertyData WHERE id NOT IN (SELECT MIN(id) FROM cmsPropertyData GROUP BY contentNodeId, versionId, propertytypeid HAVING MIN(id) IS NOT NULL)"); } - //we need to re create this index + //we need to re create this index Delete.Index("IX_cmsPropertyData_1").OnTable("cmsPropertyData"); Create.Index("IX_cmsPropertyData_1").OnTable("cmsPropertyData") .OnColumn("contentNodeId").Ascending() @@ -68,4 +68,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenFiveZer { } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFourZero/AddDataDecimalColumn.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFourZero/AddDataDecimalColumn.cs index d40efd8633..bfc7c4416c 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFourZero/AddDataDecimalColumn.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFourZero/AddDataDecimalColumn.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; using Umbraco.Core.Configuration; using Umbraco.Core.Persistence.SqlSyntax; @@ -24,4 +24,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenFourZer { } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFourZero/AddUmbracoDeployTables.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFourZero/AddUmbracoDeployTables.cs index 42224f0609..54f2b6ed59 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFourZero/AddUmbracoDeployTables.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFourZero/AddUmbracoDeployTables.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; using Umbraco.Core.Configuration; using Umbraco.Core.Persistence.SqlSyntax; @@ -44,4 +44,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenFourZer public override void Down() { } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFourZero/AddUniqueIdPropertyTypeGroupColumn.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFourZero/AddUniqueIdPropertyTypeGroupColumn.cs index 137e56158f..2cb8459e1d 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFourZero/AddUniqueIdPropertyTypeGroupColumn.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFourZero/AddUniqueIdPropertyTypeGroupColumn.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.Collections.Generic; using System.Linq; @@ -91,4 +91,4 @@ ON cmsContentType.nodeId = umbracoNode.id")) public override void Down() { } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFourZero/EnsureContentTypeUniqueIdsAreConsistent.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFourZero/EnsureContentTypeUniqueIdsAreConsistent.cs index c9d14f31f9..ad9a88c275 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFourZero/EnsureContentTypeUniqueIdsAreConsistent.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFourZero/EnsureContentTypeUniqueIdsAreConsistent.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using NPoco; using Umbraco.Core.Configuration; @@ -18,7 +18,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenFourZer public EnsureContentTypeUniqueIdsAreConsistent(IMigrationContext context) : base(context) { } - + public override void Up() { var objectTypes = new[] @@ -52,4 +52,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenFourZer public override void Down() { } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFourZero/FixListViewMediaSortOrder.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFourZero/FixListViewMediaSortOrder.cs index 7d5195331f..d34eb29dfd 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFourZero/FixListViewMediaSortOrder.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFourZero/FixListViewMediaSortOrder.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; using NPoco; using Umbraco.Core.Configuration; using Umbraco.Core.Models.Rdbms; @@ -32,4 +32,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenFourZer { } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFourZero/RemoveParentIdPropertyTypeGroupColumn.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFourZero/RemoveParentIdPropertyTypeGroupColumn.cs index e0c9184905..6211b3d56b 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFourZero/RemoveParentIdPropertyTypeGroupColumn.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFourZero/RemoveParentIdPropertyTypeGroupColumn.cs @@ -29,7 +29,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenFourZer { Delete.ForeignKey("FK_cmsPropertyTypeGroup_cmsPropertyTypeGroup").OnTable("cmsPropertyTypeGroup"); } - + Delete.Column("parentGroupId").FromTable("cmsPropertyTypeGroup"); } diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenOneZero/AssignMissingPrimaryForMySqlKeys.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenOneZero/AssignMissingPrimaryForMySqlKeys.cs index d4338f3a06..23a5e7ca08 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenOneZero/AssignMissingPrimaryForMySqlKeys.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenOneZero/AssignMissingPrimaryForMySqlKeys.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; using Umbraco.Core.Configuration; using Umbraco.Core.Persistence.SqlSyntax; @@ -13,7 +13,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenOneZero [Migration("7.0.0", "7.1.0", 0, Constants.System.UmbracoMigrationName)] public class AssignMissingPrimaryForMySqlKeys : MigrationBase { - public AssignMissingPrimaryForMySqlKeys(IMigrationContext context) + public AssignMissingPrimaryForMySqlKeys(IMigrationContext context) : base(context) { } @@ -40,4 +40,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenOneZero //don't do anything, these keys should have always existed! } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenSixZero/AddIndexToCmsMemberLoginName.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenSixZero/AddIndexToCmsMemberLoginName.cs index 4df4c198c7..d96dd82823 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenSixZero/AddIndexToCmsMemberLoginName.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenSixZero/AddIndexToCmsMemberLoginName.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; using Umbraco.Core.Logging; using Umbraco.Core.Persistence.SqlSyntax; @@ -54,4 +54,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenSixZero Delete.Index("IX_cmsMember_LoginName").OnTable("cmsMember"); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenSixZero/AddIndexToUmbracoNodePath.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenSixZero/AddIndexToUmbracoNodePath.cs index ef342a27ab..351e77f871 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenSixZero/AddIndexToUmbracoNodePath.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenSixZero/AddIndexToUmbracoNodePath.cs @@ -31,4 +31,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenSixZero Delete.Index("IX_umbracoNodePath").OnTable("umbracoNode"); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenSixZero/AddIndexToUser2NodePermission.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenSixZero/AddIndexToUser2NodePermission.cs index 5a3110900d..9a8d90212b 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenSixZero/AddIndexToUser2NodePermission.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenSixZero/AddIndexToUser2NodePermission.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; using Umbraco.Core.Logging; using Umbraco.Core.Persistence.SqlSyntax; @@ -31,4 +31,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenSixZero Delete.Index("IX_umbracoUser2NodePermission_nodeId").OnTable("cmsMember"); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenSixZero/AddIndexesToUmbracoRelationTables.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenSixZero/AddIndexesToUmbracoRelationTables.cs index 1fa2f9f68a..5c08b32616 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenSixZero/AddIndexesToUmbracoRelationTables.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenSixZero/AddIndexesToUmbracoRelationTables.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using Umbraco.Core.Logging; using Umbraco.Core.Persistence.SqlSyntax; @@ -88,4 +88,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenSixZero Delete.Index("IX_umbracoNodePath").OnTable("umbracoNode"); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenSixZero/NormalizeTemplateGuids.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenSixZero/NormalizeTemplateGuids.cs index 3c76fd11cf..10a314cd08 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenSixZero/NormalizeTemplateGuids.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenSixZero/NormalizeTemplateGuids.cs @@ -29,7 +29,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenSixZero var version = database.FirstOrDefault("SELECT version FROM umbracoMigration WHERE name=@name ORDER BY version DESC", new { name = Constants.System.UmbracoMigrationName }); if (version != null && version.StartsWith("7.6.0")) return string.Empty; - var updates = database.Query(@"SELECT umbracoNode.id, cmsTemplate.alias FROM umbracoNode + var updates = database.Query(@"SELECT umbracoNode.id, cmsTemplate.alias FROM umbracoNode JOIN cmsTemplate ON umbracoNode.id=cmsTemplate.nodeId WHERE nodeObjectType = @guid", new { guid = Constants.ObjectTypes.TemplateTypeGuid}) .Select(template => Tuple.Create((int) template.id, ("template____" + (string) template.alias).ToGuid())) diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenSixZero/ReduceLoginNameColumnsSize.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenSixZero/ReduceLoginNameColumnsSize.cs index bbea258c3b..304b0d2bbf 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenSixZero/ReduceLoginNameColumnsSize.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenSixZero/ReduceLoginNameColumnsSize.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; using Umbraco.Core.Exceptions; using Umbraco.Core.Logging; using Umbraco.Core.Persistence.SqlSyntax; @@ -45,4 +45,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenSixZero }); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenSixZero/RemovePropertyDataIdIndex.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenSixZero/RemovePropertyDataIdIndex.cs index b6a5e42292..ec794dc17d 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenSixZero/RemovePropertyDataIdIndex.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenSixZero/RemovePropertyDataIdIndex.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; using Umbraco.Core.Configuration; using Umbraco.Core.Logging; using Umbraco.Core.Persistence.SqlSyntax; @@ -16,7 +16,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenSixZero { } public override void Up() - { + { //tuple = tablename, indexname, columnname, unique var indexes = SqlSyntax.GetDefinedIndexes(Context.Database).ToArray(); var found = indexes.FirstOrDefault( @@ -26,7 +26,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenSixZero if (found != null) { //drop the index - Delete.Index("IX_cmsPropertyData").OnTable("cmsPropertyData"); + Delete.Index("IX_cmsPropertyData").OnTable("cmsPropertyData"); } } @@ -34,4 +34,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenSixZero { } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeOne/UpdateUserLanguagesToIsoCode.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeOne/UpdateUserLanguagesToIsoCode.cs index 20e4ad59a3..3e781ab163 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeOne/UpdateUserLanguagesToIsoCode.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeOne/UpdateUserLanguagesToIsoCode.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; using NPoco; using Umbraco.Core.Configuration; using Umbraco.Core.Models.Rdbms; @@ -12,7 +12,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenThreeOn [Migration("7.3.1", 0, Constants.System.UmbracoMigrationName)] public class UpdateUserLanguagesToIsoCode : MigrationBase { - public UpdateUserLanguagesToIsoCode(IMigrationContext context) + public UpdateUserLanguagesToIsoCode(IMigrationContext context) : base(context) { } @@ -35,4 +35,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenThreeOn { } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeTwo/EnsureMigrationsTableIdentityIsCorrect.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeTwo/EnsureMigrationsTableIdentityIsCorrect.cs index 1b9d722e4a..fee75ed8a2 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeTwo/EnsureMigrationsTableIdentityIsCorrect.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeTwo/EnsureMigrationsTableIdentityIsCorrect.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using NPoco; using Umbraco.Core.Configuration; using Umbraco.Core.Models.Rdbms; @@ -13,7 +13,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenThreeTw [Migration("7.3.2", 0, Constants.System.UmbracoMigrationName)] public class EnsureMigrationsTableIdentityIsCorrect : MigrationBase { - public EnsureMigrationsTableIdentityIsCorrect(IMigrationContext context) + public EnsureMigrationsTableIdentityIsCorrect(IMigrationContext context) : base(context) { } @@ -47,4 +47,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenThreeTw { } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/AddExternalLoginsTable.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/AddExternalLoginsTable.cs index e5beef1cfa..b0d8ce1dd1 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/AddExternalLoginsTable.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/AddExternalLoginsTable.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; using Umbraco.Core.Configuration; using Umbraco.Core.Persistence.DatabaseModelDefinitions; using Umbraco.Core.Persistence.SqlSyntax; @@ -30,4 +30,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenThreeZe { } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/AddForeignKeysForLanguageAndDictionaryTables.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/AddForeignKeysForLanguageAndDictionaryTables.cs index b48839240f..6f265852c8 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/AddForeignKeysForLanguageAndDictionaryTables.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/AddForeignKeysForLanguageAndDictionaryTables.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Data; using System.Linq; using NPoco; @@ -33,8 +33,8 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenThreeZe var columns = SqlSyntax.GetColumnsInSchema(Context.Database).Distinct().ToArray(); - if (columns.Any(x => x.ColumnName.InvariantEquals("id") - && x.TableName.InvariantEquals("umbracoLanguage") + if (columns.Any(x => x.ColumnName.InvariantEquals("id") + && x.TableName.InvariantEquals("umbracoLanguage") && x.DataType.InvariantEquals("smallint"))) { //Ensure that the umbracoLanguage PK is INT and not SmallInt (which it might be in older db versions) @@ -43,7 +43,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenThreeZe .WithColumn("id").AsInt32().NotNullable().Identity() .WithColumn("languageISOCode").AsString(10).Nullable() .WithColumn("languageCultureName").AsString(50).Nullable(); - + var currentData = Context.Database.Fetch(Sql().SelectAll().From()); foreach (var languageDto in currentData) { @@ -51,7 +51,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenThreeZe .EnableIdentityInsert() .Row(new {id = languageDto.Id, languageISOCode = languageDto.IsoCode, languageCultureName = languageDto.CultureName}); } - + //ok, all data has been copied over, drop the old table, rename the temp table and re-add constraints. Delete.Table("umbracoLanguage"); Rename.Table("umbracoLanguage_TEMP").To("umbracoLanguage"); @@ -95,7 +95,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenThreeZe } - + } public override void Down() @@ -103,4 +103,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenThreeZe throw new NotImplementedException(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/AddMigrationTable.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/AddMigrationTable.cs index 9b71c8b0d6..9961002289 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/AddMigrationTable.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/AddMigrationTable.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; using Umbraco.Core.Configuration; using Umbraco.Core.Persistence.DatabaseModelDefinitions; using Umbraco.Core.Persistence.SqlSyntax; @@ -38,4 +38,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenThreeZe { } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/AddPublicAccessTables.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/AddPublicAccessTables.cs index ea85c053aa..242cf2866b 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/AddPublicAccessTables.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/AddPublicAccessTables.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; using Umbraco.Core.Configuration; using Umbraco.Core.Persistence.DatabaseModelDefinitions; using Umbraco.Core.Persistence.SqlSyntax; @@ -50,4 +50,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenThreeZe { } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/AddRelationTypeForDocumentOnDelete.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/AddRelationTypeForDocumentOnDelete.cs index d93ac1a55c..5bd94ce016 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/AddRelationTypeForDocumentOnDelete.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/AddRelationTypeForDocumentOnDelete.cs @@ -27,7 +27,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenThreeZe }); } - + } @@ -35,4 +35,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenThreeZe { } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/AddUniqueIdPropertyTypeColumn.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/AddUniqueIdPropertyTypeColumn.cs index 49966d89b2..c46c8d104d 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/AddUniqueIdPropertyTypeColumn.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/AddUniqueIdPropertyTypeColumn.cs @@ -1,10 +1,10 @@ -using System.Linq; +using System.Linq; using Umbraco.Core.Configuration; using Umbraco.Core.Persistence.DatabaseModelDefinitions; using Umbraco.Core.Persistence.SqlSyntax; namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenThreeZero -{ +{ [Migration("7.3.0", 13, Constants.System.UmbracoMigrationName)] public class AddUniqueIdPropertyTypeColumn : MigrationBase { @@ -54,4 +54,4 @@ ON cmsContentType.nodeId = umbracoNode.id")) public override void Down() { } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/AddUserColumns.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/AddUserColumns.cs index a91ceb25ca..4042efbc49 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/AddUserColumns.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/AddUserColumns.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; using Umbraco.Core.Configuration; using Umbraco.Core.Persistence.SqlSyntax; @@ -21,7 +21,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenThreeZe if (columns.Any(x => x.TableName.InvariantEquals("umbracoUser") && x.ColumnName.InvariantEquals("failedLoginAttempts")) == false) Create.Column("failedLoginAttempts").OnTable("umbracoUser").AsInt32().Nullable(); - + if (columns.Any(x => x.TableName.InvariantEquals("umbracoUser") && x.ColumnName.InvariantEquals("lastLockoutDate")) == false) Create.Column("lastLockoutDate").OnTable("umbracoUser").AsDateTime().Nullable(); @@ -36,4 +36,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenThreeZe { } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/CleanUpCorruptedPublishedFlags.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/CleanUpCorruptedPublishedFlags.cs index 102bdcc896..252c7ee5a0 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/CleanUpCorruptedPublishedFlags.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/CleanUpCorruptedPublishedFlags.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; using Umbraco.Core.Configuration; using Umbraco.Core.Models.Rdbms; using Umbraco.Core.Persistence.DatabaseModelDefinitions; @@ -44,4 +44,4 @@ ORDER BY nodeId, updateDate"; { } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/CreateCacheInstructionTable.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/CreateCacheInstructionTable.cs index 6b21536e1b..e618185446 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/CreateCacheInstructionTable.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/CreateCacheInstructionTable.cs @@ -30,7 +30,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenThreeZe .WithColumn("utcStamp").AsDateTime().NotNullable() .WithColumn("jsonInstruction").AsCustom(textType).NotNullable() .WithColumn("originated").AsString(500).NotNullable(); - + } public override void Down() diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/MigrateAndRemoveTemplateMasterColumn.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/MigrateAndRemoveTemplateMasterColumn.cs index b4ab81a4c1..9b445fd06f 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/MigrateAndRemoveTemplateMasterColumn.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/MigrateAndRemoveTemplateMasterColumn.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using NPoco; using Umbraco.Core.Configuration; @@ -30,15 +30,15 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenThreeZe { return; } - + var constraints = SqlSyntax.GetConstraintsPerColumn(Context.Database).Distinct().ToArray(); //update the parentId column for all templates to be correct so it matches the current 'master' template //In some old corrupted databases, the information will not be correct in the master column so we need to fix that //first by nulling out the master column where the id doesn't actually exist - Execute.Sql(@"UPDATE cmsTemplate SET master = NULL WHERE " + - SqlSyntax.GetQuotedColumnName("master") + @" IS NOT NULL AND " + + Execute.Sql(@"UPDATE cmsTemplate SET master = NULL WHERE " + + SqlSyntax.GetQuotedColumnName("master") + @" IS NOT NULL AND " + SqlSyntax.GetQuotedColumnName("master") + @" NOT IN (" + //Stupid MySQL... needs this stupid syntax because it can do an update with a sub query of itself, // yet it can do one with a sub sub query @@ -96,7 +96,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenThreeZe return string.Empty; }); - + //now remove the master column and key if (DatabaseType.IsMySql()) @@ -113,7 +113,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenThreeZe { if (constraints.Any(x => x.Item1.InvariantEquals("cmsTemplate") && x.Item3.InvariantEquals("FK_cmsTemplate_cmsTemplate"))) { - Delete.ForeignKey("FK_cmsTemplate_cmsTemplate").OnTable("cmsTemplate"); + Delete.ForeignKey("FK_cmsTemplate_cmsTemplate").OnTable("cmsTemplate"); } //TODO: Hopefully it's not named something else silly in some crazy old versions @@ -138,7 +138,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenThreeZe if (cols.Any(x => x.ColumnName.InvariantEquals("master") && x.TableName.InvariantEquals("cmsTemplate"))) { - Delete.Column("master").FromTable("cmsTemplate"); + Delete.Column("master").FromTable("cmsTemplate"); } } @@ -168,4 +168,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenThreeZe return path; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/MigrateStylesheetDataToFile.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/MigrateStylesheetDataToFile.cs index 0bb9e83227..438b6b43ca 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/MigrateStylesheetDataToFile.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/MigrateStylesheetDataToFile.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.IO; using System.Linq; using System.Text; @@ -11,11 +11,11 @@ using File = System.IO.File; namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenThreeZero { /// - /// Ensures that any stylesheets that have properties defined at the db level have the correct new syntax + /// Ensures that any stylesheets that have properties defined at the db level have the correct new syntax /// in their files before we remove the stylesheet db tables /// /// - /// Instead of modifying the files directly (since we cannot roll them back) we will create temporary migrated files. + /// Instead of modifying the files directly (since we cannot roll them back) we will create temporary migrated files. /// These files will then be copied over once the entire migration is complete so that if any migration fails and the db changes are /// rolled back, the original files won't be affected. /// @@ -32,14 +32,14 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenThreeZe var tables = SqlSyntax.GetTablesInSchema(Context.Database).ToArray(); if (tables.InvariantContains("cmsStylesheet") == false) return; - //This is all rather nasty but it's how stylesheets used to work in the 2 various ugly ways so we just have to + //This is all rather nasty but it's how stylesheets used to work in the 2 various ugly ways so we just have to // deal with that to get this migration done var tempFolder = IOHelper.MapPath("~/App_Data/TEMP/CssMigration/"); if (Directory.Exists(tempFolder)) { - //clear any existing css files (we back the real ones up so if this migration is run again for whatever reason anything that + //clear any existing css files (we back the real ones up so if this migration is run again for whatever reason anything that // was previously backed up is still there, backup happens in a post migration: OverwriteStylesheetFilesFromTempFiles class) var files = Directory.GetFiles(tempFolder, "*.css", SearchOption.AllDirectories); foreach (var file in files) @@ -65,7 +65,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenThreeZe var fileContent = string.Empty; - //check for file and read in it's data - umbraco properties will only be kept that are in the db, + //check for file and read in it's data - umbraco properties will only be kept that are in the db, // anything below the infamous: /* EDITOR PROPERTIES - PLEASE DON'T DELETE THIS LINE TO AVOID DUPLICATE PROPERTIES */ // line is an Umbraco property and therefore anything that is there that is not in the db will be cleared. @@ -138,4 +138,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenThreeZe return content; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/MovePublicAccessXmlDataToDb.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/MovePublicAccessXmlDataToDb.cs index d891902537..19cb572c56 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/MovePublicAccessXmlDataToDb.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/MovePublicAccessXmlDataToDb.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.IO; using System.Linq; using System.Xml.Linq; @@ -30,7 +30,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenThreeZe } var xmlFile = IOHelper.MapPath(SystemDirectories.Data + "/access.config"); - + if (File.Exists(xmlFile) == false) return; using (var fileStream = File.OpenRead(xmlFile)) @@ -127,4 +127,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenThreeZe { } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/RemoveHelpTextColumn.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/RemoveHelpTextColumn.cs index 8e0468503a..4a90a5890b 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/RemoveHelpTextColumn.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/RemoveHelpTextColumn.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; using Umbraco.Core.Configuration; using Umbraco.Core.Persistence.SqlSyntax; @@ -25,4 +25,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenThreeZe { } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/RemoveLanguageLocaleColumn.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/RemoveLanguageLocaleColumn.cs index d72fdd9094..d9e081ea46 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/RemoveLanguageLocaleColumn.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/RemoveLanguageLocaleColumn.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; using Umbraco.Core.Configuration; using Umbraco.Core.Persistence.SqlSyntax; @@ -25,4 +25,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenThreeZe { } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/RemoveStylesheetDataAndTables.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/RemoveStylesheetDataAndTables.cs index 3421f0d22b..baedb6486f 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/RemoveStylesheetDataAndTables.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/RemoveStylesheetDataAndTables.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using Umbraco.Core.Configuration; using Umbraco.Core.Persistence.SqlSyntax; @@ -37,4 +37,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenThreeZe throw new NotSupportedException("Cannot downgrade from 7.3 as there are database table deletions"); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/RemoveUmbracoLoginsTable.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/RemoveUmbracoLoginsTable.cs index bb673f0406..b51d940360 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/RemoveUmbracoLoginsTable.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/RemoveUmbracoLoginsTable.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; using Umbraco.Core.Configuration; using Umbraco.Core.Persistence.SqlSyntax; @@ -15,7 +15,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenThreeZe { if (SqlSyntax.GetColumnsInSchema(Context.Database).Any(x => x.TableName.InvariantEquals("umbracoUserLogins"))) { - Delete.Table("umbracoUserLogins"); + Delete.Table("umbracoUserLogins"); } } @@ -24,4 +24,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenThreeZe throw new System.NotImplementedException(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/UpdateUniqueIdToHaveCorrectIndexType.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/UpdateUniqueIdToHaveCorrectIndexType.cs index 340b5c06da..e3a3ce931f 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/UpdateUniqueIdToHaveCorrectIndexType.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/UpdateUniqueIdToHaveCorrectIndexType.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; using Umbraco.Core.Configuration; using Umbraco.Core.Persistence.DatabaseModelDefinitions; using Umbraco.Core.Persistence.SqlSyntax; @@ -48,4 +48,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenThreeZe { } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenTwoZero/AddIndexToUmbracoNodeTable.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenTwoZero/AddIndexToUmbracoNodeTable.cs index edcf481518..ba2de4fe2f 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenTwoZero/AddIndexToUmbracoNodeTable.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenTwoZero/AddIndexToUmbracoNodeTable.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; using Umbraco.Core.Configuration; using Umbraco.Core.Persistence.DatabaseModelDefinitions; using Umbraco.Core.Persistence.SqlSyntax; @@ -10,13 +10,13 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenTwoZero { private readonly bool _skipIndexCheck; - internal AddIndexToUmbracoNodeTable(bool skipIndexCheck, IMigrationContext context) + internal AddIndexToUmbracoNodeTable(bool skipIndexCheck, IMigrationContext context) : base(context) { _skipIndexCheck = skipIndexCheck; } - public AddIndexToUmbracoNodeTable(IMigrationContext context) + public AddIndexToUmbracoNodeTable(IMigrationContext context) : base(context) { } @@ -43,4 +43,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenTwoZero Delete.Index("IX_umbracoNodeUniqueID").OnTable("umbracoNode"); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenTwoZero/AddMissingForeignKeyForContentType.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenTwoZero/AddMissingForeignKeyForContentType.cs index 2e5c90fb78..aed682e0be 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenTwoZero/AddMissingForeignKeyForContentType.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenTwoZero/AddMissingForeignKeyForContentType.cs @@ -1,4 +1,4 @@ -using System.Data; +using System.Data; using System.Linq; using Umbraco.Core.Configuration; using Umbraco.Core.Logging; @@ -11,7 +11,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenTwoZero [Migration("7.2.0", 1, Constants.System.UmbracoMigrationName)] public class AddMissingForeignKeyForContentType : MigrationBase { - public AddMissingForeignKeyForContentType(IMigrationContext context) + public AddMissingForeignKeyForContentType(IMigrationContext context) : base(context) { } @@ -45,7 +45,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenTwoZero Delete.FromTable("umbracoNode").Row(new { id = orphanedId }); } - //Some very old schemas don't have an index on the cmsContentType.nodeId column, I'm not actually sure when it was added but + //Some very old schemas don't have an index on the cmsContentType.nodeId column, I'm not actually sure when it was added but // it is absolutely required to exist in order to add other foreign keys and much better for perf, so we'll need to check it's existence // this came to light from this issue: http://issues.umbraco.org/issue/U4-4133 var dbIndexes = SqlSyntax.GetDefinedIndexes(Context.Database) @@ -82,4 +82,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenTwoZero throw new DataLossException("Cannot downgrade from a version 7.2 database to a prior version, the database schema has already been modified"); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenTwoZero/AlterDataTypePreValueTable.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenTwoZero/AlterDataTypePreValueTable.cs index 982cee048f..a79baa86a0 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenTwoZero/AlterDataTypePreValueTable.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenTwoZero/AlterDataTypePreValueTable.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; using AutoMapper; using Umbraco.Core.Configuration; using Umbraco.Core.Logging; @@ -12,7 +12,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenTwoZero [Migration("7.2.0", 0, Constants.System.UmbracoMigrationName)] public class AlterDataTypePreValueTable : MigrationBase { - public AlterDataTypePreValueTable(IMigrationContext context) + public AlterDataTypePreValueTable(IMigrationContext context) : base(context) { } @@ -41,4 +41,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenTwoZero Alter.Table("cmsDataTypePreValues").AlterColumn("value").AsString(2500).Nullable(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenTwoZero/RemoveCmsDocumentAliasColumn.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenTwoZero/RemoveCmsDocumentAliasColumn.cs index 0c907b534c..ede620994a 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenTwoZero/RemoveCmsDocumentAliasColumn.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenTwoZero/RemoveCmsDocumentAliasColumn.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; using Umbraco.Core.Configuration; using Umbraco.Core.Logging; using Umbraco.Core.Persistence.SqlSyntax; @@ -8,7 +8,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenTwoZero [Migration("7.2.0", 2, Constants.System.UmbracoMigrationName)] public class RemoveCmsDocumentAliasColumn : MigrationBase { - public RemoveCmsDocumentAliasColumn(IMigrationContext context) + public RemoveCmsDocumentAliasColumn(IMigrationContext context) : base(context) { } @@ -25,4 +25,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenTwoZero public override void Down() { } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSix/DeleteAppTables.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSix/DeleteAppTables.cs index fc3039705f..f67f7d7d3e 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSix/DeleteAppTables.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSix/DeleteAppTables.cs @@ -9,7 +9,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSix [Migration("6.0.0", 10, Constants.System.UmbracoMigrationName)] public class DeleteAppTables : MigrationBase { - public DeleteAppTables(IMigrationContext context) + public DeleteAppTables(IMigrationContext context) : base(context) { } @@ -19,7 +19,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSix Delete.Table("umbracoAppTree"); //NOTE: this is a hack since old umbraco versions might not have had their db's upgraded correctly so they are all quite inconsistent. - // This is actually done in migration: RemoveUmbracoAppConstraints to target 4.9.0 but we've found with some db's that are currently at 4.9.1, + // This is actually done in migration: RemoveUmbracoAppConstraints to target 4.9.0 but we've found with some db's that are currently at 4.9.1, // these upgrades did not run. So, now we not only have to check if these constraints exist, but we also have to check if the RemoveUmbracoAppConstraints // has executed since we cannot drop the same foreign key twice or we'll get errors. @@ -52,4 +52,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSix throw new DataLossException("Cannot rollback migration " + typeof(DeleteAppTables) + " the db tables umbracoAppTree and umbracoApp have been droppped"); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSix/EnsureAppsTreesUpdated.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSix/EnsureAppsTreesUpdated.cs index 4bf55908bd..cb949d8bfc 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSix/EnsureAppsTreesUpdated.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSix/EnsureAppsTreesUpdated.cs @@ -29,4 +29,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSix public class UpgradingEventArgs : EventArgs { } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSix/MoveMasterContentTypeData.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSix/MoveMasterContentTypeData.cs index 7ec1689ccd..cd8112910b 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSix/MoveMasterContentTypeData.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSix/MoveMasterContentTypeData.cs @@ -7,7 +7,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSix [Migration("6.0.0", 5, Constants.System.UmbracoMigrationName)] public class MoveMasterContentTypeData : MigrationBase { - public MoveMasterContentTypeData(IMigrationContext context) + public MoveMasterContentTypeData(IMigrationContext context) : base(context) { } @@ -33,4 +33,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSix { } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSix/NewCmsContentType2ContentTypeTable.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSix/NewCmsContentType2ContentTypeTable.cs index 3d907ab754..d1f7732755 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSix/NewCmsContentType2ContentTypeTable.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSix/NewCmsContentType2ContentTypeTable.cs @@ -7,7 +7,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSix [Migration("6.0.0", 4, Constants.System.UmbracoMigrationName)] public class NewCmsContentType2ContentTypeTable : MigrationBase { - public NewCmsContentType2ContentTypeTable(IMigrationContext context) + public NewCmsContentType2ContentTypeTable(IMigrationContext context) : base(context) { } @@ -30,4 +30,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSix Delete.Table("cmsContentType2ContentType"); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSix/RemoveMasterContentTypeColumn.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSix/RemoveMasterContentTypeColumn.cs index af0cbe14cc..4d46d7708b 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSix/RemoveMasterContentTypeColumn.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSix/RemoveMasterContentTypeColumn.cs @@ -8,7 +8,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSix [Migration("6.0.0", 6, Constants.System.UmbracoMigrationName)] public class RemoveMasterContentTypeColumn : MigrationBase { - public RemoveMasterContentTypeColumn(IMigrationContext context) + public RemoveMasterContentTypeColumn(IMigrationContext context) : base(context) { } @@ -28,4 +28,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSix Create.Column("masterContentType").OnTable("cmsContentType").AsInt16().Nullable().WithDefaultValue(0); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSix/RenameCmsTabTable.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSix/RenameCmsTabTable.cs index 21ad3841cd..980a0ce63d 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSix/RenameCmsTabTable.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSix/RenameCmsTabTable.cs @@ -7,7 +7,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSix [Migration("6.0.0", 0, Constants.System.UmbracoMigrationName)] public class RenameCmsTabTable : MigrationBase { - public RenameCmsTabTable(IMigrationContext context) + public RenameCmsTabTable(IMigrationContext context) : base(context) { } @@ -22,4 +22,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSix Rename.Table("cmsPropertyTypeGroup").To("cmsTab"); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSix/RenameTabIdColumn.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSix/RenameTabIdColumn.cs index 9ea074abc6..dc84c065c9 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSix/RenameTabIdColumn.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSix/RenameTabIdColumn.cs @@ -9,7 +9,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSix [Migration("6.0.0", 7, Constants.System.UmbracoMigrationName)] public class RenameTabIdColumn : MigrationBase { - public RenameTabIdColumn(IMigrationContext context) + public RenameTabIdColumn(IMigrationContext context) : base(context) { } @@ -79,4 +79,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSix .Delete.Column("propertyTypeGroupId").FromTable("propertyTypeGroupId"); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSix/UpdateCmsContentTypeAllowedContentTypeTable.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSix/UpdateCmsContentTypeAllowedContentTypeTable.cs index e8ac2c0387..7c837f5dfe 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSix/UpdateCmsContentTypeAllowedContentTypeTable.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSix/UpdateCmsContentTypeAllowedContentTypeTable.cs @@ -7,7 +7,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSix [Migration("6.0.0", 3, Constants.System.UmbracoMigrationName)] public class UpdateCmsContentTypeAllowedContentTypeTable : MigrationBase { - public UpdateCmsContentTypeAllowedContentTypeTable(IMigrationContext context) + public UpdateCmsContentTypeAllowedContentTypeTable(IMigrationContext context) : base(context) { } @@ -22,4 +22,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSix Delete.Column("sortOrder").FromTable("cmsContentTypeAllowedContentType"); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSix/UpdateCmsContentTypeTable.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSix/UpdateCmsContentTypeTable.cs index 8948bab1ff..3b79dd0294 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSix/UpdateCmsContentTypeTable.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSix/UpdateCmsContentTypeTable.cs @@ -9,7 +9,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSix [Migration("6.0.0", 2, Constants.System.UmbracoMigrationName)] public class UpdateCmsContentTypeTable : MigrationBase { - public UpdateCmsContentTypeTable(IMigrationContext context) + public UpdateCmsContentTypeTable(IMigrationContext context) : base(context) { } @@ -28,4 +28,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSix Delete.Column("isContainer").FromTable("cmsContentType"); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSix/UpdateCmsContentVersionTable.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSix/UpdateCmsContentVersionTable.cs index 2c41d408b0..892531d0c0 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSix/UpdateCmsContentVersionTable.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSix/UpdateCmsContentVersionTable.cs @@ -7,7 +7,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSix [Migration("6.0.0", 8, Constants.System.UmbracoMigrationName)] public class UpdateCmsContentVersionTable : MigrationBase { - public UpdateCmsContentVersionTable(IMigrationContext context) + public UpdateCmsContentVersionTable(IMigrationContext context) : base(context) { } @@ -22,4 +22,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSix Delete.Column("LanguageLocale").FromTable("cmsContentVersion"); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSix/UpdateCmsPropertyTypeGroupTable.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSix/UpdateCmsPropertyTypeGroupTable.cs index 120b60755e..73986f3c0e 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSix/UpdateCmsPropertyTypeGroupTable.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSix/UpdateCmsPropertyTypeGroupTable.cs @@ -8,7 +8,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSix [Migration("6.0.0", 1, Constants.System.UmbracoMigrationName)] public class UpdateCmsPropertyTypeGroupTable : MigrationBase { - public UpdateCmsPropertyTypeGroupTable(IMigrationContext context) + public UpdateCmsPropertyTypeGroupTable(IMigrationContext context) : base(context) { } @@ -29,4 +29,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSix Delete.Column("parentGroupId").FromTable("cmsPropertyTypeGroup"); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSixOneZero/CreateServerRegistryTable.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSixOneZero/CreateServerRegistryTable.cs index 346a09bd2f..75ef49cd8f 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSixOneZero/CreateServerRegistryTable.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSixOneZero/CreateServerRegistryTable.cs @@ -13,7 +13,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSixOneZero [Migration("6.1.0", 0, Constants.System.UmbracoMigrationName)] public class CreateServerRegistryTable : MigrationBase { - public CreateServerRegistryTable(IMigrationContext context) + public CreateServerRegistryTable(IMigrationContext context) : base(context) { } diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSixTwoZero/AddChangeDocumentTypePermission.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSixTwoZero/AddChangeDocumentTypePermission.cs index eb1669b252..8a524422ca 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSixTwoZero/AddChangeDocumentTypePermission.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSixTwoZero/AddChangeDocumentTypePermission.cs @@ -11,7 +11,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSixTwoZero [Migration("6.2.0", 3, Constants.System.UmbracoMigrationName)] public class AddChangeDocumentTypePermission : MigrationBase { - public AddChangeDocumentTypePermission(IMigrationContext context) + public AddChangeDocumentTypePermission(IMigrationContext context) : base(context) { } @@ -58,4 +58,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSixTwoZero return string.Empty; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSixTwoZero/AdditionalIndexesAndKeys.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSixTwoZero/AdditionalIndexesAndKeys.cs index 3e9394c2a8..c7293dedce 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSixTwoZero/AdditionalIndexesAndKeys.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSixTwoZero/AdditionalIndexesAndKeys.cs @@ -12,7 +12,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSixTwoZero [Migration("6.2.0", 1, Constants.System.UmbracoMigrationName)] public class AdditionalIndexesAndKeys : MigrationBase { - public AdditionalIndexesAndKeys(IMigrationContext context) + public AdditionalIndexesAndKeys(IMigrationContext context) : base(context) { } @@ -56,7 +56,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSixTwoZero && sqlServerSyntax.ServerVersion.ProductVersion.StartsWith("11.")) // version 11.x { // SQL Azure v2 does not support dropping clustered indexes on a table - // see http://issues.umbraco.org/issue/U4-5673 + // see http://issues.umbraco.org/issue/U4-5673 // and so we have to use a special method to do some manual work if (dbIndexes.Any(x => x.IndexName.InvariantEquals("umbracoUserLogins_Index"))) { @@ -91,18 +91,18 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSixTwoZero { Context.Database.Execute(@"CREATE TABLE ""umbracoUserLogins_temp"" ( - contextID uniqueidentifier NOT NULL, - userID int NOT NULL, - [timeout] bigint NOT NULL + contextID uniqueidentifier NOT NULL, + userID int NOT NULL, + [timeout] bigint NOT NULL ); CREATE CLUSTERED INDEX ""IX_umbracoUserLogins_Index"" ON ""umbracoUserLogins_temp"" (""contextID""); INSERT INTO ""umbracoUserLogins_temp"" SELECT * FROM ""umbracoUserLogins"" DROP TABLE ""umbracoUserLogins"" CREATE TABLE ""umbracoUserLogins"" ( - contextID uniqueidentifier NOT NULL, - userID int NOT NULL, - [timeout] bigint NOT NULL + contextID uniqueidentifier NOT NULL, + userID int NOT NULL, + [timeout] bigint NOT NULL ); CREATE CLUSTERED INDEX ""IX_umbracoUserLogins_Index"" ON ""umbracoUserLogins"" (""contextID""); INSERT INTO ""umbracoUserLogins"" SELECT * FROM ""umbracoUserLogins_temp"" @@ -110,4 +110,4 @@ DROP TABLE ""umbracoUserLogins_temp"""); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSixTwoZero/AssignMissingPrimaryForMySqlKeys.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSixTwoZero/AssignMissingPrimaryForMySqlKeys.cs index 9c86056aa7..0ba18b65c0 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSixTwoZero/AssignMissingPrimaryForMySqlKeys.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSixTwoZero/AssignMissingPrimaryForMySqlKeys.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; using System.Web.UI; using Umbraco.Core.Configuration; using Umbraco.Core.Logging; @@ -12,7 +12,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSixTwoZero [Migration("6.2.0", 0, Constants.System.UmbracoMigrationName)] public class AssignMissingPrimaryForMySqlKeys : MigrationBase { - public AssignMissingPrimaryForMySqlKeys(IMigrationContext context) + public AssignMissingPrimaryForMySqlKeys(IMigrationContext context) : base(context) { } @@ -86,4 +86,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSixTwoZero //don't do anything, these keys should have always existed! } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSixTwoZero/AssignMissingPrimaryForMySqlKeys2.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSixTwoZero/AssignMissingPrimaryForMySqlKeys2.cs index 81be21bf92..6b698a3f4b 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSixTwoZero/AssignMissingPrimaryForMySqlKeys2.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSixTwoZero/AssignMissingPrimaryForMySqlKeys2.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; using Umbraco.Core.Configuration; using Umbraco.Core.Logging; using Umbraco.Core.Persistence.SqlSyntax; @@ -11,7 +11,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSixTwoZero [Migration("6.0.0", "6.2.0", 0, Constants.System.UmbracoMigrationName)] public class AssignMissingPrimaryForMySqlKeys2 : MigrationBase { - public AssignMissingPrimaryForMySqlKeys2(IMigrationContext context) + public AssignMissingPrimaryForMySqlKeys2(IMigrationContext context) : base(context) { } @@ -37,4 +37,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSixTwoZero //don't do anything, these keys should have always existed! } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSixTwoZero/ChangePasswordColumn.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSixTwoZero/ChangePasswordColumn.cs index 298b0a44f0..e226cb0f68 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSixTwoZero/ChangePasswordColumn.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSixTwoZero/ChangePasswordColumn.cs @@ -1,4 +1,4 @@ -using System; +using System; using Umbraco.Core.Configuration; using Umbraco.Core.Logging; using Umbraco.Core.Persistence.SqlSyntax; @@ -9,7 +9,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSixTwoZero [Migration("6.2.0", 2, Constants.System.UmbracoMigrationName)] public class ChangePasswordColumn : MigrationBase { - public ChangePasswordColumn(IMigrationContext context) + public ChangePasswordColumn(IMigrationContext context) : base(context) { } @@ -26,4 +26,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSixTwoZero Alter.Table("umbracoUser").AlterColumn("userPassword").AsString(125).NotNullable(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSixTwoZero/UpdateToNewMemberPropertyAliases.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSixTwoZero/UpdateToNewMemberPropertyAliases.cs index 2d639fe6d7..788d9f6fa3 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSixTwoZero/UpdateToNewMemberPropertyAliases.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSixTwoZero/UpdateToNewMemberPropertyAliases.cs @@ -12,7 +12,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSixTwoZero [Migration("6.2.0", 4, Constants.System.UmbracoMigrationName)] public class UpdateToNewMemberPropertyAliases : MigrationBase { - public UpdateToNewMemberPropertyAliases(IMigrationContext context) + public UpdateToNewMemberPropertyAliases(IMigrationContext context) : base(context) { } @@ -50,7 +50,7 @@ INNER JOIN cmsContentType ON cmsPropertyType.contentTypeId = cmsContentType.node INNER JOIN umbracoNode ON cmsContentType.nodeId = umbracoNode.id WHERE umbracoNode.nodeObjectType = @objectType) x)"; - const string xmlSelectSql = @"SELECT cmsContentXml.* FROM cmsContentXml + const string xmlSelectSql = @"SELECT cmsContentXml.* FROM cmsContentXml INNER JOIN umbracoNode ON cmsContentXml.nodeId = umbracoNode.id WHERE umbracoNode.nodeObjectType = @objectType"; diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSixZeroOne/UpdatePropertyTypesAndGroups.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSixZeroOne/UpdatePropertyTypesAndGroups.cs index 1e51558508..3fd39d3e7a 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSixZeroOne/UpdatePropertyTypesAndGroups.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSixZeroOne/UpdatePropertyTypesAndGroups.cs @@ -11,7 +11,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSixZeroOne [Migration("6.0.2", 0, Constants.System.UmbracoMigrationName)] public class UpdatePropertyTypesAndGroups : MigrationBase { - public UpdatePropertyTypesAndGroups(IMigrationContext context) + public UpdatePropertyTypesAndGroups(IMigrationContext context) : base(context) { } @@ -30,7 +30,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSixZeroOne { if (database != null) { - //Fetch all PropertyTypes that belongs to a PropertyTypeGroup + //Fetch all PropertyTypes that belongs to a PropertyTypeGroup //NOTE: We are writing the full query because we've added a column to the PropertyTypeDto in later versions so one of the columns // won't exist yet var propertyTypes = database.Fetch("SELECT * FROM cmsPropertyType WHERE propertyTypeGroupId > 0"); @@ -94,4 +94,4 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSixZeroOne public int sortorder { get; set; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/NPocoDatabaseExtensions.cs b/src/Umbraco.Core/Persistence/NPocoDatabaseExtensions.cs index 34ef2d536d..8a69df36e3 100644 --- a/src/Umbraco.Core/Persistence/NPocoDatabaseExtensions.cs +++ b/src/Umbraco.Core/Persistence/NPocoDatabaseExtensions.cs @@ -223,4 +223,4 @@ namespace Umbraco.Core.Persistence return source.SelectByGroups(x => db.Fetch(sqlFactory(x)), groupSize); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/PocoDataDataReader.cs b/src/Umbraco.Core/Persistence/PocoDataDataReader.cs index e1b3f4e88e..5b3333ee33 100644 --- a/src/Umbraco.Core/Persistence/PocoDataDataReader.cs +++ b/src/Umbraco.Core/Persistence/PocoDataDataReader.cs @@ -15,13 +15,13 @@ namespace Umbraco.Core.Persistence /// /// We are using a custom data reader so that tons of memory is not consumed when rebuilding this table, previously /// we'd generate SQL insert statements, but we'd have to put all of the XML structures into memory first. Alternatively - /// we can use .net's DataTable, but this also requires putting everything into memory. By using a DataReader we don't have to - /// store every content item and it's XML structure in memory to get it into the DB, we can stream it into the db with this + /// we can use .net's DataTable, but this also requires putting everything into memory. By using a DataReader we don't have to + /// store every content item and it's XML structure in memory to get it into the DB, we can stream it into the db with this /// reader. /// - internal class PocoDataDataReader : BulkDataReader + internal class PocoDataDataReader : BulkDataReader where TSyntax : ISqlSyntaxProvider - { + { private readonly MicrosoftSqlSyntaxProviderBase _sqlSyntaxProvider; private readonly TableDefinition _tableDefinition; private readonly PocoColumn[] _readerColumns; @@ -30,21 +30,21 @@ namespace Umbraco.Core.Persistence private int _recordsAffected = -1; public PocoDataDataReader( - IEnumerable dataSource, + IEnumerable dataSource, PocoData pd, MicrosoftSqlSyntaxProviderBase sqlSyntaxProvider) { - if (dataSource == null) throw new ArgumentNullException(nameof(dataSource)); + if (dataSource == null) throw new ArgumentNullException(nameof(dataSource)); if (sqlSyntaxProvider == null) throw new ArgumentNullException(nameof(sqlSyntaxProvider)); _tableDefinition = DefinitionFactory.GetTableDefinition(pd.Type, sqlSyntaxProvider); if (_tableDefinition == null) throw new InvalidOperationException("No table definition found for type " + pd.Type); - + _readerColumns = pd.Columns.Select(x => x.Value).ToArray(); _sqlSyntaxProvider = sqlSyntaxProvider; _enumerator = dataSource.GetEnumerator(); _columnDefinitions = _tableDefinition.Columns.ToArray(); - + } protected override string SchemaName => _tableDefinition.SchemaName; @@ -88,13 +88,13 @@ namespace Umbraco.Core.Persistence //get the SqlDbType from the clr type sqlDbType = _sqlSyntaxProvider.GetSqlDbType(col.PropertyType); } - + AddSchemaTableRow( - col.Name, + col.Name, col.Size > 0 ? (int?)col.Size : null, - col.Precision > 0 ? (short?)col.Precision : null, - null, col.IsUnique, col.IsIdentity, col.IsNullable, sqlDbType, - null, null, null, null, null); + col.Precision > 0 ? (short?)col.Precision : null, + null, col.IsUnique, col.IsIdentity, col.IsNullable, sqlDbType, + null, null, null, null, null); } } @@ -136,4 +136,4 @@ namespace Umbraco.Core.Persistence _enumerator.Dispose(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Querying/CachedExpression.cs b/src/Umbraco.Core/Persistence/Querying/CachedExpression.cs index 5c502ec170..7c7a6ccdbd 100644 --- a/src/Umbraco.Core/Persistence/Querying/CachedExpression.cs +++ b/src/Umbraco.Core/Persistence/Querying/CachedExpression.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq.Expressions; namespace Umbraco.Core.Persistence.Querying @@ -45,4 +45,4 @@ namespace Umbraco.Core.Persistence.Querying InnerExpression = expression; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Querying/ExpressionVisitorBase.cs b/src/Umbraco.Core/Persistence/Querying/ExpressionVisitorBase.cs index b2815f8b8a..214cf950c5 100644 --- a/src/Umbraco.Core/Persistence/Querying/ExpressionVisitorBase.cs +++ b/src/Umbraco.Core/Persistence/Querying/ExpressionVisitorBase.cs @@ -541,12 +541,12 @@ namespace Umbraco.Core.Persistence.Querying case "InvariantContains": case "InvariantEquals": - //special case, if it is 'Contains' and the argumet that Contains is being called on is + //special case, if it is 'Contains' and the argumet that Contains is being called on is //Enumerable and the methodArgs is the actual member access, then it's an SQL IN claus - if (m.Object == null + if (m.Object == null && m.Arguments[0].Type != typeof(string) && m.Arguments.Count == 2 - && methodArgs.Length == 1 + && methodArgs.Length == 1 && methodArgs[0].NodeType == ExpressionType.MemberAccess && TypeHelper.IsTypeAssignableFrom(m.Arguments[0].Type)) { @@ -675,7 +675,7 @@ namespace Umbraco.Core.Persistence.Querying if (m.Object == null && methodArgs.Length == 1 && methodArgs[0].NodeType == ExpressionType.MemberAccess) { var memberAccess = VisitMemberAccess((MemberExpression) methodArgs[0]); - + var member = Expression.Convert(m.Arguments[0], typeof(object)); var lambda = Expression.Lambda>(member); var getter = lambda.Compile(); @@ -884,4 +884,4 @@ namespace Umbraco.Core.Persistence.Querying // return expression; //} } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Querying/IQuery.cs b/src/Umbraco.Core/Persistence/Querying/IQuery.cs index 88b337a634..9528d25c09 100644 --- a/src/Umbraco.Core/Persistence/Querying/IQuery.cs +++ b/src/Umbraco.Core/Persistence/Querying/IQuery.cs @@ -32,4 +32,4 @@ namespace Umbraco.Core.Persistence.Querying /// This instance so calls to this method are chainable IQuery WhereIn(Expression> fieldSelector, IEnumerable values); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Querying/ModelToSqlExpressionVisitor.cs b/src/Umbraco.Core/Persistence/Querying/ModelToSqlExpressionVisitor.cs index dc27adee6d..d1a8468185 100644 --- a/src/Umbraco.Core/Persistence/Querying/ModelToSqlExpressionVisitor.cs +++ b/src/Umbraco.Core/Persistence/Querying/ModelToSqlExpressionVisitor.cs @@ -119,4 +119,4 @@ namespace Umbraco.Core.Persistence.Querying return constExpr != null; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Querying/PocoToSqlExpressionVisitor.cs b/src/Umbraco.Core/Persistence/Querying/PocoToSqlExpressionVisitor.cs index f60cadbde5..65bc2f9a77 100644 --- a/src/Umbraco.Core/Persistence/Querying/PocoToSqlExpressionVisitor.cs +++ b/src/Umbraco.Core/Persistence/Querying/PocoToSqlExpressionVisitor.cs @@ -66,4 +66,4 @@ namespace Umbraco.Core.Persistence.Querying return $"{tableName}.{columnName}"; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Querying/Query.cs b/src/Umbraco.Core/Persistence/Querying/Query.cs index 529a11e5a3..a68df57aa3 100644 --- a/src/Umbraco.Core/Persistence/Querying/Query.cs +++ b/src/Umbraco.Core/Persistence/Querying/Query.cs @@ -63,4 +63,4 @@ namespace Umbraco.Core.Persistence.Querying return _wheres; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Querying/QueryExtensions.cs b/src/Umbraco.Core/Persistence/Querying/QueryExtensions.cs index 20c3409a40..c6a0131f9c 100644 --- a/src/Umbraco.Core/Persistence/Querying/QueryExtensions.cs +++ b/src/Umbraco.Core/Persistence/Querying/QueryExtensions.cs @@ -24,4 +24,4 @@ namespace Umbraco.Core.Persistence.Querying return q.GetWhereClauses(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Querying/SqlExpressionExtensions.cs b/src/Umbraco.Core/Persistence/Querying/SqlExpressionExtensions.cs index 593955734e..0f9eb47d77 100644 --- a/src/Umbraco.Core/Persistence/Querying/SqlExpressionExtensions.cs +++ b/src/Umbraco.Core/Persistence/Querying/SqlExpressionExtensions.cs @@ -17,7 +17,7 @@ namespace Umbraco.Core.Persistence.Querying public static bool SqlWildcard(this string str, string txt, TextColumnType columnType) { var wildcardmatch = new Regex("^" + Regex.Escape(txt). - //deal with any wildcard chars % + //deal with any wildcard chars % Replace(@"\%", ".*") + "$"); return wildcardmatch.IsMatch(str); @@ -43,4 +43,4 @@ namespace Umbraco.Core.Persistence.Querying return str.InvariantEndsWith(txt); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Querying/SqlTranslator.cs b/src/Umbraco.Core/Persistence/Querying/SqlTranslator.cs index 94434fca74..f9a2ee7698 100644 --- a/src/Umbraco.Core/Persistence/Querying/SqlTranslator.cs +++ b/src/Umbraco.Core/Persistence/Querying/SqlTranslator.cs @@ -33,4 +33,4 @@ namespace Umbraco.Core.Persistence.Querying return _sql.SQL; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Querying/StringPropertyMatchType.cs b/src/Umbraco.Core/Persistence/Querying/StringPropertyMatchType.cs index f45efb412a..f4c95c02b5 100644 --- a/src/Umbraco.Core/Persistence/Querying/StringPropertyMatchType.cs +++ b/src/Umbraco.Core/Persistence/Querying/StringPropertyMatchType.cs @@ -12,4 +12,4 @@ //Deals with % as wildcard chars in a string Wildcard } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Querying/TextColumnType.cs b/src/Umbraco.Core/Persistence/Querying/TextColumnType.cs index f33022fcbe..b6ba94f7b9 100644 --- a/src/Umbraco.Core/Persistence/Querying/TextColumnType.cs +++ b/src/Umbraco.Core/Persistence/Querying/TextColumnType.cs @@ -5,4 +5,4 @@ NVarchar, NText } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Querying/ValuePropertyMatchType.cs b/src/Umbraco.Core/Persistence/Querying/ValuePropertyMatchType.cs index f0c70a069d..14cba2bb17 100644 --- a/src/Umbraco.Core/Persistence/Querying/ValuePropertyMatchType.cs +++ b/src/Umbraco.Core/Persistence/Querying/ValuePropertyMatchType.cs @@ -11,4 +11,4 @@ GreaterThanOrEqualTo, LessThanOrEqualTo } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/RecordPersistenceType.cs b/src/Umbraco.Core/Persistence/RecordPersistenceType.cs index 53140afe81..3eb94c70ae 100644 --- a/src/Umbraco.Core/Persistence/RecordPersistenceType.cs +++ b/src/Umbraco.Core/Persistence/RecordPersistenceType.cs @@ -1,4 +1,4 @@ -namespace Umbraco.Core.Persistence +namespace Umbraco.Core.Persistence { internal enum RecordPersistenceType { @@ -6,4 +6,4 @@ namespace Umbraco.Core.Persistence Update, Delete } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/AuditRepository.cs b/src/Umbraco.Core/Persistence/Repositories/AuditRepository.cs index e223f20637..0bad55721a 100644 --- a/src/Umbraco.Core/Persistence/Repositories/AuditRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/AuditRepository.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using LightInject; @@ -25,7 +25,7 @@ namespace Umbraco.Core.Persistence.Repositories { throw new NotImplementedException(); } - + protected override void PersistUpdatedItem(AuditItem entity) { Database.Insert(new LogDto @@ -46,7 +46,7 @@ namespace Umbraco.Core.Persistence.Repositories var dto = Database.First(sql); if (dto == null) return null; - + return new AuditItem(dto.NodeId, dto.Comment, Enum.Parse(dto.Header), dto.UserId); } @@ -104,4 +104,4 @@ namespace Umbraco.Core.Persistence.Repositories new {oldestPermittedLogEntry = oldestPermittedLogEntry}); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/ContentRepository.cs b/src/Umbraco.Core/Persistence/Repositories/ContentRepository.cs index b823d99b83..541fdd8aff 100644 --- a/src/Umbraco.Core/Persistence/Repositories/ContentRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/ContentRepository.cs @@ -959,4 +959,4 @@ WHERE (@path LIKE {5})", return currentName; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/ContentTypeRepository.cs b/src/Umbraco.Core/Persistence/Repositories/ContentTypeRepository.cs index e4f6e524cf..fab16d3b9a 100644 --- a/src/Umbraco.Core/Persistence/Repositories/ContentTypeRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/ContentTypeRepository.cs @@ -283,4 +283,4 @@ namespace Umbraco.Core.Persistence.Repositories entity.ResetDirtyProperties(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/ContentTypeRepositoryBase.cs b/src/Umbraco.Core/Persistence/Repositories/ContentTypeRepositoryBase.cs index 08073ba6ca..90c60f0f1f 100644 --- a/src/Umbraco.Core/Persistence/Repositories/ContentTypeRepositoryBase.cs +++ b/src/Umbraco.Core/Persistence/Repositories/ContentTypeRepositoryBase.cs @@ -754,7 +754,7 @@ AND umbracoNode.id <> @id", AllowedTypes.AllowedId as ctaAllowedId, AllowedTypes.SortOrder as ctaSortOrder, AllowedTypes.alias as ctaAlias, ParentTypes.parentContentTypeId as chtParentId, ParentTypes.parentContentTypeKey as chtParentKey, umbracoNode.createDate as nCreateDate, umbracoNode." + sqlSyntax.GetQuotedColumnName("level") + @" as nLevel, umbracoNode.nodeObjectType as nObjectType, umbracoNode.nodeUser as nUser, - umbracoNode.parentID as nParentId, umbracoNode." + sqlSyntax.GetQuotedColumnName("path") + @" as nPath, umbracoNode.sortOrder as nSortOrder, umbracoNode." + sqlSyntax.GetQuotedColumnName("text") + @" as nName, umbracoNode.trashed as nTrashed, + umbracoNode.parentID as nParentId, umbracoNode." + sqlSyntax.GetQuotedColumnName("path") + @" as nPath, umbracoNode.sortOrder as nSortOrder, umbracoNode." + sqlSyntax.GetQuotedColumnName("text") + @" as nName, umbracoNode.trashed as nTrashed, umbracoNode.uniqueID as nUniqueId FROM cmsContentType INNER JOIN umbracoNode @@ -894,7 +894,7 @@ AND umbracoNode.id <> @id", AllowedTypes.AllowedId as ctaAllowedId, AllowedTypes.SortOrder as ctaSortOrder, AllowedTypes.alias as ctaAlias, ParentTypes.parentContentTypeId as chtParentId,ParentTypes.parentContentTypeKey as chtParentKey, umbracoNode.createDate as nCreateDate, umbracoNode." + sqlSyntax.GetQuotedColumnName("level") + @" as nLevel, umbracoNode.nodeObjectType as nObjectType, umbracoNode.nodeUser as nUser, - umbracoNode.parentID as nParentId, umbracoNode." + sqlSyntax.GetQuotedColumnName("path") + @" as nPath, umbracoNode.sortOrder as nSortOrder, umbracoNode." + sqlSyntax.GetQuotedColumnName("text") + @" as nName, umbracoNode.trashed as nTrashed, + umbracoNode.parentID as nParentId, umbracoNode." + sqlSyntax.GetQuotedColumnName("path") + @" as nPath, umbracoNode.sortOrder as nSortOrder, umbracoNode." + sqlSyntax.GetQuotedColumnName("text") + @" as nName, umbracoNode.trashed as nTrashed, umbracoNode.uniqueID as nUniqueId, Template.alias as tAlias, Template.nodeId as tId,Template.text as tText FROM cmsContentType @@ -1080,19 +1080,19 @@ AND umbracoNode.id <> @id", if (contentTypeIds.Length == 0) return; var sqlGroups = @"SELECT - pg.contenttypeNodeId AS contentTypeId, + pg.contenttypeNodeId AS contentTypeId, pg.id AS id, pg.uniqueID AS " + sqlSyntax.GetQuotedColumnName("key") + @", pg.sortOrder AS sortOrder, pg." + sqlSyntax.GetQuotedColumnName("text") + @" AS text FROM cmsPropertyTypeGroup pg WHERE pg.contenttypeNodeId IN (@ids) ORDER BY contentTypeId, id"; - var sqlProps = @"SELECT - pt.contentTypeId AS contentTypeId, - pt.id AS id, pt.uniqueID AS " + sqlSyntax.GetQuotedColumnName("key") + @", + var sqlProps = @"SELECT + pt.contentTypeId AS contentTypeId, + pt.id AS id, pt.uniqueID AS " + sqlSyntax.GetQuotedColumnName("key") + @", pt.propertyTypeGroupId AS groupId, - pt.Alias AS alias, pt." + sqlSyntax.GetQuotedColumnName("Description") + @" AS " + sqlSyntax.GetQuotedColumnName("desc") + @", pt.mandatory AS mandatory, - pt.Name AS name, pt.sortOrder AS sortOrder, pt.validationRegExp AS regexp, + pt.Alias AS alias, pt." + sqlSyntax.GetQuotedColumnName("Description") + @" AS " + sqlSyntax.GetQuotedColumnName("desc") + @", pt.mandatory AS mandatory, + pt.Name AS name, pt.sortOrder AS sortOrder, pt.validationRegExp AS regexp, dt.nodeId as dataTypeId, dt.dbType as dbType, dt.propertyEditorAlias as editorAlias FROM cmsPropertyType pt INNER JOIN cmsDataType as dt ON pt.dataTypeId = dt.nodeId @@ -1238,7 +1238,7 @@ WHERE cmsContentType." + aliasColumn + @" LIKE @pattern", { var ids = contentPath.Split(',').Select(int.Parse); var sql = new Sql(@"SELECT COUNT(*) FROM cmsContentType -INNER JOIN cmsContent ON cmsContentType.nodeId=cmsContent.contentType +INNER JOIN cmsContent ON cmsContentType.nodeId=cmsContent.contentType WHERE cmsContent.nodeId IN (@ids) AND cmsContentType.isContainer=@isContainer", new { ids, isContainer = true }); return Database.ExecuteScalar(sql) > 0; } diff --git a/src/Umbraco.Core/Persistence/Repositories/DataTypeContainerRepository.cs b/src/Umbraco.Core/Persistence/Repositories/DataTypeContainerRepository.cs index 0b0d6d4aa5..faee76110a 100644 --- a/src/Umbraco.Core/Persistence/Repositories/DataTypeContainerRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/DataTypeContainerRepository.cs @@ -10,4 +10,4 @@ namespace Umbraco.Core.Persistence.Repositories : base(uow, cache, logger, Constants.ObjectTypes.DataTypeContainerGuid) { } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/DataTypeDefinitionRepository.cs b/src/Umbraco.Core/Persistence/Repositories/DataTypeDefinitionRepository.cs index 4a7a5fef7c..8106384673 100644 --- a/src/Umbraco.Core/Persistence/Repositories/DataTypeDefinitionRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/DataTypeDefinitionRepository.cs @@ -637,4 +637,4 @@ AND umbracoNode.id <> @id", } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/DictionaryRepository.cs b/src/Umbraco.Core/Persistence/Repositories/DictionaryRepository.cs index ddc42b69f3..bc33fd0aef 100644 --- a/src/Umbraco.Core/Persistence/Repositories/DictionaryRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/DictionaryRepository.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using NPoco; @@ -390,4 +390,4 @@ namespace Umbraco.Core.Persistence.Repositories } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/DocumentTypeContainerRepository.cs b/src/Umbraco.Core/Persistence/Repositories/DocumentTypeContainerRepository.cs index fc1f1690a9..91f3f5943b 100644 --- a/src/Umbraco.Core/Persistence/Repositories/DocumentTypeContainerRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/DocumentTypeContainerRepository.cs @@ -10,4 +10,4 @@ namespace Umbraco.Core.Persistence.Repositories : base(uow, cache, logger, Constants.ObjectTypes.DocumentTypeContainerGuid) { } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/DomainRepository.cs b/src/Umbraco.Core/Persistence/Repositories/DomainRepository.cs index 8ade06546c..717ef3fec6 100644 --- a/src/Umbraco.Core/Persistence/Repositories/DomainRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/DomainRepository.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Data; using System.Linq; @@ -63,7 +63,7 @@ namespace Umbraco.Core.Persistence.Repositories .LeftJoin() .On(dto => dto.DefaultLanguage, dto => dto.Id); } - + return sql; } @@ -124,7 +124,7 @@ namespace Umbraco.Core.Persistence.Repositories { ((UmbracoDomain)entity).UpdatingEntity(); - var exists = Database.ExecuteScalar("SELECT COUNT(*) FROM umbracoDomains WHERE domainName = @domainName AND umbracoDomains.id <> @id", + var exists = Database.ExecuteScalar("SELECT COUNT(*) FROM umbracoDomains WHERE domainName = @domainName AND umbracoDomains.id <> @id", new { domainName = entity.DomainName, id = entity.Id }); //ensure there is no other domain with the same name on another entity if (exists > 0) throw new DuplicateNameException(string.Format("The domain name {0} is already assigned", entity.DomainName)); @@ -182,11 +182,11 @@ namespace Umbraco.Core.Persistence.Repositories var factory = new DomainModelFactory(); var entity = factory.BuildEntity(dto); return entity; - } + } internal class DomainModelFactory { - + public IDomain BuildEntity(DomainDto dto) { var domain = new UmbracoDomain(dto.DomainName, dto.IsoCode) @@ -208,4 +208,4 @@ namespace Umbraco.Core.Persistence.Repositories } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/EntityContainerRepository.cs b/src/Umbraco.Core/Persistence/Repositories/EntityContainerRepository.cs index dd49b22829..fa689f33b6 100644 --- a/src/Umbraco.Core/Persistence/Repositories/EntityContainerRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/EntityContainerRepository.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using NPoco; @@ -19,7 +19,7 @@ namespace Umbraco.Core.Persistence.Repositories { private readonly Guid _containerObjectType; - public EntityContainerRepository(IScopeUnitOfWork work, CacheHelper cache, ILogger logger, Guid containerObjectType) + public EntityContainerRepository(IScopeUnitOfWork work, CacheHelper cache, ILogger logger, Guid containerObjectType) : base(work, cache, logger) { var allowedContainers = new[] {Constants.ObjectTypes.DocumentTypeContainerGuid, Constants.ObjectTypes.MediaTypeContainerGuid, Constants.ObjectTypes.DataTypeContainerGuid}; @@ -269,7 +269,7 @@ namespace Umbraco.Core.Persistence.Repositories // update Database.Update(nodeDto); - + // refresh the entity entity.Path = nodeDto.Path; entity.Level = nodeDto.Level; @@ -285,4 +285,4 @@ namespace Umbraco.Core.Persistence.Repositories } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/EntityRepository.cs b/src/Umbraco.Core/Persistence/Repositories/EntityRepository.cs index 063bc45370..989f6cc6d3 100644 --- a/src/Umbraco.Core/Persistence/Repositories/EntityRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/EntityRepository.cs @@ -830,4 +830,4 @@ namespace Umbraco.Core.Persistence.Repositories #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/ExternalLoginRepository.cs b/src/Umbraco.Core/Persistence/Repositories/ExternalLoginRepository.cs index 72acb80e1b..e7e3d0d3ad 100644 --- a/src/Umbraco.Core/Persistence/Repositories/ExternalLoginRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/ExternalLoginRepository.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using Microsoft.AspNet.Identity; @@ -132,7 +132,7 @@ namespace Umbraco.Core.Persistence.Repositories { var list = new List { - "DELETE FROM umbracoExternalLogin WHERE id = @Id" + "DELETE FROM umbracoExternalLogin WHERE id = @Id" }; return list; } @@ -162,9 +162,9 @@ namespace Umbraco.Core.Persistence.Repositories var factory = new ExternalLoginFactory(); var dto = factory.BuildDto(entity); - Database.Update(dto); + Database.Update(dto); entity.ResetDirtyProperties(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/FileRepository.cs b/src/Umbraco.Core/Persistence/Repositories/FileRepository.cs index 5b3c2cf75f..c5bdbe37b5 100644 --- a/src/Umbraco.Core/Persistence/Repositories/FileRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/FileRepository.cs @@ -9,7 +9,7 @@ using Umbraco.Core.Persistence.UnitOfWork; namespace Umbraco.Core.Persistence.Repositories { - internal abstract class FileRepository : DisposableObject, IUnitOfWorkRepository, IRepository + internal abstract class FileRepository : DisposableObject, IUnitOfWorkRepository, IRepository where TEntity : IFile { protected FileRepository(IUnitOfWork work, IFileSystem fileSystem) @@ -116,7 +116,7 @@ namespace Umbraco.Core.Persistence.Repositories } #region Abstract IUnitOfWorkRepository Methods - + protected virtual void PersistNewItem(TEntity entity) { using (var stream = GetContentStream(entity.Content)) @@ -181,7 +181,7 @@ namespace Umbraco.Core.Persistence.Repositories /// /// /// Returns a list of all files with their paths. For example: - /// + /// /// \hello.txt /// \folder1\test.txt /// \folder1\blah.csv @@ -242,9 +242,9 @@ namespace Umbraco.Core.Persistence.Repositories /// Dispose the unit of work /// protected override void DisposeResources() - { + { // fixme - wtf in v8? - UnitOfWork.DisposeIfDisposable(); - } + UnitOfWork.DisposeIfDisposable(); + } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IAuditRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IAuditRepository.cs index 376895e8e7..9d8738102f 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IAuditRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IAuditRepository.cs @@ -1,4 +1,4 @@ -using Umbraco.Core.Models; +using Umbraco.Core.Models; using Umbraco.Core.Persistence.UnitOfWork; namespace Umbraco.Core.Persistence.Repositories @@ -7,4 +7,4 @@ namespace Umbraco.Core.Persistence.Repositories { void CleanLogs(int maximumAgeOfLogsInMinutes); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IContentRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IContentRepository.cs index 1e4ebb34ca..ff94aacb45 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IContentRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IContentRepository.cs @@ -53,4 +53,4 @@ namespace Umbraco.Core.Persistence.Repositories /// IEnumerable GetPermissionsForEntity(int entityId); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IContentTypeRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IContentTypeRepository.cs index d9d026cd52..07ca9248fe 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IContentTypeRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IContentTypeRepository.cs @@ -30,4 +30,4 @@ namespace Umbraco.Core.Persistence.Repositories /// IEnumerable GetAllContentTypeAliases(params Guid[] objectTypes); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IContentTypeRepositoryBase.cs b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IContentTypeRepositoryBase.cs index fbdcd67853..db134a8a40 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IContentTypeRepositoryBase.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IContentTypeRepositoryBase.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using Umbraco.Core.Events; using Umbraco.Core.Models; @@ -28,4 +28,4 @@ namespace Umbraco.Core.Persistence.Repositories /// bool HasContainerInPath(string contentPath); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IDataTypeContainerRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IDataTypeContainerRepository.cs index b2675c3ce4..460bed71d3 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IDataTypeContainerRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IDataTypeContainerRepository.cs @@ -2,4 +2,4 @@ { interface IDataTypeContainerRepository : IEntityContainerRepository { } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IDataTypeDefinitionRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IDataTypeDefinitionRepository.cs index 0cd8462718..684fd8be59 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IDataTypeDefinitionRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IDataTypeDefinitionRepository.cs @@ -8,7 +8,7 @@ namespace Umbraco.Core.Persistence.Repositories { public interface IDataTypeDefinitionRepository : IQueryRepository { - + PreValueCollection GetPreValuesCollectionByDataTypeId(int dataTypeId); string GetPreValueAsString(int preValueId); @@ -16,4 +16,4 @@ namespace Umbraco.Core.Persistence.Repositories void AddOrUpdatePreValues(int dataTypeId, IDictionary values); IEnumerable> Move(IDataTypeDefinition toMove, EntityContainer container); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IDictionaryRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IDictionaryRepository.cs index 8df42776c0..8962b027e1 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IDictionaryRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IDictionaryRepository.cs @@ -10,4 +10,4 @@ namespace Umbraco.Core.Persistence.Repositories IDictionaryItem Get(string key); IEnumerable GetDictionaryItemDescendants(Guid? parentId); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IDocumentTypeContainerRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IDocumentTypeContainerRepository.cs index 03a71e0f19..ccf8df268d 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IDocumentTypeContainerRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IDocumentTypeContainerRepository.cs @@ -2,4 +2,4 @@ { interface IDocumentTypeContainerRepository : IEntityContainerRepository { } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IDomainRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IDomainRepository.cs index aea131281e..04d748326e 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IDomainRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IDomainRepository.cs @@ -10,4 +10,4 @@ namespace Umbraco.Core.Persistence.Repositories IEnumerable GetAll(bool includeWildcards); IEnumerable GetAssignedDomains(int contentId, bool includeWildcards); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IEntityContainerRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IEntityContainerRepository.cs index 5e892e037a..14322ee55c 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IEntityContainerRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IEntityContainerRepository.cs @@ -4,4 +4,4 @@ namespace Umbraco.Core.Persistence.Repositories { interface IEntityContainerRepository : IRepository { } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IEntityRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IEntityRepository.cs index 0f8321bd42..02e0816745 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IEntityRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IEntityRepository.cs @@ -54,4 +54,4 @@ namespace Umbraco.Core.Persistence.Repositories bool Exists(int id); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IExternalLoginRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IExternalLoginRepository.cs index bfa9d406a7..9a765f6259 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IExternalLoginRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IExternalLoginRepository.cs @@ -9,4 +9,4 @@ namespace Umbraco.Core.Persistence.Repositories void SaveUserLogins(int memberId, IEnumerable logins); void DeleteUserLogins(int memberId); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/Interfaces/ILanguageRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Interfaces/ILanguageRepository.cs index 2fd57f1162..2c52a6e56d 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Interfaces/ILanguageRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Interfaces/ILanguageRepository.cs @@ -7,4 +7,4 @@ namespace Umbraco.Core.Persistence.Repositories ILanguage GetByCultureName(string cultureName); ILanguage GetByIsoCode(string isoCode); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IMacroRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IMacroRepository.cs index 5f33c3fa47..45199aa956 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IMacroRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IMacroRepository.cs @@ -10,4 +10,4 @@ namespace Umbraco.Core.Persistence.Repositories //IEnumerable GetAll(params string[] aliases); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IMediaRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IMediaRepository.cs index 70ac7bd0ba..17a4e21564 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IMediaRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IMediaRepository.cs @@ -6,4 +6,4 @@ namespace Umbraco.Core.Persistence.Repositories { IMedia GetMediaByPath(string mediaPath); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IMediaTypeContainerRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IMediaTypeContainerRepository.cs index 7d3b5a14b1..a1872df0cd 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IMediaTypeContainerRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IMediaTypeContainerRepository.cs @@ -2,4 +2,4 @@ { interface IMediaTypeContainerRepository : IEntityContainerRepository { } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IMediaTypeRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IMediaTypeRepository.cs index a601723494..7f2fc327c1 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IMediaTypeRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IMediaTypeRepository.cs @@ -14,4 +14,4 @@ namespace Umbraco.Core.Persistence.Repositories /// An enumerable list of objects IEnumerable GetByQuery(IQuery query); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IMemberGroupRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IMemberGroupRepository.cs index 764dd00bbf..ddc568b400 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IMemberGroupRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IMemberGroupRepository.cs @@ -41,4 +41,4 @@ namespace Umbraco.Core.Persistence.Repositories void DissociateRoles(int[] memberIds, string[] roleNames); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IMemberRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IMemberRepository.cs index bead7ff1bc..8f5353bdd6 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IMemberRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IMemberRepository.cs @@ -37,4 +37,4 @@ namespace Umbraco.Core.Persistence.Repositories /// int GetCountByQuery(IQuery query); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IMemberTypeRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IMemberTypeRepository.cs index 5cf4e52b88..24dd4cfbc8 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IMemberTypeRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IMemberTypeRepository.cs @@ -5,4 +5,4 @@ namespace Umbraco.Core.Persistence.Repositories { public interface IMemberTypeRepository : IUnitOfWorkRepository, IContentTypeRepositoryBase { } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IMigrationEntryRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IMigrationEntryRepository.cs index 20809a8e74..27ad825270 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IMigrationEntryRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IMigrationEntryRepository.cs @@ -8,4 +8,4 @@ namespace Umbraco.Core.Persistence.Repositories { IMigrationEntry FindEntry(string migrationName, SemVersion version); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/Interfaces/INotificationsRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Interfaces/INotificationsRepository.cs index 84685538d0..1c3f6e93e6 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Interfaces/INotificationsRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Interfaces/INotificationsRepository.cs @@ -17,4 +17,4 @@ namespace Umbraco.Core.Persistence.Repositories IEnumerable GetUsersNotifications(IEnumerable userIds, string action, IEnumerable nodeIds, Guid objectType); IEnumerable SetNotifications(IUser user, IEntity entity, string[] actions); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IPartialViewRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IPartialViewRepository.cs index 27342fe643..2e27a2bf0f 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IPartialViewRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IPartialViewRepository.cs @@ -12,4 +12,4 @@ namespace Umbraco.Core.Persistence.Repositories void SetFileContent(string filepath, Stream content); long GetFileSize(string filepath); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IPublicAccessRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IPublicAccessRepository.cs index 1e71273db3..405d8f278a 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IPublicAccessRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IPublicAccessRepository.cs @@ -1,4 +1,4 @@ -using System; +using System; using Umbraco.Core.Models; using Umbraco.Core.Persistence.UnitOfWork; @@ -6,4 +6,4 @@ namespace Umbraco.Core.Persistence.Repositories { public interface IPublicAccessRepository : IUnitOfWorkRepository, IQueryRepository { } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IQueryRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IQueryRepository.cs index 155c32297e..149253ceda 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IQueryRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IQueryRepository.cs @@ -21,4 +21,4 @@ namespace Umbraco.Core.Persistence.Repositories /// int Count(IQuery query); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IRecycleBinRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IRecycleBinRepository.cs index ce6ed2561a..b697b9be0a 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IRecycleBinRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IRecycleBinRepository.cs @@ -13,4 +13,4 @@ namespace Umbraco.Core.Persistence.Repositories /// IEnumerable GetEntitiesInRecycleBin(); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IRelationRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IRelationRepository.cs index 5a296df9f0..10ead9db46 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IRelationRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IRelationRepository.cs @@ -7,4 +7,4 @@ namespace Umbraco.Core.Persistence.Repositories { } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IRelationTypeRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IRelationTypeRepository.cs index d57dca66d9..71419cb887 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IRelationTypeRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IRelationTypeRepository.cs @@ -6,4 +6,4 @@ namespace Umbraco.Core.Persistence.Repositories { public interface IRelationTypeRepository : IUnitOfWorkRepository, IQueryRepository, IReadRepository { } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IRepository.cs index f758640765..36feb15575 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IRepository.cs @@ -3,10 +3,10 @@ namespace Umbraco.Core.Persistence.Repositories { /// - /// Defines the base implementation of a repository. - /// - public interface IRepository - { } + /// Defines the base implementation of a repository. + /// + public interface IRepository + { } public interface IReadRepository : IRepository { @@ -49,4 +49,4 @@ namespace Umbraco.Core.Persistence.Repositories public interface IRepository : IReadRepository, IWriteRepository { } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IRepositoryVersionable.cs b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IRepositoryVersionable.cs index 27a441d71f..b412088ff8 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IRepositoryVersionable.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IRepositoryVersionable.cs @@ -32,7 +32,7 @@ namespace Umbraco.Core.Persistence.Repositories /// /// Id of the to retrieve versions from /// An enumerable list of the same object with different versions - IEnumerable GetAllVersions(int id); + IEnumerable GetAllVersions(int id); /// /// Gets a list of all version Ids for the given content item @@ -77,4 +77,4 @@ namespace Umbraco.Core.Persistence.Repositories IEnumerable GetPagedResultsByQuery(IQuery query, long pageIndex, int pageSize, out long totalRecords, string orderBy, Direction orderDirection, bool orderBySystemField, IQuery filter = null, bool newest = true); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IScriptRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IScriptRepository.cs index c2c0a0ae84..26d432702c 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IScriptRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IScriptRepository.cs @@ -10,4 +10,4 @@ namespace Umbraco.Core.Persistence.Repositories void SetFileContent(string filepath, Stream content); long GetFileSize(string filepath); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IServerRegistrationRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IServerRegistrationRepository.cs index bc3bd872f9..28f2d48237 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IServerRegistrationRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IServerRegistrationRepository.cs @@ -8,4 +8,4 @@ namespace Umbraco.Core.Persistence.Repositories { void DeactiveStaleServers(TimeSpan staleTimeout); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IStylesheetRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IStylesheetRepository.cs index 5fadf7b01c..8fd14816aa 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IStylesheetRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IStylesheetRepository.cs @@ -1,4 +1,4 @@ -using System.IO; +using System.IO; using Umbraco.Core.Models; namespace Umbraco.Core.Persistence.Repositories @@ -10,4 +10,4 @@ namespace Umbraco.Core.Persistence.Repositories void SetFileContent(string filepath, Stream content); long GetFileSize(string filepath); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/Interfaces/ITagRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Interfaces/ITagRepository.cs index d705e4551f..4df8c76841 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Interfaces/ITagRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Interfaces/ITagRepository.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using Umbraco.Core.Models; using Umbraco.Core.Persistence.UnitOfWork; @@ -64,7 +64,7 @@ namespace Umbraco.Core.Persistence.Repositories /// /// The tags to assign /// - /// If set to true, this will replace all tags with the given tags, + /// If set to true, this will replace all tags with the given tags, /// if false this will append the tags that already exist for the content item /// /// @@ -94,4 +94,4 @@ namespace Umbraco.Core.Persistence.Repositories /// void ClearTagsFromEntity(int contentId); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/Interfaces/ITaskRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Interfaces/ITaskRepository.cs index f0df763fcd..149968423f 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Interfaces/ITaskRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Interfaces/ITaskRepository.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using Umbraco.Core.Models; using Umbraco.Core.Persistence.UnitOfWork; @@ -8,4 +8,4 @@ namespace Umbraco.Core.Persistence.Repositories { IEnumerable GetTasks(int? itemId = null, int? assignedUser = null, int? ownerUser = null, string taskTypeAlias = null, bool includeClosed = false); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/Interfaces/ITaskTypeRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Interfaces/ITaskTypeRepository.cs index 34a6379f3a..8c396b819c 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Interfaces/ITaskTypeRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Interfaces/ITaskTypeRepository.cs @@ -1,8 +1,8 @@ -using Umbraco.Core.Models; +using Umbraco.Core.Models; using Umbraco.Core.Persistence.UnitOfWork; namespace Umbraco.Core.Persistence.Repositories { public interface ITaskTypeRepository : IUnitOfWorkRepository, IQueryRepository { } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/Interfaces/ITemplateRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Interfaces/ITemplateRepository.cs index 4f1b64fc87..eeda2a0277 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Interfaces/ITemplateRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Interfaces/ITemplateRepository.cs @@ -75,4 +75,4 @@ namespace Umbraco.Core.Persistence.Repositories long GetFileSize(string filepath); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IUserRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IUserRepository.cs index d6fd53f2ad..114c667be1 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IUserRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IUserRepository.cs @@ -39,8 +39,8 @@ namespace Umbraco.Core.Persistence.Repositories /// /// IEnumerable GetPagedResultsByQuery(IQuery query, long pageIndex, int pageSize, out long totalRecords, Expression> orderBy); - - + + /// /// Gets the user permissions for the specified entities /// @@ -65,4 +65,4 @@ namespace Umbraco.Core.Persistence.Repositories /// void AssignUserPermission(int userId, char permission, params int[] entityIds); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IUserTypeRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IUserTypeRepository.cs index 5507b56472..1ee2d8bb98 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IUserTypeRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IUserTypeRepository.cs @@ -5,6 +5,6 @@ namespace Umbraco.Core.Persistence.Repositories { public interface IUserTypeRepository : IUnitOfWorkRepository, IQueryRepository { - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IXsltFileRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IXsltFileRepository.cs index 4c56b6eb18..cb9e74f6ed 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IXsltFileRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IXsltFileRepository.cs @@ -1,4 +1,4 @@ -using System.IO; +using System.IO; using Umbraco.Core.Models; namespace Umbraco.Core.Persistence.Repositories @@ -10,4 +10,4 @@ namespace Umbraco.Core.Persistence.Repositories void SetFileContent(string filepath, Stream content); long GetFileSize(string filepath); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/LanguageRepository.cs b/src/Umbraco.Core/Persistence/Repositories/LanguageRepository.cs index 4a0d96e049..8ea11e835e 100644 --- a/src/Umbraco.Core/Persistence/Repositories/LanguageRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/LanguageRepository.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using NPoco; @@ -165,4 +165,4 @@ namespace Umbraco.Core.Persistence.Repositories return GetAll().FirstOrDefault(x => x.IsoCode.InvariantEquals(isoCode)); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/MacroRepository.cs b/src/Umbraco.Core/Persistence/Repositories/MacroRepository.cs index 2b1ee07d86..37c7d126a2 100644 --- a/src/Umbraco.Core/Persistence/Repositories/MacroRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/MacroRepository.cs @@ -221,4 +221,4 @@ namespace Umbraco.Core.Persistence.Repositories entity.ResetDirtyProperties(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/MediaTypeContainerRepository.cs b/src/Umbraco.Core/Persistence/Repositories/MediaTypeContainerRepository.cs index 969fef118f..5148636edf 100644 --- a/src/Umbraco.Core/Persistence/Repositories/MediaTypeContainerRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/MediaTypeContainerRepository.cs @@ -10,4 +10,4 @@ namespace Umbraco.Core.Persistence.Repositories : base(uow, cache, logger, Constants.ObjectTypes.MediaTypeContainerGuid) { } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/MediaTypeRepository.cs b/src/Umbraco.Core/Persistence/Repositories/MediaTypeRepository.cs index 7003f43fc6..94271c2903 100644 --- a/src/Umbraco.Core/Persistence/Repositories/MediaTypeRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/MediaTypeRepository.cs @@ -92,7 +92,7 @@ namespace Umbraco.Core.Persistence.Repositories //order the result by name .OrderBy(x => x.Name); } - + /// /// Gets all entities of the specified query /// @@ -104,8 +104,8 @@ namespace Umbraco.Core.Persistence.Repositories return ints.Any() ? GetAll(ints) : Enumerable.Empty(); - } - + } + protected override Sql GetBaseQuery(bool isCount) { var sql = Sql(); @@ -173,4 +173,4 @@ namespace Umbraco.Core.Persistence.Repositories entity.ResetDirtyProperties(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/MemberGroupRepository.cs b/src/Umbraco.Core/Persistence/Repositories/MemberGroupRepository.cs index cd9631d21f..879c33d06c 100644 --- a/src/Umbraco.Core/Persistence/Repositories/MemberGroupRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/MemberGroupRepository.cs @@ -98,8 +98,8 @@ namespace Umbraco.Core.Persistence.Repositories var dto = _modelFactory.BuildDto(group); var o = Database.IsNew(dto) ? Convert.ToInt32(Database.Insert(dto)) : Database.Update(dto); group.Id = dto.NodeId; //Set Id on entity to ensure an Id is set - - //Update with new correct path and id + + //Update with new correct path and id dto.Path = string.Concat("-1,", dto.NodeId); Database.Update(dto); //assign to entity @@ -112,7 +112,7 @@ namespace Umbraco.Core.Persistence.Repositories var dto = _modelFactory.BuildDto(entity); Database.Update(dto); - + entity.ResetDirtyProperties(); } @@ -127,7 +127,7 @@ namespace Umbraco.Core.Persistence.Repositories return result.FirstOrDefault(); }, //cache for 5 mins since that is the default in the RuntimeCacheProvider - TimeSpan.FromMinutes(5), + TimeSpan.FromMinutes(5), //sliding is true true); } @@ -280,7 +280,7 @@ namespace Umbraco.Core.Persistence.Repositories foreach (var memberId in memberIds) { - //find any roles for the current member that are currently assigned that + //find any roles for the current member that are currently assigned that //exist in the roleNames list, then determine which ones are not currently assigned. var mId = memberId; var found = currentlyAssigned.Where(x => x.MemberId == mId).ToArray(); @@ -336,4 +336,4 @@ namespace Umbraco.Core.Persistence.Repositories /// internal static event TypedEventHandler> SavedMemberGroup; } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/MemberTypeRepository.cs b/src/Umbraco.Core/Persistence/Repositories/MemberTypeRepository.cs index 02cf1c7b9d..386a5f445a 100644 --- a/src/Umbraco.Core/Persistence/Repositories/MemberTypeRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/MemberTypeRepository.cs @@ -377,4 +377,4 @@ namespace Umbraco.Core.Persistence.Repositories return Attempt.Fail(propertyEditor); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/MigrationEntryRepository.cs b/src/Umbraco.Core/Persistence/Repositories/MigrationEntryRepository.cs index d6de7b8b1a..36606f1064 100644 --- a/src/Umbraco.Core/Persistence/Repositories/MigrationEntryRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/MigrationEntryRepository.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using LightInject; @@ -89,7 +89,7 @@ namespace Umbraco.Core.Persistence.Repositories { var list = new List { - "DELETE FROM umbracoMigration WHERE id = @Id" + "DELETE FROM umbracoMigration WHERE id = @Id" }; return list; } @@ -139,4 +139,4 @@ namespace Umbraco.Core.Persistence.Repositories return result == null ? null : factory.BuildEntity(result); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/NPocoRepositoryBase.cs b/src/Umbraco.Core/Persistence/Repositories/NPocoRepositoryBase.cs index 895c9a6858..10bc21eb70 100644 --- a/src/Umbraco.Core/Persistence/Repositories/NPocoRepositoryBase.cs +++ b/src/Umbraco.Core/Persistence/Repositories/NPocoRepositoryBase.cs @@ -29,9 +29,9 @@ namespace Umbraco.Core.Persistence.Repositories { } /// - /// Gets the repository's unit of work. - /// - protected internal new IScopeUnitOfWork UnitOfWork => base.UnitOfWork; + /// Gets the repository's unit of work. + /// + protected internal new IScopeUnitOfWork UnitOfWork => base.UnitOfWork; /// /// Gets the repository's database. @@ -98,4 +98,4 @@ namespace Umbraco.Core.Persistence.Repositories entity.DeletedDate = DateTime.Now; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/NotificationsRepository.cs b/src/Umbraco.Core/Persistence/Repositories/NotificationsRepository.cs index 16b0ba47e4..1a0d291490 100644 --- a/src/Umbraco.Core/Persistence/Repositories/NotificationsRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/NotificationsRepository.cs @@ -113,4 +113,4 @@ namespace Umbraco.Core.Persistence.Repositories protected override void DisposeResources() { } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/PartialViewMacroRepository.cs b/src/Umbraco.Core/Persistence/Repositories/PartialViewMacroRepository.cs index 806bf858a2..1cbf3b377d 100644 --- a/src/Umbraco.Core/Persistence/Repositories/PartialViewMacroRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/PartialViewMacroRepository.cs @@ -7,11 +7,11 @@ namespace Umbraco.Core.Persistence.Repositories { internal class PartialViewMacroRepository : PartialViewRepository, IPartialViewMacroRepository { - + public PartialViewMacroRepository(IUnitOfWork work, [Inject("PartialViewMacroFileSystem")] IFileSystem fileSystem) : base(work, fileSystem) { } protected override PartialViewType ViewType => PartialViewType.PartialViewMacro; } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/PartialViewRepository.cs b/src/Umbraco.Core/Persistence/Repositories/PartialViewRepository.cs index 9d3acb6d02..abc3138c0b 100644 --- a/src/Umbraco.Core/Persistence/Repositories/PartialViewRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/PartialViewRepository.cs @@ -10,7 +10,7 @@ using Umbraco.Core.Persistence.UnitOfWork; namespace Umbraco.Core.Persistence.Repositories { internal class PartialViewRepository : FileRepository, IPartialViewRepository - { + { public PartialViewRepository(IUnitOfWork work, [Inject("PartialViewFileSystem")] IFileSystem fileSystem) : base(work, fileSystem) { } @@ -140,4 +140,4 @@ namespace Umbraco.Core.Persistence.Repositories return new MemoryStream(withBom); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/PermissionRepository.cs b/src/Umbraco.Core/Persistence/Repositories/PermissionRepository.cs index 4ff81a210f..ed459fb2b8 100644 --- a/src/Umbraco.Core/Persistence/Repositories/PermissionRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/PermissionRepository.cs @@ -260,4 +260,4 @@ namespace Umbraco.Core.Persistence.Repositories public static event TypedEventHandler, SaveEventArgs> AssignedPermissions; } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/PublicAccessRepository.cs b/src/Umbraco.Core/Persistence/Repositories/PublicAccessRepository.cs index 61c5c74481..1f6f7388db 100644 --- a/src/Umbraco.Core/Persistence/Repositories/PublicAccessRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/PublicAccessRepository.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using NPoco; @@ -161,6 +161,6 @@ namespace Umbraco.Core.Persistence.Repositories protected override Guid GetEntityId(PublicAccessEntry entity) { return entity.Key; - } + } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/RecycleBinRepository.cs b/src/Umbraco.Core/Persistence/Repositories/RecycleBinRepository.cs index 325bdcb0eb..36920b306e 100644 --- a/src/Umbraco.Core/Persistence/Repositories/RecycleBinRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/RecycleBinRepository.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using Umbraco.Core.Cache; using Umbraco.Core.Configuration.UmbracoSettings; using Umbraco.Core.Logging; @@ -7,7 +7,7 @@ using Umbraco.Core.Persistence.UnitOfWork; namespace Umbraco.Core.Persistence.Repositories { - internal abstract class RecycleBinRepository : VersionableRepositoryBase, IRecycleBinRepository + internal abstract class RecycleBinRepository : VersionableRepositoryBase, IRecycleBinRepository where TEntity : class, IUmbracoEntity where TRepository : class, IRepository { @@ -22,4 +22,4 @@ namespace Umbraco.Core.Persistence.Repositories return GetByQuery(QueryT.Where(entity => entity.Trashed)); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/RedirectUrlRepository.cs b/src/Umbraco.Core/Persistence/Repositories/RedirectUrlRepository.cs index 48f4ef6e12..a51c52703d 100644 --- a/src/Umbraco.Core/Persistence/Repositories/RedirectUrlRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/RedirectUrlRepository.cs @@ -13,7 +13,7 @@ namespace Umbraco.Core.Persistence.Repositories { internal class RedirectUrlRepository : NPocoRepositoryBase, IRedirectUrlRepository { - public RedirectUrlRepository(IScopeUnitOfWork work, CacheHelper cache, ILogger logger) + public RedirectUrlRepository(IScopeUnitOfWork work, CacheHelper cache, ILogger logger) : base(work, cache, logger) { } @@ -204,6 +204,6 @@ JOIN umbracoNode ON umbracoRedirectUrl.contentKey=umbracoNode.uniqueID"); var rules = result.Items.Select(Map); return rules; - } + } } } diff --git a/src/Umbraco.Core/Persistence/Repositories/RelationRepository.cs b/src/Umbraco.Core/Persistence/Repositories/RelationRepository.cs index 1992bdd52a..7cc6b14bf1 100644 --- a/src/Umbraco.Core/Persistence/Repositories/RelationRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/RelationRepository.cs @@ -163,4 +163,4 @@ namespace Umbraco.Core.Persistence.Repositories #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/RelationTypeRepository.cs b/src/Umbraco.Core/Persistence/Repositories/RelationTypeRepository.cs index 6d6aad3ced..e9ba3cb0bd 100644 --- a/src/Umbraco.Core/Persistence/Repositories/RelationTypeRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/RelationTypeRepository.cs @@ -158,4 +158,4 @@ namespace Umbraco.Core.Persistence.Repositories #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/RepositoryBase.cs b/src/Umbraco.Core/Persistence/Repositories/RepositoryBase.cs index cfc84de220..99bc7b8c69 100644 --- a/src/Umbraco.Core/Persistence/Repositories/RepositoryBase.cs +++ b/src/Umbraco.Core/Persistence/Repositories/RepositoryBase.cs @@ -36,4 +36,4 @@ namespace Umbraco.Core.Persistence.Repositories return CacheTypeKeys.TryGetValue(type, out string key) ? key : (CacheTypeKeys[type] = "uRepo_" + type.Name + "_"); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/RepositoryBaseOfTIdTEntity.cs b/src/Umbraco.Core/Persistence/Repositories/RepositoryBaseOfTIdTEntity.cs index 161386b267..6be2ceabf2 100644 --- a/src/Umbraco.Core/Persistence/Repositories/RepositoryBaseOfTIdTEntity.cs +++ b/src/Umbraco.Core/Persistence/Repositories/RepositoryBaseOfTIdTEntity.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using Umbraco.Core.Cache; @@ -132,7 +132,7 @@ namespace Umbraco.Core.Persistence.Repositories return _cachePolicy = NoCacheRepositoryCachePolicy.Instance; // create the cache policy using IsolatedCache which is either global - // or scoped depending on the repository cache mode for the current scope + // or scoped depending on the repository cache mode for the current scope var scope = UnitOfWork.Scope; switch (scope.RepositoryCacheMode) { @@ -283,4 +283,4 @@ namespace Umbraco.Core.Persistence.Repositories CachePolicy.Delete((TEntity) entity, PersistDeletedItem); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/ScriptRepository.cs b/src/Umbraco.Core/Persistence/Repositories/ScriptRepository.cs index cda5de6d80..375c5f06ec 100644 --- a/src/Umbraco.Core/Persistence/Repositories/ScriptRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/ScriptRepository.cs @@ -18,7 +18,7 @@ namespace Umbraco.Core.Persistence.Repositories private readonly IContentSection _contentConfig; public ScriptRepository(IUnitOfWork work, [Inject("ScriptFileSystem")] IFileSystem fileSystem, IContentSection contentConfig) - : base(work, fileSystem) + : base(work, fileSystem) { if (contentConfig == null) throw new ArgumentNullException(nameof(contentConfig)); _contentConfig = contentConfig; @@ -132,4 +132,4 @@ namespace Umbraco.Core.Persistence.Repositories #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/ServerRegistrationRepository.cs b/src/Umbraco.Core/Persistence/Repositories/ServerRegistrationRepository.cs index c2e1df7055..2a1eb86aa8 100644 --- a/src/Umbraco.Core/Persistence/Repositories/ServerRegistrationRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/ServerRegistrationRepository.cs @@ -129,4 +129,4 @@ namespace Umbraco.Core.Persistence.Repositories ClearCache(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/SimilarNodeNameComparer.cs b/src/Umbraco.Core/Persistence/Repositories/SimilarNodeNameComparer.cs index ce25486422..96f503aee9 100644 --- a/src/Umbraco.Core/Persistence/Repositories/SimilarNodeNameComparer.cs +++ b/src/Umbraco.Core/Persistence/Repositories/SimilarNodeNameComparer.cs @@ -42,4 +42,4 @@ namespace Umbraco.Core.Persistence.Repositories return index; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/SimpleGetRepository.cs b/src/Umbraco.Core/Persistence/Repositories/SimpleGetRepository.cs index c52575693f..aed784f7ca 100644 --- a/src/Umbraco.Core/Persistence/Repositories/SimpleGetRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/SimpleGetRepository.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using NPoco; @@ -30,7 +30,7 @@ namespace Umbraco.Core.Persistence.Repositories protected virtual IEnumerable PerformFetch(Sql sql) { return Database.Fetch(sql); - } + } protected override TEntity PerformGet(TId id) { @@ -48,7 +48,7 @@ namespace Umbraco.Core.Persistence.Repositories { //on initial construction we don't want to have dirty properties tracked // http://issues.umbraco.org/issue/U4-1946 - dirtyEntity.ResetDirtyProperties(false); + dirtyEntity.ResetDirtyProperties(false); } return entity; @@ -62,7 +62,7 @@ namespace Umbraco.Core.Persistence.Repositories { sql.Where(GetWhereInClauseForGetAll(), new { /*ids =*/ ids }); } - + return Database.Fetch(sql).Select(ConvertToEntity); } @@ -97,4 +97,4 @@ namespace Umbraco.Core.Persistence.Repositories } #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/StylesheetRepository.cs b/src/Umbraco.Core/Persistence/Repositories/StylesheetRepository.cs index 3117bdce8a..e7e78eae76 100644 --- a/src/Umbraco.Core/Persistence/Repositories/StylesheetRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/StylesheetRepository.cs @@ -91,7 +91,7 @@ namespace Umbraco.Core.Persistence.Repositories } /// - /// Gets a list of all that exist at the relative path specified. + /// Gets a list of all that exist at the relative path specified. /// /// /// If null or not specified, will return the stylesheets at the root path relative to the IFileSystem @@ -160,4 +160,4 @@ namespace Umbraco.Core.Persistence.Repositories #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/TagRepository.cs b/src/Umbraco.Core/Persistence/Repositories/TagRepository.cs index 63611d0ad5..f881d07346 100644 --- a/src/Umbraco.Core/Persistence/Repositories/TagRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/TagRepository.cs @@ -570,4 +570,4 @@ namespace Umbraco.Core.Persistence.Repositories } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/TaskRepository.cs b/src/Umbraco.Core/Persistence/Repositories/TaskRepository.cs index 8e4eb97d55..4fdbbd86c6 100644 --- a/src/Umbraco.Core/Persistence/Repositories/TaskRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/TaskRepository.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using LightInject; @@ -169,4 +169,4 @@ namespace Umbraco.Core.Persistence.Repositories return sql; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/TaskTypeRepository.cs b/src/Umbraco.Core/Persistence/Repositories/TaskTypeRepository.cs index 7409bbc2f0..b2a38f9731 100644 --- a/src/Umbraco.Core/Persistence/Repositories/TaskTypeRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/TaskTypeRepository.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using LightInject; @@ -120,4 +120,4 @@ namespace Umbraco.Core.Persistence.Repositories entity.ResetDirtyProperties(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/TemplateRepository.cs b/src/Umbraco.Core/Persistence/Repositories/TemplateRepository.cs index 0acecc4d42..df731f0480 100644 --- a/src/Umbraco.Core/Persistence/Repositories/TemplateRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/TemplateRepository.cs @@ -848,4 +848,4 @@ namespace Umbraco.Core.Persistence.Repositories return EnsureUniqueAlias(template, attempts); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/UserRepository.cs b/src/Umbraco.Core/Persistence/Repositories/UserRepository.cs index d58c099073..0e1789961b 100644 --- a/src/Umbraco.Core/Persistence/Repositories/UserRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/UserRepository.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; @@ -426,4 +426,4 @@ namespace Umbraco.Core.Persistence.Repositories }); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/UserTypeRepository.cs b/src/Umbraco.Core/Persistence/Repositories/UserTypeRepository.cs index 8e22e91179..2549ac17e6 100644 --- a/src/Umbraco.Core/Persistence/Repositories/UserTypeRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/UserTypeRepository.cs @@ -118,4 +118,4 @@ namespace Umbraco.Core.Persistence.Repositories #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/VersionableRepositoryBase.cs b/src/Umbraco.Core/Persistence/Repositories/VersionableRepositoryBase.cs index 04104c4e02..955a578486 100644 --- a/src/Umbraco.Core/Persistence/Repositories/VersionableRepositoryBase.cs +++ b/src/Umbraco.Core/Persistence/Repositories/VersionableRepositoryBase.cs @@ -460,7 +460,7 @@ namespace Umbraco.Core.Persistence.Repositories // get PropertyDataDto distinct PropertyTypeDto var allPropertyTypeIds = allPropertyDataDtos.Select(x => x.PropertyTypeId).Distinct().ToList(); - var allPropertyTypeDtos = Database.FetchByGroups(allPropertyTypeIds, 2000, batch => + var allPropertyTypeDtos = Database.FetchByGroups(allPropertyTypeIds, 2000, batch => Sql() .Select() .From() @@ -722,10 +722,10 @@ FROM cmsDataTypePreValues a WHERE EXISTS( SELECT DISTINCT b.id as preValIdInner FROM cmsDataTypePreValues b - INNER JOIN cmsPropertyType - ON b.datatypeNodeId = cmsPropertyType.dataTypeId - INNER JOIN - (" + string.Format(parsedOriginalSql, "cmsContent.contentType") + @") as docData + INNER JOIN cmsPropertyType + ON b.datatypeNodeId = cmsPropertyType.dataTypeId + INNER JOIN + (" + string.Format(parsedOriginalSql, "cmsContent.contentType") + @") as docData ON cmsPropertyType.contentTypeId = docData.contentType WHERE a.id = b.id)", docSql.Arguments); @@ -744,8 +744,8 @@ WHERE EXISTS( FROM cmsPropertyData INNER JOIN cmsPropertyType ON cmsPropertyData.propertytypeid = cmsPropertyType.id -INNER JOIN - (" + string.Format(parsedOriginalSql, "cmsContent.nodeId, cmsContentVersion.VersionId") + @") as docData +INNER JOIN + (" + string.Format(parsedOriginalSql, "cmsContent.nodeId, cmsContentVersion.VersionId") + @") as docData ON cmsPropertyData.versionId = docData.VersionId AND cmsPropertyData.contentNodeId = docData.nodeId ORDER BY contentNodeId, versionId, propertytypeid ", docSql.Arguments); @@ -1180,4 +1180,4 @@ ORDER BY contentNodeId, versionId, propertytypeid #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/VersionableRepositoryBaseAliasRegex.cs b/src/Umbraco.Core/Persistence/Repositories/VersionableRepositoryBaseAliasRegex.cs index 13933dfc34..9eef623514 100644 --- a/src/Umbraco.Core/Persistence/Repositories/VersionableRepositoryBaseAliasRegex.cs +++ b/src/Umbraco.Core/Persistence/Repositories/VersionableRepositoryBaseAliasRegex.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Text.RegularExpressions; using Umbraco.Core.Persistence.SqlSyntax; @@ -23,4 +23,4 @@ namespace Umbraco.Core.Persistence.Repositories return aliasRegex; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/XsltFileRepository.cs b/src/Umbraco.Core/Persistence/Repositories/XsltFileRepository.cs index 461efce6c3..470b44fb0e 100644 --- a/src/Umbraco.Core/Persistence/Repositories/XsltFileRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/XsltFileRepository.cs @@ -16,7 +16,7 @@ namespace Umbraco.Core.Persistence.Repositories : base(work, fileSystem) { } - + public override XsltFile Get(string id) { var path = FileSystem.GetRelativePath(id); @@ -79,7 +79,7 @@ namespace Umbraco.Core.Persistence.Repositories } /// - /// Gets a list of all that exist at the relative path specified. + /// Gets a list of all that exist at the relative path specified. /// /// /// If null or not specified, will return the XSLT files at the root path relative to the IFileSystem @@ -132,4 +132,4 @@ namespace Umbraco.Core.Persistence.Repositories FileSystem.AddFile(filepath, content, true); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/RepositoryFactory.cs b/src/Umbraco.Core/Persistence/RepositoryFactory.cs index cfc629a80d..283cbfafd4 100644 --- a/src/Umbraco.Core/Persistence/RepositoryFactory.cs +++ b/src/Umbraco.Core/Persistence/RepositoryFactory.cs @@ -1,4 +1,4 @@ -using System; +using System; using LightInject; using Umbraco.Core.Persistence.Repositories; using Umbraco.Core.Persistence.UnitOfWork; @@ -36,4 +36,4 @@ namespace Umbraco.Core.Persistence : _container.GetInstance(uow, name); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/SqlSyntax/ColumnInfo.cs b/src/Umbraco.Core/Persistence/SqlSyntax/ColumnInfo.cs index 71b6d58d8b..654be14d34 100644 --- a/src/Umbraco.Core/Persistence/SqlSyntax/ColumnInfo.cs +++ b/src/Umbraco.Core/Persistence/SqlSyntax/ColumnInfo.cs @@ -28,4 +28,4 @@ public bool IsNullable { get; set; } public string DataType { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/SqlSyntax/DbTypes.cs b/src/Umbraco.Core/Persistence/SqlSyntax/DbTypes.cs index e744fb7fdf..63a17fa814 100644 --- a/src/Umbraco.Core/Persistence/SqlSyntax/DbTypes.cs +++ b/src/Umbraco.Core/Persistence/SqlSyntax/DbTypes.cs @@ -26,4 +26,4 @@ namespace Umbraco.Core.Persistence.SqlSyntax ColumnDbTypeMap[typeof(T)] = dbType; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/SqlSyntax/ISqlSyntaxProvider.cs b/src/Umbraco.Core/Persistence/SqlSyntax/ISqlSyntaxProvider.cs index 21db2d32f0..6cd8cbf46c 100644 --- a/src/Umbraco.Core/Persistence/SqlSyntax/ISqlSyntaxProvider.cs +++ b/src/Umbraco.Core/Persistence/SqlSyntax/ISqlSyntaxProvider.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using NPoco; using Umbraco.Core.Persistence.DatabaseAnnotations; @@ -74,7 +74,7 @@ namespace Umbraco.Core.Persistence.SqlSyntax bool SupportsClustered(); bool SupportsIdentityInsert(); bool? SupportsCaseInsensitiveQueries(IDatabase db); - + string ConvertIntegerToOrderableString { get; } string ConvertDateToOrderableString { get; } string ConvertDecimalToOrderableString { get; } @@ -85,4 +85,4 @@ namespace Umbraco.Core.Persistence.SqlSyntax IEnumerable> GetConstraintsPerColumn(IDatabase db); IEnumerable> GetDefinedIndexes(IDatabase db); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/SqlSyntax/MicrosoftSqlSyntaxProviderBase.cs b/src/Umbraco.Core/Persistence/SqlSyntax/MicrosoftSqlSyntaxProviderBase.cs index 2696dfdc3f..c115cd4286 100644 --- a/src/Umbraco.Core/Persistence/SqlSyntax/MicrosoftSqlSyntaxProviderBase.cs +++ b/src/Umbraco.Core/Persistence/SqlSyntax/MicrosoftSqlSyntaxProviderBase.cs @@ -1,145 +1,145 @@ -using System; -using System.Data; -using System.Linq; -using Umbraco.Core.Persistence.Querying; +using System; +using System.Data; +using System.Linq; +using Umbraco.Core.Persistence.Querying; -namespace Umbraco.Core.Persistence.SqlSyntax -{ - /// - /// Abstract class for defining MS sql implementations - /// - /// - public abstract class MicrosoftSqlSyntaxProviderBase : SqlSyntaxProviderBase - where TSyntax : ISqlSyntaxProvider - { - protected MicrosoftSqlSyntaxProviderBase() - { - AutoIncrementDefinition = "IDENTITY(1,1)"; - GuidColumnDefinition = "UniqueIdentifier"; - RealColumnDefinition = "FLOAT"; - BoolColumnDefinition = "BIT"; - DecimalColumnDefinition = "DECIMAL(38,6)"; - TimeColumnDefinition = "TIME"; //SQLSERVER 2008+ - BlobColumnDefinition = "VARBINARY(MAX)"; +namespace Umbraco.Core.Persistence.SqlSyntax +{ + /// + /// Abstract class for defining MS sql implementations + /// + /// + public abstract class MicrosoftSqlSyntaxProviderBase : SqlSyntaxProviderBase + where TSyntax : ISqlSyntaxProvider + { + protected MicrosoftSqlSyntaxProviderBase() + { + AutoIncrementDefinition = "IDENTITY(1,1)"; + GuidColumnDefinition = "UniqueIdentifier"; + RealColumnDefinition = "FLOAT"; + BoolColumnDefinition = "BIT"; + DecimalColumnDefinition = "DECIMAL(38,6)"; + TimeColumnDefinition = "TIME"; //SQLSERVER 2008+ + BlobColumnDefinition = "VARBINARY(MAX)"; - InitColumnTypeMap(); - } + InitColumnTypeMap(); + } - public override string RenameTable => "sp_rename '{0}', '{1}'"; + public override string RenameTable => "sp_rename '{0}', '{1}'"; - public override string AddColumn => "ALTER TABLE {0} ADD {1}"; + public override string AddColumn => "ALTER TABLE {0} ADD {1}"; - public override string GetQuotedTableName(string tableName) - { + public override string GetQuotedTableName(string tableName) + { if (tableName.Contains(".") == false) - return $"[{tableName}]"; + return $"[{tableName}]"; var tableNameParts = tableName.Split(new[] { '.' }, 2); - return $"[{tableNameParts[0]}].[{tableNameParts[1]}]"; - } + return $"[{tableNameParts[0]}].[{tableNameParts[1]}]"; + } - public override string GetQuotedColumnName(string columnName) => $"[{columnName}]"; + public override string GetQuotedColumnName(string columnName) => $"[{columnName}]"; - public override string GetQuotedName(string name) => $"[{name}]"; + public override string GetQuotedName(string name) => $"[{name}]"; - public override string GetStringColumnEqualComparison(string column, int paramIndex, TextColumnType columnType) - { - switch (columnType) - { - case TextColumnType.NVarchar: - return base.GetStringColumnEqualComparison(column, paramIndex, columnType); - case TextColumnType.NText: - //MSSQL doesn't allow for = comparison with NText columns but allows this syntax - return $"{column} LIKE @{paramIndex}"; - default: - throw new ArgumentOutOfRangeException(nameof(columnType)); - } - } + public override string GetStringColumnEqualComparison(string column, int paramIndex, TextColumnType columnType) + { + switch (columnType) + { + case TextColumnType.NVarchar: + return base.GetStringColumnEqualComparison(column, paramIndex, columnType); + case TextColumnType.NText: + //MSSQL doesn't allow for = comparison with NText columns but allows this syntax + return $"{column} LIKE @{paramIndex}"; + default: + throw new ArgumentOutOfRangeException(nameof(columnType)); + } + } - public override string GetStringColumnWildcardComparison(string column, int paramIndex, TextColumnType columnType) - { - switch (columnType) - { - case TextColumnType.NVarchar: - return base.GetStringColumnWildcardComparison(column, paramIndex, columnType); - case TextColumnType.NText: - //MSSQL doesn't allow for upper methods with NText columns - return $"{column} LIKE @{paramIndex}"; - default: - throw new ArgumentOutOfRangeException(nameof(columnType)); - } - } + public override string GetStringColumnWildcardComparison(string column, int paramIndex, TextColumnType columnType) + { + switch (columnType) + { + case TextColumnType.NVarchar: + return base.GetStringColumnWildcardComparison(column, paramIndex, columnType); + case TextColumnType.NText: + //MSSQL doesn't allow for upper methods with NText columns + return $"{column} LIKE @{paramIndex}"; + default: + throw new ArgumentOutOfRangeException(nameof(columnType)); + } + } - [Obsolete("Use the overload with the parameter index instead")] - public override string GetStringColumnStartsWithComparison(string column, string value, TextColumnType columnType) - { - switch (columnType) - { - case TextColumnType.NVarchar: - return base.GetStringColumnStartsWithComparison(column, value, columnType); - case TextColumnType.NText: - //MSSQL doesn't allow for upper methods with NText columns - return $"{column} LIKE '{value}%'"; - default: - throw new ArgumentOutOfRangeException(nameof(columnType)); - } - } + [Obsolete("Use the overload with the parameter index instead")] + public override string GetStringColumnStartsWithComparison(string column, string value, TextColumnType columnType) + { + switch (columnType) + { + case TextColumnType.NVarchar: + return base.GetStringColumnStartsWithComparison(column, value, columnType); + case TextColumnType.NText: + //MSSQL doesn't allow for upper methods with NText columns + return $"{column} LIKE '{value}%'"; + default: + throw new ArgumentOutOfRangeException(nameof(columnType)); + } + } - [Obsolete("Use the overload with the parameter index instead")] - public override string GetStringColumnEndsWithComparison(string column, string value, TextColumnType columnType) - { - switch (columnType) - { - case TextColumnType.NVarchar: - return base.GetStringColumnEndsWithComparison(column, value, columnType); - case TextColumnType.NText: - //MSSQL doesn't allow for upper methods with NText columns - return $"{column} LIKE '%{value}'"; - default: - throw new ArgumentOutOfRangeException(nameof(columnType)); - } - } + [Obsolete("Use the overload with the parameter index instead")] + public override string GetStringColumnEndsWithComparison(string column, string value, TextColumnType columnType) + { + switch (columnType) + { + case TextColumnType.NVarchar: + return base.GetStringColumnEndsWithComparison(column, value, columnType); + case TextColumnType.NText: + //MSSQL doesn't allow for upper methods with NText columns + return $"{column} LIKE '%{value}'"; + default: + throw new ArgumentOutOfRangeException(nameof(columnType)); + } + } - [Obsolete("Use the overload with the parameter index instead")] - public override string GetStringColumnContainsComparison(string column, string value, TextColumnType columnType) - { - switch (columnType) - { - case TextColumnType.NVarchar: - return base.GetStringColumnContainsComparison(column, value, columnType); - case TextColumnType.NText: - //MSSQL doesn't allow for upper methods with NText columns - return $"{column} LIKE '%{value}%'"; - default: - throw new ArgumentOutOfRangeException(nameof(columnType)); - } - } + [Obsolete("Use the overload with the parameter index instead")] + public override string GetStringColumnContainsComparison(string column, string value, TextColumnType columnType) + { + switch (columnType) + { + case TextColumnType.NVarchar: + return base.GetStringColumnContainsComparison(column, value, columnType); + case TextColumnType.NText: + //MSSQL doesn't allow for upper methods with NText columns + return $"{column} LIKE '%{value}%'"; + default: + throw new ArgumentOutOfRangeException(nameof(columnType)); + } + } - [Obsolete("Use the overload with the parameter index instead")] - public override string GetStringColumnWildcardComparison(string column, string value, TextColumnType columnType) - { - switch (columnType) - { - case TextColumnType.NVarchar: - return base.GetStringColumnContainsComparison(column, value, columnType); - case TextColumnType.NText: - //MSSQL doesn't allow for upper methods with NText columns - return $"{column} LIKE '{value}'"; - default: - throw new ArgumentOutOfRangeException(nameof(columnType)); - } - } + [Obsolete("Use the overload with the parameter index instead")] + public override string GetStringColumnWildcardComparison(string column, string value, TextColumnType columnType) + { + switch (columnType) + { + case TextColumnType.NVarchar: + return base.GetStringColumnContainsComparison(column, value, columnType); + case TextColumnType.NText: + //MSSQL doesn't allow for upper methods with NText columns + return $"{column} LIKE '{value}'"; + default: + throw new ArgumentOutOfRangeException(nameof(columnType)); + } + } - /// - /// This uses a the DbTypeMap created and custom mapping to resolve the SqlDbType - /// - /// - /// - public virtual SqlDbType GetSqlDbType(Type clrType) - { - var dbType = DbTypeMap.ColumnDbTypeMap.First(x => x.Key == clrType).Value; - return GetSqlDbType(dbType); - } + /// + /// This uses a the DbTypeMap created and custom mapping to resolve the SqlDbType + /// + /// + /// + public virtual SqlDbType GetSqlDbType(Type clrType) + { + var dbType = DbTypeMap.ColumnDbTypeMap.First(x => x.Key == clrType).Value; + return GetSqlDbType(dbType); + } /// /// Returns the mapped SqlDbType for the DbType specified @@ -152,88 +152,88 @@ namespace Umbraco.Core.Persistence.SqlSyntax //SEE: https://msdn.microsoft.com/en-us/library/cc716729(v=vs.110).aspx // and https://msdn.microsoft.com/en-us/library/yy6y35y8%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396 - switch (dbType) - { - case DbType.AnsiString: - sqlDbType = SqlDbType.VarChar; - break; - case DbType.Binary: - sqlDbType = SqlDbType.VarBinary; - break; - case DbType.Byte: - sqlDbType = SqlDbType.TinyInt; - break; - case DbType.Boolean: - sqlDbType = SqlDbType.Bit; - break; - case DbType.Currency: - sqlDbType = SqlDbType.Money; - break; - case DbType.Date: - sqlDbType = SqlDbType.Date; - break; - case DbType.DateTime: - sqlDbType = SqlDbType.DateTime; - break; - case DbType.Decimal: - sqlDbType = SqlDbType.Decimal; - break; - case DbType.Double: - sqlDbType = SqlDbType.Float; - break; - case DbType.Guid: - sqlDbType = SqlDbType.UniqueIdentifier; - break; - case DbType.Int16: - sqlDbType = SqlDbType.SmallInt; - break; - case DbType.Int32: - sqlDbType = SqlDbType.Int; - break; - case DbType.Int64: - sqlDbType = SqlDbType.BigInt; - break; - case DbType.Object: - sqlDbType = SqlDbType.Variant; - break; - case DbType.SByte: - throw new NotSupportedException("Inferring a SqlDbType from SByte is not supported."); - case DbType.Single: - sqlDbType = SqlDbType.Real; - break; - case DbType.String: - sqlDbType = SqlDbType.NVarChar; - break; - case DbType.Time: - sqlDbType = SqlDbType.Time; - break; - case DbType.UInt16: - throw new NotSupportedException("Inferring a SqlDbType from UInt16 is not supported."); - case DbType.UInt32: - throw new NotSupportedException("Inferring a SqlDbType from UInt32 is not supported."); - case DbType.UInt64: - throw new NotSupportedException("Inferring a SqlDbType from UInt64 is not supported."); - case DbType.VarNumeric: - throw new NotSupportedException("Inferring a VarNumeric from UInt64 is not supported."); - case DbType.AnsiStringFixedLength: - sqlDbType = SqlDbType.Char; - break; - case DbType.StringFixedLength: - sqlDbType = SqlDbType.NChar; - break; - case DbType.Xml: - sqlDbType = SqlDbType.Xml; - break; - case DbType.DateTime2: - sqlDbType = SqlDbType.DateTime2; - break; - case DbType.DateTimeOffset: - sqlDbType = SqlDbType.DateTimeOffset; - break; - default: - throw new ArgumentOutOfRangeException(); - } - return sqlDbType; - } - } -} \ No newline at end of file + switch (dbType) + { + case DbType.AnsiString: + sqlDbType = SqlDbType.VarChar; + break; + case DbType.Binary: + sqlDbType = SqlDbType.VarBinary; + break; + case DbType.Byte: + sqlDbType = SqlDbType.TinyInt; + break; + case DbType.Boolean: + sqlDbType = SqlDbType.Bit; + break; + case DbType.Currency: + sqlDbType = SqlDbType.Money; + break; + case DbType.Date: + sqlDbType = SqlDbType.Date; + break; + case DbType.DateTime: + sqlDbType = SqlDbType.DateTime; + break; + case DbType.Decimal: + sqlDbType = SqlDbType.Decimal; + break; + case DbType.Double: + sqlDbType = SqlDbType.Float; + break; + case DbType.Guid: + sqlDbType = SqlDbType.UniqueIdentifier; + break; + case DbType.Int16: + sqlDbType = SqlDbType.SmallInt; + break; + case DbType.Int32: + sqlDbType = SqlDbType.Int; + break; + case DbType.Int64: + sqlDbType = SqlDbType.BigInt; + break; + case DbType.Object: + sqlDbType = SqlDbType.Variant; + break; + case DbType.SByte: + throw new NotSupportedException("Inferring a SqlDbType from SByte is not supported."); + case DbType.Single: + sqlDbType = SqlDbType.Real; + break; + case DbType.String: + sqlDbType = SqlDbType.NVarChar; + break; + case DbType.Time: + sqlDbType = SqlDbType.Time; + break; + case DbType.UInt16: + throw new NotSupportedException("Inferring a SqlDbType from UInt16 is not supported."); + case DbType.UInt32: + throw new NotSupportedException("Inferring a SqlDbType from UInt32 is not supported."); + case DbType.UInt64: + throw new NotSupportedException("Inferring a SqlDbType from UInt64 is not supported."); + case DbType.VarNumeric: + throw new NotSupportedException("Inferring a VarNumeric from UInt64 is not supported."); + case DbType.AnsiStringFixedLength: + sqlDbType = SqlDbType.Char; + break; + case DbType.StringFixedLength: + sqlDbType = SqlDbType.NChar; + break; + case DbType.Xml: + sqlDbType = SqlDbType.Xml; + break; + case DbType.DateTime2: + sqlDbType = SqlDbType.DateTime2; + break; + case DbType.DateTimeOffset: + sqlDbType = SqlDbType.DateTimeOffset; + break; + default: + throw new ArgumentOutOfRangeException(); + } + return sqlDbType; + } + } +} diff --git a/src/Umbraco.Core/Persistence/SqlSyntax/MySqlSyntaxProvider.cs b/src/Umbraco.Core/Persistence/SqlSyntax/MySqlSyntaxProvider.cs index 6b9207eba7..2ecbd2c9c6 100644 --- a/src/Umbraco.Core/Persistence/SqlSyntax/MySqlSyntaxProvider.cs +++ b/src/Umbraco.Core/Persistence/SqlSyntax/MySqlSyntaxProvider.cs @@ -332,7 +332,7 @@ ORDER BY TABLE_NAME, INDEX_NAME", { case SystemMethods.NewGuid: return null; // NOT SUPPORTED! - //return "NEWID()"; + //return "NEWID()"; case SystemMethods.CurrentDateTime: return "CURRENT_TIMESTAMP"; //case SystemMethods.NewSequentialId: @@ -392,7 +392,7 @@ ORDER BY TABLE_NAME, INDEX_NAME", db.CloseSharedConnection(); } - // Could return null, which means testing failed, + // Could return null, which means testing failed, // add message to check with their hosting provider return supportsCaseInsensitiveQueries; } @@ -402,4 +402,4 @@ ORDER BY TABLE_NAME, INDEX_NAME", return NPocoDatabaseExtensions.EscapeAtSymbols(MySql.Data.MySqlClient.MySqlHelper.EscapeString(val)); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/SqlSyntax/SqlCeSyntaxProvider.cs b/src/Umbraco.Core/Persistence/SqlSyntax/SqlCeSyntaxProvider.cs index 5a74ff5193..81b13c15eb 100644 --- a/src/Umbraco.Core/Persistence/SqlSyntax/SqlCeSyntaxProvider.cs +++ b/src/Umbraco.Core/Persistence/SqlSyntax/SqlCeSyntaxProvider.cs @@ -61,7 +61,7 @@ namespace Umbraco.Core.Persistence.SqlSyntax return string.Format("{0} LIKE '{1}'", column, value); default: throw new ArgumentOutOfRangeException("columnType"); - } + } } public override string GetConcat(params string[] args) @@ -154,7 +154,7 @@ namespace Umbraco.Core.Persistence.SqlSyntax { var items = db.Fetch( - @"SELECT TABLE_NAME, INDEX_NAME, COLUMN_NAME, [UNIQUE] FROM INFORMATION_SCHEMA.INDEXES + @"SELECT TABLE_NAME, INDEX_NAME, COLUMN_NAME, [UNIQUE] FROM INFORMATION_SCHEMA.INDEXES WHERE INDEX_NAME NOT LIKE 'PK_%' ORDER BY TABLE_NAME, INDEX_NAME"); return @@ -189,7 +189,7 @@ ORDER BY TABLE_NAME, INDEX_NAME"); switch (systemMethod) { case SystemMethods.NewGuid: - return "NEWID()"; + return "NEWID()"; case SystemMethods.CurrentDateTime: return "GETDATE()"; //case SystemMethods.NewSequentialId: @@ -209,9 +209,9 @@ ORDER BY TABLE_NAME, INDEX_NAME"); } } - + public override string DropIndex { get { return "DROP INDEX {1}.{0}"; } } - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/SqlSyntax/SqlServerSyntaxProvider.cs b/src/Umbraco.Core/Persistence/SqlSyntax/SqlServerSyntaxProvider.cs index e1172b6497..5e12aea1f5 100644 --- a/src/Umbraco.Core/Persistence/SqlSyntax/SqlServerSyntaxProvider.cs +++ b/src/Umbraco.Core/Persistence/SqlSyntax/SqlServerSyntaxProvider.cs @@ -111,17 +111,17 @@ namespace Umbraco.Core.Persistence.SqlSyntax // EngineEdition: 1/Desktop 2/Standard 3/Enterprise 4/Express 5/Azure // ProductLevel: RTM, SPx, CTP... - const string sql = @"select - SERVERPROPERTY('Edition') Edition, - SERVERPROPERTY('EditionID') EditionId, - SERVERPROPERTY('InstanceName') InstanceName, - SERVERPROPERTY('ProductVersion') ProductVersion, - SERVERPROPERTY('BuildClrVersion') BuildClrVersion, - SERVERPROPERTY('EngineEdition') EngineEdition, - SERVERPROPERTY('IsClustered') IsClustered, - SERVERPROPERTY('MachineName') MachineName, - SERVERPROPERTY('ResourceLastUpdateDateTime') ResourceLastUpdateDateTime, - SERVERPROPERTY('ProductLevel') ProductLevel;"; + const string sql = @"select + SERVERPROPERTY('Edition') Edition, + SERVERPROPERTY('EditionID') EditionId, + SERVERPROPERTY('InstanceName') InstanceName, + SERVERPROPERTY('ProductVersion') ProductVersion, + SERVERPROPERTY('BuildClrVersion') BuildClrVersion, + SERVERPROPERTY('EngineEdition') EngineEdition, + SERVERPROPERTY('IsClustered') IsClustered, + SERVERPROPERTY('MachineName') MachineName, + SERVERPROPERTY('ResourceLastUpdateDateTime') ResourceLastUpdateDateTime, + SERVERPROPERTY('ProductLevel') ProductLevel;"; try { @@ -185,9 +185,9 @@ namespace Umbraco.Core.Persistence.SqlSyntax db.Fetch( @"select T.name as TABLE_NAME, I.name as INDEX_NAME, AC.Name as COLUMN_NAME, CASE WHEN I.is_unique_constraint = 1 OR I.is_unique = 1 THEN 1 ELSE 0 END AS [UNIQUE] -from sys.tables as T inner join sys.indexes as I on T.[object_id] = I.[object_id] - inner join sys.index_columns as IC on IC.[object_id] = I.[object_id] and IC.[index_id] = I.[index_id] - inner join sys.all_columns as AC on IC.[object_id] = AC.[object_id] and IC.[column_id] = AC.[column_id] +from sys.tables as T inner join sys.indexes as I on T.[object_id] = I.[object_id] + inner join sys.index_columns as IC on IC.[object_id] = I.[object_id] and IC.[index_id] = I.[index_id] + inner join sys.all_columns as AC on IC.[object_id] = AC.[object_id] and IC.[column_id] = AC.[column_id] WHERE I.name NOT LIKE 'PK_%' order by T.name, I.name"); return items.Select(item => new Tuple(item.TABLE_NAME, item.INDEX_NAME, item.COLUMN_NAME, @@ -252,4 +252,4 @@ order by T.name, I.name"); public override string RenameColumn => "sp_rename '{0}.{1}', '{2}', 'COLUMN'"; } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/SqlSyntax/SqlServerVersionName.cs b/src/Umbraco.Core/Persistence/SqlSyntax/SqlServerVersionName.cs index 2f50f39435..86ef343786 100644 --- a/src/Umbraco.Core/Persistence/SqlSyntax/SqlServerVersionName.cs +++ b/src/Umbraco.Core/Persistence/SqlSyntax/SqlServerVersionName.cs @@ -18,4 +18,4 @@ V2016 = 6, Other = 100 } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/SqlSyntax/SqlSyntaxProviderAttribute.cs b/src/Umbraco.Core/Persistence/SqlSyntax/SqlSyntaxProviderAttribute.cs index a4b40ba78c..79e564a1f4 100644 --- a/src/Umbraco.Core/Persistence/SqlSyntax/SqlSyntaxProviderAttribute.cs +++ b/src/Umbraco.Core/Persistence/SqlSyntax/SqlSyntaxProviderAttribute.cs @@ -18,4 +18,4 @@ namespace Umbraco.Core.Persistence.SqlSyntax /// public string ProviderName { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/SqlSyntax/SqlSyntaxProviderBase.cs b/src/Umbraco.Core/Persistence/SqlSyntax/SqlSyntaxProviderBase.cs index b72aa332df..0bbae1104d 100644 --- a/src/Umbraco.Core/Persistence/SqlSyntax/SqlSyntaxProviderBase.cs +++ b/src/Umbraco.Core/Persistence/SqlSyntax/SqlSyntaxProviderBase.cs @@ -535,4 +535,4 @@ namespace Umbraco.Core.Persistence.SqlSyntax public virtual string ConvertDateToOrderableString => "CONVERT(nvarchar, {0}, 102)"; public virtual string ConvertDecimalToOrderableString => "REPLACE(STR({0}, 20, 9), SPACE(1), '0')"; } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/SqlSyntax/SqlSyntaxProviderExtensions.cs b/src/Umbraco.Core/Persistence/SqlSyntax/SqlSyntaxProviderExtensions.cs index e99b4ed826..b53f6224c4 100644 --- a/src/Umbraco.Core/Persistence/SqlSyntax/SqlSyntaxProviderExtensions.cs +++ b/src/Umbraco.Core/Persistence/SqlSyntax/SqlSyntaxProviderExtensions.cs @@ -42,7 +42,7 @@ namespace Umbraco.Core.Persistence.SqlSyntax public static Sql GetDeleteSubquery(this ISqlSyntaxProvider sqlProvider, string tableName, string columnName, Sql subQuery, WhereInType whereInType = WhereInType.In) { - return + return new Sql(string.Format( whereInType == WhereInType.In ? @"DELETE FROM {0} WHERE {1} IN (SELECT {1} FROM ({2}) x)" @@ -58,4 +58,4 @@ namespace Umbraco.Core.Persistence.SqlSyntax In, NotIn } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/UmbracoDatabase.cs b/src/Umbraco.Core/Persistence/UmbracoDatabase.cs index fecae2ef59..43735b7759 100644 --- a/src/Umbraco.Core/Persistence/UmbracoDatabase.cs +++ b/src/Umbraco.Core/Persistence/UmbracoDatabase.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Data; using System.Data.Common; using System.Data.SqlClient; @@ -264,4 +264,4 @@ namespace Umbraco.Core.Persistence #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/UmbracoDatabaseExtensions.cs b/src/Umbraco.Core/Persistence/UmbracoDatabaseExtensions.cs index c1ca19e9f6..249dd3dc73 100644 --- a/src/Umbraco.Core/Persistence/UmbracoDatabaseExtensions.cs +++ b/src/Umbraco.Core/Persistence/UmbracoDatabaseExtensions.cs @@ -11,4 +11,4 @@ namespace Umbraco.Core.Persistence return asDatabase; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/UmbracoDatabaseFactory.cs b/src/Umbraco.Core/Persistence/UmbracoDatabaseFactory.cs index b3aaee76e2..21a1767b24 100644 --- a/src/Umbraco.Core/Persistence/UmbracoDatabaseFactory.cs +++ b/src/Umbraco.Core/Persistence/UmbracoDatabaseFactory.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Configuration; using System.Data.Common; @@ -252,13 +252,13 @@ namespace Umbraco.Core.Persistence // during tests, the thread static var can leak between tests // this method provides a way to force-reset the variable - internal void ResetForTests() - { + internal void ResetForTests() + { // fixme - does not make any sense! //var db = _umbracoDatabaseAccessor.UmbracoDatabase; //_umbracoDatabaseAccessor.UmbracoDatabase = null; //db?.Dispose(); - //_databaseScopeAccessor.Scope = null; - } + //_databaseScopeAccessor.Scope = null; + } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/UnitOfWork/IScopeUnitOfWork.cs b/src/Umbraco.Core/Persistence/UnitOfWork/IScopeUnitOfWork.cs index afe79b38b0..9a76bca4b3 100644 --- a/src/Umbraco.Core/Persistence/UnitOfWork/IScopeUnitOfWork.cs +++ b/src/Umbraco.Core/Persistence/UnitOfWork/IScopeUnitOfWork.cs @@ -1,4 +1,4 @@ -using Umbraco.Core.Events; +using Umbraco.Core.Events; using Umbraco.Core.Scoping; namespace Umbraco.Core.Persistence.UnitOfWork @@ -37,4 +37,4 @@ namespace Umbraco.Core.Persistence.UnitOfWork /// The lock object identifiers. void WriteLock(params int[] lockIds); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/UnitOfWork/IScopeUnitOfWorkProvider.cs b/src/Umbraco.Core/Persistence/UnitOfWork/IScopeUnitOfWorkProvider.cs index 0dc76c4833..4c7110d174 100644 --- a/src/Umbraco.Core/Persistence/UnitOfWork/IScopeUnitOfWorkProvider.cs +++ b/src/Umbraco.Core/Persistence/UnitOfWork/IScopeUnitOfWorkProvider.cs @@ -1,4 +1,4 @@ -using System.Data; +using System.Data; using Umbraco.Core.Scoping; namespace Umbraco.Core.Persistence.UnitOfWork @@ -31,4 +31,4 @@ namespace Umbraco.Core.Persistence.UnitOfWork /// IScopeUnitOfWork CreateUnitOfWork(IsolationLevel isolationLevel = IsolationLevel.Unspecified, bool readOnly = false, bool immediate = false); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/UnitOfWork/IUnitOfWork.cs b/src/Umbraco.Core/Persistence/UnitOfWork/IUnitOfWork.cs index 93cafcb493..fdc369374c 100644 --- a/src/Umbraco.Core/Persistence/UnitOfWork/IUnitOfWork.cs +++ b/src/Umbraco.Core/Persistence/UnitOfWork/IUnitOfWork.cs @@ -4,11 +4,11 @@ using Umbraco.Core.Persistence.Repositories; namespace Umbraco.Core.Persistence.UnitOfWork { - /// + /// /// Represents a persistence unit of work. /// public interface IUnitOfWork : IDisposable - { + { /// /// Registers an entity to be created as part of this unit of work. /// @@ -78,7 +78,7 @@ namespace Umbraco.Core.Persistence.UnitOfWork /// The type of the repository. /// The optional name of the repository. /// The created repository for the unit of work. - TRepository CreateRepository(string name = null) + TRepository CreateRepository(string name = null) where TRepository : IRepository; } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/UnitOfWork/IUnitOfWorkRepository.cs b/src/Umbraco.Core/Persistence/UnitOfWork/IUnitOfWorkRepository.cs index 8281d63bae..1dda7efb94 100644 --- a/src/Umbraco.Core/Persistence/UnitOfWork/IUnitOfWorkRepository.cs +++ b/src/Umbraco.Core/Persistence/UnitOfWork/IUnitOfWorkRepository.cs @@ -11,4 +11,4 @@ namespace Umbraco.Core.Persistence.UnitOfWork void PersistUpdatedItem(IEntity entity); void PersistDeletedItem(IEntity entity); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/UnitOfWork/ScopeUnitOfWork.cs b/src/Umbraco.Core/Persistence/UnitOfWork/ScopeUnitOfWork.cs index 0227467cb0..f9722d7516 100644 --- a/src/Umbraco.Core/Persistence/UnitOfWork/ScopeUnitOfWork.cs +++ b/src/Umbraco.Core/Persistence/UnitOfWork/ScopeUnitOfWork.cs @@ -8,12 +8,12 @@ using Umbraco.Core.Scoping; namespace Umbraco.Core.Persistence.UnitOfWork { - /// - /// Represents a scoped unit of work. - /// - internal class ScopeUnitOfWork : UnitOfWorkBase, IScopeUnitOfWork + /// + /// Represents a scoped unit of work. + /// + internal class ScopeUnitOfWork : UnitOfWorkBase, IScopeUnitOfWork { - private readonly IsolationLevel _isolationLevel; + private readonly IsolationLevel _isolationLevel; private readonly IScopeProvider _scopeProvider; private readonly IDatabaseContext _databaseContext; private bool _completeScope; @@ -45,8 +45,8 @@ namespace Umbraco.Core.Persistence.UnitOfWork _isolationLevel = isolationLevel; // fixme only 1! - _key = Guid.NewGuid(); - InstanceId = Guid.NewGuid(); + _key = Guid.NewGuid(); + InstanceId = Guid.NewGuid(); // be false by default // if set to true... the UnitOfWork is "auto-commit" which means that even in the case of @@ -105,7 +105,7 @@ namespace Umbraco.Core.Persistence.UnitOfWork _key = Guid.NewGuid(); // fixme kill! } - public object Key => _key; + public object Key => _key; // fixme v8 // once we are absolutely sure that our UOW cannot be disposed more than once, @@ -118,21 +118,21 @@ namespace Umbraco.Core.Persistence.UnitOfWork public IEventDispatcher Events => Scope.Events; - /// - /// Ensures disposable objects are disposed - /// - /// - /// Ensures that the Transaction instance is disposed of - /// - protected override void DisposeResources() - { + /// + /// Ensures disposable objects are disposed + /// + /// + /// Ensures that the Transaction instance is disposed of + /// + protected override void DisposeResources() + { // base deals with the operation's queue base.DisposeResources(); - if (_scope == null) return; - if (_completeScope) _scope.Complete(); - _scope.Dispose(); - _scope = null; - } + if (_scope == null) return; + if (_completeScope) _scope.Complete(); + _scope.Dispose(); + _scope = null; + } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/UnitOfWork/ScopeUnitOfWorkProvider.cs b/src/Umbraco.Core/Persistence/UnitOfWork/ScopeUnitOfWorkProvider.cs index 9ea1907f86..c159d16704 100644 --- a/src/Umbraco.Core/Persistence/UnitOfWork/ScopeUnitOfWorkProvider.cs +++ b/src/Umbraco.Core/Persistence/UnitOfWork/ScopeUnitOfWorkProvider.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Data; using Umbraco.Core.Scoping; @@ -30,4 +30,4 @@ namespace Umbraco.Core.Persistence.UnitOfWork return new ScopeUnitOfWork(ScopeProvider, DatabaseContext, _repositoryFactory, isolationLevel, readOnly, immediate); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/UnitOfWorkExtensions.cs b/src/Umbraco.Core/Persistence/UnitOfWorkExtensions.cs index 0c79b43ce3..97d9edd6d9 100644 --- a/src/Umbraco.Core/Persistence/UnitOfWorkExtensions.cs +++ b/src/Umbraco.Core/Persistence/UnitOfWorkExtensions.cs @@ -29,4 +29,4 @@ namespace Umbraco.Core.Persistence throw new ArgumentOutOfRangeException(nameof(containerObjectType)); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Properties/AssemblyInfo.cs b/src/Umbraco.Core/Properties/AssemblyInfo.cs index 44cd5df1ce..c7629694de 100644 --- a/src/Umbraco.Core/Properties/AssemblyInfo.cs +++ b/src/Umbraco.Core/Properties/AssemblyInfo.cs @@ -46,4 +46,4 @@ using System.Runtime.InteropServices; [assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")] // v8 -[assembly: InternalsVisibleTo("Umbraco.Compat7")] \ No newline at end of file +[assembly: InternalsVisibleTo("Umbraco.Compat7")] diff --git a/src/Umbraco.Core/PropertyEditors/DecimalValidator.cs b/src/Umbraco.Core/PropertyEditors/DecimalValidator.cs index 632821bc24..4b8b6213db 100644 --- a/src/Umbraco.Core/PropertyEditors/DecimalValidator.cs +++ b/src/Umbraco.Core/PropertyEditors/DecimalValidator.cs @@ -27,4 +27,4 @@ namespace Umbraco.Core.PropertyEditors return Validate(value, "", preValues, editor); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/PropertyEditors/DefaultPropertyValueConverterAttribute.cs b/src/Umbraco.Core/PropertyEditors/DefaultPropertyValueConverterAttribute.cs index 10bdd053a8..a4fb3fb298 100644 --- a/src/Umbraco.Core/PropertyEditors/DefaultPropertyValueConverterAttribute.cs +++ b/src/Umbraco.Core/PropertyEditors/DefaultPropertyValueConverterAttribute.cs @@ -21,16 +21,16 @@ namespace Umbraco.Core.PropertyEditors } /// - /// A DefaultPropertyValueConverter can 'shadow' other default property value converters so that + /// A DefaultPropertyValueConverter can 'shadow' other default property value converters so that /// a DefaultPropertyValueConverter can be more specific than another one. /// /// /// An example where this is useful is that both the RelatedLiksEditorValueConverter and the JsonValueConverter - /// will be returned as value converters for the Related Links Property editor, however the JsonValueConverter + /// will be returned as value converters for the Related Links Property editor, however the JsonValueConverter /// is a very generic converter and the RelatedLiksEditorValueConverter is more specific than it, so the RelatedLiksEditorValueConverter /// can specify that it 'shadows' the JsonValueConverter. /// public IEnumerable DefaultConvertersToShadow { get; private set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/PropertyEditors/DelimitedManifestValueValidator.cs b/src/Umbraco.Core/PropertyEditors/DelimitedManifestValueValidator.cs index 4c2b218ad0..0ea3cf6bce 100644 --- a/src/Umbraco.Core/PropertyEditors/DelimitedManifestValueValidator.cs +++ b/src/Umbraco.Core/PropertyEditors/DelimitedManifestValueValidator.cs @@ -66,4 +66,4 @@ namespace Umbraco.Core.PropertyEditors } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/PropertyEditors/EmailValidator.cs b/src/Umbraco.Core/PropertyEditors/EmailValidator.cs index 403e26ca70..d83d9fae76 100644 --- a/src/Umbraco.Core/PropertyEditors/EmailValidator.cs +++ b/src/Umbraco.Core/PropertyEditors/EmailValidator.cs @@ -28,4 +28,4 @@ namespace Umbraco.Core.PropertyEditors return this.Validate(value, null, preValues, editor); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/PropertyEditors/GridEditor.cs b/src/Umbraco.Core/PropertyEditors/GridEditor.cs index 61ea94e7dd..d021237c2a 100644 --- a/src/Umbraco.Core/PropertyEditors/GridEditor.cs +++ b/src/Umbraco.Core/PropertyEditors/GridEditor.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using Newtonsoft.Json; using Umbraco.Core.Configuration.Grid; @@ -50,7 +50,7 @@ namespace Umbraco.Core.PropertyEditors } /// - /// Serves as a hash function for a particular type. + /// Serves as a hash function for a particular type. /// /// /// A hash code for the current . @@ -60,4 +60,4 @@ namespace Umbraco.Core.PropertyEditors return Alias.GetHashCode(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/PropertyEditors/IParameterEditor.cs b/src/Umbraco.Core/PropertyEditors/IParameterEditor.cs index ce42e5d84e..ae27c7227d 100644 --- a/src/Umbraco.Core/PropertyEditors/IParameterEditor.cs +++ b/src/Umbraco.Core/PropertyEditors/IParameterEditor.cs @@ -22,4 +22,4 @@ namespace Umbraco.Core.PropertyEditors IValueEditor ValueEditor { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/PropertyEditors/IPropertyValidator.cs b/src/Umbraco.Core/PropertyEditors/IPropertyValidator.cs index 3aa5958135..3cbb3485b0 100644 --- a/src/Umbraco.Core/PropertyEditors/IPropertyValidator.cs +++ b/src/Umbraco.Core/PropertyEditors/IPropertyValidator.cs @@ -25,4 +25,4 @@ namespace Umbraco.Core.PropertyEditors /// IEnumerable Validate(object value, PreValueCollection preValues, PropertyEditor editor); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/PropertyEditors/IValueEditor.cs b/src/Umbraco.Core/PropertyEditors/IValueEditor.cs index e084e468c9..a0e01d090c 100644 --- a/src/Umbraco.Core/PropertyEditors/IValueEditor.cs +++ b/src/Umbraco.Core/PropertyEditors/IValueEditor.cs @@ -7,4 +7,4 @@ { string View { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/PropertyEditors/IntegerValidator.cs b/src/Umbraco.Core/PropertyEditors/IntegerValidator.cs index 173506e77e..826b008e3c 100644 --- a/src/Umbraco.Core/PropertyEditors/IntegerValidator.cs +++ b/src/Umbraco.Core/PropertyEditors/IntegerValidator.cs @@ -27,4 +27,4 @@ namespace Umbraco.Core.PropertyEditors return Validate(value, "", preValues, editor); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/PropertyEditors/LegacyParameterEditorAliasConverter.cs b/src/Umbraco.Core/PropertyEditors/LegacyParameterEditorAliasConverter.cs index 9e2fb5d10a..63f52f7741 100644 --- a/src/Umbraco.Core/PropertyEditors/LegacyParameterEditorAliasConverter.cs +++ b/src/Umbraco.Core/PropertyEditors/LegacyParameterEditorAliasConverter.cs @@ -7,7 +7,7 @@ using System.Linq; namespace Umbraco.Core.PropertyEditors { /// - /// Used to map the legacy parameter editor aliases to the new ones, this is really just used during + /// Used to map the legacy parameter editor aliases to the new ones, this is really just used during /// installation but has been put in a separate class in case we need it for other purposes /// public static class LegacyParameterEditorAliasConverter @@ -97,7 +97,7 @@ namespace Umbraco.Core.PropertyEditors CreateMap("mediaCurrent", Constants.PropertyEditors.MediaPickerAlias); - CreateMap("number", Constants.PropertyEditors.IntegerAlias); + CreateMap("number", Constants.PropertyEditors.IntegerAlias); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/PropertyEditors/LegacyPropertyEditorIdToAliasConverter.cs b/src/Umbraco.Core/PropertyEditors/LegacyPropertyEditorIdToAliasConverter.cs index b6180eedf0..de6a263aaa 100644 --- a/src/Umbraco.Core/PropertyEditors/LegacyPropertyEditorIdToAliasConverter.cs +++ b/src/Umbraco.Core/PropertyEditors/LegacyPropertyEditorIdToAliasConverter.cs @@ -27,7 +27,7 @@ namespace Umbraco.Core.PropertyEditors /// /// The map consists of a key which is always the GUID (lowercase, no hyphens + alias (trimmed)) /// - private static ConcurrentDictionary> _map = new ConcurrentDictionary>(); + private static ConcurrentDictionary> _map = new ConcurrentDictionary>(); /// /// Creates a map for the specified legacy id and property editor alias @@ -89,7 +89,7 @@ namespace Umbraco.Core.PropertyEditors } return found.Value.Item1; } - + internal static int Count() { return _map.Count; @@ -109,12 +109,12 @@ namespace Umbraco.Core.PropertyEditors CreateMap(Guid.Parse(Constants.PropertyEditors.ColorPicker), Constants.PropertyEditors.ColorPickerAlias); CreateMap(Guid.Parse(Constants.PropertyEditors.ContentPicker), Constants.PropertyEditors.ContentPickerAlias); CreateMap(Guid.Parse(Constants.PropertyEditors.Date), Constants.PropertyEditors.DateAlias); - CreateMap(Guid.Parse(Constants.PropertyEditors.DateTime), Constants.PropertyEditors.DateTimeAlias); + CreateMap(Guid.Parse(Constants.PropertyEditors.DateTime), Constants.PropertyEditors.DateTimeAlias); CreateMap(Guid.Parse(Constants.PropertyEditors.DropDownList), Constants.PropertyEditors.DropDownListAlias); CreateMap(Guid.Parse(Constants.PropertyEditors.DropDownListMultiple), Constants.PropertyEditors.DropDownListMultipleAlias); CreateMap(Guid.Parse(Constants.PropertyEditors.DropdownlistMultiplePublishKeys), Constants.PropertyEditors.DropdownlistMultiplePublishKeysAlias); CreateMap(Guid.Parse(Constants.PropertyEditors.DropdownlistPublishingKeys), Constants.PropertyEditors.DropdownlistPublishingKeysAlias); - CreateMap(Guid.Parse(Constants.PropertyEditors.FolderBrowser), Constants.PropertyEditors.FolderBrowserAlias); + CreateMap(Guid.Parse(Constants.PropertyEditors.FolderBrowser), Constants.PropertyEditors.FolderBrowserAlias); CreateMap(Guid.Parse(Constants.PropertyEditors.Integer), Constants.PropertyEditors.IntegerAlias); CreateMap(Guid.Parse(Constants.PropertyEditors.ListView), Constants.PropertyEditors.ListViewAlias); CreateMap(Guid.Parse(Constants.PropertyEditors.MacroContainer), Constants.PropertyEditors.MacroContainerAlias); @@ -122,7 +122,7 @@ namespace Umbraco.Core.PropertyEditors CreateMap(Guid.Parse(Constants.PropertyEditors.MemberPicker), Constants.PropertyEditors.MemberPickerAlias); CreateMap(Guid.Parse(Constants.PropertyEditors.MultiNodeTreePicker), Constants.PropertyEditors.MultiNodeTreePickerAlias); CreateMap(Guid.Parse(Constants.PropertyEditors.MultipleTextstring), Constants.PropertyEditors.MultipleTextstringAlias); - CreateMap(Guid.Parse(Constants.PropertyEditors.NoEdit), Constants.PropertyEditors.NoEditAlias); + CreateMap(Guid.Parse(Constants.PropertyEditors.NoEdit), Constants.PropertyEditors.NoEditAlias); CreateMap(Guid.Parse(Constants.PropertyEditors.RadioButtonList), Constants.PropertyEditors.RadioButtonListAlias); CreateMap(Guid.Parse(Constants.PropertyEditors.RelatedLinks), Constants.PropertyEditors.RelatedLinksAlias); CreateMap(Guid.Parse(Constants.PropertyEditors.Slider), Constants.PropertyEditors.SliderAlias); @@ -130,8 +130,8 @@ namespace Umbraco.Core.PropertyEditors CreateMap(Guid.Parse(Constants.PropertyEditors.Textbox), Constants.PropertyEditors.TextboxAlias); CreateMap(Guid.Parse(Constants.PropertyEditors.TextboxMultiple), Constants.PropertyEditors.TextboxMultipleAlias); CreateMap(Guid.Parse(Constants.PropertyEditors.TinyMCEv3), Constants.PropertyEditors.TinyMCEAlias); - CreateMap(Guid.Parse(Constants.PropertyEditors.TrueFalse), Constants.PropertyEditors.TrueFalseAlias); - CreateMap(Guid.Parse(Constants.PropertyEditors.UserPicker), Constants.PropertyEditors.UserPickerAlias); + CreateMap(Guid.Parse(Constants.PropertyEditors.TrueFalse), Constants.PropertyEditors.TrueFalseAlias); + CreateMap(Guid.Parse(Constants.PropertyEditors.UserPicker), Constants.PropertyEditors.UserPickerAlias); CreateMap(Guid.Parse(Constants.PropertyEditors.UploadField), Constants.PropertyEditors.UploadFieldAlias); CreateMap(Guid.Parse(Constants.PropertyEditors.XPathCheckBoxList), Constants.PropertyEditors.XPathCheckBoxListAlias); CreateMap(Guid.Parse(Constants.PropertyEditors.XPathDropDownList), Constants.PropertyEditors.XPathDropDownListAlias); @@ -141,13 +141,13 @@ namespace Umbraco.Core.PropertyEditors //TODO: Map this somewhere! CreateMap(Guid.Parse(Constants.PropertyEditors.PickerRelations), Constants.PropertyEditors.PickerRelationsAlias); CreateMap(Guid.Parse(Constants.PropertyEditors.UltimatePicker), Constants.PropertyEditors.ContentPickerAlias); - CreateMap(Guid.Parse(Constants.PropertyEditors.UltraSimpleEditor), Constants.PropertyEditors.MarkdownEditorAlias); + CreateMap(Guid.Parse(Constants.PropertyEditors.UltraSimpleEditor), Constants.PropertyEditors.MarkdownEditorAlias); //Not being converted - convert to label CreateMap(Guid.Parse(Constants.PropertyEditors.DictionaryPicker), Constants.PropertyEditors.NoEditAlias); CreateMap(Guid.Parse(Constants.PropertyEditors.UmbracoUserControlWrapper), Constants.PropertyEditors.NoEditAlias); - - + + } } diff --git a/src/Umbraco.Core/PropertyEditors/ManifestPropertyValidator.cs b/src/Umbraco.Core/PropertyEditors/ManifestPropertyValidator.cs index 59aa0e9163..9fccbd101d 100644 --- a/src/Umbraco.Core/PropertyEditors/ManifestPropertyValidator.cs +++ b/src/Umbraco.Core/PropertyEditors/ManifestPropertyValidator.cs @@ -63,4 +63,4 @@ namespace Umbraco.Core.PropertyEditors return ValidatorInstance.Validate(value, Config, preValues, editor); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/PropertyEditors/ManifestValueValidator.cs b/src/Umbraco.Core/PropertyEditors/ManifestValueValidator.cs index 46ed82feb3..a9c25bf029 100644 --- a/src/Umbraco.Core/PropertyEditors/ManifestValueValidator.cs +++ b/src/Umbraco.Core/PropertyEditors/ManifestValueValidator.cs @@ -30,17 +30,17 @@ namespace Umbraco.Core.PropertyEditors /// string representing an editor's model. /// /// - /// An object that is used to configure the validator. An example could be a regex + /// An object that is used to configure the validator. An example could be a regex /// expression if the validator was a regex validator. This is defined in the manifest along with /// the definition of the validator. /// /// The current pre-values stored for the data type /// The property editor instance that is being validated /// - /// Returns a list of validation results. If a result does not have a field name applied to it then then we assume that - /// the validation message applies to the entire property type being validated. If there is a field name applied to a + /// Returns a list of validation results. If a result does not have a field name applied to it then then we assume that + /// the validation message applies to the entire property type being validated. If there is a field name applied to a /// validation result we will try to match that field name up with a field name on the item itself. /// public abstract IEnumerable Validate(object value, string config, PreValueCollection preValues, PropertyEditor editor); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/PropertyEditors/ParameterEditor.cs b/src/Umbraco.Core/PropertyEditors/ParameterEditor.cs index 044691162d..a410c60eda 100644 --- a/src/Umbraco.Core/PropertyEditors/ParameterEditor.cs +++ b/src/Umbraco.Core/PropertyEditors/ParameterEditor.cs @@ -16,7 +16,7 @@ namespace Umbraco.Core.PropertyEditors /// /// The constructor will setup the property editor based on the attribute if one is found /// - public ParameterEditor() + public ParameterEditor() { Configuration = new Dictionary(); //assign properties based on the attribute if it is found @@ -60,7 +60,7 @@ namespace Umbraco.Core.PropertyEditors } [JsonIgnore] - IValueEditor IParameterEditor.ValueEditor + IValueEditor IParameterEditor.ValueEditor { get { return ValueEditor; } } @@ -93,4 +93,4 @@ namespace Umbraco.Core.PropertyEditors return editor; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/PropertyEditors/ParameterEditorAttribute.cs b/src/Umbraco.Core/PropertyEditors/ParameterEditorAttribute.cs index 3188cac309..8bb9de61e5 100644 --- a/src/Umbraco.Core/PropertyEditors/ParameterEditorAttribute.cs +++ b/src/Umbraco.Core/PropertyEditors/ParameterEditorAttribute.cs @@ -32,6 +32,6 @@ namespace Umbraco.Core.PropertyEditors public string Alias { get; } public string Name { get; } - public string EditorView { get; } + public string EditorView { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/PropertyEditors/ParameterValueEditor.cs b/src/Umbraco.Core/PropertyEditors/ParameterValueEditor.cs index 6c5f03f9e7..69cfe033ce 100644 --- a/src/Umbraco.Core/PropertyEditors/ParameterValueEditor.cs +++ b/src/Umbraco.Core/PropertyEditors/ParameterValueEditor.cs @@ -11,7 +11,7 @@ namespace Umbraco.Core.PropertyEditors /// default ctor /// public ParameterValueEditor() - { + { } /// @@ -26,4 +26,4 @@ namespace Umbraco.Core.PropertyEditors public string View { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/PropertyEditors/PreValueEditor.cs b/src/Umbraco.Core/PropertyEditors/PreValueEditor.cs index 100e68c379..cebeb8cb25 100644 --- a/src/Umbraco.Core/PropertyEditors/PreValueEditor.cs +++ b/src/Umbraco.Core/PropertyEditors/PreValueEditor.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Reflection; @@ -15,8 +15,8 @@ namespace Umbraco.Core.PropertyEditors /// /// /// A pre-value editor is made up of multiple pre-value fields, each field defines a key that the value is stored against. - /// Each field can have any editor and the value from each field can store any data such as a simple string or a json structure. - /// + /// Each field can have any editor and the value from each field can store any data such as a simple string or a json structure. + /// /// The Json serialization attributes are required for manifest property editors to work. /// public class PreValueEditor @@ -24,7 +24,7 @@ namespace Umbraco.Core.PropertyEditors public PreValueEditor() { var fields = new List(); - + //the ctor checks if we have PreValueFieldAttributes applied and if so we construct our fields from them var props = TypeHelper.CachedDiscoverableProperties(GetType()) .Where(x => x.Name != "Fields"); @@ -49,7 +49,7 @@ namespace Umbraco.Core.PropertyEditors { instance.Key = p.Name; } - + if (!att.Name.IsNullOrWhiteSpace()) instance.Name = att.Name; if (!att.View.IsNullOrWhiteSpace()) @@ -104,13 +104,13 @@ namespace Umbraco.Core.PropertyEditors /// /// /// - /// The current value that has been persisted to the database for this pre-value editor. This value may be usesful for + /// The current value that has been persisted to the database for this pre-value editor. This value may be usesful for /// how the value then get's deserialized again to be re-persisted. In most cases it will probably not be used. /// /// /// /// By default this will just return the Posted editorValue. - /// + /// /// This can be overridden if perhaps you have a comma delimited string posted value but want to convert those to individual rows, or to convert /// a json structure to multiple rows. /// @@ -134,8 +134,8 @@ namespace Umbraco.Core.PropertyEditors /// /// This is generally not going to be used by anything unless a property editor wants to change the merging /// functionality or needs to convert some legacy persisted data, or convert the string values to strongly typed values in json (i.e. booleans) - /// - /// IMPORTANT! When using this method the default pre values dictionary should not be modified which would change the property editor's global + /// + /// IMPORTANT! When using this method the default pre values dictionary should not be modified which would change the property editor's global /// singleton pre-values! /// public virtual IDictionary ConvertDbToEditor(IDictionary defaultPreVals, PreValueCollection persistedPreVals) @@ -163,7 +163,7 @@ namespace Umbraco.Core.PropertyEditors return defaultPreValCopy; } - //it's an array so need to format it + //it's an array so need to format it var result = new Dictionary(); var asArray = persistedPreVals.PreValuesAsArray.ToArray(); for (var i = 0; i < asArray.Length; i++) diff --git a/src/Umbraco.Core/PropertyEditors/PreValueField.cs b/src/Umbraco.Core/PropertyEditors/PreValueField.cs index 2b66f7a6a8..71d84b450a 100644 --- a/src/Umbraco.Core/PropertyEditors/PreValueField.cs +++ b/src/Umbraco.Core/PropertyEditors/PreValueField.cs @@ -68,8 +68,8 @@ namespace Umbraco.Core.PropertyEditors /// /// Defines the view to use for the editor, this can be one of 3 things: - /// * the full virtual path or - /// * the relative path to the current Umbraco folder + /// * the full virtual path or + /// * the relative path to the current Umbraco folder /// * a simple view name which will map to the views/prevalueeditors/{view}.html /// [JsonProperty("view", Required = Required.Always)] @@ -83,8 +83,8 @@ namespace Umbraco.Core.PropertyEditors /// /// This allows for custom configuration to be injected into the pre-value editor - /// + /// [JsonProperty("config")] public IDictionary Config { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/PropertyEditors/PreValueFieldAttribute.cs b/src/Umbraco.Core/PropertyEditors/PreValueFieldAttribute.cs index 94ebe13fde..4e77caabb1 100644 --- a/src/Umbraco.Core/PropertyEditors/PreValueFieldAttribute.cs +++ b/src/Umbraco.Core/PropertyEditors/PreValueFieldAttribute.cs @@ -3,7 +3,7 @@ namespace Umbraco.Core.PropertyEditors { /// - /// Allows for specifying an attribute on a property of a custm PreValueEditor to be included in the field list. OTherwise it can be attributed + /// Allows for specifying an attribute on a property of a custm PreValueEditor to be included in the field list. OTherwise it can be attributed /// on a custom implemention of a PreValueField to have the properties auto-filled. /// [AttributeUsage(AttributeTargets.Property | AttributeTargets.Class, AllowMultiple = false)] @@ -65,4 +65,4 @@ namespace Umbraco.Core.PropertyEditors /// public Type PreValueFieldType { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/PropertyEditors/PropertyEditor.cs b/src/Umbraco.Core/PropertyEditors/PropertyEditor.cs index 3f16fcb82e..ee81c79082 100644 --- a/src/Umbraco.Core/PropertyEditors/PropertyEditor.cs +++ b/src/Umbraco.Core/PropertyEditors/PropertyEditor.cs @@ -191,4 +191,4 @@ namespace Umbraco.Core.PropertyEditors return $"Name: {Name}, Alias: {Alias}, IsParameterEditor: {IsParameterEditor}"; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/PropertyEditors/PropertyEditorAttribute.cs b/src/Umbraco.Core/PropertyEditors/PropertyEditorAttribute.cs index 9d14b3ac39..81f61d1d20 100644 --- a/src/Umbraco.Core/PropertyEditors/PropertyEditorAttribute.cs +++ b/src/Umbraco.Core/PropertyEditors/PropertyEditorAttribute.cs @@ -83,4 +83,4 @@ namespace Umbraco.Core.PropertyEditors /// public string Group { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/PropertyEditors/PropertyValueConverterCollection.cs b/src/Umbraco.Core/PropertyEditors/PropertyValueConverterCollection.cs index 4b321debfb..5f432f69b0 100644 --- a/src/Umbraco.Core/PropertyEditors/PropertyValueConverterCollection.cs +++ b/src/Umbraco.Core/PropertyEditors/PropertyValueConverterCollection.cs @@ -7,7 +7,7 @@ namespace Umbraco.Core.PropertyEditors { public class PropertyValueConverterCollection : BuilderCollectionBase { - public PropertyValueConverterCollection(IEnumerable items) + public PropertyValueConverterCollection(IEnumerable items) : base(items) { } diff --git a/src/Umbraco.Core/PropertyEditors/PropertyValueConverterCollectionBuilder.cs b/src/Umbraco.Core/PropertyEditors/PropertyValueConverterCollectionBuilder.cs index 9cbd70b362..5c5a8c16c8 100644 --- a/src/Umbraco.Core/PropertyEditors/PropertyValueConverterCollectionBuilder.cs +++ b/src/Umbraco.Core/PropertyEditors/PropertyValueConverterCollectionBuilder.cs @@ -5,7 +5,7 @@ namespace Umbraco.Core.PropertyEditors { public class PropertyValueConverterCollectionBuilder : OrderedCollectionBuilderBase { - public PropertyValueConverterCollectionBuilder(IServiceContainer container) + public PropertyValueConverterCollectionBuilder(IServiceContainer container) : base(container) { } diff --git a/src/Umbraco.Core/PropertyEditors/PropertyValueEditor.cs b/src/Umbraco.Core/PropertyEditors/PropertyValueEditor.cs index 004e45a170..c51eebd93a 100644 --- a/src/Umbraco.Core/PropertyEditors/PropertyValueEditor.cs +++ b/src/Umbraco.Core/PropertyEditors/PropertyValueEditor.cs @@ -76,8 +76,8 @@ namespace Umbraco.Core.PropertyEditors /// /// Defines the view to use for the editor, this can be one of 3 things: - /// * the full virtual path or - /// * the relative path to the current Umbraco folder + /// * the full virtual path or + /// * the relative path to the current Umbraco folder /// * a simple view name which will map to the views/propertyeditors/{view}/{view}.html /// [JsonProperty("view", Required = Required.Always)] @@ -100,7 +100,7 @@ namespace Umbraco.Core.PropertyEditors /// /// /// This will become legacy as soon as we implement overridable pre-values. - /// + /// /// The default validator used is the RequiredValueValidator but this can be overridden by property editors /// if they need to do some custom validation, or if the value being validated is a json object. /// @@ -114,7 +114,7 @@ namespace Umbraco.Core.PropertyEditors /// /// /// This will become legacy as soon as we implement overridable pre-values. - /// + /// /// The default validator used is the RegexValueValidator but this can be overridden by property editors /// if they need to do some custom validation, or if the value being validated is a json object. /// @@ -199,7 +199,7 @@ namespace Umbraco.Core.PropertyEditors //ensure these are nullable so we can return a null if required //NOTE: This is allowing type of 'long' because I think json.net will deserialize a numerical value as long // instead of int. Even though our db will not support this (will get truncated), we'll at least parse to this. - + valueType = typeof(long?); //if parsing is successful, we need to return as an Int, we're only dealing with long's here because of json.net, we actually @@ -207,7 +207,7 @@ namespace Umbraco.Core.PropertyEditors //when we compare the values for dirty tracking we'll be comparing an int -> long and they will not match. var result = value.TryConvertTo(valueType); return result.Success && result.Result != null - ? Attempt.Succeed((int)(long)result.Result) + ? Attempt.Succeed((int)(long)result.Result) : result; case DataTypeDatabaseType.Decimal: @@ -231,14 +231,14 @@ namespace Umbraco.Core.PropertyEditors /// /// /// - /// The current value that has been persisted to the database for this editor. This value may be usesful for + /// The current value that has been persisted to the database for this editor. This value may be usesful for /// how the value then get's deserialized again to be re-persisted. In most cases it will probably not be used. /// /// /// /// By default this will attempt to automatically convert the string value to the value type supplied by ValueType. - /// - /// If overridden then the object returned must match the type supplied in the ValueType, otherwise persisting the + /// + /// If overridden then the object returned must match the type supplied in the ValueType, otherwise persisting the /// value to the DB will fail when it tries to validate the value type. /// public virtual object ConvertEditorToDb(ContentPropertyData editorValue, object currentValue) @@ -277,7 +277,7 @@ namespace Umbraco.Core.PropertyEditors switch (GetDatabaseType()) { - case DataTypeDatabaseType.Ntext: + case DataTypeDatabaseType.Ntext: case DataTypeDatabaseType.Nvarchar: //if it is a string type, we will attempt to see if it is json stored data, if it is we'll try to convert //to a real json object so we can pass the true json object directly to angular! @@ -300,8 +300,8 @@ namespace Umbraco.Core.PropertyEditors //Decimals need to be formatted with invariant culture (dots, not commas) //Anything else falls back to ToString() var decim = property.Value.TryConvertTo(); - return decim.Success - ? decim.Result.ToString(NumberFormatInfo.InvariantInfo) + return decim.Success + ? decim.Result.ToString(NumberFormatInfo.InvariantInfo) : property.Value.ToString(); case DataTypeDatabaseType.Date: var date = property.Value.TryConvertTo(); @@ -313,7 +313,7 @@ namespace Umbraco.Core.PropertyEditors return date.Result.Value.ToIsoString(); default: throw new ArgumentOutOfRangeException(); - } + } } /// @@ -326,9 +326,9 @@ namespace Umbraco.Core.PropertyEditors /// /// By default this will just return the value of ConvertDbToString but ensure that if the db value type is nvarchar or text /// it is a CDATA fragment, otherwise it is just a text fragment. - /// + /// /// This method by default will only return XText or XCData which must be wrapped in an element! - /// + /// /// If the value is empty we will not return as CDATA since that will just take up more space in the file. /// public virtual XNode ConvertDbToXml(Property property, PropertyType propertyType, IDataTypeService dataTypeService) @@ -344,7 +344,7 @@ namespace Umbraco.Core.PropertyEditors case DataTypeDatabaseType.Date: case DataTypeDatabaseType.Integer: case DataTypeDatabaseType.Decimal: - return new XText(ConvertDbToString(property, propertyType, dataTypeService)); + return new XText(ConvertDbToString(property, propertyType, dataTypeService)); case DataTypeDatabaseType.Nvarchar: case DataTypeDatabaseType.Ntext: //put text in cdata @@ -374,7 +374,7 @@ namespace Umbraco.Core.PropertyEditors return property.Value.ToXmlString(); case DataTypeDatabaseType.Integer: case DataTypeDatabaseType.Decimal: - return property.Value.ToXmlString(property.Value.GetType()); + return property.Value.ToXmlString(property.Value.GetType()); case DataTypeDatabaseType.Date: //treat dates differently, output the format as xml format if (property.Value == null) @@ -392,4 +392,4 @@ namespace Umbraco.Core.PropertyEditors } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/PropertyEditors/RegexValidator.cs b/src/Umbraco.Core/PropertyEditors/RegexValidator.cs index b923a7a4a1..4cac9f1370 100644 --- a/src/Umbraco.Core/PropertyEditors/RegexValidator.cs +++ b/src/Umbraco.Core/PropertyEditors/RegexValidator.cs @@ -43,9 +43,9 @@ namespace Umbraco.Core.PropertyEditors if (regex.IsMatch(asString) == false) { yield return new ValidationResult("Value is invalid, it does not match the correct pattern", new[] { "value" }); - } + } } - + } /// @@ -64,4 +64,4 @@ namespace Umbraco.Core.PropertyEditors return Validate(value, _regex, preValues, editor); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/PropertyEditors/RequiredManifestValueValidator.cs b/src/Umbraco.Core/PropertyEditors/RequiredManifestValueValidator.cs index b3e8ff1f6f..e421bf7cac 100644 --- a/src/Umbraco.Core/PropertyEditors/RequiredManifestValueValidator.cs +++ b/src/Umbraco.Core/PropertyEditors/RequiredManifestValueValidator.cs @@ -36,7 +36,7 @@ namespace Umbraco.Core.PropertyEditors } } - + } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/PropertyEditors/SupportTagsAttribute.cs b/src/Umbraco.Core/PropertyEditors/SupportTagsAttribute.cs index 3ff124d345..a1874daae3 100644 --- a/src/Umbraco.Core/PropertyEditors/SupportTagsAttribute.cs +++ b/src/Umbraco.Core/PropertyEditors/SupportTagsAttribute.cs @@ -59,4 +59,4 @@ namespace Umbraco.Core.PropertyEditors /// public string TagGroup { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/PropertyEditors/TagPropertyDefinition.cs b/src/Umbraco.Core/PropertyEditors/TagPropertyDefinition.cs index fd314ba9b7..4d9bc0e3d4 100644 --- a/src/Umbraco.Core/PropertyEditors/TagPropertyDefinition.cs +++ b/src/Umbraco.Core/PropertyEditors/TagPropertyDefinition.cs @@ -33,7 +33,7 @@ namespace Umbraco.Core.PropertyEditors TagGroup = tagsAttribute.TagGroup; var preValues = propertySaving.PreValues.PreValuesAsDictionary; - StorageType = preValues.ContainsKey("storageType") && preValues["storageType"].Value == TagCacheStorageType.Json.ToString() ? + StorageType = preValues.ContainsKey("storageType") && preValues["storageType"].Value == TagCacheStorageType.Json.ToString() ? TagCacheStorageType.Json : TagCacheStorageType.Csv; } @@ -58,4 +58,4 @@ namespace Umbraco.Core.PropertyEditors public virtual string TagGroup { get; private set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/PropertyEditors/TagValueType.cs b/src/Umbraco.Core/PropertyEditors/TagValueType.cs index e837d1e8bf..f244c74bc8 100644 --- a/src/Umbraco.Core/PropertyEditors/TagValueType.cs +++ b/src/Umbraco.Core/PropertyEditors/TagValueType.cs @@ -12,11 +12,11 @@ /// /// The list of tags will be supplied by the property editor's ConvertEditorToDb method result which will need to return an IEnumerable{string} value - /// + /// /// /// if the ConvertEditorToDb doesn't return an IEnumerable{string} then it will automatically try to be detected as either CSV or JSON and if neither of those match /// an exception will be thrown. /// CustomTagList } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/PropertyEditors/ValidatorCollection.cs b/src/Umbraco.Core/PropertyEditors/ValidatorCollection.cs index 607499a116..968175545a 100644 --- a/src/Umbraco.Core/PropertyEditors/ValidatorCollection.cs +++ b/src/Umbraco.Core/PropertyEditors/ValidatorCollection.cs @@ -6,7 +6,7 @@ namespace Umbraco.Core.PropertyEditors { internal class ValidatorCollection : BuilderCollectionBase { - public ValidatorCollection(IEnumerable items) + public ValidatorCollection(IEnumerable items) : base(items) { } diff --git a/src/Umbraco.Core/PropertyEditors/ValidatorCollectionBuilder.cs b/src/Umbraco.Core/PropertyEditors/ValidatorCollectionBuilder.cs index d98d85d994..06a60631d3 100644 --- a/src/Umbraco.Core/PropertyEditors/ValidatorCollectionBuilder.cs +++ b/src/Umbraco.Core/PropertyEditors/ValidatorCollectionBuilder.cs @@ -10,7 +10,7 @@ namespace Umbraco.Core.PropertyEditors { internal class ValidatorCollectionBuilder : LazyCollectionBuilderBase { - public ValidatorCollectionBuilder(IServiceContainer container) + public ValidatorCollectionBuilder(IServiceContainer container) : base(container) { } diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/CheckboxListValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/CheckboxListValueConverter.cs index 3f7e1c377b..4051a9037e 100644 --- a/src/Umbraco.Core/PropertyEditors/ValueConverters/CheckboxListValueConverter.cs +++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/CheckboxListValueConverter.cs @@ -34,6 +34,6 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters sourceString.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries).Select(v => v.Trim()); return values; - } + } } } diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/ColorPickerValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/ColorPickerValueConverter.cs index d293215349..3dd6efa79c 100644 --- a/src/Umbraco.Core/PropertyEditors/ValueConverters/ColorPickerValueConverter.cs +++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/ColorPickerValueConverter.cs @@ -8,7 +8,7 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters { public override bool IsConverter(PublishedPropertyType propertyType) { - return propertyType.PropertyEditorAlias.InvariantEquals(Constants.PropertyEditors.ColorPickerAlias); + return propertyType.PropertyEditorAlias.InvariantEquals(Constants.PropertyEditors.ColorPickerAlias); } public override Type GetPropertyValueType(PublishedPropertyType propertyType) diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/DatePickerValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/DatePickerValueConverter.cs index 40b9d73516..75ff3a3d30 100644 --- a/src/Umbraco.Core/PropertyEditors/ValueConverters/DatePickerValueConverter.cs +++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/DatePickerValueConverter.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using System.Xml; using Umbraco.Core.Models.PublishedContent; @@ -7,12 +7,12 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters { [DefaultPropertyValueConverter] public class DatePickerValueConverter : PropertyValueConverterBase - { - private static readonly string[] PropertyEditorAliases = - { - Constants.PropertyEditors.DateTimeAlias, - Constants.PropertyEditors.DateAlias - }; + { + private static readonly string[] PropertyEditorAliases = + { + Constants.PropertyEditors.DateTimeAlias, + Constants.PropertyEditors.DateAlias + }; public override bool IsConverter(PublishedPropertyType propertyType) { @@ -59,4 +59,4 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters return XmlConvert.ToString((DateTime)inter, XmlDateTimeSerializationMode.Unspecified); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/DecimalValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/DecimalValueConverter.cs index 75ded06120..08941046a4 100644 --- a/src/Umbraco.Core/PropertyEditors/ValueConverters/DecimalValueConverter.cs +++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/DecimalValueConverter.cs @@ -34,7 +34,7 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters return (decimal.TryParse(sourceString, NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out d)) ? d : 0M; } - // in the database an a decimal is an a decimal + // in the database an a decimal is an a decimal // default value is zero return (source is decimal) ? source : 0M; } diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/DropdownListMultipleValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/DropdownListMultipleValueConverter.cs index d44c234c50..e8fb3ae918 100644 --- a/src/Umbraco.Core/PropertyEditors/ValueConverters/DropdownListMultipleValueConverter.cs +++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/DropdownListMultipleValueConverter.cs @@ -35,6 +35,6 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters sourceString.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries).Select(v => v.Trim()); return values; - } + } } } diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/DropdownListMultipleWithKeysValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/DropdownListMultipleWithKeysValueConverter.cs index efcf517cff..6e7e5e130d 100644 --- a/src/Umbraco.Core/PropertyEditors/ValueConverters/DropdownListMultipleWithKeysValueConverter.cs +++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/DropdownListMultipleWithKeysValueConverter.cs @@ -35,6 +35,6 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters .ToArray(); return prevalueIds; - } + } } } diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/DropdownListValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/DropdownListValueConverter.cs index 33a11d2b2a..eb75e7eebe 100644 --- a/src/Umbraco.Core/PropertyEditors/ValueConverters/DropdownListValueConverter.cs +++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/DropdownListValueConverter.cs @@ -25,6 +25,6 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters { return source?.ToString() ?? string.Empty; } - + } } diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/DropdownListWithKeysValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/DropdownListWithKeysValueConverter.cs index 67ca48375c..1c02d89044 100644 --- a/src/Umbraco.Core/PropertyEditors/ValueConverters/DropdownListWithKeysValueConverter.cs +++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/DropdownListWithKeysValueConverter.cs @@ -28,6 +28,6 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters return intAttempt.Result; return null; - } + } } } diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/EmailAddressValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/EmailAddressValueConverter.cs index 34013e5253..bb31fd5063 100644 --- a/src/Umbraco.Core/PropertyEditors/ValueConverters/EmailAddressValueConverter.cs +++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/EmailAddressValueConverter.cs @@ -24,6 +24,6 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters public override object ConvertInterToObject(PublishedPropertyType propertyType, PropertyCacheLevel cacheLevel, object source, bool preview) { return source?.ToString() ?? string.Empty; - } + } } } diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/GridValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/GridValueConverter.cs index d8679642bc..e31e42477b 100644 --- a/src/Umbraco.Core/PropertyEditors/ValueConverters/GridValueConverter.cs +++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/GridValueConverter.cs @@ -121,4 +121,4 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/ImageCropperValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/ImageCropperValueConverter.cs index 8c1220639d..c39d1d8b73 100644 --- a/src/Umbraco.Core/PropertyEditors/ValueConverters/ImageCropperValueConverter.cs +++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/ImageCropperValueConverter.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Globalization; using System.Linq; using Newtonsoft.Json; @@ -131,4 +131,4 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters return sourceString; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/JsonValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/JsonValueConverter.cs index fb33a1bcbc..f49eb8243e 100644 --- a/src/Umbraco.Core/PropertyEditors/ValueConverters/JsonValueConverter.cs +++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/JsonValueConverter.cs @@ -52,14 +52,14 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters } catch (Exception ex) { - Current.Logger.Error("Could not parse the string " + sourceString + " to a json object", ex); + Current.Logger.Error("Could not parse the string " + sourceString + " to a json object", ex); } } - + //it's not json, just return the string return sourceString; } //TODO: Now to convert that to XPath! } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/LabelValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/LabelValueConverter.cs index e2e27c66e4..fbe57adbf2 100644 --- a/src/Umbraco.Core/PropertyEditors/ValueConverters/LabelValueConverter.cs +++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/LabelValueConverter.cs @@ -9,7 +9,7 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters /// /// Without a property converter defined for the label type, the value will be converted with /// the `ConvertUsingDarkMagic` method which will try to parse the value into it's correct type, but this - /// can cause issues if the string is detected as a number and then strips leading zeros. + /// can cause issues if the string is detected as a number and then strips leading zeros. /// Example: http://issues.umbraco.org/issue/U4-7929 /// [DefaultPropertyValueConverter] @@ -35,4 +35,4 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters return source == null ? string.Empty : source.ToString(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/MemberGroupPickerValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/MemberGroupPickerValueConverter.cs index acf2b19d9e..fc1959a95a 100644 --- a/src/Umbraco.Core/PropertyEditors/ValueConverters/MemberGroupPickerValueConverter.cs +++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/MemberGroupPickerValueConverter.cs @@ -24,6 +24,6 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters public override object ConvertSourceToInter(PublishedPropertyType propertyType, object source, bool preview) { return source?.ToString() ?? string.Empty; - } + } } } diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/RadioButtonListValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/RadioButtonListValueConverter.cs index 7d52aab2c9..ef3e2e094b 100644 --- a/src/Umbraco.Core/PropertyEditors/ValueConverters/RadioButtonListValueConverter.cs +++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/RadioButtonListValueConverter.cs @@ -28,6 +28,6 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters return intAttempt.Result; return null; - } + } } } diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/SliderValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/SliderValueConverter.cs index 3c76e3ce9a..fb3a62ba13 100644 --- a/src/Umbraco.Core/PropertyEditors/ValueConverters/SliderValueConverter.cs +++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/SliderValueConverter.cs @@ -24,8 +24,8 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters public override Type GetPropertyValueType(PublishedPropertyType propertyType) { - return IsRangeDataType(propertyType.DataTypeId) - ? typeof(Range) + return IsRangeDataType(propertyType.DataTypeId) + ? typeof(Range) : typeof(decimal); } diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/TinyMceValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/TinyMceValueConverter.cs index 900d844957..3d35865607 100644 --- a/src/Umbraco.Core/PropertyEditors/ValueConverters/TinyMceValueConverter.cs +++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/TinyMceValueConverter.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Web; using Umbraco.Core.Models.PublishedContent; @@ -9,24 +9,24 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters /// [DefaultPropertyValueConverter] public class TinyMceValueConverter : PropertyValueConverterBase - { + { public override bool IsConverter(PublishedPropertyType propertyType) { return propertyType.PropertyEditorAlias == Constants.PropertyEditors.TinyMCEAlias; } - public override Type GetPropertyValueType(PublishedPropertyType propertyType) - { - return typeof (IHtmlString); - } + public override Type GetPropertyValueType(PublishedPropertyType propertyType) + { + return typeof (IHtmlString); + } - public override PropertyCacheLevel GetPropertyCacheLevel(PublishedPropertyType propertyType) - { + public override PropertyCacheLevel GetPropertyCacheLevel(PublishedPropertyType propertyType) + { // PropertyCacheLevel.Content is ok here because that converter does not parse {locallink} nor executes macros return PropertyCacheLevel.Content; - } + } - public override object ConvertSourceToInter(PublishedPropertyType propertyType, object source, bool preview) + public override object ConvertSourceToInter(PublishedPropertyType propertyType, object source, bool preview) { // in xml a string is: string // in the database a string is: string @@ -46,4 +46,4 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters return inter; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/UploadPropertyConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/UploadPropertyConverter.cs index 6b5634cbfe..9c5386d642 100644 --- a/src/Umbraco.Core/PropertyEditors/ValueConverters/UploadPropertyConverter.cs +++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/UploadPropertyConverter.cs @@ -51,6 +51,6 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters public override object ConvertInterToObject(PublishedPropertyType propertyType, PropertyCacheLevel cacheLevel, object source, bool preview) { return source?.ToString() ?? ""; - } + } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/PropertyEditors/ValueValidatorAttribute.cs b/src/Umbraco.Core/PropertyEditors/ValueValidatorAttribute.cs index 305842c0ca..71222aadbd 100644 --- a/src/Umbraco.Core/PropertyEditors/ValueValidatorAttribute.cs +++ b/src/Umbraco.Core/PropertyEditors/ValueValidatorAttribute.cs @@ -11,4 +11,4 @@ namespace Umbraco.Core.PropertyEditors } public string TypeName { get; private set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/ReadLock.cs b/src/Umbraco.Core/ReadLock.cs index 7a933e5301..684758e86a 100644 --- a/src/Umbraco.Core/ReadLock.cs +++ b/src/Umbraco.Core/ReadLock.cs @@ -7,7 +7,7 @@ using System.Threading; namespace Umbraco.Core { /// - /// Provides a convenience methodology for implementing locked access to resources. + /// Provides a convenience methodology for implementing locked access to resources. /// /// /// Intended as an infrastructure class. @@ -17,9 +17,9 @@ namespace Umbraco.Core private readonly ReaderWriterLockSlim _rwLock; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public ReadLock(ReaderWriterLockSlim rwLock) + public ReadLock(ReaderWriterLockSlim rwLock) { _rwLock = rwLock; _rwLock.EnterReadLock(); diff --git a/src/Umbraco.Core/RenderingEngine.cs b/src/Umbraco.Core/RenderingEngine.cs index d243d47601..6e55bfdaca 100644 --- a/src/Umbraco.Core/RenderingEngine.cs +++ b/src/Umbraco.Core/RenderingEngine.cs @@ -1,4 +1,4 @@ -namespace Umbraco.Core +namespace Umbraco.Core { public enum RenderingEngine { @@ -6,4 +6,4 @@ namespace Umbraco.Core Mvc, WebForms } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/RuntimeLevel.cs b/src/Umbraco.Core/RuntimeLevel.cs index a15c513525..f9ec3c90c5 100644 --- a/src/Umbraco.Core/RuntimeLevel.cs +++ b/src/Umbraco.Core/RuntimeLevel.cs @@ -1,4 +1,4 @@ -namespace Umbraco.Core +namespace Umbraco.Core { public enum RuntimeLevel { @@ -34,4 +34,4 @@ namespace Umbraco.Core /// Run = 4 } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/RuntimeState.cs b/src/Umbraco.Core/RuntimeState.cs index 267837ea8d..e4f934a60c 100644 --- a/src/Umbraco.Core/RuntimeState.cs +++ b/src/Umbraco.Core/RuntimeState.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Threading; using System.Web; using Semver; @@ -120,4 +120,4 @@ namespace Umbraco.Core /// public BootFailedException BootFailedException { get; internal set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/SafeCallContext.cs b/src/Umbraco.Core/SafeCallContext.cs index ff1cb3568c..357def0a97 100644 --- a/src/Umbraco.Core/SafeCallContext.cs +++ b/src/Umbraco.Core/SafeCallContext.cs @@ -93,4 +93,4 @@ namespace Umbraco.Core } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Scoping/IScopeContext.cs b/src/Umbraco.Core/Scoping/IScopeContext.cs index 73a04751b9..f4fb652bc7 100644 --- a/src/Umbraco.Core/Scoping/IScopeContext.cs +++ b/src/Umbraco.Core/Scoping/IScopeContext.cs @@ -1,4 +1,4 @@ -using System; +using System; namespace Umbraco.Core.Scoping { @@ -39,4 +39,4 @@ namespace Umbraco.Core.Scoping /// T Enlist(string key, Func creator, Action action = null, int priority = 100); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Scoping/Scope.cs b/src/Umbraco.Core/Scoping/Scope.cs index ad43a44bb9..1c3a774450 100644 --- a/src/Umbraco.Core/Scoping/Scope.cs +++ b/src/Umbraco.Core/Scoping/Scope.cs @@ -42,7 +42,7 @@ namespace Umbraco.Core.Scoping private const IsolationLevel DefaultIsolationLevel = IsolationLevel.RepeatableRead; // initializes a new scope - private Scope(ScopeProvider scopeProvider, + private Scope(ScopeProvider scopeProvider, ILogger logger, FileSystems fileSystems, Scope parent, ScopeContext scopeContext, bool detachable, IsolationLevel isolationLevel = IsolationLevel.Unspecified, RepositoryCacheMode repositoryCacheMode = RepositoryCacheMode.Unspecified, @@ -113,7 +113,7 @@ namespace Umbraco.Core.Scoping } // initializes a new scope - public Scope(ScopeProvider scopeProvider, + public Scope(ScopeProvider scopeProvider, ILogger logger, FileSystems fileSystems, bool detachable, ScopeContext scopeContext, IsolationLevel isolationLevel = IsolationLevel.Unspecified, RepositoryCacheMode repositoryCacheMode = RepositoryCacheMode.Unspecified, @@ -369,7 +369,7 @@ namespace Umbraco.Core.Scoping { // figure out completed var completed = _completed.HasValue && _completed.Value; - + // deal with database var databaseException = false; if (_database != null) diff --git a/src/Umbraco.Core/Scoping/ScopeContextualBase.cs b/src/Umbraco.Core/Scoping/ScopeContextualBase.cs index f7f5f852d6..7461142234 100644 --- a/src/Umbraco.Core/Scoping/ScopeContextualBase.cs +++ b/src/Umbraco.Core/Scoping/ScopeContextualBase.cs @@ -1,4 +1,4 @@ -using System; +using System; namespace Umbraco.Core.Scoping { @@ -37,4 +37,4 @@ namespace Umbraco.Core.Scoping public abstract void Release(bool completed); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Security/AuthenticationExtensions.cs b/src/Umbraco.Core/Security/AuthenticationExtensions.cs index 13613cc89d..5d02194c29 100644 --- a/src/Umbraco.Core/Security/AuthenticationExtensions.cs +++ b/src/Umbraco.Core/Security/AuthenticationExtensions.cs @@ -41,14 +41,14 @@ namespace Umbraco.Core.Security { try { - //create the Umbraco user identity + //create the Umbraco user identity var identity = new UmbracoBackOfficeIdentity(ticket); //set the principal object var principal = new GenericPrincipal(identity, identity.Roles); //It is actually not good enough to set this on the current app Context and the thread, it also needs - // to be set explicitly on the HttpContext.Current !! This is a strange web api thing that is actually + // to be set explicitly on the HttpContext.Current !! This is a strange web api thing that is actually // an underlying fault of asp.net not propogating the User correctly. if (HttpContext.Current != null) { @@ -101,7 +101,7 @@ namespace Umbraco.Core.Security if (backOfficeIdentity != null) return backOfficeIdentity; } - //Otherwise convert to a UmbracoBackOfficeIdentity if it's auth'd and has the back office session + //Otherwise convert to a UmbracoBackOfficeIdentity if it's auth'd and has the back office session var claimsIdentity = user.Identity as ClaimsIdentity; if (claimsIdentity != null && claimsIdentity.IsAuthenticated && claimsIdentity.HasClaim(x => x.Type == Constants.Security.SessionIdClaimType)) { @@ -110,7 +110,7 @@ namespace Umbraco.Core.Security return UmbracoBackOfficeIdentity.FromClaimsIdentity(claimsIdentity); } catch (InvalidOperationException) - { + { } } @@ -118,11 +118,11 @@ namespace Umbraco.Core.Security } /// - /// This will return the current back office identity. + /// This will return the current back office identity. /// /// - /// - /// If set to true and a back office identity is not found and not authenticated, this will attempt to authenticate the + /// + /// If set to true and a back office identity is not found and not authenticated, this will attempt to authenticate the /// request just as is done in the Umbraco module and then set the current identity if it is valid. /// Just like in the UmbracoModule, if this is true then the user's culture will be assigned to the request. /// @@ -136,21 +136,21 @@ namespace Umbraco.Core.Security //If it's already a UmbracoBackOfficeIdentity var backOfficeIdentity = GetUmbracoIdentity(http.User); - if (backOfficeIdentity != null) return backOfficeIdentity; + if (backOfficeIdentity != null) return backOfficeIdentity; if (authenticateRequestIfNotFound == false) return null; - //even if authenticateRequestIfNotFound is true we cannot continue if the request is actually authenticated + //even if authenticateRequestIfNotFound is true we cannot continue if the request is actually authenticated // which would mean something strange is going on that it is not an umbraco identity. if (http.User.Identity.IsAuthenticated) return null; //So the user is not authed but we've been asked to do the auth if authenticateRequestIfNotFound = true, // which might occur in old webforms style things or for routes that aren't included as a back office request. // in this case, we are just reverting to authing using the cookie. - - // TODO: Even though this is in theory legacy, we have legacy bits laying around and we'd need to do the auth based on + + // TODO: Even though this is in theory legacy, we have legacy bits laying around and we'd need to do the auth based on // how the Module will eventually do it (by calling in to any registered authenticators). - + var ticket = http.GetUmbracoAuthTicket(); if (http.AuthenticateCurrentRequest(ticket, true)) { @@ -161,11 +161,11 @@ namespace Umbraco.Core.Security } /// - /// This will return the current back office identity. + /// This will return the current back office identity. /// /// /// - /// If set to true and a back office identity is not found and not authenticated, this will attempt to authenticate the + /// If set to true and a back office identity is not found and not authenticated, this will attempt to authenticate the /// request just as is done in the Umbraco module and then set the current identity if it is valid /// /// @@ -181,7 +181,7 @@ namespace Umbraco.Core.Security { if (http == null) throw new ArgumentNullException("http"); Logout(http, UmbracoConfig.For.UmbracoSettings().Security.AuthCookieName); - } + } /// /// This clears the forms authentication cookie @@ -192,7 +192,7 @@ namespace Umbraco.Core.Security if (http == null) throw new ArgumentNullException("http"); new HttpContextWrapper(http).UmbracoLogout(); } - + /// /// This will force ticket renewal in the OWIN pipeline /// @@ -228,13 +228,13 @@ namespace Umbraco.Core.Security if (userdata == null) throw new ArgumentNullException("userdata"); var userDataString = JsonConvert.SerializeObject(userdata); return CreateAuthTicketAndCookie( - http, - userdata.Username, - userDataString, + http, + userdata.Username, + userDataString, //use the configuration timeout - this is the same timeout that will be used when renewing the ticket. - GlobalSettings.TimeOutInMinutes, + GlobalSettings.TimeOutInMinutes, //Umbraco has always persisted it's original cookie for 1 day so we'll keep it that way - 1440, + 1440, UmbracoConfig.For.UmbracoSettings().Security.AuthCookieName, UmbracoConfig.For.UmbracoSettings().Security.AuthCookieDomain); } @@ -334,7 +334,7 @@ namespace Umbraco.Core.Security { //ensure there's def an expired cookie http.Response.Cookies.Add(new HttpCookie(c) { Expires = DateTime.Now.AddYears(-1) }); - } + } } } @@ -405,7 +405,7 @@ namespace Umbraco.Core.Security userData, "/" ); - + // Encrypt the cookie using the machine key for secure transport var hash = FormsAuthentication.Encrypt(ticket); var cookie = new HttpCookie( @@ -417,15 +417,15 @@ namespace Umbraco.Core.Security Path = "/" }; - if (GlobalSettings.UseSSL) + if (GlobalSettings.UseSSL) cookie.Secure = true; //ensure http only, this should only be able to be accessed via the server cookie.HttpOnly = true; - + http.Response.Cookies.Set(cookie); return ticket; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Security/BackOfficeClaimsIdentityFactory.cs b/src/Umbraco.Core/Security/BackOfficeClaimsIdentityFactory.cs index 7c2373a000..fb4d2d0860 100644 --- a/src/Umbraco.Core/Security/BackOfficeClaimsIdentityFactory.cs +++ b/src/Umbraco.Core/Security/BackOfficeClaimsIdentityFactory.cs @@ -45,7 +45,7 @@ namespace Umbraco.Core.Security } public class BackOfficeClaimsIdentityFactory : BackOfficeClaimsIdentityFactory - { + { } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Security/BackOfficeCookieAuthenticationProvider.cs b/src/Umbraco.Core/Security/BackOfficeCookieAuthenticationProvider.cs index 086d1a77bf..9b0b483421 100644 --- a/src/Umbraco.Core/Security/BackOfficeCookieAuthenticationProvider.cs +++ b/src/Umbraco.Core/Security/BackOfficeCookieAuthenticationProvider.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Globalization; using System.Net.Http.Headers; using System.Threading; @@ -51,4 +51,4 @@ namespace Umbraco.Core.Security return base.ValidateIdentity(context); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Security/BackOfficeSignInManager.cs b/src/Umbraco.Core/Security/BackOfficeSignInManager.cs index 8f5bdad0f6..c136bc6a10 100644 --- a/src/Umbraco.Core/Security/BackOfficeSignInManager.cs +++ b/src/Umbraco.Core/Security/BackOfficeSignInManager.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics; using System.Security.Claims; using System.Threading.Tasks; @@ -49,7 +49,7 @@ namespace Umbraco.Core.Security public override async Task PasswordSignInAsync(string userName, string password, bool isPersistent, bool shouldLockout) { var result = await PasswordSignInAsyncImpl(userName, password, isPersistent, shouldLockout); - + switch (result) { case SignInStatus.Success: @@ -176,7 +176,7 @@ namespace Umbraco.Core.Security AllowRefresh = true, IssuedUtc = nowUtc, ExpiresUtc = nowUtc.AddMinutes(GlobalSettings.TimeOutInMinutes) - }, userIdentity, rememberBrowserIdentity); + }, userIdentity, rememberBrowserIdentity); } else { @@ -232,4 +232,4 @@ namespace Umbraco.Core.Security return null; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Security/BackOfficeUserManager.cs b/src/Umbraco.Core/Security/BackOfficeUserManager.cs index 0397057d6d..148de877de 100644 --- a/src/Umbraco.Core/Security/BackOfficeUserManager.cs +++ b/src/Umbraco.Core/Security/BackOfficeUserManager.cs @@ -36,7 +36,7 @@ namespace Umbraco.Core.Security #region Static Create methods /// - /// Creates a BackOfficeUserManager instance with all default options and the default BackOfficeUserManager + /// Creates a BackOfficeUserManager instance with all default options and the default BackOfficeUserManager /// /// /// @@ -109,7 +109,7 @@ namespace Umbraco.Core.Security #region What we support do not currently - //NOTE: Not sure if we really want/need to ever support this + //NOTE: Not sure if we really want/need to ever support this public override bool SupportsUserClaim { get { return false; } @@ -144,8 +144,8 @@ namespace Umbraco.Core.Security /// /// protected void InitUserManager( - BackOfficeUserManager manager, - MembershipProviderBase membershipProvider, + BackOfficeUserManager manager, + MembershipProviderBase membershipProvider, IDataProtectionProvider dataProtectionProvider) { // Configure validation logic for usernames @@ -168,7 +168,7 @@ namespace Umbraco.Core.Security //use a custom hasher based on our membership provider manager.PasswordHasher = new MembershipPasswordHasher(membershipProvider); - + if (dataProtectionProvider != null) { manager.UserTokenProvider = new DataProtectorTokenProvider(dataProtectionProvider.Create("ASP.NET Identity")); @@ -200,7 +200,7 @@ namespace Umbraco.Core.Security // BodyFormat = "Your security code is: {0}" //}); - //manager.SmsService = new SmsService(); + //manager.SmsService = new SmsService(); } /// @@ -214,12 +214,12 @@ namespace Umbraco.Core.Security /// * Get password store /// * Call VerifyPasswordAsync with the password store + user + password /// * Uses the PasswordHasher.VerifyHashedPassword to compare the stored password - /// + /// /// In some cases people want simple custom control over the username/password check, for simplicity /// sake, developers would like the users to simply validate against an LDAP directory but the user - /// data remains stored inside of Umbraco. + /// data remains stored inside of Umbraco. /// See: http://issues.umbraco.org/issue/U4-7032 for the use cases. - /// + /// /// We've allowed this check to be overridden with a simple callback so that developers don't actually /// have to implement/override this class. /// diff --git a/src/Umbraco.Core/Security/BackOfficeUserManagerMarker.cs b/src/Umbraco.Core/Security/BackOfficeUserManagerMarker.cs index 9dd5afd9da..300350072e 100644 --- a/src/Umbraco.Core/Security/BackOfficeUserManagerMarker.cs +++ b/src/Umbraco.Core/Security/BackOfficeUserManagerMarker.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.AspNet.Identity.Owin; using Microsoft.Owin; using Umbraco.Core.Models.Identity; @@ -6,8 +6,8 @@ using Umbraco.Core.Models.Identity; namespace Umbraco.Core.Security { /// - /// This class is only here due to the fact that IOwinContext Get / Set only work in generics, if they worked - /// with regular 'object' then we wouldn't have to use this work around but because of that we have to use this + /// This class is only here due to the fact that IOwinContext Get / Set only work in generics, if they worked + /// with regular 'object' then we wouldn't have to use this work around but because of that we have to use this /// class to resolve the 'real' type of the registered user manager /// /// @@ -23,4 +23,4 @@ namespace Umbraco.Core.Security return mgr; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Security/BackOfficeUserPasswordCheckerResult.cs b/src/Umbraco.Core/Security/BackOfficeUserPasswordCheckerResult.cs index 8ce843856a..365a9941b2 100644 --- a/src/Umbraco.Core/Security/BackOfficeUserPasswordCheckerResult.cs +++ b/src/Umbraco.Core/Security/BackOfficeUserPasswordCheckerResult.cs @@ -1,4 +1,4 @@ -namespace Umbraco.Core.Security +namespace Umbraco.Core.Security { /// /// The result returned from the IBackOfficeUserPasswordChecker @@ -9,4 +9,4 @@ namespace Umbraco.Core.Security InvalidCredentials, FallbackToDefaultChecker } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Security/BackOfficeUserStore.cs b/src/Umbraco.Core/Security/BackOfficeUserStore.cs index 5a26ec1021..0c1dd11447 100644 --- a/src/Umbraco.Core/Security/BackOfficeUserStore.cs +++ b/src/Umbraco.Core/Security/BackOfficeUserStore.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Data; using System.Data.Common; @@ -14,10 +14,10 @@ using Umbraco.Core.Services; namespace Umbraco.Core.Security { - public class BackOfficeUserStore : DisposableObject, - IUserStore, - IUserPasswordStore, - IUserEmailStore, + public class BackOfficeUserStore : DisposableObject, + IUserStore, + IUserPasswordStore, + IUserEmailStore, IUserLoginStore, IUserRoleStore, IUserSecurityStampStore, @@ -89,7 +89,7 @@ namespace Umbraco.Core.Security UpdateMemberProperties(member, user); //the password must be 'something' it could be empty if authenticating - // with an external provider so we'll just generate one and prefix it, the + // with an external provider so we'll just generate one and prefix it, the // prefix will help us determine if the password hasn't actually been specified yet. if (member.RawPasswordValue.IsNullOrWhiteSpace()) { @@ -138,7 +138,7 @@ namespace Umbraco.Core.Security var logins = await GetLoginsAsync(user); _externalLoginService.SaveUserLogins(found.Id, logins); } - } + } } /// @@ -368,7 +368,7 @@ namespace Umbraco.Core.Security /// /// public Task FindAsync(UserLoginInfo login) - { + { ThrowIfDisposed(); if (login == null) throw new ArgumentNullException("login"); @@ -396,12 +396,12 @@ namespace Umbraco.Core.Security /// /// public Task AddToRoleAsync(BackOfficeIdentityUser user, string roleName) - { + { ThrowIfDisposed(); if (user == null) throw new ArgumentNullException("user"); if (user.AllowedSections.InvariantContains(roleName)) return Task.FromResult(0); - + var asInt = user.Id.TryConvertTo(); if (asInt == false) { @@ -424,7 +424,7 @@ namespace Umbraco.Core.Security /// /// public Task RemoveFromRoleAsync(BackOfficeIdentityUser user, string roleName) - { + { ThrowIfDisposed(); if (user == null) throw new ArgumentNullException("user"); @@ -452,7 +452,7 @@ namespace Umbraco.Core.Security /// /// public Task> GetRolesAsync(BackOfficeIdentityUser user) - { + { ThrowIfDisposed(); if (user == null) throw new ArgumentNullException("user"); return Task.FromResult((IList)user.AllowedSections.ToList()); @@ -464,7 +464,7 @@ namespace Umbraco.Core.Security /// /// public Task IsInRoleAsync(BackOfficeIdentityUser user, string roleName) - { + { ThrowIfDisposed(); if (user == null) throw new ArgumentNullException("user"); return Task.FromResult(user.AllowedSections.InvariantContains(roleName)); @@ -476,7 +476,7 @@ namespace Umbraco.Core.Security /// /// public Task SetSecurityStampAsync(BackOfficeIdentityUser user, string stamp) - { + { ThrowIfDisposed(); if (user == null) throw new ArgumentNullException("user"); @@ -490,12 +490,12 @@ namespace Umbraco.Core.Security /// /// public Task GetSecurityStampAsync(BackOfficeIdentityUser user) - { + { ThrowIfDisposed(); if (user == null) throw new ArgumentNullException("user"); //the stamp cannot be null, so if it is currently null then we'll just return a hash of the password - return Task.FromResult(user.SecurityStamp.IsNullOrWhiteSpace() + return Task.FromResult(user.SecurityStamp.IsNullOrWhiteSpace() ? user.PasswordHash.ToMd5() : user.SecurityStamp); } @@ -532,7 +532,7 @@ namespace Umbraco.Core.Security } #region IUserLockoutStore - + /// /// Returns the DateTimeOffset that represents the end of a user's lockout, any time in the past should be considered not locked out. /// @@ -691,7 +691,7 @@ namespace Umbraco.Core.Security anythingChanged = true; user.SecurityStamp = identityUser.SecurityStamp; } - + if (user.AllowedSections.ContainsAll(identityUser.AllowedSections) == false || identityUser.AllowedSections.ContainsAll(user.AllowedSections) == false) { @@ -716,6 +716,6 @@ namespace Umbraco.Core.Security throw new ObjectDisposedException(GetType().Name); } - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Security/EmailService.cs b/src/Umbraco.Core/Security/EmailService.cs index 807d528f3d..c32888bcb4 100644 --- a/src/Umbraco.Core/Security/EmailService.cs +++ b/src/Umbraco.Core/Security/EmailService.cs @@ -16,7 +16,7 @@ namespace Umbraco.Core.Security mailMessage.Subject = message.Subject; //TODO: This check could be nicer but that is the way it is currently - mailMessage.IsBodyHtml = message.Body.IsNullOrWhiteSpace() == false + mailMessage.IsBodyHtml = message.Body.IsNullOrWhiteSpace() == false && message.Body.Contains("<") && message.Body.Contains(" - /// This interface is only here due to the fact that IOwinContext Get / Set only work in generics, if they worked - /// with regular 'object' then we wouldn't have to use this work around but because of that we have to use this + /// This interface is only here due to the fact that IOwinContext Get / Set only work in generics, if they worked + /// with regular 'object' then we wouldn't have to use this work around but because of that we have to use this /// class to resolve the 'real' type of the registered user manager /// internal interface IBackOfficeUserManagerMarker { BackOfficeUserManager GetManager(IOwinContext owin); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Security/IBackOfficeUserPasswordChecker.cs b/src/Umbraco.Core/Security/IBackOfficeUserPasswordChecker.cs index 6ee65e0fef..d6b761ebbb 100644 --- a/src/Umbraco.Core/Security/IBackOfficeUserPasswordChecker.cs +++ b/src/Umbraco.Core/Security/IBackOfficeUserPasswordChecker.cs @@ -1,14 +1,14 @@ -using System.Threading.Tasks; +using System.Threading.Tasks; using Umbraco.Core.Models.Identity; namespace Umbraco.Core.Security { /// - /// Used by the BackOfficeUserManager to check the username/password which allows for developers to more easily + /// Used by the BackOfficeUserManager to check the username/password which allows for developers to more easily /// set the logic for this procedure. /// public interface IBackOfficeUserPasswordChecker { Task CheckPasswordAsync(BackOfficeIdentityUser user, string password); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Security/IUmbracoMemberTypeMembershipProvider.cs b/src/Umbraco.Core/Security/IUmbracoMemberTypeMembershipProvider.cs index fc07abc896..f67b3d099d 100644 --- a/src/Umbraco.Core/Security/IUmbracoMemberTypeMembershipProvider.cs +++ b/src/Umbraco.Core/Security/IUmbracoMemberTypeMembershipProvider.cs @@ -1,10 +1,10 @@ -using System.Collections.Specialized; +using System.Collections.Specialized; namespace Umbraco.Core.Security { /// /// An interface for exposing the content type properties for storing membership data in when - /// a membership provider's data is backed by an Umbraco content type. + /// a membership provider's data is backed by an Umbraco content type. /// public interface IUmbracoMemberTypeMembershipProvider { @@ -20,4 +20,4 @@ namespace Umbraco.Core.Security string PasswordRetrievalAnswerPropertyTypeAlias { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Security/IUsersMembershipProvider.cs b/src/Umbraco.Core/Security/IUsersMembershipProvider.cs index 8f2dbf8b00..700849aabb 100644 --- a/src/Umbraco.Core/Security/IUsersMembershipProvider.cs +++ b/src/Umbraco.Core/Security/IUsersMembershipProvider.cs @@ -1,4 +1,4 @@ -namespace Umbraco.Core.Security +namespace Umbraco.Core.Security { /// /// A marker interface used internally to identify Umbraco built-in Users membership providers @@ -7,4 +7,4 @@ namespace Umbraco.Core.Security { } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Security/MembershipPasswordHasher.cs b/src/Umbraco.Core/Security/MembershipPasswordHasher.cs index 56daa3efdd..14e7c69322 100644 --- a/src/Umbraco.Core/Security/MembershipPasswordHasher.cs +++ b/src/Umbraco.Core/Security/MembershipPasswordHasher.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNet.Identity; +using Microsoft.AspNet.Identity; namespace Umbraco.Core.Security { @@ -28,4 +28,4 @@ namespace Umbraco.Core.Security } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Security/MembershipProviderBase.cs b/src/Umbraco.Core/Security/MembershipProviderBase.cs index 663f090859..eff71b0a9d 100644 --- a/src/Umbraco.Core/Security/MembershipProviderBase.cs +++ b/src/Umbraco.Core/Security/MembershipProviderBase.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Specialized; using System.Configuration.Provider; using System.Security.Cryptography; @@ -57,7 +57,7 @@ namespace Umbraco.Core.Security } /// - /// Providers can override this setting, by default this is false which means that the provider will + /// Providers can override this setting, by default this is false which means that the provider will /// authenticate the username + password when ChangePassword is called. This property exists purely for /// backwards compatibility. /// @@ -215,12 +215,12 @@ namespace Umbraco.Core.Security /// The friendly name of the provider. /// A collection of the name/value pairs representing the provider-specific attributes specified in the configuration for this provider. /// The name of the provider is null. - /// An attempt is made to call - /// on a provider after the provider + /// An attempt is made to call + /// on a provider after the provider /// has already been initialized. /// The name of the provider has a length of zero. public override void Initialize(string name, NameValueCollection config) - { + { // Initialize base provider class base.Initialize(name, config); @@ -268,7 +268,7 @@ namespace Umbraco.Core.Security Current.Logger.Error("Cannot specify a Hashed password format with the enabledPasswordRetrieval option set to true", ex); throw ex; } - + _customHashAlgorithmType = config.GetValue("hashAlgorithmType", string.Empty); } @@ -295,7 +295,7 @@ namespace Umbraco.Core.Security AlphanumericChars, Strength } - + /// /// Processes a request to update the password for a membership user. /// @@ -307,7 +307,7 @@ namespace Umbraco.Core.Security /// /// /// Checks to ensure the AllowManuallyChangingPassword rule is adhered to - /// + /// public override bool ChangePassword(string username, string oldPassword, string newPassword) { if (oldPassword.IsNullOrWhiteSpace() && AllowManuallyChangingPassword == false) @@ -372,7 +372,7 @@ namespace Umbraco.Core.Security { throw new NotSupportedException("Updating the password Question and Answer is not available if requiresQuestionAndAnswer is not set in web.config"); } - + if (AllowManuallyChangingPassword == false) { if (ValidateUser(username, password) == false) @@ -524,7 +524,7 @@ namespace Umbraco.Core.Security { var userService = Current.Services.UserService; - var canReset = this.CanResetPassword(userService); + var canReset = this.CanResetPassword(userService); if (canReset == false) { @@ -566,7 +566,7 @@ namespace Umbraco.Core.Security { return Attempt.Fail(PasswordValidityError.Strength); } - + } if (password.Length < minLength) @@ -576,7 +576,7 @@ namespace Umbraco.Core.Security return Attempt.Succeed(PasswordValidityError.Ok); } - + /// /// Gets the name of the default app. /// @@ -642,7 +642,7 @@ namespace Umbraco.Core.Security { return pass; } - + if (PasswordFormat == MembershipPasswordFormat.Hashed) { //the better way, we use salt per member @@ -806,13 +806,13 @@ namespace Umbraco.Core.Security case MembershipPasswordFormat.Hashed: var saltLen = GenerateSalt(); salt = storedString.Substring(0, saltLen.Length); - return storedString.Substring(saltLen.Length); - case MembershipPasswordFormat.Clear: + return storedString.Substring(saltLen.Length); + case MembershipPasswordFormat.Clear: case MembershipPasswordFormat.Encrypted: default: salt = string.Empty; return storedString; - + } } @@ -836,9 +836,9 @@ namespace Umbraco.Core.Security //the legacy salt was actually the password :( Key = Encoding.Unicode.GetBytes(password) }; - } + } } - + //get the algorithm by name if (_customHashAlgorithmType.IsNullOrWhiteSpace()) @@ -934,4 +934,4 @@ namespace Umbraco.Core.Security } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Security/MembershipProviderExtensions.cs b/src/Umbraco.Core/Security/MembershipProviderExtensions.cs index 645de22ab8..cd23388a39 100644 --- a/src/Umbraco.Core/Security/MembershipProviderExtensions.cs +++ b/src/Umbraco.Core/Security/MembershipProviderExtensions.cs @@ -26,7 +26,7 @@ namespace Umbraco.Core.Security internal static bool CanResetPassword(this MembershipProvider provider, IUserService userService) { if (provider == null) throw new ArgumentNullException("provider"); - + var canReset = provider.EnablePasswordReset; if (userService == null) return canReset; diff --git a/src/Umbraco.Core/Security/OwinExtensions.cs b/src/Umbraco.Core/Security/OwinExtensions.cs index 251f008a8c..98f17ae38b 100644 --- a/src/Umbraco.Core/Security/OwinExtensions.cs +++ b/src/Umbraco.Core/Security/OwinExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.AspNet.Identity.Owin; using Microsoft.Owin; using Umbraco.Core.Models.Identity; @@ -11,7 +11,7 @@ namespace Umbraco.Core.Security /// Gets the back office sign in manager out of OWIN /// /// - /// + /// public static BackOfficeSignInManager GetBackOfficeSignInManager(this IOwinContext owinContext) { var mgr = owinContext.Get(); @@ -28,9 +28,9 @@ namespace Umbraco.Core.Security /// /// /// - /// This is required because to extract the user manager we need to user a custom service since owin only deals in generics and + /// This is required because to extract the user manager we need to user a custom service since owin only deals in generics and /// developers could register their own user manager types - /// + /// public static BackOfficeUserManager GetBackOfficeUserManager(this IOwinContext owinContext) { var marker = owinContext.Get(BackOfficeUserManager.OwinMarkerKey); @@ -44,4 +44,4 @@ namespace Umbraco.Core.Security return mgr; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Security/UmbracoBackOfficeIdentity.cs b/src/Umbraco.Core/Security/UmbracoBackOfficeIdentity.cs index 1bc9902da5..cf6a77205a 100644 --- a/src/Umbraco.Core/Security/UmbracoBackOfficeIdentity.cs +++ b/src/Umbraco.Core/Security/UmbracoBackOfficeIdentity.cs @@ -36,15 +36,15 @@ namespace Umbraco.Core.Security var username = identity.GetUserName(); var session = identity.FindFirstValue(Constants.Security.SessionIdClaimType); - var startContentId = identity.FindFirstValue(Constants.Security.StartContentNodeIdClaimType); + var startContentId = identity.FindFirstValue(Constants.Security.StartContentNodeIdClaimType); var startMediaId = identity.FindFirstValue(Constants.Security.StartMediaNodeIdClaimType); var culture = identity.FindFirstValue(ClaimTypes.Locality); - var id = identity.FindFirstValue(ClaimTypes.NameIdentifier); + var id = identity.FindFirstValue(ClaimTypes.NameIdentifier); var realName = identity.FindFirstValue(ClaimTypes.GivenName); - if (username == null || startContentId == null || startMediaId == null - || culture == null || id == null + if (username == null || startContentId == null || startMediaId == null + || culture == null || id == null || realName == null || session == null) throw new InvalidOperationException("Cannot create a " + typeof(UmbracoBackOfficeIdentity) + " from " + typeof(ClaimsIdentity) + " since there are missing required claims"); @@ -155,7 +155,7 @@ namespace Umbraco.Core.Security { foreach (var claim in claimsIdentity.Claims) { - //In one special case we will replace a claim if it exists already and that is the + //In one special case we will replace a claim if it exists already and that is the // Forms auth claim for name which automatically gets added TryRemoveClaim(FindFirst(x => x.Type == claim.Type && x.Issuer == "Forms")); @@ -177,14 +177,14 @@ namespace Umbraco.Core.Security { ClaimTypes.NameIdentifier, //id ClaimTypes.Name, //username - ClaimTypes.GivenName, + ClaimTypes.GivenName, Constants.Security.StartContentNodeIdClaimType, - Constants.Security.StartMediaNodeIdClaimType, - ClaimTypes.Locality, + Constants.Security.StartMediaNodeIdClaimType, + ClaimTypes.Locality, Constants.Security.SessionIdClaimType }; } - } + } /// /// Adds claims based on the UserData data @@ -214,7 +214,7 @@ namespace Umbraco.Core.Security { AddClaim(new Claim(Constants.Security.SessionIdClaimType, SessionId, ClaimValueTypes.String, Issuer, Issuer, this)); - //The security stamp claim is also required... this is because this claim type is hard coded + //The security stamp claim is also required... this is because this claim type is hard coded // by the SecurityStampValidator, see: https://katanaproject.codeplex.com/workitem/444 if (HasClaim(x => x.Type == Microsoft.AspNet.Identity.Constants.DefaultSecurityStampClaimType) == false) { @@ -227,7 +227,7 @@ namespace Umbraco.Core.Security { foreach (var application in AllowedApplications) { - AddClaim(new Claim(Constants.Security.AllowedApplicationsClaimType, application, ClaimValueTypes.String, Issuer, Issuer, this)); + AddClaim(new Claim(Constants.Security.AllowedApplicationsClaimType, application, ClaimValueTypes.String, Issuer, Issuer, this)); } } @@ -242,8 +242,8 @@ namespace Umbraco.Core.Security } } - - + + } protected internal UserData UserData { get; private set; } @@ -316,4 +316,4 @@ namespace Umbraco.Core.Security } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Security/UmbracoMembershipProviderBase.cs b/src/Umbraco.Core/Security/UmbracoMembershipProviderBase.cs index 328d8ad335..6f88c9bcd5 100644 --- a/src/Umbraco.Core/Security/UmbracoMembershipProviderBase.cs +++ b/src/Umbraco.Core/Security/UmbracoMembershipProviderBase.cs @@ -1,4 +1,4 @@ -using System.Text; +using System.Text; using System.Web.Security; namespace Umbraco.Core.Security @@ -11,7 +11,7 @@ namespace Umbraco.Core.Security public abstract string DefaultMemberTypeAlias { get; } - + /// /// Adds a new membership user to the data source. /// @@ -55,7 +55,7 @@ namespace Umbraco.Core.Security status = valStatus; return null; } - + return PerformCreateUser(memberTypeAlias, username, password, email, passwordQuestion, passwordAnswer, isApproved, providerUserKey, out status); } @@ -84,4 +84,4 @@ namespace Umbraco.Core.Security return sb.ToString(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Security/UserData.cs b/src/Umbraco.Core/Security/UserData.cs index 407d2782dd..80741caab8 100644 --- a/src/Umbraco.Core/Security/UserData.cs +++ b/src/Umbraco.Core/Security/UserData.cs @@ -31,13 +31,13 @@ namespace Umbraco.Core.Security /// /// This is the 'security stamp' for validation - /// + /// [DataMember(Name = "sessionId")] - public string SessionId { get; set; } + public string SessionId { get; set; } [DataMember(Name = "id")] public object Id { get; set; } - + [DataMember(Name = "roles")] public string[] Roles { get; set; } @@ -59,4 +59,4 @@ namespace Umbraco.Core.Security [DataMember(Name = "culture")] public string Culture { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/SemVersionExtensions.cs b/src/Umbraco.Core/SemVersionExtensions.cs index f45aacdfc2..e96b6fae45 100644 --- a/src/Umbraco.Core/SemVersionExtensions.cs +++ b/src/Umbraco.Core/SemVersionExtensions.cs @@ -9,4 +9,4 @@ namespace Umbraco.Core return semVersion.ToString().Replace("--", "-").Replace("-+", "+"); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Serialization/AbstractSerializationService.cs b/src/Umbraco.Core/Serialization/AbstractSerializationService.cs index 6e8ee40dad..f9e2f122fa 100644 --- a/src/Umbraco.Core/Serialization/AbstractSerializationService.cs +++ b/src/Umbraco.Core/Serialization/AbstractSerializationService.cs @@ -30,4 +30,4 @@ namespace Umbraco.Core.Serialization /// public abstract IStreamedResult ToStream(object input, string intent = null); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Serialization/ForceInt32Converter.cs b/src/Umbraco.Core/Serialization/ForceInt32Converter.cs index 97639a3cb2..9cff7f1401 100644 --- a/src/Umbraco.Core/Serialization/ForceInt32Converter.cs +++ b/src/Umbraco.Core/Serialization/ForceInt32Converter.cs @@ -25,4 +25,4 @@ namespace Umbraco.Core.Serialization throw new NotImplementedException(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Serialization/Formatter.cs b/src/Umbraco.Core/Serialization/Formatter.cs index 286034dccb..ad92c65c6e 100644 --- a/src/Umbraco.Core/Serialization/Formatter.cs +++ b/src/Umbraco.Core/Serialization/Formatter.cs @@ -18,4 +18,4 @@ namespace Umbraco.Core.Serialization #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Serialization/IFormatter.cs b/src/Umbraco.Core/Serialization/IFormatter.cs index f0719481a4..974c140f9e 100644 --- a/src/Umbraco.Core/Serialization/IFormatter.cs +++ b/src/Umbraco.Core/Serialization/IFormatter.cs @@ -6,4 +6,4 @@ ISerializer Serializer { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Serialization/ISerializer.cs b/src/Umbraco.Core/Serialization/ISerializer.cs index 714aec540a..e8239d424d 100644 --- a/src/Umbraco.Core/Serialization/ISerializer.cs +++ b/src/Umbraco.Core/Serialization/ISerializer.cs @@ -9,4 +9,4 @@ namespace Umbraco.Core.Serialization IStreamedResult ToStream(object input); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Serialization/IStreamedResult.cs b/src/Umbraco.Core/Serialization/IStreamedResult.cs index a1001c5696..b49dac6650 100644 --- a/src/Umbraco.Core/Serialization/IStreamedResult.cs +++ b/src/Umbraco.Core/Serialization/IStreamedResult.cs @@ -7,4 +7,4 @@ namespace Umbraco.Core.Serialization Stream ResultStream { get; } bool Success { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Serialization/JsonCreationConverter.cs b/src/Umbraco.Core/Serialization/JsonCreationConverter.cs index 1dd79fbb96..3639337b68 100644 --- a/src/Umbraco.Core/Serialization/JsonCreationConverter.cs +++ b/src/Umbraco.Core/Serialization/JsonCreationConverter.cs @@ -44,4 +44,4 @@ namespace Umbraco.Core.Serialization throw new NotImplementedException(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Serialization/JsonNetSerializer.cs b/src/Umbraco.Core/Serialization/JsonNetSerializer.cs index 800278abf0..14dea715df 100644 --- a/src/Umbraco.Core/Serialization/JsonNetSerializer.cs +++ b/src/Umbraco.Core/Serialization/JsonNetSerializer.cs @@ -69,4 +69,4 @@ namespace Umbraco.Core.Serialization #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Serialization/JsonToStringConverter.cs b/src/Umbraco.Core/Serialization/JsonToStringConverter.cs index eeda4345c0..59d5e90c4e 100644 --- a/src/Umbraco.Core/Serialization/JsonToStringConverter.cs +++ b/src/Umbraco.Core/Serialization/JsonToStringConverter.cs @@ -30,4 +30,4 @@ namespace Umbraco.Core.Serialization return typeof(string).IsAssignableFrom(objectType); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Serialization/NoTypeConverterJsonConverter.cs b/src/Umbraco.Core/Serialization/NoTypeConverterJsonConverter.cs index 78dda6c4c6..dcc084238b 100644 --- a/src/Umbraco.Core/Serialization/NoTypeConverterJsonConverter.cs +++ b/src/Umbraco.Core/Serialization/NoTypeConverterJsonConverter.cs @@ -1,4 +1,4 @@ -using System; +using System; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; @@ -10,9 +10,9 @@ namespace Umbraco.Core.Serialization /// /// /// In some cases thsi is required if your model has an explicit type converter, see: http://stackoverflow.com/a/31328131/694494 - /// + /// /// NOTE: I was going to use this for the ImageCropDataSetConverter to convert to String, which would have worked by putting this attribute: - /// [JsonConverter(typeof(NoTypeConverterJsonConverter{ImageCropDataSet}))] on top of the ImageCropDataSet class, however it turns out we + /// [JsonConverter(typeof(NoTypeConverterJsonConverter{ImageCropDataSet}))] on top of the ImageCropDataSet class, however it turns out we /// don't require this because to convert to string, we just override ToString(). /// I'll leave this class here for the future though. /// @@ -49,4 +49,4 @@ namespace Umbraco.Core.Serialization JsonSerializer.CreateDefault(new JsonSerializerSettings { ContractResolver = resolver }).Serialize(writer, value); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Serialization/SerializationExtensions.cs b/src/Umbraco.Core/Serialization/SerializationExtensions.cs index be14b4c1c3..eff6f29bf5 100644 --- a/src/Umbraco.Core/Serialization/SerializationExtensions.cs +++ b/src/Umbraco.Core/Serialization/SerializationExtensions.cs @@ -37,4 +37,4 @@ namespace Umbraco.Core.Serialization return StreamResultExtensions.ToJsonString(service.ToStream(input, intent).ResultStream); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Serialization/SerializationService.cs b/src/Umbraco.Core/Serialization/SerializationService.cs index 886b6ba473..2d280b1cab 100644 --- a/src/Umbraco.Core/Serialization/SerializationService.cs +++ b/src/Umbraco.Core/Serialization/SerializationService.cs @@ -42,4 +42,4 @@ namespace Umbraco.Core.Serialization #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Serialization/StreamResultExtensions.cs b/src/Umbraco.Core/Serialization/StreamResultExtensions.cs index 96490a933c..3d8d2cb924 100644 --- a/src/Umbraco.Core/Serialization/StreamResultExtensions.cs +++ b/src/Umbraco.Core/Serialization/StreamResultExtensions.cs @@ -19,4 +19,4 @@ namespace Umbraco.Core.Serialization return XDocument.Load(stream); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Serialization/StreamedResult.cs b/src/Umbraco.Core/Serialization/StreamedResult.cs index 0a50751229..c7d5a33248 100644 --- a/src/Umbraco.Core/Serialization/StreamedResult.cs +++ b/src/Umbraco.Core/Serialization/StreamedResult.cs @@ -18,4 +18,4 @@ namespace Umbraco.Core.Serialization #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Serialization/UdiJsonConverter.cs b/src/Umbraco.Core/Serialization/UdiJsonConverter.cs index ff62535825..8dec6f3919 100644 --- a/src/Umbraco.Core/Serialization/UdiJsonConverter.cs +++ b/src/Umbraco.Core/Serialization/UdiJsonConverter.cs @@ -24,4 +24,4 @@ namespace Umbraco.Core.Serialization return val == null ? null : Udi.Parse(val); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Serialization/UdiRangeJsonConverter.cs b/src/Umbraco.Core/Serialization/UdiRangeJsonConverter.cs index 099c46f29d..bc5b315c55 100644 --- a/src/Umbraco.Core/Serialization/UdiRangeJsonConverter.cs +++ b/src/Umbraco.Core/Serialization/UdiRangeJsonConverter.cs @@ -1,4 +1,4 @@ -using System; +using System; using Newtonsoft.Json; using Newtonsoft.Json.Linq; @@ -23,4 +23,4 @@ namespace Umbraco.Core.Serialization return val == null ? null : UdiRange.Parse(val); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/ServiceProviderExtensions.cs b/src/Umbraco.Core/ServiceProviderExtensions.cs index a453498e0b..a467dc3455 100644 --- a/src/Umbraco.Core/ServiceProviderExtensions.cs +++ b/src/Umbraco.Core/ServiceProviderExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using Umbraco.Core.Logging; @@ -43,4 +43,4 @@ namespace Umbraco.Core return instances; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/AuditService.cs b/src/Umbraco.Core/Services/AuditService.cs index c95d25e9c4..1af79276b7 100644 --- a/src/Umbraco.Core/Services/AuditService.cs +++ b/src/Umbraco.Core/Services/AuditService.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using Umbraco.Core.Events; using Umbraco.Core.Logging; @@ -71,4 +71,4 @@ namespace Umbraco.Core.Services } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/Changes/ContentTypeChange.cs b/src/Umbraco.Core/Services/Changes/ContentTypeChange.cs index a5182f0829..d67f8f9200 100644 --- a/src/Umbraco.Core/Services/Changes/ContentTypeChange.cs +++ b/src/Umbraco.Core/Services/Changes/ContentTypeChange.cs @@ -4,8 +4,8 @@ using Umbraco.Core.Models; namespace Umbraco.Core.Services.Changes { - internal class ContentTypeChange - where TItem : class, IContentTypeComposition + internal class ContentTypeChange + where TItem : class, IContentTypeComposition { public ContentTypeChange(TItem item, ContentTypeChangeTypes changeTypes) { diff --git a/src/Umbraco.Core/Services/Changes/DomainChangeTypes.cs b/src/Umbraco.Core/Services/Changes/DomainChangeTypes.cs index 17a8da6230..9dd8a956b7 100644 --- a/src/Umbraco.Core/Services/Changes/DomainChangeTypes.cs +++ b/src/Umbraco.Core/Services/Changes/DomainChangeTypes.cs @@ -7,4 +7,4 @@ Refresh = 2, Remove = 3 } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/Changes/TreeChangeExtensions.cs b/src/Umbraco.Core/Services/Changes/TreeChangeExtensions.cs index e8c1db3f44..b3d15bd612 100644 --- a/src/Umbraco.Core/Services/Changes/TreeChangeExtensions.cs +++ b/src/Umbraco.Core/Services/Changes/TreeChangeExtensions.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; namespace Umbraco.Core.Services.Changes { @@ -29,4 +29,4 @@ namespace Umbraco.Core.Services.Changes return (change & types) == TreeChangeTypes.None; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/Changes/TreeChangeTypes.cs b/src/Umbraco.Core/Services/Changes/TreeChangeTypes.cs index 34d5f39b65..e2457864ed 100644 --- a/src/Umbraco.Core/Services/Changes/TreeChangeTypes.cs +++ b/src/Umbraco.Core/Services/Changes/TreeChangeTypes.cs @@ -1,4 +1,4 @@ -using System; +using System; namespace Umbraco.Core.Services.Changes { @@ -22,4 +22,4 @@ namespace Umbraco.Core.Services.Changes // never to return Remove = 8, } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/ContentService.cs b/src/Umbraco.Core/Services/ContentService.cs index c3d15c3c5b..985e43110b 100644 --- a/src/Umbraco.Core/Services/ContentService.cs +++ b/src/Umbraco.Core/Services/ContentService.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Globalization; using System.Linq; @@ -2505,7 +2505,7 @@ namespace Umbraco.Core.Services var moves = new List>(); var contentTypeIdsA = contentTypeIds.ToArray(); - // using an immediate uow here because we keep making changes with + // using an immediate uow here because we keep making changes with // PerformMoveLocked and DeleteLocked that must be applied immediately, // no point queuing operations // @@ -2603,4 +2603,4 @@ namespace Umbraco.Core.Services #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/ContentServiceExtensions.cs b/src/Umbraco.Core/Services/ContentServiceExtensions.cs index 4919a81217..11a68adacc 100644 --- a/src/Umbraco.Core/Services/ContentServiceExtensions.cs +++ b/src/Umbraco.Core/Services/ContentServiceExtensions.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; using Umbraco.Core.Models.Membership; namespace Umbraco.Core.Services @@ -35,4 +35,4 @@ namespace Umbraco.Core.Services return mediaService.CountChildren(Constants.System.RecycleBinMedia) > 0; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/ContentTypeService.cs b/src/Umbraco.Core/Services/ContentTypeService.cs index 5c73ad5980..bf9ba115bb 100644 --- a/src/Umbraco.Core/Services/ContentTypeService.cs +++ b/src/Umbraco.Core/Services/ContentTypeService.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using Umbraco.Core.Events; using Umbraco.Core.Logging; @@ -67,4 +67,4 @@ namespace Umbraco.Core.Services } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/ContentTypeServiceBase.cs b/src/Umbraco.Core/Services/ContentTypeServiceBase.cs index 28f7e9a65f..8902c0864b 100644 --- a/src/Umbraco.Core/Services/ContentTypeServiceBase.cs +++ b/src/Umbraco.Core/Services/ContentTypeServiceBase.cs @@ -1,4 +1,4 @@ -using Umbraco.Core.Events; +using Umbraco.Core.Events; using Umbraco.Core.Logging; using Umbraco.Core.Persistence.UnitOfWork; @@ -10,4 +10,4 @@ namespace Umbraco.Core.Services : base(provider, logger, eventMessagesFactory) { } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/ContentTypeServiceBaseOfTItemTService.cs b/src/Umbraco.Core/Services/ContentTypeServiceBaseOfTItemTService.cs index 7ecc0e361f..feb7e66f47 100644 --- a/src/Umbraco.Core/Services/ContentTypeServiceBaseOfTItemTService.cs +++ b/src/Umbraco.Core/Services/ContentTypeServiceBaseOfTItemTService.cs @@ -1,4 +1,4 @@ -using System.Runtime.CompilerServices; +using System.Runtime.CompilerServices; using Umbraco.Core.Events; using Umbraco.Core.Logging; using Umbraco.Core.Models; @@ -128,4 +128,4 @@ namespace Umbraco.Core.Services uow.Events.Dispatch(DeletedContainer, This, args); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/ContentTypeServiceBaseOfTRepositoryTItemTService.cs b/src/Umbraco.Core/Services/ContentTypeServiceBaseOfTRepositoryTItemTService.cs index cf1ecb159c..8552b0d0e3 100644 --- a/src/Umbraco.Core/Services/ContentTypeServiceBaseOfTRepositoryTItemTService.cs +++ b/src/Umbraco.Core/Services/ContentTypeServiceBaseOfTRepositoryTItemTService.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using Umbraco.Core.Events; @@ -923,4 +923,4 @@ namespace Umbraco.Core.Services #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/ContentTypeServiceExtensions.cs b/src/Umbraco.Core/Services/ContentTypeServiceExtensions.cs index ed04edc6bf..8d2dacfe56 100644 --- a/src/Umbraco.Core/Services/ContentTypeServiceExtensions.cs +++ b/src/Umbraco.Core/Services/ContentTypeServiceExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using Umbraco.Core.Models; @@ -28,7 +28,7 @@ namespace Umbraco.Core.Services IContentTypeComposition[] allContentTypes, string[] filterContentTypes = null, string[] filterPropertyTypes = null) - { + { filterContentTypes = filterContentTypes == null ? new string[] { } : filterContentTypes.Where(x => x.IsNullOrWhiteSpace() == false).ToArray(); @@ -48,7 +48,7 @@ namespace Umbraco.Core.Services .ToArray(); var sourceId = source != null ? source.Id : 0; - + // find out if any content type uses this content type var isUsing = allContentTypes.Where(x => x.ContentTypeComposition.Any(y => y.Id == sourceId)).ToArray(); if (isUsing.Length > 0) @@ -68,16 +68,16 @@ namespace Umbraco.Core.Services .Where(x => x.ContentTypeComposition.Any() == false).ToArray(); foreach (var x in usableContentTypes) list.Add(x); - + // indirect types are those that we use, directly or indirectly var indirectContentTypes = GetDirectOrIndirect(source).ToArray(); foreach (var x in indirectContentTypes) list.Add(x); //At this point we have a list of content types that 'could' be compositions - + //now we'll filter this list based on the filters requested - var filtered = list + var filtered = list .Where(x => { //need to filter any content types that are included in this list @@ -85,13 +85,13 @@ namespace Umbraco.Core.Services }) .Where(x => { - //need to filter any content types that have matching property aliases that are included in this list + //need to filter any content types that have matching property aliases that are included in this list //ensure that we don't return if there's any overlapping property aliases from the filtered ones specified return filterPropertyTypes.Intersect( - x.PropertyTypes.Select(p => p.Alias), + x.PropertyTypes.Select(p => p.Alias), StringComparer.InvariantCultureIgnoreCase).Any() == false; }) - .OrderBy(x => x.Name) + .OrderBy(x => x.Name) .ToList(); //get ancestor ids - we will filter all ancestors @@ -146,7 +146,7 @@ namespace Umbraco.Core.Services x => x.Id)); var stack = new Stack(); - + foreach (var x in ctype.ContentTypeComposition) stack.Push(x); @@ -162,4 +162,4 @@ namespace Umbraco.Core.Services } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/DataTypeService.cs b/src/Umbraco.Core/Services/DataTypeService.cs index 90478ac91a..9e0c2cb5c8 100644 --- a/src/Umbraco.Core/Services/DataTypeService.cs +++ b/src/Umbraco.Core/Services/DataTypeService.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using Umbraco.Core.Events; @@ -535,7 +535,7 @@ namespace Umbraco.Core.Services Audit(uow, AuditType.Delete, "Delete DataTypeDefinition performed by user", userId, dataTypeDefinition.Id); uow.Complete(); - } + } } private void Audit(IUnitOfWork uow, AuditType type, string message, int userId, int objectId) @@ -554,22 +554,22 @@ namespace Umbraco.Core.Services /// /// Occurs before Delete /// - public static event TypedEventHandler> Deleting; + public static event TypedEventHandler> Deleting; /// /// Occurs after Delete /// - public static event TypedEventHandler> Deleted; + public static event TypedEventHandler> Deleted; /// /// Occurs before Save /// - public static event TypedEventHandler> Saving; + public static event TypedEventHandler> Saving; /// /// Occurs after Save /// - public static event TypedEventHandler> Saved; + public static event TypedEventHandler> Saved; /// /// Occurs before Move @@ -582,4 +582,4 @@ namespace Umbraco.Core.Services public static event TypedEventHandler> Moved; #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/DomainService.cs b/src/Umbraco.Core/Services/DomainService.cs index 840884a8cc..7fa1a391af 100644 --- a/src/Umbraco.Core/Services/DomainService.cs +++ b/src/Umbraco.Core/Services/DomainService.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using Umbraco.Core.Events; @@ -132,4 +132,4 @@ namespace Umbraco.Core.Services #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/EntityService.cs b/src/Umbraco.Core/Services/EntityService.cs index d6a20eaf85..8b4a15dcea 100644 --- a/src/Umbraco.Core/Services/EntityService.cs +++ b/src/Umbraco.Core/Services/EntityService.cs @@ -70,7 +70,7 @@ namespace Umbraco.Core.Services // lazy-constructed because when the ctor runs, the query factory may not be ready - private IQuery QueryRootEntity => _queryRootEntity + private IQuery QueryRootEntity => _queryRootEntity ?? (_queryRootEntity = UowProvider.DatabaseContext.Query().Where(x => x.ParentId == -1)); #endregion @@ -415,7 +415,7 @@ namespace Umbraco.Core.Services /// /// /// - /// + /// /// public IEnumerable GetPagedDescendants(int id, UmbracoObjectTypes umbracoObjectType, long pageIndex, int pageSize, out long totalRecords, string orderBy = "path", Direction orderDirection = Direction.Ascending, string filter = "") @@ -615,8 +615,8 @@ namespace Umbraco.Core.Services public virtual UmbracoObjectTypes GetObjectType(IUmbracoEntity entity) { var entityImpl = entity as UmbracoEntity; - return entityImpl == null - ? GetObjectType(entity.Id) + return entityImpl == null + ? GetObjectType(entity.Id) : UmbracoObjectTypesExtensions.GetUmbracoObjectType(entityImpl.NodeObjectTypeId); } @@ -673,4 +673,4 @@ namespace Umbraco.Core.Services } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/EntityXmlSerializer.cs b/src/Umbraco.Core/Services/EntityXmlSerializer.cs index 07fce9182a..66eb9e6b25 100644 --- a/src/Umbraco.Core/Services/EntityXmlSerializer.cs +++ b/src/Umbraco.Core/Services/EntityXmlSerializer.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Globalization; using System.Linq; @@ -32,11 +32,11 @@ namespace Umbraco.Core.Services /// Optional parameter indicating whether to include descendents /// containing the xml representation of the Content object public XElement Serialize( - IContentService contentService, - IDataTypeService dataTypeService, + IContentService contentService, + IDataTypeService dataTypeService, IUserService userService, IEnumerable urlSegmentProviders, - IContent content, + IContent content, bool deep = false) { if (contentService == null) throw new ArgumentNullException("contentService"); @@ -76,11 +76,11 @@ namespace Umbraco.Core.Services /// Optional parameter indicating whether to include descendents /// containing the xml representation of the Media object public XElement Serialize( - IMediaService mediaService, - IDataTypeService dataTypeService, + IMediaService mediaService, + IDataTypeService dataTypeService, IUserService userService, - IEnumerable urlSegmentProviders, - IMedia media, + IEnumerable urlSegmentProviders, + IMedia media, bool deep = false) { if (mediaService == null) throw new ArgumentNullException("mediaService"); @@ -126,7 +126,7 @@ namespace Umbraco.Core.Services xml.Add(new XAttribute("loginName", member.Username)); xml.Add(new XAttribute("email", member.Email)); - + xml.Add(new XAttribute("icon", member.ContentType.Icon)); return xml; @@ -194,7 +194,7 @@ namespace Umbraco.Core.Services } if (string.IsNullOrWhiteSpace(folderNames) == false) - xml.Add(new XAttribute("Folders", folderNames)); + xml.Add(new XAttribute("Folders", folderNames)); return xml; } @@ -422,7 +422,7 @@ namespace Umbraco.Core.Services new XElement("Mandatory", propertyType.Mandatory.ToString()), propertyType.ValidationRegExp != null ? new XElement("Validation", propertyType.ValidationRegExp) : null, propertyType.Description != null ? new XElement("Description", new XCData(propertyType.Description)) : null); - + genericProperties.Add(genericProperty); } @@ -479,7 +479,7 @@ namespace Umbraco.Core.Services currentXml.Add(childXml); //copy local (out of closure) var c = child; - //get this item's children + //get this item's children var children = originalDescendants.Where(x => x.ParentId == c.Id); //recurse and add it's children to the child xml element AddChildXml(mediaService, dataTypeService, userService, urlSegmentProviders, originalDescendants, children, childXml); @@ -537,11 +537,11 @@ namespace Umbraco.Core.Services currentXml.Add(childXml); //copy local (out of closure) var c = child; - //get this item's children + //get this item's children var children = originalDescendants.Where(x => x.ParentId == c.Id); //recurse and add it's children to the child xml element AddChildXml(contentService, dataTypeService, userService, urlSegmentProviders, originalDescendants, children, childXml); } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/ExternalLoginService.cs b/src/Umbraco.Core/Services/ExternalLoginService.cs index 44451851be..56b8946381 100644 --- a/src/Umbraco.Core/Services/ExternalLoginService.cs +++ b/src/Umbraco.Core/Services/ExternalLoginService.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using Microsoft.AspNet.Identity; using Umbraco.Core.Events; @@ -77,4 +77,4 @@ namespace Umbraco.Core.Services } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/FileService.cs b/src/Umbraco.Core/Services/FileService.cs index c5e3e4b102..976f5b7438 100644 --- a/src/Umbraco.Core/Services/FileService.cs +++ b/src/Umbraco.Core/Services/FileService.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel; using System.IO; @@ -1195,4 +1195,4 @@ namespace Umbraco.Core.Services #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/IApplicationTreeService.cs b/src/Umbraco.Core/Services/IApplicationTreeService.cs index 9721cd9a56..b8ac272439 100644 --- a/src/Umbraco.Core/Services/IApplicationTreeService.cs +++ b/src/Umbraco.Core/Services/IApplicationTreeService.cs @@ -134,4 +134,4 @@ namespace Umbraco.Core.Services throw new System.NotImplementedException(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/IAuditService.cs b/src/Umbraco.Core/Services/IAuditService.cs index 0a2488f00e..19ad180df3 100644 --- a/src/Umbraco.Core/Services/IAuditService.cs +++ b/src/Umbraco.Core/Services/IAuditService.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using Umbraco.Core.Models; @@ -12,4 +12,4 @@ namespace Umbraco.Core.Services IEnumerable GetLogs(AuditType type, DateTime? sinceDate = null); void CleanLogs(int maximumAgeOfLogsInMinutes); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/IContentService.cs b/src/Umbraco.Core/Services/IContentService.cs index bd4d21fe8a..5d71fee38c 100644 --- a/src/Umbraco.Core/Services/IContentService.cs +++ b/src/Umbraco.Core/Services/IContentService.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel; using System.Xml; @@ -608,4 +608,4 @@ namespace Umbraco.Core.Services /// IContent CreateContentWithIdentity(string name, int parentId, string contentTypeAlias, int userId = 0); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/IContentServiceBase.cs b/src/Umbraco.Core/Services/IContentServiceBase.cs index 7264c51779..a748e88fb4 100644 --- a/src/Umbraco.Core/Services/IContentServiceBase.cs +++ b/src/Umbraco.Core/Services/IContentServiceBase.cs @@ -1,4 +1,4 @@ -namespace Umbraco.Core.Services +namespace Umbraco.Core.Services { /// /// Placehold for sharing logic between the content, media (and member) services @@ -6,4 +6,4 @@ namespace Umbraco.Core.Services /// public interface IContentServiceBase : IService { } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/IContentTypeService.cs b/src/Umbraco.Core/Services/IContentTypeService.cs index e0d4b3549e..51b78ee060 100644 --- a/src/Umbraco.Core/Services/IContentTypeService.cs +++ b/src/Umbraco.Core/Services/IContentTypeService.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using Umbraco.Core.Models; @@ -25,4 +25,4 @@ namespace Umbraco.Core.Services /// IEnumerable GetAllContentTypeAliases(params Guid[] objectTypes); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/IDataTypeService.cs b/src/Umbraco.Core/Services/IDataTypeService.cs index 3f038c2ba6..461d1e1193 100644 --- a/src/Umbraco.Core/Services/IDataTypeService.cs +++ b/src/Umbraco.Core/Services/IDataTypeService.cs @@ -1,11 +1,11 @@ -using System; +using System; using System.Collections.Generic; using Umbraco.Core.Models; namespace Umbraco.Core.Services { /// - /// Defines the DataType Service, which is an easy access to operations involving + /// Defines the DataType Service, which is an easy access to operations involving /// public interface IDataTypeService : IService { @@ -138,6 +138,6 @@ namespace Umbraco.Core.Services string GetPreValueAsString(int id); Attempt> Move(IDataTypeDefinition toMove, int parentId); - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/IDomainService.cs b/src/Umbraco.Core/Services/IDomainService.cs index 7a6ce21c8a..4c79f58016 100644 --- a/src/Umbraco.Core/Services/IDomainService.cs +++ b/src/Umbraco.Core/Services/IDomainService.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using Umbraco.Core.Models; namespace Umbraco.Core.Services @@ -13,4 +13,4 @@ namespace Umbraco.Core.Services IEnumerable GetAssignedDomains(int contentId, bool includeWildcards); Attempt Save(IDomain domainEntity); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/IEntityService.cs b/src/Umbraco.Core/Services/IEntityService.cs index 598dbd7c88..e0070bdc68 100644 --- a/src/Umbraco.Core/Services/IEntityService.cs +++ b/src/Umbraco.Core/Services/IEntityService.cs @@ -264,4 +264,4 @@ namespace Umbraco.Core.Services /// Type of the entity Type GetEntityType(UmbracoObjectTypes umbracoObjectType); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/IExternalLoginService.cs b/src/Umbraco.Core/Services/IExternalLoginService.cs index e1b1a161d8..535b797d61 100644 --- a/src/Umbraco.Core/Services/IExternalLoginService.cs +++ b/src/Umbraco.Core/Services/IExternalLoginService.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using Microsoft.AspNet.Identity; using Umbraco.Core.Models.Identity; @@ -17,7 +17,7 @@ namespace Umbraco.Core.Services IEnumerable GetAll(int userId); /// - /// Returns all logins matching the login info - generally there should only be one but in some cases + /// Returns all logins matching the login info - generally there should only be one but in some cases /// there might be more than one depending on if an adminstrator has been editing/removing members /// /// @@ -37,4 +37,4 @@ namespace Umbraco.Core.Services /// void DeleteUserLogins(int userId); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/IFileService.cs b/src/Umbraco.Core/Services/IFileService.cs index d7477a2f0c..09ff9869ad 100644 --- a/src/Umbraco.Core/Services/IFileService.cs +++ b/src/Umbraco.Core/Services/IFileService.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.IO; using Umbraco.Core.Models; @@ -34,7 +34,7 @@ namespace Umbraco.Core.Services /// /// An enumerable list of objects IEnumerable GetStylesheets(params string[] names); - + /// /// Gets a object by its name /// @@ -175,7 +175,7 @@ namespace Umbraco.Core.Services /// Returns a template as a template node which can be traversed (parent, children) /// /// - /// + /// TemplateNode GetTemplateNode(string alias); /// @@ -228,16 +228,16 @@ namespace Umbraco.Core.Services void SaveTemplate(IEnumerable templates, int userId = 0); /// - /// This checks what the default rendering engine is set in config but then also ensures that there isn't already - /// a template that exists in the opposite rendering engine's template folder, then returns the appropriate + /// This checks what the default rendering engine is set in config but then also ensures that there isn't already + /// a template that exists in the opposite rendering engine's template folder, then returns the appropriate /// rendering engine to use. - /// + /// /// /// /// The reason this is required is because for example, if you have a master page file already existing under ~/masterpages/Blah.aspx - /// and then you go to create a template in the tree called Blah and the default rendering engine is MVC, it will create a Blah.cshtml - /// empty template in ~/Views. This means every page that is using Blah will go to MVC and render an empty page. - /// This is mostly related to installing packages since packages install file templates to the file system and then create the + /// and then you go to create a template in the tree called Blah and the default rendering engine is MVC, it will create a Blah.cshtml + /// empty template in ~/Views. This means every page that is using Blah will go to MVC and render an empty page. + /// This is mostly related to installing packages since packages install file templates to the file system and then create the /// templates in business logic. Without this, it could cause the wrong rendering engine to be used for a package. /// RenderingEngine DetermineTemplateRenderingEngine(ITemplate template); @@ -382,4 +382,4 @@ namespace Umbraco.Core.Services /// The content of the partial view. string GetPartialViewSnippetContent(string snippetName); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/ILocalizationService.cs b/src/Umbraco.Core/Services/ILocalizationService.cs index e6563b7ee9..13ee68baed 100644 --- a/src/Umbraco.Core/Services/ILocalizationService.cs +++ b/src/Umbraco.Core/Services/ILocalizationService.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using Umbraco.Core.Models; @@ -137,4 +137,4 @@ namespace Umbraco.Core.Services /// Optional id of the user deleting the language void Delete(ILanguage language, int userId = 0); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/ILocalizedTextService.cs b/src/Umbraco.Core/Services/ILocalizedTextService.cs index e35bad8b66..9d0a69497d 100644 --- a/src/Umbraco.Core/Services/ILocalizedTextService.cs +++ b/src/Umbraco.Core/Services/ILocalizedTextService.cs @@ -5,10 +5,10 @@ using System.Globalization; namespace Umbraco.Core.Services { /// - /// The entry point to localize any key in the text storage source for a given culture + /// The entry point to localize any key in the text storage source for a given culture /// /// - /// This class is created to be as simple as possible so that it can be replaced very easily, + /// This class is created to be as simple as possible so that it can be replaced very easily, /// all other methods are extension methods that simply call the one underlying method in this class /// public interface ILocalizedTextService @@ -42,7 +42,7 @@ namespace Umbraco.Core.Services /// /// /// - /// TODO: This is just a hack due to the way we store the language files, they should be stored with 4 letters since that + /// TODO: This is just a hack due to the way we store the language files, they should be stored with 4 letters since that /// is what they reference but they are stored with 2, further more our user's languages are stored with 2. So this attempts /// to resolve the full culture if possible. /// diff --git a/src/Umbraco.Core/Services/IMacroService.cs b/src/Umbraco.Core/Services/IMacroService.cs index cbe733e156..1655ffc64d 100644 --- a/src/Umbraco.Core/Services/IMacroService.cs +++ b/src/Umbraco.Core/Services/IMacroService.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using Umbraco.Core.Models; @@ -61,4 +61,4 @@ namespace Umbraco.Core.Services ///// An object //IMacroPropertyType GetMacroPropertyTypeByAlias(string alias); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/IMediaService.cs b/src/Umbraco.Core/Services/IMediaService.cs index 69e8920d56..e29d9b9ae1 100644 --- a/src/Umbraco.Core/Services/IMediaService.cs +++ b/src/Umbraco.Core/Services/IMediaService.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel; using System.Xml.Linq; @@ -112,7 +112,7 @@ namespace Umbraco.Core.Services /// Id of the Parent to retrieve Children from /// An Enumerable list of objects IEnumerable GetChildren(int id); - + /// /// Gets a collection of objects by Parent Id /// diff --git a/src/Umbraco.Core/Services/IMemberGroupService.cs b/src/Umbraco.Core/Services/IMemberGroupService.cs index 966bb87e4c..934bf1a480 100644 --- a/src/Umbraco.Core/Services/IMemberGroupService.cs +++ b/src/Umbraco.Core/Services/IMemberGroupService.cs @@ -11,4 +11,4 @@ namespace Umbraco.Core.Services void Save(IMemberGroup memberGroup, bool raiseEvents = true); void Delete(IMemberGroup memberGroup); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/IMemberService.cs b/src/Umbraco.Core/Services/IMemberService.cs index 96029c6a4d..05912a4205 100644 --- a/src/Umbraco.Core/Services/IMemberService.cs +++ b/src/Umbraco.Core/Services/IMemberService.cs @@ -73,7 +73,7 @@ namespace Umbraco.Core.Services /// /// Creates and persists a Member /// - /// Using this method will persist the Member object before its returned + /// Using this method will persist the Member object before its returned /// meaning that it will have an Id available (unlike the CreateMember method) /// Username of the Member to create /// Email of the Member to create @@ -85,7 +85,7 @@ namespace Umbraco.Core.Services /// /// Creates and persists a Member /// - /// Using this method will persist the Member object before its returned + /// Using this method will persist the Member object before its returned /// meaning that it will have an Id available (unlike the CreateMember method) /// Username of the Member to create /// Email of the Member to create @@ -97,7 +97,7 @@ namespace Umbraco.Core.Services /// /// This is simply a helper method which essentially just wraps the MembershipProvider's ChangePassword method /// - /// This method exists so that Umbraco developers can use one entry point to create/update + /// This method exists so that Umbraco developers can use one entry point to create/update /// Members if they choose to. /// The Member to save the password for /// The password to encrypt and save @@ -215,4 +215,4 @@ namespace Umbraco.Core.Services /// IEnumerable GetMembersByPropertyValue(string propertyTypeAlias, DateTime value, ValuePropertyMatchType matchType = ValuePropertyMatchType.Exact); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/IMemberTypeService.cs b/src/Umbraco.Core/Services/IMemberTypeService.cs index 3c0ed4d18f..16950bf20c 100644 --- a/src/Umbraco.Core/Services/IMemberTypeService.cs +++ b/src/Umbraco.Core/Services/IMemberTypeService.cs @@ -1,4 +1,4 @@ -using Umbraco.Core.Models; +using Umbraco.Core.Models; namespace Umbraco.Core.Services { @@ -9,4 +9,4 @@ namespace Umbraco.Core.Services { string GetDefault(); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/IMembershipMemberService.cs b/src/Umbraco.Core/Services/IMembershipMemberService.cs index 8a64198b9e..0be76a7fb7 100644 --- a/src/Umbraco.Core/Services/IMembershipMemberService.cs +++ b/src/Umbraco.Core/Services/IMembershipMemberService.cs @@ -94,13 +94,13 @@ namespace Umbraco.Core.Services /// An can be of type or /// or to Delete void Delete(T membershipUser); - + /// /// Saves an /// /// An can be of type or /// or to Save - /// Optional parameter to raise events. + /// Optional parameter to raise events. /// Default is True otherwise set to False to not raise events void Save(T entity, bool raiseEvents = true); @@ -109,7 +109,7 @@ namespace Umbraco.Core.Services /// /// An can be of type or /// to save - /// Optional parameter to raise events. + /// Optional parameter to raise events. /// Default is True otherwise set to False to not raise events void Save(IEnumerable entities, bool raiseEvents = true); @@ -147,4 +147,4 @@ namespace Umbraco.Core.Services /// IEnumerable GetAll(long pageIndex, int pageSize, out long totalRecords); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/IMembershipRoleService.cs b/src/Umbraco.Core/Services/IMembershipRoleService.cs index d66e9f17ac..30531b5031 100644 --- a/src/Umbraco.Core/Services/IMembershipRoleService.cs +++ b/src/Umbraco.Core/Services/IMembershipRoleService.cs @@ -14,13 +14,13 @@ namespace Umbraco.Core.Services IEnumerable GetMembersInRole(string roleName); IEnumerable FindMembersInRole(string roleName, string usernameToMatch, StringPropertyMatchType matchType = StringPropertyMatchType.StartsWith); bool DeleteRole(string roleName, bool throwIfBeingUsed); - void AssignRole(string username, string roleName); + void AssignRole(string username, string roleName); void AssignRoles(string[] usernames, string[] roleNames); - void DissociateRole(string username, string roleName); + void DissociateRole(string username, string roleName); void DissociateRoles(string[] usernames, string[] roleNames); - void AssignRole(int memberId, string roleName); + void AssignRole(int memberId, string roleName); void AssignRoles(int[] memberIds, string[] roleNames); void DissociateRole(int memberId, string roleName); void DissociateRoles(int[] memberIds, string[] roleNames); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/IMembershipUserService.cs b/src/Umbraco.Core/Services/IMembershipUserService.cs index 182d08f9bd..6379f966e5 100644 --- a/src/Umbraco.Core/Services/IMembershipUserService.cs +++ b/src/Umbraco.Core/Services/IMembershipUserService.cs @@ -1,4 +1,4 @@ -using Umbraco.Core.Models.Membership; +using Umbraco.Core.Models.Membership; namespace Umbraco.Core.Services { @@ -22,4 +22,4 @@ namespace Umbraco.Core.Services /// IUser CreateUserWithIdentity(string username, string email, IUserType userType); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/IMigrationEntryService.cs b/src/Umbraco.Core/Services/IMigrationEntryService.cs index 2ba3fec157..bcdfa191b9 100644 --- a/src/Umbraco.Core/Services/IMigrationEntryService.cs +++ b/src/Umbraco.Core/Services/IMigrationEntryService.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using Semver; using Umbraco.Core.Models; @@ -30,4 +30,4 @@ namespace Umbraco.Core.Services /// IEnumerable GetAll(string migrationName); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/IPackagingService.cs b/src/Umbraco.Core/Services/IPackagingService.cs index eb0da52b7c..5a527c1983 100644 --- a/src/Umbraco.Core/Services/IPackagingService.cs +++ b/src/Umbraco.Core/Services/IPackagingService.cs @@ -121,7 +121,7 @@ namespace Umbraco.Core.Services /// Optional parameter indicating whether or not to raise events /// containing the xml representation of the Language object XElement Export(ILanguage language, bool raiseEvents = true); - + /// /// Exports a list of items to xml as an /// @@ -197,4 +197,4 @@ namespace Umbraco.Core.Services /// string FetchPackageFile(Guid packageId, Version umbracoVersion, int userId); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/IPublicAccessService.cs b/src/Umbraco.Core/Services/IPublicAccessService.cs index 0d83b0fb64..c66be1433b 100644 --- a/src/Umbraco.Core/Services/IPublicAccessService.cs +++ b/src/Umbraco.Core/Services/IPublicAccessService.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel; using Umbraco.Core.Models; @@ -21,7 +21,7 @@ namespace Umbraco.Core.Services /// /// Returns null if no entry is found PublicAccessEntry GetEntryForContent(IContent content); - + /// /// Gets the entry defined for the content item based on a content path /// @@ -73,4 +73,4 @@ namespace Umbraco.Core.Services Attempt Delete(PublicAccessEntry entry); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/IRedirectUrlService.cs b/src/Umbraco.Core/Services/IRedirectUrlService.cs index 1249b3b664..62e59e910c 100644 --- a/src/Umbraco.Core/Services/IRedirectUrlService.cs +++ b/src/Umbraco.Core/Services/IRedirectUrlService.cs @@ -5,7 +5,7 @@ using Umbraco.Core.Models; namespace Umbraco.Core.Services { /// - /// + /// /// public interface IRedirectUrlService : IService { @@ -72,7 +72,7 @@ namespace Umbraco.Core.Services /// The total count of redirect urls. /// The redirect urls. IEnumerable GetAllRedirectUrls(int rootContentId, long pageIndex, int pageSize, out long total); - + /// /// Searches for all redirect urls that contain a given search term in their URL property. /// diff --git a/src/Umbraco.Core/Services/IRelationService.cs b/src/Umbraco.Core/Services/IRelationService.cs index 5fb1f3c8cc..2b402a3b75 100644 --- a/src/Umbraco.Core/Services/IRelationService.cs +++ b/src/Umbraco.Core/Services/IRelationService.cs @@ -285,4 +285,4 @@ namespace Umbraco.Core.Services /// to Delete Relations for void DeleteRelationsOfType(IRelationType relationType); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/ISectionService.cs b/src/Umbraco.Core/Services/ISectionService.cs index 52c86093c7..4f6dbaaa8c 100644 --- a/src/Umbraco.Core/Services/ISectionService.cs +++ b/src/Umbraco.Core/Services/ISectionService.cs @@ -43,7 +43,7 @@ namespace Umbraco.Core.Services /// /// Deletes the section - /// + /// void DeleteSection(Section section); } @@ -105,10 +105,10 @@ namespace Umbraco.Core.Services /// /// Deletes the section - /// + /// public void DeleteSection(Section section) { throw new System.NotImplementedException(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/IServerRegistrationService.cs b/src/Umbraco.Core/Services/IServerRegistrationService.cs index a852029f74..47bf3838f2 100644 --- a/src/Umbraco.Core/Services/IServerRegistrationService.cs +++ b/src/Umbraco.Core/Services/IServerRegistrationService.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using Umbraco.Core.Models; using Umbraco.Core.Sync; @@ -49,4 +49,4 @@ namespace Umbraco.Core.Services /// The role of the current server. ServerRole GetCurrentServerRole(); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/IService.cs b/src/Umbraco.Core/Services/IService.cs index e80576c493..ebe6b26d2b 100644 --- a/src/Umbraco.Core/Services/IService.cs +++ b/src/Umbraco.Core/Services/IService.cs @@ -1,4 +1,4 @@ -using Umbraco.Core.Logging; +using Umbraco.Core.Logging; namespace Umbraco.Core.Services { @@ -9,4 +9,4 @@ namespace Umbraco.Core.Services { } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/ITagService.cs b/src/Umbraco.Core/Services/ITagService.cs index 2454066d5f..d6295b8045 100644 --- a/src/Umbraco.Core/Services/ITagService.cs +++ b/src/Umbraco.Core/Services/ITagService.cs @@ -1,15 +1,15 @@ -using System; +using System; using System.Collections.Generic; using Umbraco.Core.Models; namespace Umbraco.Core.Services { /// - /// Tag service to query for tags in the tags db table. The tags returned are only relavent for published content & saved media or members + /// Tag service to query for tags in the tags db table. The tags returned are only relavent for published content & saved media or members /// /// /// If there is unpublished content with tags, those tags will not be contained. - /// + /// /// This service does not contain methods to query for content, media or members based on tags, those methods will be added /// to the content, media and member services respectively. /// @@ -80,7 +80,7 @@ namespace Umbraco.Core.Services /// /// Gets all tags for content items /// - /// Use the optional tagGroup parameter to limit the + /// Use the optional tagGroup parameter to limit the /// result to a specific 'Tag Group'. /// Optional name of the 'Tag Group' /// An enumerable list of @@ -89,7 +89,7 @@ namespace Umbraco.Core.Services /// /// Gets all tags for media items /// - /// Use the optional tagGroup parameter to limit the + /// Use the optional tagGroup parameter to limit the /// result to a specific 'Tag Group'. /// Optional name of the 'Tag Group' /// An enumerable list of @@ -98,7 +98,7 @@ namespace Umbraco.Core.Services /// /// Gets all tags for member items /// - /// Use the optional tagGroup parameter to limit the + /// Use the optional tagGroup parameter to limit the /// result to a specific 'Tag Group'. /// Optional name of the 'Tag Group' /// An enumerable list of @@ -107,7 +107,7 @@ namespace Umbraco.Core.Services /// /// Gets all tags attached to a property by entity id /// - /// Use the optional tagGroup parameter to limit the + /// Use the optional tagGroup parameter to limit the /// result to a specific 'Tag Group'. /// The content item id to get tags for /// Property type alias @@ -118,7 +118,7 @@ namespace Umbraco.Core.Services /// /// Gets all tags attached to an entity (content, media or member) by entity id /// - /// Use the optional tagGroup parameter to limit the + /// Use the optional tagGroup parameter to limit the /// result to a specific 'Tag Group'. /// The content item id to get tags for /// Optional name of the 'Tag Group' @@ -128,7 +128,7 @@ namespace Umbraco.Core.Services /// /// Gets all tags attached to a property by entity id /// - /// Use the optional tagGroup parameter to limit the + /// Use the optional tagGroup parameter to limit the /// result to a specific 'Tag Group'. /// The content item id to get tags for /// Property type alias @@ -139,11 +139,11 @@ namespace Umbraco.Core.Services /// /// Gets all tags attached to an entity (content, media or member) by entity id /// - /// Use the optional tagGroup parameter to limit the + /// Use the optional tagGroup parameter to limit the /// result to a specific 'Tag Group'. /// The content item id to get tags for /// Optional name of the 'Tag Group' /// An enumerable list of IEnumerable GetTagsForEntity(Guid contentId, string tagGroup = null); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/ITaskService.cs b/src/Umbraco.Core/Services/ITaskService.cs index 2586f4ea89..2fd37777ad 100644 --- a/src/Umbraco.Core/Services/ITaskService.cs +++ b/src/Umbraco.Core/Services/ITaskService.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using Umbraco.Core.Models; @@ -24,4 +24,4 @@ namespace Umbraco.Core.Services IEnumerable GetAllTaskTypes(); Task GetTaskById(int id); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/IUserService.cs b/src/Umbraco.Core/Services/IUserService.cs index 7353f44cb8..1b7f3985d5 100644 --- a/src/Umbraco.Core/Services/IUserService.cs +++ b/src/Umbraco.Core/Services/IUserService.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using Umbraco.Core.Models.Membership; @@ -39,21 +39,21 @@ namespace Umbraco.Core.Services /// Username /// IProfile GetProfileByUserName(string username); - + /// /// Gets a user by Id /// /// Id of the user to retrieve /// IUser GetUserById(int id); - + /// /// Removes a specific section from all users /// /// This is useful when an entire section is removed from config /// Alias of the section to remove void DeleteSectionFromAllUsers(string sectionAlias); - + /// /// Add a specific section to all users or those specified as parameters /// @@ -61,7 +61,7 @@ namespace Umbraco.Core.Services /// Alias of the section to add /// Specifiying nothing will add the section to all user void AddSectionToAllUsers(string sectionAlias, params int[] userIds); - + /// /// Get permissions set for a user and optional node ids /// @@ -73,10 +73,10 @@ namespace Umbraco.Core.Services /// /// Replaces the same permission set for a single user to any number of entities - /// + /// /// Id of the user /// - /// Permissions as enumerable list of , + /// Permissions as enumerable list of , /// if no permissions are specified then all permissions for this node are removed for this user /// /// Specify the nodes to replace permissions for. If nothing is specified all permissions are removed. @@ -99,7 +99,7 @@ namespace Umbraco.Core.Services /// Optional Ids of UserTypes to retrieve /// An enumerable list of IEnumerable GetAllUserTypes(params int[] ids); - + /// /// Gets a UserType by its Alias /// @@ -125,7 +125,7 @@ namespace Umbraco.Core.Services /// Saves a UserType /// /// UserType to save - /// Optional parameter to raise events. + /// Optional parameter to raise events. /// Default is True otherwise set to False to not raise events void SaveUserType(IUserType userType, bool raiseEvents = true); diff --git a/src/Umbraco.Core/Services/LocalizationService.cs b/src/Umbraco.Core/Services/LocalizationService.cs index 789e07eb49..ed44526352 100644 --- a/src/Umbraco.Core/Services/LocalizationService.cs +++ b/src/Umbraco.Core/Services/LocalizationService.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using Umbraco.Core.Events; @@ -389,9 +389,9 @@ namespace Umbraco.Core.Services } /// - /// This is here to take care of a hack - the DictionaryTranslation model contains an ILanguage reference which we don't want but + /// This is here to take care of a hack - the DictionaryTranslation model contains an ILanguage reference which we don't want but /// we cannot remove it because it would be a large breaking change, so we need to make sure it's resolved lazily. This is because - /// if developers have a lot of dictionary items and translations, the caching and cloning size gets much much larger because of + /// if developers have a lot of dictionary items and translations, the caching and cloning size gets much much larger because of /// the large object graphs. So now we don't cache or clone the attached ILanguage /// private void EnsureDictionaryItemLanguageCallback(IDictionaryItem d) @@ -446,4 +446,4 @@ namespace Umbraco.Core.Services public static event TypedEventHandler> SavedLanguage; #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/LocalizedTextService.cs b/src/Umbraco.Core/Services/LocalizedTextService.cs index 5eb2c7ecb0..5c3ed7dd09 100644 --- a/src/Umbraco.Core/Services/LocalizedTextService.cs +++ b/src/Umbraco.Core/Services/LocalizedTextService.cs @@ -77,7 +77,7 @@ namespace Umbraco.Core.Services if (xmlSource != null) { return GetFromXmlSource(xmlSource, culture, area, alias, tokens); - } + } else { return GetFromDictionarySource(culture, area, alias, tokens); @@ -187,16 +187,16 @@ namespace Umbraco.Core.Services /// /// /// - /// TODO: This is just a hack due to the way we store the language files, they should be stored with 4 letters since that + /// TODO: This is just a hack due to the way we store the language files, they should be stored with 4 letters since that /// is what they reference but they are stored with 2, further more our user's languages are stored with 2. So this attempts /// to resolve the full culture if possible. - /// + /// /// This only works when this service is constructed with the LocalizedTextServiceFileSources /// public CultureInfo ConvertToSupportedCultureWithRegionCode(CultureInfo currentCulture) { if (currentCulture == null) throw new ArgumentNullException("currentCulture"); - + if (_fileSources == null) return currentCulture; if (currentCulture.Name.Length > 2) return currentCulture; @@ -214,10 +214,10 @@ namespace Umbraco.Core.Services if (currentCulture == null) throw new ArgumentNullException("currentCulture"); if (_fileSources == null) return currentCulture.Name; - + var attempt = _fileSources.Value.TryConvert4LetterCultureTo2Letter(currentCulture); - return attempt - ? attempt.Result + return attempt + ? attempt.Result : currentCulture.Name; } @@ -226,11 +226,11 @@ namespace Umbraco.Core.Services if (_dictionarySource.ContainsKey(culture) == false) { _logger.Warn("The culture specified {0} was not found in any configured sources for this service", () => culture); - return "[" + key + "]"; + return "[" + key + "]"; } var cultureSource = _dictionarySource[culture]; - + string found; if (area.IsNullOrWhiteSpace()) { @@ -264,7 +264,7 @@ namespace Umbraco.Core.Services if (xmlSource.ContainsKey(culture) == false) { _logger.Warn("The culture specified {0} was not found in any configured sources for this service", () => culture); - return "[" + key + "]"; + return "[" + key + "]"; } var found = FindTranslation(xmlSource, culture, area, key); @@ -273,7 +273,7 @@ namespace Umbraco.Core.Services { return ParseTokens(found.Value, tokens); } - + // Fall back to English by default if we can't find the key found = FindTranslation(xmlSource, new CultureInfo("en-US"), area, key); if (found != null) @@ -303,11 +303,11 @@ namespace Umbraco.Core.Services /// /// /// - /// This is based on how the legacy ui localized text worked, each token was just a sequential value delimited with a % symbol. + /// This is based on how the legacy ui localized text worked, each token was just a sequential value delimited with a % symbol. /// For example: hello %0%, you are %1% ! - /// + /// /// Since we're going to continue using the same language files for now, the token system needs to remain the same. With our new service - /// we support a dictionary which means in the future we can really have any sort of token system. + /// we support a dictionary which means in the future we can really have any sort of token system. /// Currently though, the token key's will need to be an integer and sequential - though we aren't going to throw exceptions if that is not the case. /// internal static string ParseTokens(string value, IDictionary tokens) diff --git a/src/Umbraco.Core/Services/LocalizedTextServiceExtensions.cs b/src/Umbraco.Core/Services/LocalizedTextServiceExtensions.cs index e7526f6e34..367a870896 100644 --- a/src/Umbraco.Core/Services/LocalizedTextServiceExtensions.cs +++ b/src/Umbraco.Core/Services/LocalizedTextServiceExtensions.cs @@ -98,7 +98,7 @@ namespace Umbraco.Core.Services return cultureDictionary[text].IfNullOrWhiteSpace(text); } - private static ICultureDictionary CultureDictionary + private static ICultureDictionary CultureDictionary => _cultureDictionary ?? (_cultureDictionary = Current.CultureDictionaryFactory.CreateDictionary()); } } diff --git a/src/Umbraco.Core/Services/LocalizedTextServiceFileSources.cs b/src/Umbraco.Core/Services/LocalizedTextServiceFileSources.cs index ad68ce1089..0c747aebf6 100644 --- a/src/Umbraco.Core/Services/LocalizedTextServiceFileSources.cs +++ b/src/Umbraco.Core/Services/LocalizedTextServiceFileSources.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Globalization; using System.IO; @@ -28,7 +28,7 @@ namespace Umbraco.Core.Services /// /// This is used to configure the file sources with the main file sources shipped with Umbraco and also including supplemental/plugin based - /// localization files. The supplemental files will be loaded in and merged in after the primary files. + /// localization files. The supplemental files will be loaded in and merged in after the primary files. /// The supplemental files must be named with the 4 letter culture name with a hyphen such as : en-AU.xml /// /// @@ -37,9 +37,9 @@ namespace Umbraco.Core.Services /// public LocalizedTextServiceFileSources( ILogger logger, - IRuntimeCacheProvider cache, + IRuntimeCacheProvider cache, DirectoryInfo fileSourceFolder, - IEnumerable supplementFileSources) + IEnumerable supplementFileSources) { if (logger == null) throw new ArgumentNullException("logger"); if (cache == null) throw new ArgumentNullException("cache"); @@ -103,7 +103,7 @@ namespace Umbraco.Core.Services culture = CultureInfo.GetCultureInfo(filename); } - //get the lazy value from cache + //get the lazy value from cache result[culture] = new Lazy(() => _cache.GetCacheItem( string.Format("{0}-{1}", typeof(LocalizedTextServiceFileSources).Name, culture.Name), () => { @@ -144,7 +144,7 @@ namespace Umbraco.Core.Services public LocalizedTextServiceFileSources(ILogger logger, IRuntimeCacheProvider cache, DirectoryInfo fileSourceFolder) : this(logger, cache, fileSourceFolder, Enumerable.Empty()) { - + } /// @@ -193,7 +193,7 @@ namespace Umbraco.Core.Services var fileName = Path.GetFileName(x.File.FullName); return fileName.InvariantStartsWith(culture.Name) && fileName.InvariantEndsWith(".xml"); }); - + foreach (var supplementaryFile in found) { using (var fs = supplementaryFile.File.OpenRead()) @@ -255,4 +255,4 @@ namespace Umbraco.Core.Services } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/LocalizedTextServiceSupplementaryFileSource.cs b/src/Umbraco.Core/Services/LocalizedTextServiceSupplementaryFileSource.cs index 04ff8c13a9..a1bcd89da8 100644 --- a/src/Umbraco.Core/Services/LocalizedTextServiceSupplementaryFileSource.cs +++ b/src/Umbraco.Core/Services/LocalizedTextServiceSupplementaryFileSource.cs @@ -1,11 +1,11 @@ -using System; +using System; using System.IO; namespace Umbraco.Core.Services { public class LocalizedTextServiceSupplementaryFileSource { - + public LocalizedTextServiceSupplementaryFileSource(FileInfo file, bool overwriteCoreKeys) { if (file == null) throw new ArgumentNullException("file"); @@ -17,4 +17,4 @@ namespace Umbraco.Core.Services public FileInfo File { get; private set; } public bool OverwriteCoreKeys { get; private set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/MacroService.cs b/src/Umbraco.Core/Services/MacroService.cs index 503d08f393..d84af3e666 100644 --- a/src/Umbraco.Core/Services/MacroService.cs +++ b/src/Umbraco.Core/Services/MacroService.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using Umbraco.Core.Events; @@ -114,7 +114,7 @@ namespace Umbraco.Core.Services Audit(uow, AuditType.Delete, "Delete Macro performed by user", userId, -1); uow.Complete(); - } + } } /// @@ -176,22 +176,22 @@ namespace Umbraco.Core.Services /// /// Occurs before Delete /// - public static event TypedEventHandler> Deleting; + public static event TypedEventHandler> Deleting; /// /// Occurs after Delete /// - public static event TypedEventHandler> Deleted; + public static event TypedEventHandler> Deleted; /// /// Occurs before Save /// - public static event TypedEventHandler> Saving; + public static event TypedEventHandler> Saving; /// /// Occurs after Save /// - public static event TypedEventHandler> Saved; + public static event TypedEventHandler> Saved; #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/MediaService.cs b/src/Umbraco.Core/Services/MediaService.cs index 2ebb111907..78f80791b3 100644 --- a/src/Umbraco.Core/Services/MediaService.cs +++ b/src/Umbraco.Core/Services/MediaService.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Globalization; using System.IO; @@ -1417,7 +1417,7 @@ namespace Umbraco.Core.Services var moves = new List>(); var mediaTypeIdsA = mediaTypeIds.ToArray(); - // using an immediate uow here because we keep making changes with + // using an immediate uow here because we keep making changes with // PerformMoveLocked and DeleteLocked that must be applied immediately, // no point queuing operations // diff --git a/src/Umbraco.Core/Services/MemberGroupService.cs b/src/Umbraco.Core/Services/MemberGroupService.cs index 89677342be..f92e16d675 100644 --- a/src/Umbraco.Core/Services/MemberGroupService.cs +++ b/src/Umbraco.Core/Services/MemberGroupService.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using Umbraco.Core.Events; using Umbraco.Core.Logging; using Umbraco.Core.Models; @@ -137,4 +137,4 @@ namespace Umbraco.Core.Services /// public static event TypedEventHandler> Saved; } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/MemberService.cs b/src/Umbraco.Core/Services/MemberService.cs index 1979f0a244..ec4abedb19 100644 --- a/src/Umbraco.Core/Services/MemberService.cs +++ b/src/Umbraco.Core/Services/MemberService.cs @@ -1305,4 +1305,4 @@ namespace Umbraco.Core.Services #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/MemberTypeService.cs b/src/Umbraco.Core/Services/MemberTypeService.cs index 8a2c54641f..569d8845dc 100644 --- a/src/Umbraco.Core/Services/MemberTypeService.cs +++ b/src/Umbraco.Core/Services/MemberTypeService.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using Umbraco.Core.Events; using Umbraco.Core.Logging; @@ -52,4 +52,4 @@ namespace Umbraco.Core.Services } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/MigrationEntryService.cs b/src/Umbraco.Core/Services/MigrationEntryService.cs index e3fd7b6bc7..49d6e635a1 100644 --- a/src/Umbraco.Core/Services/MigrationEntryService.cs +++ b/src/Umbraco.Core/Services/MigrationEntryService.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using Semver; using Umbraco.Core.Events; using Umbraco.Core.Logging; @@ -73,4 +73,4 @@ namespace Umbraco.Core.Services } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/MoveOperationStatusType.cs b/src/Umbraco.Core/Services/MoveOperationStatusType.cs index d1a3439cab..95ccce93ca 100644 --- a/src/Umbraco.Core/Services/MoveOperationStatusType.cs +++ b/src/Umbraco.Core/Services/MoveOperationStatusType.cs @@ -1,5 +1,5 @@ -namespace Umbraco.Core.Services -{ +namespace Umbraco.Core.Services +{ /// /// A status type of the result of moving an item @@ -29,4 +29,4 @@ namespace Umbraco.Core.Services /// FailedNotAllowedByPath = 15, } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/NotificationService.cs b/src/Umbraco.Core/Services/NotificationService.cs index e554f650c1..f03312402f 100644 --- a/src/Umbraco.Core/Services/NotificationService.cs +++ b/src/Umbraco.Core/Services/NotificationService.cs @@ -170,15 +170,15 @@ namespace Umbraco.Core.Services { var content = entitiesL[j]; var path = paths[j]; - + // test if the notification applies to the path ie to this entity if (path.Contains(notifications[i].EntityId) == false) continue; // next entity - + if (prevVersionDictionary.ContainsKey(content.Id) == false) { prevVersionDictionary[content.Id] = GetPreviousVersion(content.Id); } - + // queue notification var req = CreateNotificationRequest(operatingUser, user, content, prevVersionDictionary[content.Id], actionName, http, createSubject, createBody); Enqueue(req); @@ -190,7 +190,7 @@ namespace Umbraco.Core.Services { i++; } while (i < notifications.Count && notifications[i].UserId == user.Id); - + if (i >= notifications.Count) break; // break if no more notifications } @@ -356,7 +356,7 @@ namespace Umbraco.Core.Services /// /// Callback to create the mail subject /// Callback to create the mail body - private NotificationRequest CreateNotificationRequest(IUser performingUser, IUser mailingUser, IContentBase content, IContentBase oldDoc, + private NotificationRequest CreateNotificationRequest(IUser performingUser, IUser mailingUser, IContentBase content, IContentBase oldDoc, string actionName, HttpContextBase http, Func createSubject, Func createBody) @@ -366,8 +366,8 @@ namespace Umbraco.Core.Services if (content == null) throw new ArgumentNullException("content"); if (http == null) throw new ArgumentNullException("http"); if (createSubject == null) throw new ArgumentNullException("createSubject"); - if (createBody == null) throw new ArgumentNullException("createBody"); - + if (createBody == null) throw new ArgumentNullException("createBody"); + // build summary var summary = new StringBuilder(); var props = content.Properties.ToArray(); @@ -665,4 +665,4 @@ namespace Umbraco.Core.Services #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/OperationStatus.cs b/src/Umbraco.Core/Services/OperationStatus.cs index a2553c0ce4..27c37419bd 100644 --- a/src/Umbraco.Core/Services/OperationStatus.cs +++ b/src/Umbraco.Core/Services/OperationStatus.cs @@ -1,4 +1,4 @@ -using System; +using System; using Umbraco.Core.Events; namespace Umbraco.Core.Services @@ -80,7 +80,7 @@ namespace Umbraco.Core.Services /// /// The status of the operation. /// Event messages produced by the operation. - public OperationStatus(OperationStatusType statusType, EventMessages eventMessages) + public OperationStatus(OperationStatusType statusType, EventMessages eventMessages) : base(statusType, eventMessages) { } @@ -207,4 +207,4 @@ namespace Umbraco.Core.Services } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/OperationStatusType.cs b/src/Umbraco.Core/Services/OperationStatusType.cs index cceef0d347..bc4295bdbf 100644 --- a/src/Umbraco.Core/Services/OperationStatusType.cs +++ b/src/Umbraco.Core/Services/OperationStatusType.cs @@ -1,4 +1,4 @@ -namespace Umbraco.Core.Services +namespace Umbraco.Core.Services { /// /// A value indicating the result of an operation. @@ -67,4 +67,4 @@ namespace Umbraco.Core.Services return (int) status >= 10; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/PackagingService.cs b/src/Umbraco.Core/Services/PackagingService.cs index f321f8a705..a50ebddf5f 100644 --- a/src/Umbraco.Core/Services/PackagingService.cs +++ b/src/Umbraco.Core/Services/PackagingService.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Globalization; using System.IO; @@ -64,7 +64,7 @@ namespace Umbraco.Core.Services ILocalizationService localizationService, IEntityService entityService, IUserService userService, - IScopeUnitOfWorkProvider uowProvider, + IScopeUnitOfWorkProvider uowProvider, IEnumerable urlSegmentProviders) { _logger = logger; @@ -168,7 +168,7 @@ namespace Umbraco.Core.Services { var contents = new List(); foreach (var root in roots) - { + { var contentTypeAlias = root.Name.LocalName; if (_importedContentTypes.ContainsKey(contentTypeAlias) == false) @@ -425,7 +425,7 @@ namespace Umbraco.Core.Services var list = _importedContentTypes.Select(x => x.Value).ToList(); _contentTypeService.Save(list, userId); - //Now we can finish the import by updating the 'structure', + //Now we can finish the import by updating the 'structure', //which requires the doc types to be saved/available in the db if (importStructure) { @@ -459,7 +459,7 @@ namespace Umbraco.Core.Services { var foldersAttribute = documentType.Attribute("Folders"); var infoElement = documentType.Element("Info"); - if (foldersAttribute != null && infoElement != null + if (foldersAttribute != null && infoElement != null //don't import any folder if this is a child doc type - the parent doc type will need to //exist which contains it's folders && ((string)infoElement.Element("Master")).IsNullOrWhiteSpace()) @@ -680,7 +680,7 @@ namespace Umbraco.Core.Services //If no DataTypeDefinition with the guid from the xml wasn't found OR the ControlId on the DataTypeDefinition didn't match the DataType Id //We look up a DataTypeDefinition that matches - + //get the alias as a string for use below var propertyEditorAlias = property.Element("Type").Value.Trim(); @@ -868,7 +868,7 @@ namespace Umbraco.Core.Services foreach (var dataTypeElement in dataTypeElements) { var dataTypeDefinitionName = dataTypeElement.Attribute("Name").Value; - + var dataTypeDefinitionId = new Guid(dataTypeElement.Attribute("Definition").Value); var databaseTypeAttribute = dataTypeElement.Attribute("DatabaseType"); @@ -943,7 +943,7 @@ namespace Umbraco.Core.Services { _logger.Error("Could not create folder: " + rootFolder, tryCreateFolder.Exception); throw tryCreateFolder.Exception; - } + } current = _dataTypeService.GetContainer(tryCreateFolder.Result.Value.Id); } @@ -1489,7 +1489,7 @@ namespace Umbraco.Core.Services throw new ConnectionException("An error occuring downloading the package from " + url, ex); } - //successfull + //successfull if (bytes.Length > 0) { var packagePath = IOHelper.MapPath(SystemDirectories.Packages); @@ -1517,7 +1517,7 @@ namespace Umbraco.Core.Services var auditRepo = uow.CreateRepository(); auditRepo.AddOrUpdate(new AuditItem(objectId, message, type, userId)); } - + #endregion #region Templates diff --git a/src/Umbraco.Core/Services/PublicAccessService.cs b/src/Umbraco.Core/Services/PublicAccessService.cs index 4eac09ec5f..0cbbf59a92 100644 --- a/src/Umbraco.Core/Services/PublicAccessService.cs +++ b/src/Umbraco.Core/Services/PublicAccessService.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using Umbraco.Core.Events; @@ -63,7 +63,7 @@ namespace Umbraco.Core.Services { var repo = uow.CreateRepository(); - //This will retrieve from cache! + //This will retrieve from cache! var entries = repo.GetAll().ToArray(); uow.Complete(); @@ -236,7 +236,7 @@ namespace Umbraco.Core.Services /// /// Occurs before Delete - /// + /// public static event TypedEventHandler> Deleting; /// @@ -246,4 +246,4 @@ namespace Umbraco.Core.Services } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/PublicAccessServiceExtensions.cs b/src/Umbraco.Core/Services/PublicAccessServiceExtensions.cs index 00b3290f5c..d686cda73e 100644 --- a/src/Umbraco.Core/Services/PublicAccessServiceExtensions.cs +++ b/src/Umbraco.Core/Services/PublicAccessServiceExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Web.Security; @@ -37,7 +37,7 @@ namespace Umbraco.Core.Services publicAccessService.Save(entry); } } - + return hasChange; } @@ -63,4 +63,4 @@ namespace Umbraco.Core.Services && roles.Contains(x.RuleValue)); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/PublishStatus.cs b/src/Umbraco.Core/Services/PublishStatus.cs index 046ef2e806..ea465a5907 100644 --- a/src/Umbraco.Core/Services/PublishStatus.cs +++ b/src/Umbraco.Core/Services/PublishStatus.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using Umbraco.Core.Events; using Umbraco.Core.Models; @@ -38,4 +38,4 @@ namespace Umbraco.Core.Services /// public IEnumerable InvalidProperties { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/PublishStatusType.cs b/src/Umbraco.Core/Services/PublishStatusType.cs index cc9f21d94d..a391a6914d 100644 --- a/src/Umbraco.Core/Services/PublishStatusType.cs +++ b/src/Umbraco.Core/Services/PublishStatusType.cs @@ -1,4 +1,4 @@ -namespace Umbraco.Core.Services +namespace Umbraco.Core.Services { /// /// A value indicating the result of publishing a content item. @@ -35,7 +35,7 @@ namespace Umbraco.Core.Services FailedHasExpired = 12, /// - /// The content item is scheduled to be released in the future and therefore we cannot force it to + /// The content item is scheduled to be released in the future and therefore we cannot force it to /// be published during a bulk publish operation. /// FailedAwaitingRelease = 13, @@ -81,4 +81,4 @@ namespace Umbraco.Core.Services return (int) status >= 10; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/RedirectUrlService.cs b/src/Umbraco.Core/Services/RedirectUrlService.cs index 9a1f51e276..a30262e5e1 100644 --- a/src/Umbraco.Core/Services/RedirectUrlService.cs +++ b/src/Umbraco.Core/Services/RedirectUrlService.cs @@ -10,7 +10,7 @@ namespace Umbraco.Core.Services { internal class RedirectUrlService : ScopeRepositoryService, IRedirectUrlService { - public RedirectUrlService(IScopeUnitOfWorkProvider provider, ILogger logger, IEventMessagesFactory eventMessagesFactory) + public RedirectUrlService(IScopeUnitOfWorkProvider provider, ILogger logger, IEventMessagesFactory eventMessagesFactory) : base(provider, logger, eventMessagesFactory) { } @@ -28,7 +28,7 @@ namespace Umbraco.Core.Services uow.Complete(); } } - + public void Delete(IRedirectUrl redirectUrl) { using (var uow = UowProvider.CreateUnitOfWork()) diff --git a/src/Umbraco.Core/Services/RelationService.cs b/src/Umbraco.Core/Services/RelationService.cs index 2146ef74fd..6e6afd302b 100644 --- a/src/Umbraco.Core/Services/RelationService.cs +++ b/src/Umbraco.Core/Services/RelationService.cs @@ -723,4 +723,4 @@ namespace Umbraco.Core.Services public static event TypedEventHandler> SavedRelationType; #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/RepositoryService.cs b/src/Umbraco.Core/Services/RepositoryService.cs index 9c76bf906a..ab8b6ff475 100644 --- a/src/Umbraco.Core/Services/RepositoryService.cs +++ b/src/Umbraco.Core/Services/RepositoryService.cs @@ -1,4 +1,4 @@ -using System; +using System; using Umbraco.Core.Events; using Umbraco.Core.Logging; using Umbraco.Core.Persistence.Querying; @@ -24,4 +24,4 @@ namespace Umbraco.Core.Services protected IQuery Query() => UowProvider.DatabaseContext.Query(); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/ScopeRepositoryService.cs b/src/Umbraco.Core/Services/ScopeRepositoryService.cs index 23c612d6fc..413cac0e4f 100644 --- a/src/Umbraco.Core/Services/ScopeRepositoryService.cs +++ b/src/Umbraco.Core/Services/ScopeRepositoryService.cs @@ -1,4 +1,4 @@ -using Umbraco.Core.Events; +using Umbraco.Core.Events; using Umbraco.Core.Logging; using Umbraco.Core.Persistence.UnitOfWork; @@ -14,4 +14,4 @@ namespace Umbraco.Core.Services internal new IScopeUnitOfWorkProvider UowProvider { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/ServerRegistrationService.cs b/src/Umbraco.Core/Services/ServerRegistrationService.cs index 7e6814f9c7..aa29f18f8f 100644 --- a/src/Umbraco.Core/Services/ServerRegistrationService.cs +++ b/src/Umbraco.Core/Services/ServerRegistrationService.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Web; @@ -154,4 +154,4 @@ namespace Umbraco.Core.Services return _currentServerRole; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/ServiceContext.cs b/src/Umbraco.Core/Services/ServiceContext.cs index be9189db6a..80fbe6c71a 100644 --- a/src/Umbraco.Core/Services/ServiceContext.cs +++ b/src/Umbraco.Core/Services/ServiceContext.cs @@ -1,4 +1,4 @@ -using System; +using System; namespace Umbraco.Core.Services { @@ -7,11 +7,11 @@ namespace Umbraco.Core.Services /// public class ServiceContext { - private readonly Lazy _migrationEntryService; - private readonly Lazy _publicAccessService; - private readonly Lazy _taskService; - private readonly Lazy _domainService; - private readonly Lazy _auditService; + private readonly Lazy _migrationEntryService; + private readonly Lazy _publicAccessService; + private readonly Lazy _taskService; + private readonly Lazy _domainService; + private readonly Lazy _auditService; private readonly Lazy _localizedTextService; private readonly Lazy _tagService; private readonly Lazy _contentService; @@ -273,4 +273,4 @@ namespace Umbraco.Core.Services /// public IRedirectUrlService RedirectUrlService => _redirectUrlService.Value; } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/ServiceWithResultExtensions.cs b/src/Umbraco.Core/Services/ServiceWithResultExtensions.cs index d272eb5bf9..f9c993a3b8 100644 --- a/src/Umbraco.Core/Services/ServiceWithResultExtensions.cs +++ b/src/Umbraco.Core/Services/ServiceWithResultExtensions.cs @@ -1,10 +1,10 @@ -namespace Umbraco.Core.Services +namespace Umbraco.Core.Services { /// /// These are used currently to return the temporary 'operation' interfaces for services /// which are used to return a status from operational methods so we can determine if things are /// cancelled, etc... - /// + /// /// These will be obsoleted in v8 since all real services methods will be changed to have the correct result. /// public static class ServiceWithResultExtensions @@ -18,4 +18,4 @@ namespace Umbraco.Core.Services return (IMediaServiceOperations)mediaService; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/TagExtractor.cs b/src/Umbraco.Core/Services/TagExtractor.cs index a9c17fb48f..acf6865d32 100644 --- a/src/Umbraco.Core/Services/TagExtractor.cs +++ b/src/Umbraco.Core/Services/TagExtractor.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using Newtonsoft.Json; using Umbraco.Core.Composing; @@ -32,7 +32,7 @@ namespace Umbraco.Core.Services /// The content's Property /// The data that has been submitted to be saved for a content property /// - /// If the is then this is expected to be a delimited string, + /// If the is then this is expected to be a delimited string, /// otherwise if it is then this is expected to be IEnumerable{string} /// /// @@ -65,7 +65,7 @@ namespace Umbraco.Core.Services /// /// The content's Property /// - /// If the is then this is expected to be a delimited string, + /// If the is then this is expected to be a delimited string, /// otherwise if it is then this is expected to be IEnumerable{string} /// /// The delimiter for the value if convertedPropertyValue is a string delimited value @@ -110,8 +110,8 @@ namespace Umbraco.Core.Services if (parsedJson != null) { //recurse with new value - SetPropertyTags(property, parsedJson, delimiter, replaceTags, tagGroup, valueType, storageType); - } + SetPropertyTags(property, parsedJson, delimiter, replaceTags, tagGroup, valueType, storageType); + } } catch (Exception ex) { @@ -126,4 +126,4 @@ namespace Umbraco.Core.Services } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/TagService.cs b/src/Umbraco.Core/Services/TagService.cs index 4485762564..00c6522544 100644 --- a/src/Umbraco.Core/Services/TagService.cs +++ b/src/Umbraco.Core/Services/TagService.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using Umbraco.Core.Events; using Umbraco.Core.Logging; @@ -9,14 +9,14 @@ using Umbraco.Core.Persistence.UnitOfWork; namespace Umbraco.Core.Services { /// - /// Tag service to query for tags in the tags db table. The tags returned are only relevant for published content & saved media or members + /// Tag service to query for tags in the tags db table. The tags returned are only relevant for published content & saved media or members /// /// /// If there is unpublished content with tags, those tags will not be contained /// public class TagService : ScopeRepositoryService, ITagService { - + public TagService(IScopeUnitOfWorkProvider provider, ILogger logger, IEventMessagesFactory eventMessagesFactory) : base(provider, logger, eventMessagesFactory) { @@ -28,7 +28,7 @@ namespace Umbraco.Core.Services { var repository = uow.CreateRepository(); return repository.GetTaggedEntityById(id); - } + } } public TaggedEntity GetTaggedEntityByKey(Guid key) @@ -37,7 +37,7 @@ namespace Umbraco.Core.Services { var repository = uow.CreateRepository(); return repository.GetTaggedEntityByKey(key); - } + } } /// @@ -52,7 +52,7 @@ namespace Umbraco.Core.Services { var repository = uow.CreateRepository(); return repository.GetTaggedEntitiesByTagGroup(TaggableObjectTypes.Content, tagGroup); - } + } } /// @@ -68,7 +68,7 @@ namespace Umbraco.Core.Services { var repository = uow.CreateRepository(); return repository.GetTaggedEntitiesByTag(TaggableObjectTypes.Content, tag, tagGroup); - } + } } /// @@ -83,7 +83,7 @@ namespace Umbraco.Core.Services { var repository = uow.CreateRepository(); return repository.GetTaggedEntitiesByTagGroup(TaggableObjectTypes.Media, tagGroup); - } + } } /// @@ -99,7 +99,7 @@ namespace Umbraco.Core.Services { var repository = uow.CreateRepository(); return repository.GetTaggedEntitiesByTag(TaggableObjectTypes.Media, tag, tagGroup); - } + } } /// @@ -114,7 +114,7 @@ namespace Umbraco.Core.Services { var repository = uow.CreateRepository(); return repository.GetTaggedEntitiesByTagGroup(TaggableObjectTypes.Member, tagGroup); - } + } } /// @@ -130,7 +130,7 @@ namespace Umbraco.Core.Services { var repository = uow.CreateRepository(); return repository.GetTaggedEntitiesByTag(TaggableObjectTypes.Member, tag, tagGroup); - } + } } /// @@ -144,13 +144,13 @@ namespace Umbraco.Core.Services { var repository = uow.CreateRepository(); return repository.GetTagsForEntityType(TaggableObjectTypes.All, tagGroup); - } + } } /// /// Gets all tags for content items /// - /// Use the optional tagGroup parameter to limit the + /// Use the optional tagGroup parameter to limit the /// result to a specific 'Tag Group'. /// Optional name of the 'Tag Group' /// An enumerable list of @@ -166,7 +166,7 @@ namespace Umbraco.Core.Services /// /// Gets all tags for media items /// - /// Use the optional tagGroup parameter to limit the + /// Use the optional tagGroup parameter to limit the /// result to a specific 'Tag Group'. /// Optional name of the 'Tag Group' /// An enumerable list of @@ -182,7 +182,7 @@ namespace Umbraco.Core.Services /// /// Gets all tags for member items /// - /// Use the optional tagGroup parameter to limit the + /// Use the optional tagGroup parameter to limit the /// result to a specific 'Tag Group'. /// Optional name of the 'Tag Group' /// An enumerable list of @@ -198,7 +198,7 @@ namespace Umbraco.Core.Services /// /// Gets all tags attached to a property by entity id /// - /// Use the optional tagGroup parameter to limit the + /// Use the optional tagGroup parameter to limit the /// result to a specific 'Tag Group'. /// The content item id to get tags for /// Property type alias @@ -216,7 +216,7 @@ namespace Umbraco.Core.Services /// /// Gets all tags attached to an entity (content, media or member) by entity id /// - /// Use the optional tagGroup parameter to limit the + /// Use the optional tagGroup parameter to limit the /// result to a specific 'Tag Group'. /// The content item id to get tags for /// Optional name of the 'Tag Group' @@ -233,7 +233,7 @@ namespace Umbraco.Core.Services /// /// Gets all tags attached to a property by entity id /// - /// Use the optional tagGroup parameter to limit the + /// Use the optional tagGroup parameter to limit the /// result to a specific 'Tag Group'. /// The content item id to get tags for /// Property type alias @@ -251,7 +251,7 @@ namespace Umbraco.Core.Services /// /// Gets all tags attached to an entity (content, media or member) by entity id /// - /// Use the optional tagGroup parameter to limit the + /// Use the optional tagGroup parameter to limit the /// result to a specific 'Tag Group'. /// The content item id to get tags for /// Optional name of the 'Tag Group' @@ -265,4 +265,4 @@ namespace Umbraco.Core.Services } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/TaskService.cs b/src/Umbraco.Core/Services/TaskService.cs index 4f43b856e9..481d5c07f7 100644 --- a/src/Umbraco.Core/Services/TaskService.cs +++ b/src/Umbraco.Core/Services/TaskService.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using Umbraco.Core.Events; using Umbraco.Core.Logging; @@ -105,4 +105,4 @@ namespace Umbraco.Core.Services } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/UnPublishStatus.cs b/src/Umbraco.Core/Services/UnPublishStatus.cs index 42a48177a3..ff305ab0b3 100644 --- a/src/Umbraco.Core/Services/UnPublishStatus.cs +++ b/src/Umbraco.Core/Services/UnPublishStatus.cs @@ -1,4 +1,4 @@ -using Umbraco.Core.Events; +using Umbraco.Core.Events; using Umbraco.Core.Models; namespace Umbraco.Core.Services @@ -32,4 +32,4 @@ namespace Umbraco.Core.Services /// public IContent ContentItem => Value; } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/UnPublishedStatusType.cs b/src/Umbraco.Core/Services/UnPublishedStatusType.cs index cf887871ef..aafa567ef9 100644 --- a/src/Umbraco.Core/Services/UnPublishedStatusType.cs +++ b/src/Umbraco.Core/Services/UnPublishedStatusType.cs @@ -1,4 +1,4 @@ -namespace Umbraco.Core.Services +namespace Umbraco.Core.Services { /// /// A status type of the result of unpublishing a content item @@ -23,4 +23,4 @@ namespace Umbraco.Core.Services /// FailedCancelledByEvent = 14, } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Services/UserServiceExtensions.cs b/src/Umbraco.Core/Services/UserServiceExtensions.cs index b78d66cbf5..0d7b53ca82 100644 --- a/src/Umbraco.Core/Services/UserServiceExtensions.cs +++ b/src/Umbraco.Core/Services/UserServiceExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using System.Web.Security; using Umbraco.Core.Models.Membership; @@ -83,4 +83,4 @@ namespace Umbraco.Core.Services return found; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Strategies/ManifestWatcherComponent.cs b/src/Umbraco.Core/Strategies/ManifestWatcherComponent.cs index a46c96edf9..da2f3bba32 100644 --- a/src/Umbraco.Core/Strategies/ManifestWatcherComponent.cs +++ b/src/Umbraco.Core/Strategies/ManifestWatcherComponent.cs @@ -34,4 +34,4 @@ namespace Umbraco.Core.Strategies _mw = null; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Strategies/RelateOnTrashComponent.cs b/src/Umbraco.Core/Strategies/RelateOnTrashComponent.cs index 5912ca90fc..71049b898e 100644 --- a/src/Umbraco.Core/Strategies/RelateOnTrashComponent.cs +++ b/src/Umbraco.Core/Strategies/RelateOnTrashComponent.cs @@ -73,4 +73,4 @@ namespace Umbraco.Core.Strategies } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/StringAliasCaseType.cs b/src/Umbraco.Core/StringAliasCaseType.cs index 524d1a5a78..403a7c6d05 100644 --- a/src/Umbraco.Core/StringAliasCaseType.cs +++ b/src/Umbraco.Core/StringAliasCaseType.cs @@ -1,4 +1,4 @@ -using Umbraco.Core.CodeAnnotations; +using Umbraco.Core.CodeAnnotations; namespace Umbraco.Core { @@ -9,4 +9,4 @@ namespace Umbraco.Core CamelCase, Unchanged } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/StringUdi.cs b/src/Umbraco.Core/StringUdi.cs index 0f42f4b5f6..d172d634b5 100644 --- a/src/Umbraco.Core/StringUdi.cs +++ b/src/Umbraco.Core/StringUdi.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.ComponentModel; namespace Umbraco.Core @@ -70,4 +70,4 @@ namespace Umbraco.Core return this; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Strings/Css/StylesheetRule.cs b/src/Umbraco.Core/Strings/Css/StylesheetRule.cs index 4f45525038..e97e6cff1e 100644 --- a/src/Umbraco.Core/Strings/Css/StylesheetRule.cs +++ b/src/Umbraco.Core/Strings/Css/StylesheetRule.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using System.Text; @@ -27,4 +27,4 @@ namespace Umbraco.Core.Strings.Css return sb.ToString(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Strings/DefaultShortStringHelperConfig.cs b/src/Umbraco.Core/Strings/DefaultShortStringHelperConfig.cs index 589bf62628..ec98eb17c0 100644 --- a/src/Umbraco.Core/Strings/DefaultShortStringHelperConfig.cs +++ b/src/Umbraco.Core/Strings/DefaultShortStringHelperConfig.cs @@ -215,4 +215,4 @@ namespace Umbraco.Core.Strings return text.Length <= length ? text : text.Substring(0, length); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Strings/Diff.cs b/src/Umbraco.Core/Strings/Diff.cs index ed381d4f6f..1993b8f666 100644 --- a/src/Umbraco.Core/Strings/Diff.cs +++ b/src/Umbraco.Core/Strings/Diff.cs @@ -7,21 +7,21 @@ using System.Text.RegularExpressions; namespace Umbraco.Core.Strings { - /// + /// /// This Class implements the Difference Algorithm published in /// "An O(ND) Difference Algorithm and its Variations" by Eugene Myers - /// Algorithmica Vol. 1 No. 2, 1986, p 251. - /// + /// Algorithmica Vol. 1 No. 2, 1986, p 251. + /// /// The algorithm itself is comparing 2 arrays of numbers so when comparing 2 text documents - /// each line is converted into a (hash) number. See DiffText(). - /// + /// each line is converted into a (hash) number. See DiffText(). + /// /// diff.cs: A port of the algorithm to C# /// Copyright (c) by Matthias Hertel, http://www.mathertel.de - /// This work is licensed under a BSD style license. See http://www.mathertel.de/License.aspx - /// + /// This work is licensed under a BSD style license. See http://www.mathertel.de/License.aspx + /// internal class Diff { - /// Data on one input file being compared. + /// Data on one input file being compared. /// internal class DiffData { @@ -72,7 +72,7 @@ namespace Umbraco.Core.Strings private struct Smsrd { internal int X, Y; - // internal int u, v; // 2002.09.20: no need for 2 points + // internal int u, v; // 2002.09.20: no need for 2 points } /// @@ -87,7 +87,7 @@ namespace Umbraco.Core.Strings } // DiffText /// - /// Find the difference in 2 texts, comparing by textlines. + /// Find the difference in 2 texts, comparing by textlines. /// This method uses the DiffInt internally by 1st converting the string into char codes /// then uses the diff int method /// @@ -104,7 +104,7 @@ namespace Umbraco.Core.Strings /// Find the difference in 2 text documents, comparing by textlines. /// The algorithm itself is comparing 2 arrays of numbers so when comparing 2 text documents /// each line is converted into a (hash) number. This hash-value is computed by storing all - /// textlines into a common hashtable so i can find dublicates in there, and generating a + /// textlines into a common hashtable so i can find dublicates in there, and generating a /// new number each time a new textline is inserted. /// /// A-version of the text (usualy the old one) @@ -338,7 +338,7 @@ namespace Umbraco.Core.Strings { ret.X = downVector[downOffset + k]; ret.Y = downVector[downOffset + k] - k; - // ret.u = UpVector[UpOffset + k]; // 2002.09.20: no need for 2 points + // ret.u = UpVector[UpOffset + k]; // 2002.09.20: no need for 2 points // ret.v = UpVector[UpOffset + k] - k; return (ret); } // if @@ -378,7 +378,7 @@ namespace Umbraco.Core.Strings { ret.X = downVector[downOffset + k]; ret.Y = downVector[downOffset + k] - k; - // ret.u = UpVector[UpOffset + k]; // 2002.09.20: no need for 2 points + // ret.u = UpVector[UpOffset + k]; // 2002.09.20: no need for 2 points // ret.v = UpVector[UpOffset + k] - k; return (ret); } // if @@ -393,7 +393,7 @@ namespace Umbraco.Core.Strings /// - /// This is the divide-and-conquer implementation of the longes common-subsequence (LCS) + /// This is the divide-and-conquer implementation of the longes common-subsequence (LCS) /// algorithm. /// The published algorithm passes recursively parts of the A and B sequences. /// To avoid copying these arrays the lower and upper bounds are passed while the sequences stay constant. @@ -444,13 +444,13 @@ namespace Umbraco.Core.Strings // The path is from LowerX to (x,y) and (x,y) to UpperX Lcs(dataA, lowerA, smsrd.X, dataB, lowerB, smsrd.Y, downVector, upVector); - Lcs(dataA, smsrd.X, upperA, dataB, smsrd.Y, upperB, downVector, upVector); // 2002.09.20: no need for 2 points + Lcs(dataA, smsrd.X, upperA, dataB, smsrd.Y, upperB, downVector, upVector); // 2002.09.20: no need for 2 points } } // LCS() /// Scan the tables of which lines are inserted and deleted, - /// producing an edit script in forward order. + /// producing an edit script in forward order. /// /// dynamic array private static Item[] CreateDiffs(DiffData dataA, DiffData dataB) @@ -506,5 +506,5 @@ namespace Umbraco.Core.Strings } // class Diff - + } diff --git a/src/Umbraco.Core/Strings/IShortStringHelper.cs b/src/Umbraco.Core/Strings/IShortStringHelper.cs index 3108ef069f..f48d43aa4f 100644 --- a/src/Umbraco.Core/Strings/IShortStringHelper.cs +++ b/src/Umbraco.Core/Strings/IShortStringHelper.cs @@ -98,7 +98,7 @@ namespace Umbraco.Core.Strings /// Cleans a string. /// /// The text to clean. - /// A flag indicating the target casing and encoding of the string. By default, + /// A flag indicating the target casing and encoding of the string. By default, /// strings are cleaned up to camelCase and Ascii. /// The clean string. /// The string is cleaned in the context of the IShortStringHelper default culture. @@ -108,7 +108,7 @@ namespace Umbraco.Core.Strings /// Cleans a string, using a specified separator. /// /// The text to clean. - /// A flag indicating the target casing and encoding of the string. By default, + /// A flag indicating the target casing and encoding of the string. By default, /// strings are cleaned up to camelCase and Ascii. /// The separator. /// The clean string. @@ -119,7 +119,7 @@ namespace Umbraco.Core.Strings /// Cleans a string in the context of a specified culture. /// /// The text to clean. - /// A flag indicating the target casing and encoding of the string. By default, + /// A flag indicating the target casing and encoding of the string. By default, /// strings are cleaned up to camelCase and Ascii. /// The culture. /// The clean string. @@ -129,7 +129,7 @@ namespace Umbraco.Core.Strings /// Cleans a string in the context of a specified culture, using a specified separator. /// /// The text to clean. - /// A flag indicating the target casing and encoding of the string. By default, + /// A flag indicating the target casing and encoding of the string. By default, /// strings are cleaned up to camelCase and Ascii. /// The separator. /// The culture. diff --git a/src/Umbraco.Core/Strings/IUrlSegmentProvider.cs b/src/Umbraco.Core/Strings/IUrlSegmentProvider.cs index c3ef596ad0..824ae50aa4 100644 --- a/src/Umbraco.Core/Strings/IUrlSegmentProvider.cs +++ b/src/Umbraco.Core/Strings/IUrlSegmentProvider.cs @@ -27,7 +27,7 @@ namespace Umbraco.Core.Strings /// url per culture. string GetUrlSegment(IContentBase content, CultureInfo culture); - //TODO: For the 301 tracking, we need to add another extended interface to this so that + //TODO: For the 301 tracking, we need to add another extended interface to this so that // the RedirectTrackingEventHandler can ask the IUrlSegmentProvider if the URL is changing. // Currently the way it works is very hacky, see notes in: RedirectTrackingEventHandler.ContentService_Publishing } diff --git a/src/Umbraco.Core/Strings/Utf8ToAsciiConverter.cs b/src/Umbraco.Core/Strings/Utf8ToAsciiConverter.cs index e08defdedd..318fe2b5df 100644 --- a/src/Umbraco.Core/Strings/Utf8ToAsciiConverter.cs +++ b/src/Umbraco.Core/Strings/Utf8ToAsciiConverter.cs @@ -124,7 +124,7 @@ namespace Umbraco.Core.Strings // The Unicode standard assigns the following code points to control characters: from \U0000 to \U001F, // \U007F, and from \U0080 to \U009F. According to the Unicode standard, these values are to be // interpreted as control characters unless their use is otherwise defined by an application. Valid - // control characters are members of the UnicodeCategory.Control category. + // control characters are members of the UnicodeCategory.Control category. // we don't want them } @@ -133,10 +133,10 @@ namespace Umbraco.Core.Strings // // The Unicode standard recognizes three subcategories of separators: // // - Space separators (the UnicodeCategory.SpaceSeparator category), which includes characters such as \u0020. // // - Line separators (the UnicodeCategory.LineSeparator category), which includes \u2028. - // // - Paragraph separators (the UnicodeCategory.ParagraphSeparator category), which includes \u2029. + // // - Paragraph separators (the UnicodeCategory.ParagraphSeparator category), which includes \u2029. // // // // Note: The Unicode standard classifies the characters \u000A (LF), \u000C (FF), and \u000A (CR) as control - // // characters (members of the UnicodeCategory.Control category), not as separator characters. + // // characters (members of the UnicodeCategory.Control category), not as separator characters. // // better do it via WhiteSpace //} @@ -3448,7 +3448,7 @@ namespace Umbraco.Core.Strings case '\u0440': // р output[opos++] = 'r'; break; - case '\u0421': // С + case '\u0421': // С output[opos++] = 'S'; break; case '\u0441': // с diff --git a/src/Umbraco.Core/Sync/ApplicationUrlHelper.cs b/src/Umbraco.Core/Sync/ApplicationUrlHelper.cs index d0e3ca70bf..8980c13ec4 100644 --- a/src/Umbraco.Core/Sync/ApplicationUrlHelper.cs +++ b/src/Umbraco.Core/Sync/ApplicationUrlHelper.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Web; using Umbraco.Core.Configuration; using Umbraco.Core.Configuration.UmbracoSettings; @@ -106,7 +106,7 @@ namespace Umbraco.Core.Sync // use ports from request // otherwise, // if non-standard ports used, - // user may need to set umbracoApplicationUrl manually per + // user may need to set umbracoApplicationUrl manually per // http://our.umbraco.org/documentation/Using-Umbraco/Config-files/umbracoSettings/#ScheduledTasks var port = (request.IsSecureConnection == false && GlobalSettings.UseSSL == false) || (request.IsSecureConnection && GlobalSettings.UseSSL) @@ -120,4 +120,4 @@ namespace Umbraco.Core.Sync return url.TrimEnd('/'); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Sync/ConfigServerAddress.cs b/src/Umbraco.Core/Sync/ConfigServerAddress.cs index 431dcd9573..fa1cf20f8e 100644 --- a/src/Umbraco.Core/Sync/ConfigServerAddress.cs +++ b/src/Umbraco.Core/Sync/ConfigServerAddress.cs @@ -27,6 +27,6 @@ namespace Umbraco.Core.Sync public override string ToString() { return ServerAddress; - } + } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Sync/DatabaseServerMessengerOptions.cs b/src/Umbraco.Core/Sync/DatabaseServerMessengerOptions.cs index c38a0c2568..6bfd6bff4a 100644 --- a/src/Umbraco.Core/Sync/DatabaseServerMessengerOptions.cs +++ b/src/Umbraco.Core/Sync/DatabaseServerMessengerOptions.cs @@ -1,8 +1,8 @@ -using System; +using System; using System.Collections.Generic; namespace Umbraco.Core.Sync -{ +{ /// /// Provides options to the . /// @@ -48,4 +48,4 @@ namespace Umbraco.Core.Sync /// public int PruneThrottleSeconds { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Sync/DatabaseServerRegistrar.cs b/src/Umbraco.Core/Sync/DatabaseServerRegistrar.cs index 111f1b0c9f..09b6b72478 100644 --- a/src/Umbraco.Core/Sync/DatabaseServerRegistrar.cs +++ b/src/Umbraco.Core/Sync/DatabaseServerRegistrar.cs @@ -57,4 +57,4 @@ namespace Umbraco.Core.Sync } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Sync/DatabaseServerRegistrarOptions.cs b/src/Umbraco.Core/Sync/DatabaseServerRegistrarOptions.cs index 5b5f6fc457..6f019e7104 100644 --- a/src/Umbraco.Core/Sync/DatabaseServerRegistrarOptions.cs +++ b/src/Umbraco.Core/Sync/DatabaseServerRegistrarOptions.cs @@ -32,4 +32,4 @@ namespace Umbraco.Core.Sync /// public TimeSpan StaleServerTimeout { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Sync/IServerAddress.cs b/src/Umbraco.Core/Sync/IServerAddress.cs index 84a3563c60..b71db6f16c 100644 --- a/src/Umbraco.Core/Sync/IServerAddress.cs +++ b/src/Umbraco.Core/Sync/IServerAddress.cs @@ -14,4 +14,4 @@ namespace Umbraco.Core.Sync //TODO : Should probably add things like port, protocol, server name, app id } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Sync/IServerMessenger.cs b/src/Umbraco.Core/Sync/IServerMessenger.cs index 1eb2ea0f67..1df4ce9710 100644 --- a/src/Umbraco.Core/Sync/IServerMessenger.cs +++ b/src/Umbraco.Core/Sync/IServerMessenger.cs @@ -87,4 +87,4 @@ namespace Umbraco.Core.Sync /// The ICacheRefresher. void PerformRefreshAll(IEnumerable servers, ICacheRefresher refresher); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Sync/IServerRegistrar.cs b/src/Umbraco.Core/Sync/IServerRegistrar.cs index 802cf8ecaf..5e5a93078f 100644 --- a/src/Umbraco.Core/Sync/IServerRegistrar.cs +++ b/src/Umbraco.Core/Sync/IServerRegistrar.cs @@ -26,4 +26,4 @@ namespace Umbraco.Core.Sync /// string GetCurrentServerUmbracoApplicationUrl(); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Sync/MessageType.cs b/src/Umbraco.Core/Sync/MessageType.cs index 9cdf94bafa..98b089dad3 100644 --- a/src/Umbraco.Core/Sync/MessageType.cs +++ b/src/Umbraco.Core/Sync/MessageType.cs @@ -13,4 +13,4 @@ RemoveByInstance, RefreshByPayload } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Sync/RefreshInstruction.cs b/src/Umbraco.Core/Sync/RefreshInstruction.cs index 8c1cfca96d..b6caf42db6 100644 --- a/src/Umbraco.Core/Sync/RefreshInstruction.cs +++ b/src/Umbraco.Core/Sync/RefreshInstruction.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using Newtonsoft.Json; @@ -72,7 +72,7 @@ namespace Umbraco.Core.Sync case MessageType.RefreshByJson: return new[] { new RefreshInstruction(refresher, RefreshMethodType.RefreshByJson, json) }; - + case MessageType.RefreshById: if (idType == null) throw new InvalidOperationException("Cannot refresh by id if idType is null."); @@ -87,7 +87,7 @@ namespace Umbraco.Core.Sync // must be ints, bulk-remove is not supported, iterate return ids.Select(x => new RefreshInstruction(refresher, RefreshMethodType.RemoveById, (int) x)); //return new[] { new RefreshInstruction(refresher, RefreshMethodType.RemoveByIds, JsonConvert.SerializeObject(ids.Cast().ToArray())) }; - + default: //case MessageType.RefreshByInstance: //case MessageType.RemoveByInstance: @@ -124,14 +124,14 @@ namespace Umbraco.Core.Sync /// Gets or sets the payload data value. /// public string JsonPayload { get; set; } - + protected bool Equals(RefreshInstruction other) { - return RefreshType == other.RefreshType - && RefresherId.Equals(other.RefresherId) - && GuidId.Equals(other.GuidId) - && IntId == other.IntId - && string.Equals(JsonIds, other.JsonIds) + return RefreshType == other.RefreshType + && RefresherId.Equals(other.RefresherId) + && GuidId.Equals(other.GuidId) + && IntId == other.IntId + && string.Equals(JsonIds, other.JsonIds) && string.Equals(JsonPayload, other.JsonPayload); } @@ -167,4 +167,4 @@ namespace Umbraco.Core.Sync return Equals(left, right) == false; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Sync/RefreshInstructionEnvelope.cs b/src/Umbraco.Core/Sync/RefreshInstructionEnvelope.cs index bcbde3a38e..ac51e14a30 100644 --- a/src/Umbraco.Core/Sync/RefreshInstructionEnvelope.cs +++ b/src/Umbraco.Core/Sync/RefreshInstructionEnvelope.cs @@ -1,10 +1,10 @@ -using System.Collections.Generic; +using System.Collections.Generic; using Umbraco.Core.Cache; namespace Umbraco.Core.Sync { /// - /// Used for any 'Batched' instances which specifies a set of targeting a collection of + /// Used for any 'Batched' instances which specifies a set of targeting a collection of /// /// public sealed class RefreshInstructionEnvelope @@ -20,4 +20,4 @@ namespace Umbraco.Core.Sync public ICacheRefresher Refresher { get; set; } public IEnumerable Instructions { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Sync/RefreshMethodType.cs b/src/Umbraco.Core/Sync/RefreshMethodType.cs index 4f6ad64716..d5e9046540 100644 --- a/src/Umbraco.Core/Sync/RefreshMethodType.cs +++ b/src/Umbraco.Core/Sync/RefreshMethodType.cs @@ -1,4 +1,4 @@ -using System; +using System; namespace Umbraco.Core.Sync { @@ -41,4 +41,4 @@ namespace Umbraco.Core.Sync // RemoveById / ByInstance (support enumeration of int or guid) // Notify (for everything JSON) } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Sync/ServerMessengerBase.cs b/src/Umbraco.Core/Sync/ServerMessengerBase.cs index b20c7f9f45..c021a64969 100644 --- a/src/Umbraco.Core/Sync/ServerMessengerBase.cs +++ b/src/Umbraco.Core/Sync/ServerMessengerBase.cs @@ -228,7 +228,7 @@ namespace Umbraco.Core.Sync throw new NotSupportedException("Invalid message type " + messageType); } } - + /// /// Executes the strongly typed on the local/current server /// diff --git a/src/Umbraco.Core/Sync/ServerRole.cs b/src/Umbraco.Core/Sync/ServerRole.cs index cbc121c4bc..a42f015c5b 100644 --- a/src/Umbraco.Core/Sync/ServerRole.cs +++ b/src/Umbraco.Core/Sync/ServerRole.cs @@ -1,4 +1,4 @@ -namespace Umbraco.Core.Sync +namespace Umbraco.Core.Sync { /// /// The role of a server in an application environment. @@ -25,4 +25,4 @@ namespace Umbraco.Core.Sync /// Master = 3 } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Sync/ServerSyncWebServiceClient.cs b/src/Umbraco.Core/Sync/ServerSyncWebServiceClient.cs index 6a620bc4c3..1c05a4600d 100644 --- a/src/Umbraco.Core/Sync/ServerSyncWebServiceClient.cs +++ b/src/Umbraco.Core/Sync/ServerSyncWebServiceClient.cs @@ -25,20 +25,20 @@ namespace Umbraco.Core.Sync public void BulkRefresh(RefreshInstruction[] instructions, string appId, string login, string password) { this.Invoke("BulkRefresh", new object[] { - instructions, + instructions, appId, - login, - password}); + login, + password}); } /// public System.IAsyncResult BeginBulkRefresh(RefreshInstruction[] instructions, string appId, string login, string password, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("BulkRefresh", new object[] { - instructions, + instructions, appId, - login, - password}, callback, asyncState); + login, + password}, callback, asyncState); } /// @@ -52,18 +52,18 @@ namespace Umbraco.Core.Sync public void RefreshAll(System.Guid uniqueIdentifier, string Login, string Password) { this.Invoke("RefreshAll", new object[] { - uniqueIdentifier, - Login, - Password}); + uniqueIdentifier, + Login, + Password}); } /// public System.IAsyncResult BeginRefreshAll(System.Guid uniqueIdentifier, string Login, string Password, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("RefreshAll", new object[] { - uniqueIdentifier, - Login, - Password}, callback, asyncState); + uniqueIdentifier, + Login, + Password}, callback, asyncState); } /// @@ -71,26 +71,26 @@ namespace Umbraco.Core.Sync { this.EndInvoke(asyncResult); } - + /// [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://umbraco.org/webservices/RefreshByJson", RequestNamespace = "http://umbraco.org/webservices/", ResponseNamespace = "http://umbraco.org/webservices/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] public void RefreshByJson(System.Guid uniqueIdentifier, string jsonPayload, string Login, string Password) { this.Invoke("RefreshByJson", new object[] { - uniqueIdentifier, - jsonPayload, - Login, - Password}); + uniqueIdentifier, + jsonPayload, + Login, + Password}); } /// public System.IAsyncResult BeginRefreshByJson(System.Guid uniqueIdentifier, string jsonPayload, string Login, string Password, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("RefreshByJson", new object[] { - uniqueIdentifier, - jsonPayload, - Login, - Password}, callback, asyncState); + uniqueIdentifier, + jsonPayload, + Login, + Password}, callback, asyncState); } /// @@ -104,20 +104,20 @@ namespace Umbraco.Core.Sync public void RefreshByGuid(System.Guid uniqueIdentifier, System.Guid Id, string Login, string Password) { this.Invoke("RefreshByGuid", new object[] { - uniqueIdentifier, - Id, - Login, - Password}); + uniqueIdentifier, + Id, + Login, + Password}); } /// public System.IAsyncResult BeginRefreshByGuid(System.Guid uniqueIdentifier, System.Guid Id, string Login, string Password, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("RefreshByGuid", new object[] { - uniqueIdentifier, - Id, - Login, - Password}, callback, asyncState); + uniqueIdentifier, + Id, + Login, + Password}, callback, asyncState); } /// @@ -127,28 +127,28 @@ namespace Umbraco.Core.Sync } /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://umbraco.org/webservices/RefreshById", - RequestNamespace = "http://umbraco.org/webservices/", - ResponseNamespace = "http://umbraco.org/webservices/", - Use = System.Web.Services.Description.SoapBindingUse.Literal, + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://umbraco.org/webservices/RefreshById", + RequestNamespace = "http://umbraco.org/webservices/", + ResponseNamespace = "http://umbraco.org/webservices/", + Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] public void RefreshById(System.Guid uniqueIdentifier, int Id, string Login, string Password) { this.Invoke("RefreshById", new object[] { - uniqueIdentifier, - Id, - Login, - Password}); + uniqueIdentifier, + Id, + Login, + Password}); } /// public System.IAsyncResult BeginRefreshById(System.Guid uniqueIdentifier, int Id, string Login, string Password, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("RefreshById", new object[] { - uniqueIdentifier, - Id, - Login, - Password}, callback, asyncState); + uniqueIdentifier, + Id, + Login, + Password}, callback, asyncState); } /// @@ -159,28 +159,28 @@ namespace Umbraco.Core.Sync /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://umbraco.org/webservices/RefreshByIds", - RequestNamespace = "http://umbraco.org/webservices/", - ResponseNamespace = "http://umbraco.org/webservices/", - Use = System.Web.Services.Description.SoapBindingUse.Literal, + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://umbraco.org/webservices/RefreshByIds", + RequestNamespace = "http://umbraco.org/webservices/", + ResponseNamespace = "http://umbraco.org/webservices/", + Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] public void RefreshByIds(System.Guid uniqueIdentifier, string jsonIds, string Login, string Password) { this.Invoke("RefreshByIds", new object[] { - uniqueIdentifier, - jsonIds, - Login, - Password}); + uniqueIdentifier, + jsonIds, + Login, + Password}); } /// public System.IAsyncResult BeginRefreshByIds(System.Guid uniqueIdentifier, string jsonIds, string Login, string Password, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("RefreshByIds", new object[] { - uniqueIdentifier, - jsonIds, - Login, - Password}, callback, asyncState); + uniqueIdentifier, + jsonIds, + Login, + Password}, callback, asyncState); } /// @@ -196,20 +196,20 @@ namespace Umbraco.Core.Sync public void RemoveById(System.Guid uniqueIdentifier, int Id, string Login, string Password) { this.Invoke("RemoveById", new object[] { - uniqueIdentifier, - Id, - Login, - Password}); + uniqueIdentifier, + Id, + Login, + Password}); } /// public System.IAsyncResult BeginRemoveById(System.Guid uniqueIdentifier, int Id, string Login, string Password, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("RemoveById", new object[] { - uniqueIdentifier, - Id, - Login, - Password}, callback, asyncState); + uniqueIdentifier, + Id, + Login, + Password}, callback, asyncState); } /// @@ -223,8 +223,8 @@ namespace Umbraco.Core.Sync public System.Xml.XmlNode GetRefreshers(string Login, string Password) { object[] results = this.Invoke("GetRefreshers", new object[] { - Login, - Password}); + Login, + Password}); return ((System.Xml.XmlNode)(results[0])); } @@ -232,8 +232,8 @@ namespace Umbraco.Core.Sync public System.IAsyncResult BeginGetRefreshers(string Login, string Password, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("GetRefreshers", new object[] { - Login, - Password}, callback, asyncState); + Login, + Password}, callback, asyncState); } /// @@ -243,4 +243,4 @@ namespace Umbraco.Core.Sync return ((System.Xml.XmlNode)(results[0])); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Sync/WebServiceServerMessenger.cs b/src/Umbraco.Core/Sync/WebServiceServerMessenger.cs index 0e39473992..df95c79afd 100644 --- a/src/Umbraco.Core/Sync/WebServiceServerMessenger.cs +++ b/src/Umbraco.Core/Sync/WebServiceServerMessenger.cs @@ -19,7 +19,7 @@ namespace Umbraco.Core.Sync /// this messenger sends ALL instructions to ALL servers, including the local server. /// the CacheRefresher web service will run ALL instructions, so there may be duplicated, /// except for "bulk" refresh, where it excludes those coming from the local server - /// + /// // // TODO see Message() method: stop sending to local server! // just need to figure out WebServerUtility permissions issues, if any @@ -49,7 +49,7 @@ namespace Umbraco.Core.Sync /// Distribution will be enabled based on the umbraco config setting. internal WebServiceServerMessenger(string login, string password) : this(login, password, UmbracoConfig.For.UmbracoSettings().DistributedCall.Enabled) - { + { } /// @@ -104,7 +104,7 @@ namespace Umbraco.Core.Sync { Login = result.Item1; Password = result.Item2; - DistributedEnabled = UmbracoConfig.For.UmbracoSettings().DistributedCall.Enabled; + DistributedEnabled = UmbracoConfig.For.UmbracoSettings().DistributedCall.Enabled; } } catch (Exception ex) @@ -153,7 +153,7 @@ namespace Umbraco.Core.Sync protected virtual void Message( IEnumerable servers, ICacheRefresher refresher, - MessageType messageType, + MessageType messageType, IEnumerable ids = null, Type idArrayType = null, string jsonPayload = null) @@ -213,7 +213,7 @@ namespace Umbraco.Core.Sync else // must be guids { // bulk of guids is not supported, iterate - asyncResults.AddRange(ids.Select(i => + asyncResults.AddRange(ids.Select(i => client.BeginRefreshByGuid(refresher.RefresherUniqueId, (Guid)i, Login, Password, null, null))); } @@ -223,7 +223,7 @@ namespace Umbraco.Core.Sync throw new InvalidOperationException("Cannot remove by id if the idArrayType is null."); // must be ints - asyncResults.AddRange(ids.Select(i => + asyncResults.AddRange(ids.Select(i => client.BeginRemoveById(refresher.RefresherUniqueId, (int)i, Login, Password, null, null))); break; } @@ -375,7 +375,7 @@ namespace Umbraco.Core.Sync string url = (ex.Response != null) ? ex.Response.ResponseUri.ToString() : "invalid url (responseUri null)"; Current.Logger.Error("Error refreshing a node in the distributed list, URI attempted: " + url, ex); } - + private static void LogStartDispatch() { Current.Logger.Info("Submitting calls to distributed servers"); @@ -383,4 +383,4 @@ namespace Umbraco.Core.Sync #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/SystemUtilities.cs b/src/Umbraco.Core/SystemUtilities.cs index 77ff1c8ba6..3dee17f838 100644 --- a/src/Umbraco.Core/SystemUtilities.cs +++ b/src/Umbraco.Core/SystemUtilities.cs @@ -1,48 +1,48 @@ -using System.Security; +using System.Security; using System.Web; namespace Umbraco.Core { - /// - /// Static helper methods for returning information about the current System - /// - public static class SystemUtilities - { - private static bool _knowTrustLevel; - private static AspNetHostingPermissionLevel _trustLevel; + /// + /// Static helper methods for returning information about the current System + /// + public static class SystemUtilities + { + private static bool _knowTrustLevel; + private static AspNetHostingPermissionLevel _trustLevel; - /// - /// Get the current trust level of the hosted application - /// - /// - public static AspNetHostingPermissionLevel GetCurrentTrustLevel() - { - if (_knowTrustLevel) return _trustLevel; + /// + /// Get the current trust level of the hosted application + /// + /// + public static AspNetHostingPermissionLevel GetCurrentTrustLevel() + { + if (_knowTrustLevel) return _trustLevel; - foreach (var trustLevel in new[] { - AspNetHostingPermissionLevel.Unrestricted, - AspNetHostingPermissionLevel.High, - AspNetHostingPermissionLevel.Medium, - AspNetHostingPermissionLevel.Low, - AspNetHostingPermissionLevel.Minimal }) - { - try - { - new AspNetHostingPermission(trustLevel).Demand(); - } - catch (SecurityException) - { - continue; - } + foreach (var trustLevel in new[] { + AspNetHostingPermissionLevel.Unrestricted, + AspNetHostingPermissionLevel.High, + AspNetHostingPermissionLevel.Medium, + AspNetHostingPermissionLevel.Low, + AspNetHostingPermissionLevel.Minimal }) + { + try + { + new AspNetHostingPermission(trustLevel).Demand(); + } + catch (SecurityException) + { + continue; + } _trustLevel = trustLevel; - _knowTrustLevel = true; - return _trustLevel; - } + _knowTrustLevel = true; + return _trustLevel; + } - _trustLevel = AspNetHostingPermissionLevel.None; + _trustLevel = AspNetHostingPermissionLevel.None; _knowTrustLevel = true; return _trustLevel; } - } -} \ No newline at end of file + } +} diff --git a/src/Umbraco.Core/TopoGraph.cs b/src/Umbraco.Core/TopoGraph.cs index 268da440b2..9a4c975cbe 100644 --- a/src/Umbraco.Core/TopoGraph.cs +++ b/src/Umbraco.Core/TopoGraph.cs @@ -130,4 +130,4 @@ namespace Umbraco.Core } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/TopologicalSorter.cs b/src/Umbraco.Core/TopologicalSorter.cs index 2145878f1c..359e43e1e6 100644 --- a/src/Umbraco.Core/TopologicalSorter.cs +++ b/src/Umbraco.Core/TopologicalSorter.cs @@ -178,4 +178,4 @@ // public Lazy Item { get; set; } // } // } -//} \ No newline at end of file +//} diff --git a/src/Umbraco.Core/TypeExtensions.cs b/src/Umbraco.Core/TypeExtensions.cs index a7ddcbdb2f..24280bcd16 100644 --- a/src/Umbraco.Core/TypeExtensions.cs +++ b/src/Umbraco.Core/TypeExtensions.cs @@ -12,8 +12,8 @@ using Umbraco.Core.Strings; namespace Umbraco.Core { - public static class TypeExtensions - { + public static class TypeExtensions + { /// /// Tries to return a value based on a property name for an object but ignores case sensitivity /// @@ -25,7 +25,7 @@ namespace Umbraco.Core /// Currenty this will only work for ProperCase and camelCase properties, see the TODO below to enable complete case insensitivity /// internal static Attempt GetMemberIgnoreCase(this Type type, object target, string memberName) - { + { Func> getMember = memberAlias => { @@ -60,14 +60,14 @@ namespace Umbraco.Core } return attempt; - } + } - public static object GetDefaultValue(this Type t) - { - return t.IsValueType - ? Activator.CreateInstance(t) - : null; - } + public static object GetDefaultValue(this Type t) + { + return t.IsValueType + ? Activator.CreateInstance(t) + : null; + } internal static MethodInfo GetGenericMethod(this Type type, string name, params Type[] parameterTypes) { var methods = type.GetMethods().Where(method => method.Name == name); @@ -81,45 +81,45 @@ namespace Umbraco.Core return null; } - /// - /// Checks if the type is an anonymous type - /// - /// - /// - /// - /// reference: http://jclaes.blogspot.com/2011/05/checking-for-anonymous-types.html - /// - public static bool IsAnonymousType(this Type type) - { - if (type == null) throw new ArgumentNullException("type"); + /// + /// Checks if the type is an anonymous type + /// + /// + /// + /// + /// reference: http://jclaes.blogspot.com/2011/05/checking-for-anonymous-types.html + /// + public static bool IsAnonymousType(this Type type) + { + if (type == null) throw new ArgumentNullException("type"); - return Attribute.IsDefined(type, typeof(CompilerGeneratedAttribute), false) - && type.IsGenericType && type.Name.Contains("AnonymousType") - && (type.Name.StartsWith("<>") || type.Name.StartsWith("VB$")) - && (type.Attributes & TypeAttributes.NotPublic) == TypeAttributes.NotPublic; - } + return Attribute.IsDefined(type, typeof(CompilerGeneratedAttribute), false) + && type.IsGenericType && type.Name.Contains("AnonymousType") + && (type.Name.StartsWith("<>") || type.Name.StartsWith("VB$")) + && (type.Attributes & TypeAttributes.NotPublic) == TypeAttributes.NotPublic; + } - public static T GetCustomAttribute(this Type type, bool inherit) - where T : Attribute - { - return type.GetCustomAttributes(inherit).SingleOrDefault(); - } + public static T GetCustomAttribute(this Type type, bool inherit) + where T : Attribute + { + return type.GetCustomAttributes(inherit).SingleOrDefault(); + } - public static IEnumerable GetCustomAttributes(this Type type, bool inherited) - where T : Attribute - { - if (type == null) return Enumerable.Empty(); - return type.GetCustomAttributes(typeof (T), inherited).OfType(); - } + public static IEnumerable GetCustomAttributes(this Type type, bool inherited) + where T : Attribute + { + if (type == null) return Enumerable.Empty(); + return type.GetCustomAttributes(typeof (T), inherited).OfType(); + } - /// - /// Determines whether the specified type is enumerable. - /// - /// The type. - /// - internal static bool HasParameters(this MethodInfo method, params Type[] parameterTypes) + /// + /// Determines whether the specified type is enumerable. + /// + /// The type. + /// + internal static bool HasParameters(this MethodInfo method, params Type[] parameterTypes) { var methodParameters = method.GetParameters().Select(parameter => parameter.ParameterType).ToArray(); @@ -132,7 +132,7 @@ namespace Umbraco.Core return true; } - + public static IEnumerable GetBaseTypes(this Type type, bool andSelf) { if (andSelf) @@ -150,105 +150,105 @@ namespace Umbraco.Core return allTypes.SelectMany(t => t.GetMethods()); } - - /// - /// true if the specified type is enumerable; otherwise, false. - /// - public static bool IsEnumerable(this Type type) - { - if (type.IsGenericType) - { - if (type.GetGenericTypeDefinition().GetInterfaces().Contains(typeof(IEnumerable))) - return true; - } - else - { - if (type.GetInterfaces().Contains(typeof(IEnumerable))) - return true; - } - return false; - } - /// - /// Determines whether [is of generic type] [the specified type]. - /// - /// The type. - /// Type of the generic. - /// - /// true if [is of generic type] [the specified type]; otherwise, false. - /// - public static bool IsOfGenericType(this Type type, Type genericType) - { - Type[] args; - return type.TryGetGenericArguments(genericType, out args); - } + /// + /// true if the specified type is enumerable; otherwise, false. + /// + public static bool IsEnumerable(this Type type) + { + if (type.IsGenericType) + { + if (type.GetGenericTypeDefinition().GetInterfaces().Contains(typeof(IEnumerable))) + return true; + } + else + { + if (type.GetInterfaces().Contains(typeof(IEnumerable))) + return true; + } + return false; + } - /// - /// Will find the generic type of the 'type' parameter passed in that is equal to the 'genericType' parameter passed in - /// - /// - /// - /// - /// - public static bool TryGetGenericArguments(this Type type, Type genericType, out Type[] genericArgType) - { - if (type == null) - { - throw new ArgumentNullException("type"); - } - if (genericType == null) - { - throw new ArgumentNullException("genericType"); - } - if (genericType.IsGenericType == false) - { - throw new ArgumentException("genericType must be a generic type"); - } + /// + /// Determines whether [is of generic type] [the specified type]. + /// + /// The type. + /// Type of the generic. + /// + /// true if [is of generic type] [the specified type]; otherwise, false. + /// + public static bool IsOfGenericType(this Type type, Type genericType) + { + Type[] args; + return type.TryGetGenericArguments(genericType, out args); + } - Func checkGenericType = (@int, t) => - { - if (@int.IsGenericType) - { - var def = @int.GetGenericTypeDefinition(); - if (def == t) - { - return @int.GetGenericArguments(); - } - } - return null; - }; + /// + /// Will find the generic type of the 'type' parameter passed in that is equal to the 'genericType' parameter passed in + /// + /// + /// + /// + /// + public static bool TryGetGenericArguments(this Type type, Type genericType, out Type[] genericArgType) + { + if (type == null) + { + throw new ArgumentNullException("type"); + } + if (genericType == null) + { + throw new ArgumentNullException("genericType"); + } + if (genericType.IsGenericType == false) + { + throw new ArgumentException("genericType must be a generic type"); + } - //first, check if the type passed in is already the generic type - genericArgType = checkGenericType(type, genericType); - if (genericArgType != null) - return true; + Func checkGenericType = (@int, t) => + { + if (@int.IsGenericType) + { + var def = @int.GetGenericTypeDefinition(); + if (def == t) + { + return @int.GetGenericArguments(); + } + } + return null; + }; - //if we're looking for interfaces, enumerate them: - if (genericType.IsInterface) - { - foreach (Type @interface in type.GetInterfaces()) - { - genericArgType = checkGenericType(@interface, genericType); - if (genericArgType != null) - return true; - } - } - else - { - //loop back into the base types as long as they are generic - while (type.BaseType != null && type.BaseType != typeof(object)) - { - genericArgType = checkGenericType(type.BaseType, genericType); - if (genericArgType != null) - return true; - type = type.BaseType; - } + //first, check if the type passed in is already the generic type + genericArgType = checkGenericType(type, genericType); + if (genericArgType != null) + return true; - } + //if we're looking for interfaces, enumerate them: + if (genericType.IsInterface) + { + foreach (Type @interface in type.GetInterfaces()) + { + genericArgType = checkGenericType(@interface, genericType); + if (genericArgType != null) + return true; + } + } + else + { + //loop back into the base types as long as they are generic + while (type.BaseType != null && type.BaseType != typeof(object)) + { + genericArgType = checkGenericType(type.BaseType, genericType); + if (genericArgType != null) + return true; + type = type.BaseType; + } - return false; + } - } + return false; + + } /// /// Gets all properties in a flat hierarchy @@ -344,27 +344,27 @@ namespace Umbraco.Core } /// - /// Determines whether the specified actual type is type. - /// - /// - /// The actual type. - /// - /// true if the specified actual type is type; otherwise, false. - /// - public static bool IsType(this Type actualType) - { - return TypeHelper.IsTypeAssignableFrom(actualType); - } + /// Determines whether the specified actual type is type. + /// + /// + /// The actual type. + /// + /// true if the specified actual type is type; otherwise, false. + /// + public static bool IsType(this Type actualType) + { + return TypeHelper.IsTypeAssignableFrom(actualType); + } public static bool Inherits(this Type type) { return typeof (TBase).IsAssignableFrom(type); } - public static bool Inherits(this Type type, Type tbase) - { - return tbase.IsAssignableFrom(type); - } + public static bool Inherits(this Type type, Type tbase) + { + return tbase.IsAssignableFrom(type); + } public static bool Implements(this Type type) { @@ -404,27 +404,27 @@ namespace Umbraco.Core return (attrs.Length > 0 ? attrs.ToList().ConvertAll(input => (TAttribute)input) : null); } - /// - /// Returns the full type name with the assembly but without all of the assembly specific version information. - /// - /// - /// - /// - /// This method is like an 'inbetween' of Type.FullName and Type.AssemblyQualifiedName which returns the type and the assembly separated - /// by a comma. - /// - /// - /// The output of this class would be: - /// - /// Umbraco.Core.TypeExtensions, Umbraco.Core - /// - public static string GetFullNameWithAssembly(this Type type) - { - var assemblyName = type.Assembly.GetName(); + /// + /// Returns the full type name with the assembly but without all of the assembly specific version information. + /// + /// + /// + /// + /// This method is like an 'inbetween' of Type.FullName and Type.AssemblyQualifiedName which returns the type and the assembly separated + /// by a comma. + /// + /// + /// The output of this class would be: + /// + /// Umbraco.Core.TypeExtensions, Umbraco.Core + /// + public static string GetFullNameWithAssembly(this Type type) + { + var assemblyName = type.Assembly.GetName(); - return string.Concat(type.FullName, ", ", + return string.Concat(type.FullName, ", ", assemblyName.FullName.StartsWith("App_Code.") ? "App_Code" : assemblyName.Name); - } + } /// /// Determines whether an instance of a specified type can be assigned to the current type instance. @@ -478,4 +478,4 @@ namespace Umbraco.Core return null; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Udi.cs b/src/Umbraco.Core/Udi.cs index 9a2730ab7a..3c44bc237b 100644 --- a/src/Umbraco.Core/Udi.cs +++ b/src/Umbraco.Core/Udi.cs @@ -46,24 +46,24 @@ namespace Umbraco.Core UdiTypes = new Lazy>(() => { var result = new Dictionary(); - + // known types: foreach (var fi in typeof(Constants.UdiEntityType).GetFields(BindingFlags.Public | BindingFlags.Static)) { - // IsLiteral determines if its value is written at + // IsLiteral determines if its value is written at // compile time and not changeable - // IsInitOnly determine if the field can be set + // IsInitOnly determine if the field can be set // in the body of the constructor - // for C# a field which is readonly keyword would have both true + // for C# a field which is readonly keyword would have both true // but a const field would have only IsLiteral equal to true if (fi.IsLiteral && fi.IsInitOnly == false) { var udiType = fi.GetCustomAttribute(); - if (udiType == null) + if (udiType == null) throw new InvalidOperationException("All Constants listed in UdiEntityType must be attributed with " + typeof(Constants.UdiTypeAttribute)); result[fi.GetValue(null).ToString()] = udiType.UdiType; - } + } } // Scan for unknown UDI types @@ -87,7 +87,7 @@ namespace Umbraco.Core } return result; - }); + }); } /// @@ -207,7 +207,7 @@ namespace Umbraco.Core throw new ArgumentException("Value cannot be null or whitespace.", "id"); if (udiType != UdiType.StringUdi) throw new InvalidOperationException(string.Format("Entity type \"{0}\" does not have string udis.", entityType)); - + return new StringUdi(entityType, id); } diff --git a/src/Umbraco.Core/UdiDefinitionAttribute.cs b/src/Umbraco.Core/UdiDefinitionAttribute.cs index cc52bb6039..a5ff960db1 100644 --- a/src/Umbraco.Core/UdiDefinitionAttribute.cs +++ b/src/Umbraco.Core/UdiDefinitionAttribute.cs @@ -1,4 +1,4 @@ -using System; +using System; namespace Umbraco.Core { @@ -17,4 +17,4 @@ namespace Umbraco.Core public UdiType UdiType { get; private set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/UdiEntityType.cs b/src/Umbraco.Core/UdiEntityType.cs index f6b9b1e3b0..bfbdefd87a 100644 --- a/src/Umbraco.Core/UdiEntityType.cs +++ b/src/Umbraco.Core/UdiEntityType.cs @@ -182,4 +182,4 @@ namespace Umbraco.Core } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/UdiGetterExtensions.cs b/src/Umbraco.Core/UdiGetterExtensions.cs index 3d829c8a1a..631c5b454d 100644 --- a/src/Umbraco.Core/UdiGetterExtensions.cs +++ b/src/Umbraco.Core/UdiGetterExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using Umbraco.Core.Models; using Umbraco.Core.Models.EntityBase; @@ -200,8 +200,8 @@ namespace Umbraco.Core if (entity == null) throw new ArgumentNullException("entity"); // we should throw on Unknown but for the time being, assume it means PartialView - var entityType = entity.ViewType == PartialViewType.PartialViewMacro - ? Constants.UdiEntityType.PartialViewMacro + var entityType = entity.ViewType == PartialViewType.PartialViewMacro + ? Constants.UdiEntityType.PartialViewMacro : Constants.UdiEntityType.PartialView; return new StringUdi(entityType, entity.Path.TrimStart('/')).EnsureClosed(); @@ -318,4 +318,4 @@ namespace Umbraco.Core throw new NotSupportedException(string.Format("Entity type {0} is not supported.", entity.GetType().FullName)); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/UdiRange.cs b/src/Umbraco.Core/UdiRange.cs index a708220066..937798f69e 100644 --- a/src/Umbraco.Core/UdiRange.cs +++ b/src/Umbraco.Core/UdiRange.cs @@ -1,4 +1,4 @@ -using System; +using System; namespace Umbraco.Core { @@ -101,4 +101,4 @@ namespace Umbraco.Core return !(range1 == range2); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/UdiType.cs b/src/Umbraco.Core/UdiType.cs index d15987033d..6d183d7c36 100644 --- a/src/Umbraco.Core/UdiType.cs +++ b/src/Umbraco.Core/UdiType.cs @@ -9,4 +9,4 @@ GuidUdi, StringUdi } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/UdiTypeConverter.cs b/src/Umbraco.Core/UdiTypeConverter.cs index 110b899454..e63aa7f786 100644 --- a/src/Umbraco.Core/UdiTypeConverter.cs +++ b/src/Umbraco.Core/UdiTypeConverter.cs @@ -34,4 +34,4 @@ namespace Umbraco.Core return base.ConvertFrom(context, culture, value); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/UmbracoApplicationBase.cs b/src/Umbraco.Core/UmbracoApplicationBase.cs index f4f6468afa..353879ec61 100644 --- a/src/Umbraco.Core/UmbracoApplicationBase.cs +++ b/src/Umbraco.Core/UmbracoApplicationBase.cs @@ -80,7 +80,7 @@ namespace Umbraco.Core protected virtual void ConfigureUnhandledException(ILogger logger) { - //take care of unhandled exceptions - there is nothing we can do to + //take care of unhandled exceptions - there is nothing we can do to // prevent the entire w3wp process to go down but at least we can try // and log the exception AppDomain.CurrentDomain.UnhandledException += (_, args) => @@ -139,7 +139,7 @@ namespace Umbraco.Core OnApplicationInit(this, new EventArgs()); } - + #endregion #region End @@ -156,7 +156,7 @@ namespace Umbraco.Core { _runtime.Terminate(); _runtime.DisposeIfDisposable(); - + _runtime = null; } @@ -229,7 +229,7 @@ namespace Umbraco.Core } #endregion - + #region Utilities private static void TryInvoke(EventHandler handler, string name, object sender, EventArgs evargs) diff --git a/src/Umbraco.Core/UpgradeableReadLock.cs b/src/Umbraco.Core/UpgradeableReadLock.cs index 8a1108fc6f..41d47c3453 100644 --- a/src/Umbraco.Core/UpgradeableReadLock.cs +++ b/src/Umbraco.Core/UpgradeableReadLock.cs @@ -7,7 +7,7 @@ using System.Threading; namespace Umbraco.Core { /// - /// Provides a convenience methodology for implementing locked access to resources. + /// Provides a convenience methodology for implementing locked access to resources. /// /// /// Intended as an infrastructure class. @@ -15,31 +15,31 @@ namespace Umbraco.Core public class UpgradeableReadLock : IDisposable { private readonly ReaderWriterLockSlim _rwLock; - private bool _upgraded = false; + private bool _upgraded = false; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The rw lock. - public UpgradeableReadLock(ReaderWriterLockSlim rwLock) + public UpgradeableReadLock(ReaderWriterLockSlim rwLock) { _rwLock = rwLock; _rwLock.EnterUpgradeableReadLock(); } - public void UpgradeToWriteLock() - { - _rwLock.EnterWriteLock(); - _upgraded = true; - } + public void UpgradeToWriteLock() + { + _rwLock.EnterWriteLock(); + _upgraded = true; + } void IDisposable.Dispose() { - if (_upgraded) - { - _rwLock.ExitWriteLock(); - } - _rwLock.ExitUpgradeableReadLock(); + if (_upgraded) + { + _rwLock.ExitWriteLock(); + } + _rwLock.ExitUpgradeableReadLock(); } } } diff --git a/src/Umbraco.Core/UriExtensions.cs b/src/Umbraco.Core/UriExtensions.cs index cddd4ef83f..6c37a43623 100644 --- a/src/Umbraco.Core/UriExtensions.cs +++ b/src/Umbraco.Core/UriExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.IO; using System.Linq; using Umbraco.Core.Configuration; @@ -21,21 +21,21 @@ namespace Umbraco.Core /// /// /// There are some special routes we need to check to properly determine this: - /// + /// /// If any route has an extension in the path like .aspx = back office - /// + /// /// These are def back office: /// /Umbraco/RestServices = back office /// /Umbraco/BackOffice = back office /// If it's not any of the above, and there's no extension then we cannot determine if it's back office or front-end /// so we can only assume that it is not back office. This will occur if people use an UmbracoApiController for the backoffice /// but do not inherit from UmbracoAuthorizedApiController and do not use [IsBackOffice] attribute. - /// - /// These are def front-end: + /// + /// These are def front-end: /// /Umbraco/Surface = front-end /// /Umbraco/Api = front-end /// But if we've got this far we'll just have to assume it's front-end anyways. - /// + /// /// internal static bool IsBackOfficeRequest(this Uri url, string applicationPath) { @@ -44,7 +44,7 @@ namespace Umbraco.Core var fullUrlPath = url.AbsolutePath.TrimStart(new[] {'/'}); var appPath = applicationPath.TrimStart(new[] {'/'}); var urlPath = fullUrlPath.TrimStart(appPath).EnsureStartsWith('/'); - + //check if this is in the umbraco back office var isUmbracoPath = urlPath.InvariantStartsWith(GlobalSettings.Path.EnsureStartsWith('/').TrimStart(appPath.EnsureStartsWith('/')).EnsureStartsWith('/')); //if not, then def not back office @@ -86,10 +86,10 @@ namespace Umbraco.Core return false; } - //if its none of the above, we will have to try to detect if it's a PluginController route, we can detect this by + //if its none of the above, we will have to try to detect if it's a PluginController route, we can detect this by // checking how many parts the route has, for example, all PluginController routes will be routed like // Umbraco/MYPLUGINAREA/MYCONTROLLERNAME/{action}/{id} - // so if the path contains at a minimum 3 parts: Umbraco + MYPLUGINAREA + MYCONTROLLERNAME then we will have to assume it is a + // so if the path contains at a minimum 3 parts: Umbraco + MYPLUGINAREA + MYCONTROLLERNAME then we will have to assume it is a // plugin controller for the front-end. if (urlPath.Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries).Length >= 3) { @@ -132,7 +132,7 @@ namespace Umbraco.Core } return false; } - + /// /// This is a performance tweak to check if this not an ASP.Net server file /// .Net will pass these requests through to the module when in integrated mode. @@ -240,14 +240,14 @@ namespace Umbraco.Core var path = uri.GetSafeAbsolutePath(); if (uri.IsAbsoluteUri) { - if (path != "/" && path.EndsWith("/") == false) + if (path != "/" && path.EndsWith("/") == false) uri = new Uri(uri.GetLeftPart(UriPartial.Authority) + path + "/" + uri.Query); return uri; } - + if (path != "/" && path.EndsWith("/") == false) - uri = new Uri(path + "/" + uri.Query, UriKind.Relative); - + uri = new Uri(path + "/" + uri.Query, UriKind.Relative); + return uri; } @@ -311,4 +311,4 @@ namespace Umbraco.Core return new Uri(uri.GetComponents(UriComponents.AbsoluteUri & ~UriComponents.Port, UriFormat.UriEscaped)); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/VersionExtensions.cs b/src/Umbraco.Core/VersionExtensions.cs index b6fbb06515..3502980b5f 100644 --- a/src/Umbraco.Core/VersionExtensions.cs +++ b/src/Umbraco.Core/VersionExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using Semver; @@ -14,7 +14,7 @@ namespace Umbraco.Core if (maxParts >= 4) { - return new Version(semVersion.Major, semVersion.Minor, semVersion.Patch, build); + return new Version(semVersion.Major, semVersion.Minor, semVersion.Patch, build); } if (maxParts == 3) { @@ -27,7 +27,7 @@ namespace Umbraco.Core public static Version SubtractRevision(this Version version) { var parts = new List(new[] {version.Major, version.Minor, version.Build, version.Revision}); - + //remove all prefixed zero parts while (parts[0] <= 0) { @@ -57,12 +57,12 @@ namespace Umbraco.Core //subtract 1 from the last non-zero parts[lastNonZero] = parts[lastNonZero] - 1; - //the last non zero is actually the revision so we can just return + //the last non zero is actually the revision so we can just return if (lastNonZero == (parts.Count -1)) { return FromList(parts); } - + //the last non zero isn't the revision so the remaining zero's need to be replaced with int.max for (var i = lastNonZero + 1; i < parts.Count; i++) { @@ -81,4 +81,4 @@ namespace Umbraco.Core return new Version(parts[0], parts[1], parts[2], parts[3]); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/WriteLock.cs b/src/Umbraco.Core/WriteLock.cs index 6b61af7a55..ceeb175c25 100644 --- a/src/Umbraco.Core/WriteLock.cs +++ b/src/Umbraco.Core/WriteLock.cs @@ -7,7 +7,7 @@ using System.Threading; namespace Umbraco.Core { /// - /// Provides a convenience methodology for implementing locked access to resources. + /// Provides a convenience methodology for implementing locked access to resources. /// /// /// Intended as an infrastructure class. diff --git a/src/Umbraco.Core/Xml/DynamicContext.cs b/src/Umbraco.Core/Xml/DynamicContext.cs index 858d1cd663..7072f28a6a 100644 --- a/src/Umbraco.Core/Xml/DynamicContext.cs +++ b/src/Umbraco.Core/Xml/DynamicContext.cs @@ -8,305 +8,305 @@ using System.Xml.XPath; namespace Umbraco.Core.Xml { - /// - /// Provides the evaluation context for fast execution and custom - /// variables resolution. - /// - /// - /// This class is responsible for resolving variables during dynamic expression execution. - /// Discussed in http://weblogs.asp.net/cazzu/archive/2003/10/07/30888.aspx - /// Author: Daniel Cazzulino, blog - /// - public class DynamicContext : XsltContext - { - #region Private vars + /// + /// Provides the evaluation context for fast execution and custom + /// variables resolution. + /// + /// + /// This class is responsible for resolving variables during dynamic expression execution. + /// Discussed in http://weblogs.asp.net/cazzu/archive/2003/10/07/30888.aspx + /// Author: Daniel Cazzulino, blog + /// + public class DynamicContext : XsltContext + { + #region Private vars - readonly IDictionary _variables = - new Dictionary(); + readonly IDictionary _variables = + new Dictionary(); - #endregion Private + #endregion Private - #region Constructors & Initialization + #region Constructors & Initialization - /// - /// Initializes a new instance of the class. - /// - public DynamicContext() - : base(new NameTable()) - { - } + /// + /// Initializes a new instance of the class. + /// + public DynamicContext() + : base(new NameTable()) + { + } - /// - /// Initializes a new instance of the - /// class with the specified . - /// - /// The NameTable to use. - public DynamicContext(NameTable table) - : base(table) - { - } + /// + /// Initializes a new instance of the + /// class with the specified . + /// + /// The NameTable to use. + public DynamicContext(NameTable table) + : base(table) + { + } - /// - /// Initializes a new instance of the class. - /// - /// A previously filled context with the namespaces to use. - public DynamicContext(XmlNamespaceManager context) - : this(context, new NameTable()) - { - } + /// + /// Initializes a new instance of the class. + /// + /// A previously filled context with the namespaces to use. + public DynamicContext(XmlNamespaceManager context) + : this(context, new NameTable()) + { + } - /// - /// Initializes a new instance of the class. - /// - /// A previously filled context with the namespaces to use. - /// The NameTable to use. - public DynamicContext(XmlNamespaceManager context, NameTable table) - : base(table) - { - object xml = table.Add(XmlNamespaces.Xml); - object xmlns = table.Add(XmlNamespaces.XmlNs); + /// + /// Initializes a new instance of the class. + /// + /// A previously filled context with the namespaces to use. + /// The NameTable to use. + public DynamicContext(XmlNamespaceManager context, NameTable table) + : base(table) + { + object xml = table.Add(XmlNamespaces.Xml); + object xmlns = table.Add(XmlNamespaces.XmlNs); - if (context == null) return; + if (context == null) return; - foreach (string prefix in context) - { - var uri = context.LookupNamespace(prefix); - // Use fast object reference comparison to omit forbidden namespace declarations. - if (Equals(uri, xml) || Equals(uri, xmlns)) - continue; - if (uri == null) - continue; - base.AddNamespace(prefix, uri); - } - } + foreach (string prefix in context) + { + var uri = context.LookupNamespace(prefix); + // Use fast object reference comparison to omit forbidden namespace declarations. + if (Equals(uri, xml) || Equals(uri, xmlns)) + continue; + if (uri == null) + continue; + base.AddNamespace(prefix, uri); + } + } - #endregion Constructors & Initialization + #endregion Constructors & Initialization - #region Common Overrides + #region Common Overrides - /// - /// Implementation equal to . - /// - public override int CompareDocument(string baseUri, string nextbaseUri) - { - return String.Compare(baseUri, nextbaseUri, false, System.Globalization.CultureInfo.InvariantCulture); - } + /// + /// Implementation equal to . + /// + public override int CompareDocument(string baseUri, string nextbaseUri) + { + return String.Compare(baseUri, nextbaseUri, false, System.Globalization.CultureInfo.InvariantCulture); + } - /// - /// Same as . - /// - public override string LookupNamespace(string prefix) - { - var key = NameTable.Get(prefix); - return key == null ? null : base.LookupNamespace(key); - } + /// + /// Same as . + /// + public override string LookupNamespace(string prefix) + { + var key = NameTable.Get(prefix); + return key == null ? null : base.LookupNamespace(key); + } - /// - /// Same as . - /// - public override string LookupPrefix(string uri) - { - var key = NameTable.Get(uri); - return key == null ? null : base.LookupPrefix(key); - } + /// + /// Same as . + /// + public override string LookupPrefix(string uri) + { + var key = NameTable.Get(uri); + return key == null ? null : base.LookupPrefix(key); + } - /// - /// Same as . - /// - public override bool PreserveWhitespace(XPathNavigator node) - { - return true; - } + /// + /// Same as . + /// + public override bool PreserveWhitespace(XPathNavigator node) + { + return true; + } - /// - /// Same as . - /// - public override bool Whitespace - { - get { return true; } - } + /// + /// Same as . + /// + public override bool Whitespace + { + get { return true; } + } - #endregion Common Overrides + #endregion Common Overrides - #region Public Members + #region Public Members - /// - /// Shortcut method that compiles an expression using an empty navigator. - /// - /// The expression to compile - /// A compiled . - public static XPathExpression Compile(string xpath) - { - return new XmlDocument().CreateNavigator().Compile(xpath); - } + /// + /// Shortcut method that compiles an expression using an empty navigator. + /// + /// The expression to compile + /// A compiled . + public static XPathExpression Compile(string xpath) + { + return new XmlDocument().CreateNavigator().Compile(xpath); + } - #endregion Public Members + #endregion Public Members - #region Variable Handling Code + #region Variable Handling Code - /// - /// Adds the variable to the dynamic evaluation context. - /// - /// The name of the variable to add to the context. - /// The value of the variable to add to the context. - /// - /// Value type conversion for XPath evaluation is as follows: - /// - /// - /// CLR Type - /// XPath type - /// - /// - /// System.String - /// XPathResultType.String - /// - /// - /// System.Double (or types that can be converted to) - /// XPathResultType.Number - /// - /// - /// System.Boolean - /// XPathResultType.Boolean - /// - /// - /// System.Xml.XPath.XPathNavigator - /// XPathResultType.Navigator - /// - /// - /// System.Xml.XPath.XPathNodeIterator - /// XPathResultType.NodeSet - /// - /// - /// Others - /// XPathResultType.Any - /// - /// - /// See the topic "Compile, Select, Evaluate, and Matches with - /// XPath and XPathExpressions" in MSDN documentation for additional information. - /// - /// The is null. - public void AddVariable(string name, object value) - { - if (value == null) throw new ArgumentNullException("value"); - _variables[name] = new DynamicVariable(name, value); - } + /// + /// Adds the variable to the dynamic evaluation context. + /// + /// The name of the variable to add to the context. + /// The value of the variable to add to the context. + /// + /// Value type conversion for XPath evaluation is as follows: + /// + /// + /// CLR Type + /// XPath type + /// + /// + /// System.String + /// XPathResultType.String + /// + /// + /// System.Double (or types that can be converted to) + /// XPathResultType.Number + /// + /// + /// System.Boolean + /// XPathResultType.Boolean + /// + /// + /// System.Xml.XPath.XPathNavigator + /// XPathResultType.Navigator + /// + /// + /// System.Xml.XPath.XPathNodeIterator + /// XPathResultType.NodeSet + /// + /// + /// Others + /// XPathResultType.Any + /// + /// + /// See the topic "Compile, Select, Evaluate, and Matches with + /// XPath and XPathExpressions" in MSDN documentation for additional information. + /// + /// The is null. + public void AddVariable(string name, object value) + { + if (value == null) throw new ArgumentNullException("value"); + _variables[name] = new DynamicVariable(name, value); + } - /// - /// See . Not used in our implementation. - /// - public override IXsltContextFunction ResolveFunction(string prefix, string name, XPathResultType[] argTypes) - { - return null; - } + /// + /// See . Not used in our implementation. + /// + public override IXsltContextFunction ResolveFunction(string prefix, string name, XPathResultType[] argTypes) + { + return null; + } - /// - /// Resolves the dynamic variables added to the context. See . - /// - public override IXsltContextVariable ResolveVariable(string prefix, string name) - { - IXsltContextVariable var; - _variables.TryGetValue(name, out var); - return var; - } + /// + /// Resolves the dynamic variables added to the context. See . + /// + public override IXsltContextVariable ResolveVariable(string prefix, string name) + { + IXsltContextVariable var; + _variables.TryGetValue(name, out var); + return var; + } - #endregion Variable Handling Code + #endregion Variable Handling Code - #region Internal DynamicVariable class + #region Internal DynamicVariable class - /// - /// Represents a variable during dynamic expression execution. - /// - internal class DynamicVariable : IXsltContextVariable - { - readonly string _name; - readonly object _value; + /// + /// Represents a variable during dynamic expression execution. + /// + internal class DynamicVariable : IXsltContextVariable + { + readonly string _name; + readonly object _value; - #region Public Members + #region Public Members public string Name { get { return _name; } } - /// - /// Initializes a new instance of the class. - /// - /// The name of the variable. - /// The value of the variable. - public DynamicVariable(string name, object value) - { + /// + /// Initializes a new instance of the class. + /// + /// The name of the variable. + /// The value of the variable. + public DynamicVariable(string name, object value) + { - _name = name; - _value = value; + _name = name; + _value = value; - if (value is String) - _type = XPathResultType.String; - else if (value is bool) - _type = XPathResultType.Boolean; - else if (value is XPathNavigator) - _type = XPathResultType.Navigator; - else if (value is XPathNodeIterator) - _type = XPathResultType.NodeSet; - else - { - // Try to convert to double (native XPath numeric type) - if (value is double) - { - _type = XPathResultType.Number; - } - else - { - if (value is IConvertible) - { - try - { - _value = Convert.ToDouble(value); - // We suceeded, so it's a number. - _type = XPathResultType.Number; - } - catch (FormatException) - { - _type = XPathResultType.Any; - } - catch (OverflowException) - { - _type = XPathResultType.Any; - } - } - else - { - _type = XPathResultType.Any; - } - } - } - } + if (value is String) + _type = XPathResultType.String; + else if (value is bool) + _type = XPathResultType.Boolean; + else if (value is XPathNavigator) + _type = XPathResultType.Navigator; + else if (value is XPathNodeIterator) + _type = XPathResultType.NodeSet; + else + { + // Try to convert to double (native XPath numeric type) + if (value is double) + { + _type = XPathResultType.Number; + } + else + { + if (value is IConvertible) + { + try + { + _value = Convert.ToDouble(value); + // We suceeded, so it's a number. + _type = XPathResultType.Number; + } + catch (FormatException) + { + _type = XPathResultType.Any; + } + catch (OverflowException) + { + _type = XPathResultType.Any; + } + } + else + { + _type = XPathResultType.Any; + } + } + } + } - #endregion Public Members + #endregion Public Members - #region IXsltContextVariable Implementation + #region IXsltContextVariable Implementation - XPathResultType IXsltContextVariable.VariableType - { - get { return _type; } - } + XPathResultType IXsltContextVariable.VariableType + { + get { return _type; } + } - readonly XPathResultType _type; + readonly XPathResultType _type; - object IXsltContextVariable.Evaluate(XsltContext context) - { - return _value; - } + object IXsltContextVariable.Evaluate(XsltContext context) + { + return _value; + } - bool IXsltContextVariable.IsLocal - { - get { return false; } - } + bool IXsltContextVariable.IsLocal + { + get { return false; } + } - bool IXsltContextVariable.IsParam - { - get { return false; } - } + bool IXsltContextVariable.IsParam + { + get { return false; } + } - #endregion IXsltContextVariable Implementation - } + #endregion IXsltContextVariable Implementation + } - #endregion Internal DynamicVariable class - } -} \ No newline at end of file + #endregion Internal DynamicVariable class + } +} diff --git a/src/Umbraco.Core/Xml/UmbracoXPathPathSyntaxParser.cs b/src/Umbraco.Core/Xml/UmbracoXPathPathSyntaxParser.cs index a2e0ff6fb5..652d8f2dee 100644 --- a/src/Umbraco.Core/Xml/UmbracoXPathPathSyntaxParser.cs +++ b/src/Umbraco.Core/Xml/UmbracoXPathPathSyntaxParser.cs @@ -8,7 +8,7 @@ using Umbraco.Core.Exceptions; namespace Umbraco.Core.Xml { /// - /// This is used to parse our customize Umbraco XPath expressions (i.e. that include special tokens like $site) into + /// This is used to parse our customize Umbraco XPath expressions (i.e. that include special tokens like $site) into /// a real XPath statement /// internal class UmbracoXPathPathSyntaxParser @@ -25,16 +25,16 @@ namespace Umbraco.Core.Xml /// The callback to return whether a published node exists based on Id /// public static string ParseXPathQuery( - string xpathExpression, - int? nodeContextId, + string xpathExpression, + int? nodeContextId, Func> getPath, Func publishedContentExists) { - //TODO: This should probably support some of the old syntax and token replacements, currently + //TODO: This should probably support some of the old syntax and token replacements, currently // it does not, there is a ticket raised here about it: http://issues.umbraco.org/issue/U4-6364 - // previous tokens were: "$currentPage", "$ancestorOrSelf", "$parentPage" and I beleive they were - // allowed 'inline', not just at the beginning... whether or not we want to support that is up + // previous tokens were: "$currentPage", "$ancestorOrSelf", "$parentPage" and I beleive they were + // allowed 'inline', not just at the beginning... whether or not we want to support that is up // for discussion. if (string.IsNullOrWhiteSpace(xpathExpression)) throw new ArgumentNullOrEmptyException(nameof(xpathExpression)); diff --git a/src/Umbraco.Core/Xml/XPath/INavigableContent.cs b/src/Umbraco.Core/Xml/XPath/INavigableContent.cs index d74e08c0be..3c4350043c 100644 --- a/src/Umbraco.Core/Xml/XPath/INavigableContent.cs +++ b/src/Umbraco.Core/Xml/XPath/INavigableContent.cs @@ -46,7 +46,7 @@ namespace Umbraco.Core.Xml.XPath object Value(int index); // TODO implement the following one - + ///// ///// Gets the value of a field of the navigable content, for a specified language. ///// diff --git a/src/Umbraco.Core/Xml/XPath/MacroNavigator.cs b/src/Umbraco.Core/Xml/XPath/MacroNavigator.cs index b44b7d5f6e..d0e563d939 100644 --- a/src/Umbraco.Core/Xml/XPath/MacroNavigator.cs +++ b/src/Umbraco.Core/Xml/XPath/MacroNavigator.cs @@ -218,7 +218,7 @@ namespace Umbraco.Core.Xml.XPath public bool WrapNavigatorInNodes { get; private set; } public KeyValuePair[] Attributes { get; private set; } } - + #endregion /// @@ -239,7 +239,7 @@ namespace Umbraco.Core.Xml.XPath /// public override bool IsEmptyElement { - get + get { DebugEnter("IsEmptyElement"); bool isEmpty; @@ -1030,7 +1030,7 @@ namespace Umbraco.Core.Xml.XPath // gets a value indicating whether this state is at the same position as another one. public bool IsSamePosition(State other) { - return other.Position == Position + return other.Position == Position && (Position != StatePosition.ParameterNavigator || other.ParameterNavigator.IsSamePosition(ParameterNavigator)) && other.ParameterIndex == ParameterIndex && other.ParameterAttributeIndex == ParameterAttributeIndex; diff --git a/src/Umbraco.Core/Xml/XPathVariable.cs b/src/Umbraco.Core/Xml/XPathVariable.cs index d5ecb928de..41fc1340d1 100644 --- a/src/Umbraco.Core/Xml/XPathVariable.cs +++ b/src/Umbraco.Core/Xml/XPathVariable.cs @@ -6,27 +6,27 @@ namespace Umbraco.Core.Xml /// Represents a variable in an XPath query. /// /// The name must be foo in the constructor and $foo in the XPath query. - public class XPathVariable - { + public class XPathVariable + { /// /// Gets or sets the name of the variable. /// - public string Name { get; private set; } + public string Name { get; private set; } /// /// Gets or sets the value of the variable. /// - public string Value { get; private set; } + public string Value { get; private set; } /// /// Initializes a new instance of the class with a name and a value. /// /// /// - public XPathVariable(string name, string value) - { - Name = name; - Value = value; - } - } + public XPathVariable(string name, string value) + { + Name = name; + Value = value; + } + } } diff --git a/src/Umbraco.Core/Xml/XmlHelper.cs b/src/Umbraco.Core/Xml/XmlHelper.cs index 3fa5c0ebc8..d4f2d40656 100644 --- a/src/Umbraco.Core/Xml/XmlHelper.cs +++ b/src/Umbraco.Core/Xml/XmlHelper.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.IO; using System.Linq; @@ -12,7 +12,7 @@ using Umbraco.Core.IO; namespace Umbraco.Core.Xml { /// - /// The XmlHelper class contains general helper methods for working with xml in umbraco. + /// The XmlHelper class contains general helper methods for working with xml in umbraco. /// public class XmlHelper { @@ -218,7 +218,7 @@ namespace Umbraco.Core.Xml } if (a >= 0) - return false; + return false; // append child nodes to last position, in sort-order // so all child nodes will go after the property nodes @@ -243,7 +243,7 @@ namespace Umbraco.Core.Xml string childNodesXPath, XmlNode node, Func orderBy) - { + { var nodeSortOrder = orderBy(node); var childNodesAndOrder = parentNode.SelectNodes(childNodesXPath).Cast() .Select(x => Tuple.Create(x, orderBy(x))).ToArray(); @@ -336,13 +336,13 @@ namespace Umbraco.Core.Xml } - /// + /// /// Imports a XML node from text. /// /// The text. /// The XML doc. /// - public static XmlNode ImportXmlNodeFromText(string text, ref XmlDocument xmlDoc) + public static XmlNode ImportXmlNodeFromText(string text, ref XmlDocument xmlDoc) { xmlDoc.LoadXml(text); return xmlDoc.FirstChild; @@ -356,9 +356,9 @@ namespace Umbraco.Core.Xml public static XmlDocument OpenAsXmlDocument(string filePath) { - var reader = new XmlTextReader(IOHelper.MapPath(filePath)) {WhitespaceHandling = WhitespaceHandling.All}; + var reader = new XmlTextReader(IOHelper.MapPath(filePath)) {WhitespaceHandling = WhitespaceHandling.All}; - var xmlDoc = new XmlDocument(); + var xmlDoc = new XmlDocument(); //Load the file into the XmlDocument xmlDoc.Load(reader); //Close off the connection to the file. @@ -488,7 +488,7 @@ namespace Umbraco.Core.Xml /// /// The XmlNode. /// the value as a string - public static string GetNodeValue(XmlNode n) + public static string GetNodeValue(XmlNode n) { var value = string.Empty; if (n == null || n.FirstChild == null) @@ -502,9 +502,9 @@ namespace Umbraco.Core.Xml /// /// The XML string. /// - /// true if the specified string appears to be XML; otherwise, false. + /// true if the specified string appears to be XML; otherwise, false. /// - public static bool CouldItBeXml(string xml) + public static bool CouldItBeXml(string xml) { if (string.IsNullOrEmpty(xml)) return false; @@ -520,7 +520,7 @@ namespace Umbraco.Core.Xml /// Name of the root. /// Name of the element. /// Returns an System.Xml.XmlDocument representation of the delimited string data. - public static XmlDocument Split(string data, string[] separator, string rootName, string elementName) + public static XmlDocument Split(string data, string[] separator, string rootName, string elementName) { return Split(new XmlDocument(), data, separator, rootName, elementName); } @@ -534,7 +534,7 @@ namespace Umbraco.Core.Xml /// Name of the root node. /// Name of the element node. /// Returns an System.Xml.XmlDocument representation of the delimited string data. - public static XmlDocument Split(XmlDocument xml, string data, string[] separator, string rootName, string elementName) + public static XmlDocument Split(XmlDocument xml, string data, string[] separator, string rootName, string elementName) { // load new XML document. xml.LoadXml(string.Concat("<", rootName, "/>")); @@ -558,19 +558,19 @@ namespace Umbraco.Core.Xml return xml; } - /// - /// Return a dictionary of attributes found for a string based tag - /// - /// - /// - public static Dictionary GetAttributesFromElement(string tag) - { - var m = - Regex.Matches(tag, "(?\\S*)=\"(?[^\"]*)\"", - RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace); - // fix for issue 14862: return lowercase attributes for case insensitive matching - var d = m.Cast().ToDictionary(attributeSet => attributeSet.Groups["attributeName"].Value.ToString().ToLower(), attributeSet => attributeSet.Groups["attributeValue"].Value.ToString()); - return d; - } + /// + /// Return a dictionary of attributes found for a string based tag + /// + /// + /// + public static Dictionary GetAttributesFromElement(string tag) + { + var m = + Regex.Matches(tag, "(?\\S*)=\"(?[^\"]*)\"", + RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace); + // fix for issue 14862: return lowercase attributes for case insensitive matching + var d = m.Cast().ToDictionary(attributeSet => attributeSet.Groups["attributeName"].Value.ToString().ToLower(), attributeSet => attributeSet.Groups["attributeValue"].Value.ToString()); + return d; + } } } diff --git a/src/Umbraco.Core/Xml/XmlNamespaces.cs b/src/Umbraco.Core/Xml/XmlNamespaces.cs index aecbe9de87..2f4b2d6842 100644 --- a/src/Umbraco.Core/Xml/XmlNamespaces.cs +++ b/src/Umbraco.Core/Xml/XmlNamespaces.cs @@ -2,40 +2,40 @@ namespace Umbraco.Core.Xml { - /// - /// Provides public constants for wellknown XML namespaces. - /// - /// Author: Daniel Cazzulino, blog - public static class XmlNamespaces - { - /// - /// The public XML 1.0 namespace. - /// - /// See http://www.w3.org/TR/2004/REC-xml-20040204/ - public const string Xml = "http://www.w3.org/XML/1998/namespace"; + /// + /// Provides public constants for wellknown XML namespaces. + /// + /// Author: Daniel Cazzulino, blog + public static class XmlNamespaces + { + /// + /// The public XML 1.0 namespace. + /// + /// See http://www.w3.org/TR/2004/REC-xml-20040204/ + public const string Xml = "http://www.w3.org/XML/1998/namespace"; - /// - /// Public Xml Namespaces specification namespace. - /// - /// See http://www.w3.org/TR/REC-xml-names/ - public const string XmlNs = "http://www.w3.org/2000/xmlns/"; + /// + /// Public Xml Namespaces specification namespace. + /// + /// See http://www.w3.org/TR/REC-xml-names/ + public const string XmlNs = "http://www.w3.org/2000/xmlns/"; - /// - /// Public Xml Namespaces prefix. - /// - /// See http://www.w3.org/TR/REC-xml-names/ - public const string XmlNsPrefix = "xmlns"; + /// + /// Public Xml Namespaces prefix. + /// + /// See http://www.w3.org/TR/REC-xml-names/ + public const string XmlNsPrefix = "xmlns"; - /// - /// XML Schema instance namespace. - /// - /// See http://www.w3.org/TR/xmlschema-1/ - public const string Xsi = "http://www.w3.org/2001/XMLSchema-instance"; + /// + /// XML Schema instance namespace. + /// + /// See http://www.w3.org/TR/xmlschema-1/ + public const string Xsi = "http://www.w3.org/2001/XMLSchema-instance"; - /// - /// XML 1.0 Schema namespace. - /// - /// See http://www.w3.org/TR/xmlschema-1/ - public const string Xsd = "http://www.w3.org/2001/XMLSchema"; - } + /// + /// XML 1.0 Schema namespace. + /// + /// See http://www.w3.org/TR/xmlschema-1/ + public const string Xsd = "http://www.w3.org/2001/XMLSchema"; + } } diff --git a/src/Umbraco.Core/Xml/XmlNodeListFactory.cs b/src/Umbraco.Core/Xml/XmlNodeListFactory.cs index 1bf945fa3f..7320ce55da 100644 --- a/src/Umbraco.Core/Xml/XmlNodeListFactory.cs +++ b/src/Umbraco.Core/Xml/XmlNodeListFactory.cs @@ -7,172 +7,172 @@ using System.Xml.XPath; namespace Umbraco.Core.Xml { - class XmlNodeListFactory - { - private XmlNodeListFactory() { } + class XmlNodeListFactory + { + private XmlNodeListFactory() { } - #region Public members + #region Public members - /// - /// Creates an instance of a that allows - /// enumerating elements in the iterator. - /// - /// The result of a previous node selection - /// through an query. - /// An initialized list ready to be enumerated. - /// The underlying XML store used to issue the query must be - /// an object inheriting , such as - /// . - public static XmlNodeList CreateNodeList(XPathNodeIterator iterator) - { - return new XmlNodeListIterator(iterator); - } + /// + /// Creates an instance of a that allows + /// enumerating elements in the iterator. + /// + /// The result of a previous node selection + /// through an query. + /// An initialized list ready to be enumerated. + /// The underlying XML store used to issue the query must be + /// an object inheriting , such as + /// . + public static XmlNodeList CreateNodeList(XPathNodeIterator iterator) + { + return new XmlNodeListIterator(iterator); + } - #endregion Public members + #endregion Public members - #region XmlNodeListIterator + #region XmlNodeListIterator - private class XmlNodeListIterator : XmlNodeList - { - readonly XPathNodeIterator _iterator; - readonly IList _nodes = new List(); + private class XmlNodeListIterator : XmlNodeList + { + readonly XPathNodeIterator _iterator; + readonly IList _nodes = new List(); - public XmlNodeListIterator(XPathNodeIterator iterator) - { - _iterator = iterator.Clone(); - } + public XmlNodeListIterator(XPathNodeIterator iterator) + { + _iterator = iterator.Clone(); + } - public override System.Collections.IEnumerator GetEnumerator() - { - return new XmlNodeListEnumerator(this); - } + public override System.Collections.IEnumerator GetEnumerator() + { + return new XmlNodeListEnumerator(this); + } - public override XmlNode Item(int index) - { + public override XmlNode Item(int index) + { - if (index >= _nodes.Count) - ReadTo(index); - // Compatible behavior with .NET - if (index >= _nodes.Count || index < 0) - return null; - return _nodes[index]; - } + if (index >= _nodes.Count) + ReadTo(index); + // Compatible behavior with .NET + if (index >= _nodes.Count || index < 0) + return null; + return _nodes[index]; + } - public override int Count - { - get - { - if (!_done) ReadToEnd(); - return _nodes.Count; - } - } + public override int Count + { + get + { + if (!_done) ReadToEnd(); + return _nodes.Count; + } + } - /// - /// Reads the entire iterator. - /// - private void ReadToEnd() - { - while (_iterator.MoveNext()) - { - var node = _iterator.Current as IHasXmlNode; - // Check IHasXmlNode interface. - if (node == null) - throw new ArgumentException("IHasXmlNode is missing."); - _nodes.Add(node.GetNode()); - } - _done = true; - } + /// + /// Reads the entire iterator. + /// + private void ReadToEnd() + { + while (_iterator.MoveNext()) + { + var node = _iterator.Current as IHasXmlNode; + // Check IHasXmlNode interface. + if (node == null) + throw new ArgumentException("IHasXmlNode is missing."); + _nodes.Add(node.GetNode()); + } + _done = true; + } - /// - /// Reads up to the specified index, or until the - /// iterator is consumed. - /// - private void ReadTo(int to) - { - while (_nodes.Count <= to) - { - if (_iterator.MoveNext()) - { - var node = _iterator.Current as IHasXmlNode; - // Check IHasXmlNode interface. - if (node == null) - throw new ArgumentException("IHasXmlNode is missing."); - _nodes.Add(node.GetNode()); - } - else - { - _done = true; - return; - } - } - } + /// + /// Reads up to the specified index, or until the + /// iterator is consumed. + /// + private void ReadTo(int to) + { + while (_nodes.Count <= to) + { + if (_iterator.MoveNext()) + { + var node = _iterator.Current as IHasXmlNode; + // Check IHasXmlNode interface. + if (node == null) + throw new ArgumentException("IHasXmlNode is missing."); + _nodes.Add(node.GetNode()); + } + else + { + _done = true; + return; + } + } + } + + /// + /// Flags that the iterator has been consumed. + /// + private bool Done + { + get { return _done; } + } - /// - /// Flags that the iterator has been consumed. - /// - private bool Done - { - get { return _done; } - } - bool _done; - /// - /// Current count of nodes in the iterator (read so far). - /// - private int CurrentPosition - { - get { return _nodes.Count; } - } + /// + /// Current count of nodes in the iterator (read so far). + /// + private int CurrentPosition + { + get { return _nodes.Count; } + } - #region XmlNodeListEnumerator + #region XmlNodeListEnumerator - private class XmlNodeListEnumerator : System.Collections.IEnumerator - { - readonly XmlNodeListIterator _iterator; - int _position = -1; + private class XmlNodeListEnumerator : System.Collections.IEnumerator + { + readonly XmlNodeListIterator _iterator; + int _position = -1; - public XmlNodeListEnumerator(XmlNodeListIterator iterator) - { - _iterator = iterator; - } + public XmlNodeListEnumerator(XmlNodeListIterator iterator) + { + _iterator = iterator; + } - #region IEnumerator Members + #region IEnumerator Members - void System.Collections.IEnumerator.Reset() - { - _position = -1; - } + void System.Collections.IEnumerator.Reset() + { + _position = -1; + } - bool System.Collections.IEnumerator.MoveNext() - { - _position++; - _iterator.ReadTo(_position); + bool System.Collections.IEnumerator.MoveNext() + { + _position++; + _iterator.ReadTo(_position); - // If we reached the end and our index is still - // bigger, there're no more items. - if (_iterator.Done && _position >= _iterator.CurrentPosition) - return false; + // If we reached the end and our index is still + // bigger, there're no more items. + if (_iterator.Done && _position >= _iterator.CurrentPosition) + return false; - return true; - } + return true; + } - object System.Collections.IEnumerator.Current - { - get - { - return _iterator[_position]; - } - } + object System.Collections.IEnumerator.Current + { + get + { + return _iterator[_position]; + } + } - #endregion - } + #endregion + } - #endregion XmlNodeListEnumerator - } + #endregion XmlNodeListEnumerator + } - #endregion XmlNodeListIterator - } -} \ No newline at end of file + #endregion XmlNodeListIterator + } +} diff --git a/src/Umbraco.Core/XmlExtensions.cs b/src/Umbraco.Core/XmlExtensions.cs index 0f2239dbe7..7ae2e6d284 100644 --- a/src/Umbraco.Core/XmlExtensions.cs +++ b/src/Umbraco.Core/XmlExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.IO; using System.Linq; @@ -11,16 +11,16 @@ using Umbraco.Core.Xml; namespace Umbraco.Core { - /// - /// Extension methods for xml objects - /// - internal static class XmlExtensions - { + /// + /// Extension methods for xml objects + /// + internal static class XmlExtensions + { public static bool HasAttribute(this XmlAttributeCollection attributes, string attributeName) { return attributes.Cast().Any(x => x.Name == attributeName); - } - + } + /// /// Selects a list of XmlNode matching an XPath expression. /// @@ -248,21 +248,21 @@ namespace Umbraco.Core return default(T); } - public static T AttributeValue(this XmlNode xml, string attributeName) - { - if (xml == null) throw new ArgumentNullException("xml"); - if (xml.Attributes == null) return default(T); + public static T AttributeValue(this XmlNode xml, string attributeName) + { + if (xml == null) throw new ArgumentNullException("xml"); + if (xml.Attributes == null) return default(T); - if (xml.Attributes[attributeName] == null) - return default(T); + if (xml.Attributes[attributeName] == null) + return default(T); - var val = xml.Attributes[attributeName].Value; - var result = val.TryConvertTo(); - if (result.Success) - return result.Result; + var val = xml.Attributes[attributeName].Value; + var result = val.TryConvertTo(); + if (result.Success) + return result.Result; - return default(T); - } + return default(T); + } public static XElement GetXElement(this XmlNode node) { @@ -292,20 +292,20 @@ namespace Umbraco.Core // .ToString(SaveOptions.*) is "a\r\nb" and cannot figure out how to get rid of "\r" // and when saving data we want nothing to change // this method will produce a string that respects the \r and \n in the data value - public static string ToDataString(this XElement xml) - { - var settings = new XmlWriterSettings - { + public static string ToDataString(this XElement xml) + { + var settings = new XmlWriterSettings + { OmitXmlDeclaration = true, - NewLineHandling = NewLineHandling.None, + NewLineHandling = NewLineHandling.None, Indent = false - }; - var output = new StringBuilder(); - using (var writer = XmlWriter.Create(output, settings)) - { + }; + var output = new StringBuilder(); + using (var writer = XmlWriter.Create(output, settings)) + { xml.WriteTo(writer); } - return output.ToString(); - } - } -} \ No newline at end of file + return output.ToString(); + } + } +} diff --git a/src/Umbraco.Core/_Legacy/PackageActions/PackageActionCollection.cs b/src/Umbraco.Core/_Legacy/PackageActions/PackageActionCollection.cs index 92fce9ce85..46ea3c1e39 100644 --- a/src/Umbraco.Core/_Legacy/PackageActions/PackageActionCollection.cs +++ b/src/Umbraco.Core/_Legacy/PackageActions/PackageActionCollection.cs @@ -5,7 +5,7 @@ namespace Umbraco.Core._Legacy.PackageActions { internal class PackageActionCollection : BuilderCollectionBase { - public PackageActionCollection(IEnumerable items) + public PackageActionCollection(IEnumerable items) : base(items) { } } diff --git a/src/Umbraco.Core/_Legacy/PackageActions/PackageActionCollectionBuilder.cs b/src/Umbraco.Core/_Legacy/PackageActions/PackageActionCollectionBuilder.cs index 01ed8ebf66..42ab3ec7c2 100644 --- a/src/Umbraco.Core/_Legacy/PackageActions/PackageActionCollectionBuilder.cs +++ b/src/Umbraco.Core/_Legacy/PackageActions/PackageActionCollectionBuilder.cs @@ -5,7 +5,7 @@ namespace Umbraco.Core._Legacy.PackageActions { internal class PackageActionCollectionBuilder : LazyCollectionBuilderBase { - public PackageActionCollectionBuilder(IServiceContainer container) + public PackageActionCollectionBuilder(IServiceContainer container) : base(container) { } diff --git a/src/Umbraco.MSBuild.Tasks/GetAssemblyFileVersion.cs b/src/Umbraco.MSBuild.Tasks/GetAssemblyFileVersion.cs index ff4b6dec13..2251470e41 100644 --- a/src/Umbraco.MSBuild.Tasks/GetAssemblyFileVersion.cs +++ b/src/Umbraco.MSBuild.Tasks/GetAssemblyFileVersion.cs @@ -9,7 +9,7 @@ namespace Umbraco.MSBuild.Tasks { [Required] public string strFilePathAssemblyInfo { get; set; } - + [Output] public string strAssemblyFileVersion { get; set; } diff --git a/src/Umbraco.MSBuild.Tasks/Properties/AssemblyInfo.cs b/src/Umbraco.MSBuild.Tasks/Properties/AssemblyInfo.cs index fe7739861c..48dcc9cec7 100644 --- a/src/Umbraco.MSBuild.Tasks/Properties/AssemblyInfo.cs +++ b/src/Umbraco.MSBuild.Tasks/Properties/AssemblyInfo.cs @@ -2,7 +2,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following +// 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("Umbraco.MSBuild.Tasks")] @@ -14,8 +14,8 @@ using System.Runtime.InteropServices; [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 +// 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)] @@ -25,11 +25,11 @@ using System.Runtime.InteropServices; // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // -// You can specify all the values or you can default the Build and Revision Numbers +// 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.0.0.0")] diff --git a/src/Umbraco.Tests.Benchmarks/BulkInsertBenchmarks.cs b/src/Umbraco.Tests.Benchmarks/BulkInsertBenchmarks.cs index 378a57976d..2e853658b6 100644 --- a/src/Umbraco.Tests.Benchmarks/BulkInsertBenchmarks.cs +++ b/src/Umbraco.Tests.Benchmarks/BulkInsertBenchmarks.cs @@ -38,7 +38,7 @@ namespace Umbraco.Tests.Benchmarks .WithLaunchCount(1) // benchmark process will be launched only once .WithIterationTime(TimeInterval.FromMilliseconds(100)) // 100ms per iteration .WithWarmupCount(3) // 3 warmup iteration - .WithTargetCount(3)); // 3 target iteration + .WithTargetCount(3)); // 3 target iteration } } @@ -80,8 +80,8 @@ namespace Umbraco.Tests.Benchmarks SetupSqlCe(path, logger); SetupSqlServer(logger); - - } + + } private void SetupSqlServer(ILogger logger) { @@ -94,16 +94,16 @@ namespace Umbraco.Tests.Benchmarks //re-create it _dbSqlServer.Execute(@"CREATE TABLE [umbracoServer]( - [id] [int] IDENTITY(1,1) NOT NULL, - [address] [nvarchar](500) NOT NULL, - [computerName] [nvarchar](255) NOT NULL, - [registeredDate] [datetime] NOT NULL CONSTRAINT [DF_umbracoServer_registeredDate] DEFAULT (getdate()), - [lastNotifiedDate] [datetime] NOT NULL, - [isActive] [bit] NOT NULL, - [isMaster] [bit] NOT NULL, - CONSTRAINT [PK_umbracoServer] PRIMARY KEY CLUSTERED + [id] [int] IDENTITY(1,1) NOT NULL, + [address] [nvarchar](500) NOT NULL, + [computerName] [nvarchar](255) NOT NULL, + [registeredDate] [datetime] NOT NULL CONSTRAINT [DF_umbracoServer_registeredDate] DEFAULT (getdate()), + [lastNotifiedDate] [datetime] NOT NULL, + [isActive] [bit] NOT NULL, + [isMaster] [bit] NOT NULL, + CONSTRAINT [PK_umbracoServer] PRIMARY KEY CLUSTERED ( - [id] ASC + [id] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] )"); } @@ -113,7 +113,7 @@ namespace Umbraco.Tests.Benchmarks var dbName = string.Concat("Umb", Guid.NewGuid(), ".sdf"); AppDomain.CurrentDomain.SetData("DataDirectory", path); var sqlCeConnectionString = $"Datasource=|DataDirectory|\\{dbName};Flush Interval=1;"; - + _dbFile = Path.Combine(path, dbName); //only create the db one time @@ -130,12 +130,12 @@ namespace Umbraco.Tests.Benchmarks var creation = new DatabaseSchemaCreation(_dbSqlCe, logger); creation.InitializeDatabaseSchema(); } - _initDbBytes = File.ReadAllBytes(_dbFile); + _initDbBytes = File.ReadAllBytes(_dbFile); } else { File.WriteAllBytes(_dbFile, _initDbBytes); - } + } //create the db _dbSqlCe = GetSqlCeDatabase(sqlCeConnectionString, logger); @@ -217,4 +217,4 @@ namespace Umbraco.Tests.Benchmarks } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests.Benchmarks/LinqCastBenchmarks.cs b/src/Umbraco.Tests.Benchmarks/LinqCastBenchmarks.cs index eddc9188b8..50ae745237 100644 --- a/src/Umbraco.Tests.Benchmarks/LinqCastBenchmarks.cs +++ b/src/Umbraco.Tests.Benchmarks/LinqCastBenchmarks.cs @@ -55,4 +55,4 @@ namespace Umbraco.Tests.Benchmarks } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests.Benchmarks/ModelToSqlExpressionHelperBenchmarks.cs b/src/Umbraco.Tests.Benchmarks/ModelToSqlExpressionHelperBenchmarks.cs index 7f782df694..e029eea473 100644 --- a/src/Umbraco.Tests.Benchmarks/ModelToSqlExpressionHelperBenchmarks.cs +++ b/src/Umbraco.Tests.Benchmarks/ModelToSqlExpressionHelperBenchmarks.cs @@ -18,7 +18,7 @@ namespace Umbraco.Tests.Benchmarks { public Config() { - Add(new MemoryDiagnoser()); + Add(new MemoryDiagnoser()); } } @@ -30,7 +30,7 @@ namespace Umbraco.Tests.Benchmarks mapperCollection.Setup(x => x[It.IsAny()]).Returns(contentMapper); _mapperCollection = mapperCollection.Object; } - + private readonly ISqlSyntaxProvider _syntaxProvider = new SqlCeSyntaxProvider(); private readonly CachedExpression _cachedExpression; private readonly IMapperCollection _mapperCollection; @@ -47,7 +47,7 @@ namespace Umbraco.Tests.Benchmarks var modelToSqlExpressionHelper = new ModelToSqlExpressionVisitor(_syntaxProvider, _mapperCollection); var result = modelToSqlExpressionHelper.Visit(predicate); - } + } } [Benchmark] @@ -59,7 +59,7 @@ namespace Umbraco.Tests.Benchmarks var b = i * 10; Expression> predicate = content => content.Path.StartsWith("-1") && content.Published && (content.ContentTypeId == a || content.ContentTypeId == b); - + var modelToSqlExpressionHelper = new ModelToSqlExpressionVisitor(_syntaxProvider, _mapperCollection); //wrap it! @@ -70,4 +70,4 @@ namespace Umbraco.Tests.Benchmarks } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests.Benchmarks/Program.cs b/src/Umbraco.Tests.Benchmarks/Program.cs index 2f41642bbf..2eac9ee419 100644 --- a/src/Umbraco.Tests.Benchmarks/Program.cs +++ b/src/Umbraco.Tests.Benchmarks/Program.cs @@ -16,7 +16,7 @@ namespace Umbraco.Tests.Benchmarks typeof(XmlPublishedContentInitBenchmarks), }); - switcher.Run(args); + switcher.Run(args); } } } diff --git a/src/Umbraco.Tests.Benchmarks/Properties/AssemblyInfo.cs b/src/Umbraco.Tests.Benchmarks/Properties/AssemblyInfo.cs index fb00b8d4e9..2ab0051c26 100644 --- a/src/Umbraco.Tests.Benchmarks/Properties/AssemblyInfo.cs +++ b/src/Umbraco.Tests.Benchmarks/Properties/AssemblyInfo.cs @@ -2,7 +2,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following +// 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("Umbraco.Tests.Benchmarks")] @@ -14,8 +14,8 @@ using System.Runtime.InteropServices; [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 +// 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)] @@ -25,11 +25,11 @@ using System.Runtime.InteropServices; // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // -// You can specify all the values or you can default the Build and Revision Numbers +// 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.0.0.0")] diff --git a/src/Umbraco.Tests.Benchmarks/XmlBenchmarks.cs b/src/Umbraco.Tests.Benchmarks/XmlBenchmarks.cs index c85cf4711f..99080ebab7 100644 --- a/src/Umbraco.Tests.Benchmarks/XmlBenchmarks.cs +++ b/src/Umbraco.Tests.Benchmarks/XmlBenchmarks.cs @@ -24,7 +24,7 @@ namespace Umbraco.Tests.Benchmarks .WithLaunchCount(1) // benchmark process will be launched only once .WithIterationTime(TimeInterval.FromMilliseconds(100)) // 100ms per iteration .WithWarmupCount(3) // 3 warmup iteration - .WithTargetCount(3)); // 3 target iteration + .WithTargetCount(3)); // 3 target iteration } } @@ -33,35 +33,35 @@ namespace Umbraco.Tests.Benchmarks { var templateId = 0; var xmlText = @" - ]> - - - - 1 - - This is some content]]> - - - - - - - - - - - - - - - - + + + + 1 + + This is some content]]> + + + + + + + + + + + + + + + + "; _xml = new XmlDocument(); _xml.LoadXml(xmlText); diff --git a/src/Umbraco.Tests.Benchmarks/XmlPublishedContentInitBenchmarks.cs b/src/Umbraco.Tests.Benchmarks/XmlPublishedContentInitBenchmarks.cs index e4d53ccff9..dbfe5a0bc9 100644 --- a/src/Umbraco.Tests.Benchmarks/XmlPublishedContentInitBenchmarks.cs +++ b/src/Umbraco.Tests.Benchmarks/XmlPublishedContentInitBenchmarks.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Xml; @@ -28,7 +28,7 @@ namespace Umbraco.Tests.Benchmarks .WithLaunchCount(1) // benchmark process will be launched only once .WithIterationTime(TimeInterval.FromMilliseconds(100)) // 100ms per iteration .WithWarmupCount(3) // 3 warmup iteration - .WithTargetCount(3)); // 3 target iteration + .WithTargetCount(3)); // 3 target iteration } } @@ -279,7 +279,7 @@ namespace Umbraco.Tests.Benchmarks var nodes = xmlNode.SelectNodes(dataXPath); contentType = GetPublishedContentType(PublishedItemType.Content, docTypeAlias); - + var propertyNodes = new Dictionary(); if (nodes != null) foreach (XmlNode n in nodes) @@ -310,4 +310,4 @@ namespace Umbraco.Tests.Benchmarks } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Cache/CacheProviderTests.cs b/src/Umbraco.Tests/Cache/CacheProviderTests.cs index 384fbf2bb8..98f6e5771b 100644 --- a/src/Umbraco.Tests/Cache/CacheProviderTests.cs +++ b/src/Umbraco.Tests/Cache/CacheProviderTests.cs @@ -22,7 +22,7 @@ namespace Umbraco.Tests.Cache public virtual void TearDown() { Provider.ClearAllCache(); - } + } [Test] public void Throws_On_Reentry() @@ -84,7 +84,7 @@ namespace Umbraco.Tests.Cache var counter = 0; object result; - + result = Provider.GetCacheItem("Blah", () => { counter++; @@ -178,7 +178,7 @@ namespace Umbraco.Tests.Cache Assert.AreEqual(2, GetTotalItemCount); } - [Test] + [Test] public void Can_Clear_All_Items() { var cacheContent1 = new MacroCacheContent(new LiteralControl(), "Test1"); @@ -254,4 +254,4 @@ namespace Umbraco.Tests.Cache Assert.AreEqual(1, GetTotalItemCount); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Cache/CacheRefresherComponentTests.cs b/src/Umbraco.Tests/Cache/CacheRefresherComponentTests.cs index ece846e0e4..f169e0eb6c 100644 --- a/src/Umbraco.Tests/Cache/CacheRefresherComponentTests.cs +++ b/src/Umbraco.Tests/Cache/CacheRefresherComponentTests.cs @@ -121,4 +121,4 @@ namespace Umbraco.Tests.Cache Assert.IsTrue(ok, "see log for details"); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Cache/CacheRefresherTests.cs b/src/Umbraco.Tests/Cache/CacheRefresherTests.cs index 170a72f793..bd8ccdacbd 100644 --- a/src/Umbraco.Tests/Cache/CacheRefresherTests.cs +++ b/src/Umbraco.Tests/Cache/CacheRefresherTests.cs @@ -1,4 +1,4 @@ -using NUnit.Framework; +using NUnit.Framework; using Umbraco.Core.Sync; namespace Umbraco.Tests.Cache @@ -26,4 +26,4 @@ namespace Umbraco.Tests.Cache return hash1 != hash2; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Cache/DeepCloneRuntimeCacheProviderTests.cs b/src/Umbraco.Tests/Cache/DeepCloneRuntimeCacheProviderTests.cs index bea89dea0f..f257858ed8 100644 --- a/src/Umbraco.Tests/Cache/DeepCloneRuntimeCacheProviderTests.cs +++ b/src/Umbraco.Tests/Cache/DeepCloneRuntimeCacheProviderTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics; using System.Reflection; using System.Web; @@ -66,7 +66,7 @@ namespace Umbraco.Tests.Cache Assert.IsTrue(original.IsDirty()); var val = _provider.GetCacheItem("test", () => original); - + Assert.AreNotEqual(original.CloneId, val.CloneId); Assert.IsFalse(val.IsDirty()); } @@ -127,4 +127,4 @@ namespace Umbraco.Tests.Cache } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Cache/DefaultCachePolicyTests.cs b/src/Umbraco.Tests/Cache/DefaultCachePolicyTests.cs index cf9165ab03..27d9dcc89e 100644 --- a/src/Umbraco.Tests/Cache/DefaultCachePolicyTests.cs +++ b/src/Umbraco.Tests/Cache/DefaultCachePolicyTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Web.Caching; using Moq; @@ -133,4 +133,4 @@ namespace Umbraco.Tests.Cache } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Cache/DistributedCache/DistributedCacheTests.cs b/src/Umbraco.Tests/Cache/DistributedCache/DistributedCacheTests.cs index 8f5ecf7f58..ed28004477 100644 --- a/src/Umbraco.Tests/Cache/DistributedCache/DistributedCacheTests.cs +++ b/src/Umbraco.Tests/Cache/DistributedCache/DistributedCacheTests.cs @@ -209,4 +209,4 @@ namespace Umbraco.Tests.Cache.DistributedCache #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Cache/FullDataSetCachePolicyTests.cs b/src/Umbraco.Tests/Cache/FullDataSetCachePolicyTests.cs index 37ac0bef02..c3cfe08e71 100644 --- a/src/Umbraco.Tests/Cache/FullDataSetCachePolicyTests.cs +++ b/src/Umbraco.Tests/Cache/FullDataSetCachePolicyTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.Collections.Generic; using System.Linq; @@ -62,7 +62,7 @@ namespace Umbraco.Tests.Cache var getAll = new AuditItem[] {}; var cached = new List(); - + IList list = null; var cache = new Mock(); @@ -210,4 +210,4 @@ namespace Umbraco.Tests.Cache } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Cache/HttpRequestCacheProviderTests.cs b/src/Umbraco.Tests/Cache/HttpRequestCacheProviderTests.cs index 87a468ddd5..f45f723073 100644 --- a/src/Umbraco.Tests/Cache/HttpRequestCacheProviderTests.cs +++ b/src/Umbraco.Tests/Cache/HttpRequestCacheProviderTests.cs @@ -31,7 +31,7 @@ namespace Umbraco.Tests.Cache [TestFixture] public class StaticCacheProviderTests : CacheProviderTests { - private StaticCacheProvider _provider; + private StaticCacheProvider _provider; public override void Setup() { @@ -49,4 +49,4 @@ namespace Umbraco.Tests.Cache get { return _provider.StaticCache.Count; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Cache/HttpRuntimeCacheProviderTests.cs b/src/Umbraco.Tests/Cache/HttpRuntimeCacheProviderTests.cs index d1196b7d66..77eee55372 100644 --- a/src/Umbraco.Tests/Cache/HttpRuntimeCacheProviderTests.cs +++ b/src/Umbraco.Tests/Cache/HttpRuntimeCacheProviderTests.cs @@ -56,4 +56,4 @@ namespace Umbraco.Tests.Cache return "succ" + i; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Cache/PublishedCache/PublishedContentCacheTests.cs b/src/Umbraco.Tests/Cache/PublishedCache/PublishedContentCacheTests.cs index e0a678ff62..28d707c2a5 100644 --- a/src/Umbraco.Tests/Cache/PublishedCache/PublishedContentCacheTests.cs +++ b/src/Umbraco.Tests/Cache/PublishedCache/PublishedContentCacheTests.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; using System.Xml; using Moq; using NUnit.Framework; @@ -14,38 +14,38 @@ using Umbraco.Web.Security; namespace Umbraco.Tests.Cache.PublishedCache { - [TestFixture] + [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerFixture)] public class PublishContentCacheTests : BaseWebTest - { - private FakeHttpContextFactory _httpContextFactory; - private UmbracoContext _umbracoContext; - private IPublishedContentCache _cache; - private XmlDocument _xml; + { + private FakeHttpContextFactory _httpContextFactory; + private UmbracoContext _umbracoContext; + private IPublishedContentCache _cache; + private XmlDocument _xml; - private string GetXml() - { - return @" ]> - - - - - - - - - - - - - + + + + + + + + + + + + + "; - } + } public override void SetUp() { @@ -53,73 +53,73 @@ namespace Umbraco.Tests.Cache.PublishedCache _httpContextFactory = new FakeHttpContextFactory("~/Home"); - var settings = SettingsForTests.GenerateMockSettings(); + var settings = SettingsForTests.GenerateMockSettings(); - SettingsForTests.ConfigureSettings(settings); + SettingsForTests.ConfigureSettings(settings); _xml = new XmlDocument(); _xml.LoadXml(GetXml()); - var xmlStore = new XmlStore(() => _xml); - var cacheProvider = new StaticCacheProvider(); + var xmlStore = new XmlStore(() => _xml); + var cacheProvider = new StaticCacheProvider(); var domainCache = new DomainCache(ServiceContext.DomainService); - var facade = new Facade( - new PublishedContentCache(xmlStore, domainCache, cacheProvider, ContentTypesCache, null, null), - new PublishedMediaCache(xmlStore, ServiceContext.MediaService, ServiceContext.UserService, cacheProvider, ContentTypesCache), - new PublishedMemberCache(null, cacheProvider, Current.Services.MemberService, ContentTypesCache), - domainCache); - var facadeService = new Mock(); - facadeService.Setup(x => x.CreateFacade(It.IsAny())).Returns(facade); + var facade = new Facade( + new PublishedContentCache(xmlStore, domainCache, cacheProvider, ContentTypesCache, null, null), + new PublishedMediaCache(xmlStore, ServiceContext.MediaService, ServiceContext.UserService, cacheProvider, ContentTypesCache), + new PublishedMemberCache(null, cacheProvider, Current.Services.MemberService, ContentTypesCache), + domainCache); + var facadeService = new Mock(); + facadeService.Setup(x => x.CreateFacade(It.IsAny())).Returns(facade); - _umbracoContext = new UmbracoContext( - _httpContextFactory.HttpContext, - facadeService.Object, - new WebSecurity(_httpContextFactory.HttpContext, Current.Services.UserService), - settings, - Enumerable.Empty()); + _umbracoContext = new UmbracoContext( + _httpContextFactory.HttpContext, + facadeService.Object, + new WebSecurity(_httpContextFactory.HttpContext, Current.Services.UserService), + settings, + Enumerable.Empty()); - _cache = _umbracoContext.ContentCache; + _cache = _umbracoContext.ContentCache; } - [Test] - public void Has_Content() - { - Assert.IsTrue(_cache.HasContent()); - } + [Test] + public void Has_Content() + { + Assert.IsTrue(_cache.HasContent()); + } - [Test] - public void Get_Root_Docs() - { - var result = _cache.GetAtRoot(); - Assert.AreEqual(2, result.Count()); - Assert.AreEqual(1046, result.ElementAt(0).Id); - Assert.AreEqual(1172, result.ElementAt(1).Id); - } + [Test] + public void Get_Root_Docs() + { + var result = _cache.GetAtRoot(); + Assert.AreEqual(2, result.Count()); + Assert.AreEqual(1046, result.ElementAt(0).Id); + Assert.AreEqual(1172, result.ElementAt(1).Id); + } - [TestCase("/", 1046)] - [TestCase("/home", 1046)] - [TestCase("/Home", 1046)] //test different cases - [TestCase("/home/sub1", 1173)] - [TestCase("/Home/sub1", 1173)] - [TestCase("/home/Sub1", 1173)] //test different cases - [TestCase("/home/Sub'Apostrophe", 1177)] - public void Get_Node_By_Route(string route, int nodeId) - { - var result = _cache.GetByRoute(route, false); - Assert.IsNotNull(result); - Assert.AreEqual(nodeId, result.Id); - } + [TestCase("/", 1046)] + [TestCase("/home", 1046)] + [TestCase("/Home", 1046)] //test different cases + [TestCase("/home/sub1", 1173)] + [TestCase("/Home/sub1", 1173)] + [TestCase("/home/Sub1", 1173)] //test different cases + [TestCase("/home/Sub'Apostrophe", 1177)] + public void Get_Node_By_Route(string route, int nodeId) + { + var result = _cache.GetByRoute(route, false); + Assert.IsNotNull(result); + Assert.AreEqual(nodeId, result.Id); + } - [TestCase("/", 1046)] - [TestCase("/sub1", 1173)] - [TestCase("/Sub1", 1173)] - public void Get_Node_By_Route_Hiding_Top_Level_Nodes(string route, int nodeId) - { - var result = _cache.GetByRoute(route, true); - Assert.IsNotNull(result); - Assert.AreEqual(nodeId, result.Id); - } - } -} \ No newline at end of file + [TestCase("/", 1046)] + [TestCase("/sub1", 1173)] + [TestCase("/Sub1", 1173)] + public void Get_Node_By_Route_Hiding_Top_Level_Nodes(string route, int nodeId) + { + var result = _cache.GetByRoute(route, true); + Assert.IsNotNull(result); + Assert.AreEqual(nodeId, result.Id); + } + } +} diff --git a/src/Umbraco.Tests/Cache/PublishedCache/PublishedMediaCacheTests.cs b/src/Umbraco.Tests/Cache/PublishedCache/PublishedMediaCacheTests.cs index db810e778e..804fe107c3 100644 --- a/src/Umbraco.Tests/Cache/PublishedCache/PublishedMediaCacheTests.cs +++ b/src/Umbraco.Tests/Cache/PublishedCache/PublishedMediaCacheTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Xml; @@ -18,10 +18,10 @@ using Umbraco.Core.Models.Membership; namespace Umbraco.Tests.Cache.PublishedCache { - [TestFixture] + [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] public class PublishMediaCacheTests : BaseWebTest - { + { protected override void Compose() { base.Compose(); @@ -31,45 +31,45 @@ namespace Umbraco.Tests.Cache.PublishedCache .Append(); } - private IMediaType MakeNewMediaType(IUser user, string text, int parentId = -1) - { - var mt = new MediaType(parentId) { Name = text, Alias = text, Thumbnail = "icon-folder", Icon = "icon-folder" }; + private IMediaType MakeNewMediaType(IUser user, string text, int parentId = -1) + { + var mt = new MediaType(parentId) { Name = text, Alias = text, Thumbnail = "icon-folder", Icon = "icon-folder" }; ServiceContext.MediaTypeService.Save(mt); - return mt; - } + return mt; + } - private IMedia MakeNewMedia(string name, IMediaType mediaType, IUser user, int parentId) - { - var m = ServiceContext.MediaService.CreateMediaWithIdentity(name, parentId, mediaType.Alias); - return m; - } + private IMedia MakeNewMedia(string name, IMediaType mediaType, IUser user, int parentId) + { + var m = ServiceContext.MediaService.CreateMediaWithIdentity(name, parentId, mediaType.Alias); + return m; + } //NOTE: This is "Without_Examine" too [Test] - public void Get_Root_Docs() - { + public void Get_Root_Docs() + { var user = ServiceContext.UserService.GetUserById(0); var mType = MakeNewMediaType(user, "TestMediaType"); - var mRoot1 = MakeNewMedia("MediaRoot1", mType, user, -1); - var mRoot2 = MakeNewMedia("MediaRoot2", mType, user, -1); - var mChild1 = MakeNewMedia("Child1", mType, user, mRoot1.Id); - var mChild2 = MakeNewMedia("Child2", mType, user, mRoot2.Id); + var mRoot1 = MakeNewMedia("MediaRoot1", mType, user, -1); + var mRoot2 = MakeNewMedia("MediaRoot2", mType, user, -1); + var mChild1 = MakeNewMedia("Child1", mType, user, mRoot1.Id); + var mChild2 = MakeNewMedia("Child2", mType, user, mRoot2.Id); - var ctx = GetUmbracoContext("/test"); + var ctx = GetUmbracoContext("/test"); var cache = new PublishedMediaCache(new XmlStore((XmlDocument) null), ServiceContext.MediaService, ServiceContext.UserService, new StaticCacheProvider(), ContentTypesCache); - var roots = cache.GetAtRoot(); - Assert.AreEqual(2, roots.Count()); - Assert.IsTrue(roots.Select(x => x.Id).ContainsAll(new[] {mRoot1.Id, mRoot2.Id})); + var roots = cache.GetAtRoot(); + Assert.AreEqual(2, roots.Count()); + Assert.IsTrue(roots.Select(x => x.Id).ContainsAll(new[] {mRoot1.Id, mRoot2.Id})); - } + } - [Test] - public void Get_Item_Without_Examine() - { + [Test] + public void Get_Item_Without_Examine() + { var user = ServiceContext.UserService.GetUserById(0); var mType = MakeNewMediaType(user, "TestMediaType"); - var mRoot = MakeNewMedia("MediaRoot", mType, user, -1); - var mChild1 = MakeNewMedia("Child1", mType, user, mRoot.Id); + var mRoot = MakeNewMedia("MediaRoot", mType, user, -1); + var mChild1 = MakeNewMedia("Child1", mType, user, mRoot.Id); //var publishedMedia = PublishedMediaTests.GetNode(mRoot.Id, GetUmbracoContext("/test", 1234)); var umbracoContext = GetUmbracoContext("/test"); @@ -77,59 +77,59 @@ namespace Umbraco.Tests.Cache.PublishedCache var publishedMedia = cache.GetById(mRoot.Id); Assert.IsNotNull(publishedMedia); - Assert.AreEqual(mRoot.Id, publishedMedia.Id); - Assert.AreEqual(mRoot.CreateDate.ToString("dd/MM/yyyy HH:mm:ss"), publishedMedia.CreateDate.ToString("dd/MM/yyyy HH:mm:ss")); - Assert.AreEqual(mRoot.CreatorId, publishedMedia.CreatorId); - //Assert.AreEqual(mRoot.User.Name, publishedMedia.CreatorName); - Assert.AreEqual(mRoot.ContentType.Alias, publishedMedia.DocumentTypeAlias); - Assert.AreEqual(mRoot.ContentType.Id, publishedMedia.DocumentTypeId); - Assert.AreEqual(mRoot.Level, publishedMedia.Level); - Assert.AreEqual(mRoot.Name, publishedMedia.Name); - Assert.AreEqual(mRoot.Path, publishedMedia.Path); - Assert.AreEqual(mRoot.SortOrder, publishedMedia.SortOrder); - Assert.IsNull(publishedMedia.Parent); - } + Assert.AreEqual(mRoot.Id, publishedMedia.Id); + Assert.AreEqual(mRoot.CreateDate.ToString("dd/MM/yyyy HH:mm:ss"), publishedMedia.CreateDate.ToString("dd/MM/yyyy HH:mm:ss")); + Assert.AreEqual(mRoot.CreatorId, publishedMedia.CreatorId); + //Assert.AreEqual(mRoot.User.Name, publishedMedia.CreatorName); + Assert.AreEqual(mRoot.ContentType.Alias, publishedMedia.DocumentTypeAlias); + Assert.AreEqual(mRoot.ContentType.Id, publishedMedia.DocumentTypeId); + Assert.AreEqual(mRoot.Level, publishedMedia.Level); + Assert.AreEqual(mRoot.Name, publishedMedia.Name); + Assert.AreEqual(mRoot.Path, publishedMedia.Path); + Assert.AreEqual(mRoot.SortOrder, publishedMedia.SortOrder); + Assert.IsNull(publishedMedia.Parent); + } - [TestCase("id")] - [TestCase("nodeId")] - [TestCase("__NodeId")] - public void DictionaryDocument_Id_Keys(string key) - { - var dicDoc = GetDictionaryDocument(idKey: key); - DoAssert(dicDoc); - } + [TestCase("id")] + [TestCase("nodeId")] + [TestCase("__NodeId")] + public void DictionaryDocument_Id_Keys(string key) + { + var dicDoc = GetDictionaryDocument(idKey: key); + DoAssert(dicDoc); + } - [TestCase("template")] - [TestCase("templateId")] - public void DictionaryDocument_Template_Keys(string key) - { - var dicDoc = GetDictionaryDocument(templateKey: key); - DoAssert(dicDoc); - } + [TestCase("template")] + [TestCase("templateId")] + public void DictionaryDocument_Template_Keys(string key) + { + var dicDoc = GetDictionaryDocument(templateKey: key); + DoAssert(dicDoc); + } - [TestCase("nodeName")] - [TestCase("__nodeName")] - public void DictionaryDocument_NodeName_Keys(string key) - { - var dicDoc = GetDictionaryDocument(nodeNameKey: key); - DoAssert(dicDoc); - } + [TestCase("nodeName")] + [TestCase("__nodeName")] + public void DictionaryDocument_NodeName_Keys(string key) + { + var dicDoc = GetDictionaryDocument(nodeNameKey: key); + DoAssert(dicDoc); + } - [TestCase("nodeTypeAlias")] - [TestCase("__NodeTypeAlias")] - public void DictionaryDocument_NodeTypeAlias_Keys(string key) - { - var dicDoc = GetDictionaryDocument(nodeTypeAliasKey: key); - DoAssert(dicDoc); - } + [TestCase("nodeTypeAlias")] + [TestCase("__NodeTypeAlias")] + public void DictionaryDocument_NodeTypeAlias_Keys(string key) + { + var dicDoc = GetDictionaryDocument(nodeTypeAliasKey: key); + DoAssert(dicDoc); + } - [TestCase("path")] - [TestCase("__Path")] - public void DictionaryDocument_Path_Keys(string key) - { - var dicDoc = GetDictionaryDocument(pathKey: key); - DoAssert(dicDoc); - } + [TestCase("path")] + [TestCase("__Path")] + public void DictionaryDocument_Path_Keys(string key) + { + var dicDoc = GetDictionaryDocument(pathKey: key); + DoAssert(dicDoc); + } [Test] public void DictionaryDocument_Key() @@ -139,82 +139,82 @@ namespace Umbraco.Tests.Cache.PublishedCache DoAssert(dicDoc, keyVal: key); } - [Test] - public void DictionaryDocument_Get_Children() - { - var child1 = GetDictionaryDocument(idVal: 222333); - var child2 = GetDictionaryDocument(idVal: 444555); + [Test] + public void DictionaryDocument_Get_Children() + { + var child1 = GetDictionaryDocument(idVal: 222333); + var child2 = GetDictionaryDocument(idVal: 444555); - var dicDoc = GetDictionaryDocument(children: new List() - { - child1, child2 - }); + var dicDoc = GetDictionaryDocument(children: new List() + { + child1, child2 + }); - Assert.AreEqual(2, dicDoc.Children.Count()); - Assert.AreEqual(222333, dicDoc.Children.ElementAt(0).Id); - Assert.AreEqual(444555, dicDoc.Children.ElementAt(1).Id); - } + Assert.AreEqual(2, dicDoc.Children.Count()); + Assert.AreEqual(222333, dicDoc.Children.ElementAt(0).Id); + Assert.AreEqual(444555, dicDoc.Children.ElementAt(1).Id); + } [Test] public void Convert_From_Search_Result() - { + { var ctx = GetUmbracoContext("/test"); - var key = Guid.NewGuid(); + var key = Guid.NewGuid(); - var result = new SearchResult() - { - LongId = 1234, - Score = 1 - }; - result.Fields.Add("__IndexType", "media"); - result.Fields.Add("__NodeId", "1234"); - result.Fields.Add("__NodeTypeAlias", Constants.Conventions.MediaTypes.Image); - result.Fields.Add("__Path", "-1,1234"); - result.Fields.Add("__nodeName", "Test"); - result.Fields.Add("id", "1234"); + var result = new SearchResult() + { + LongId = 1234, + Score = 1 + }; + result.Fields.Add("__IndexType", "media"); + result.Fields.Add("__NodeId", "1234"); + result.Fields.Add("__NodeTypeAlias", Constants.Conventions.MediaTypes.Image); + result.Fields.Add("__Path", "-1,1234"); + result.Fields.Add("__nodeName", "Test"); + result.Fields.Add("id", "1234"); result.Fields.Add("key", key.ToString()); result.Fields.Add("urlName", "/media/test.jpg"); result.Fields.Add("nodeType", "0"); result.Fields.Add("sortOrder", "0"); result.Fields.Add("level", "2"); result.Fields.Add("nodeName", "Test"); - result.Fields.Add("nodeTypeAlias", Constants.Conventions.MediaTypes.Image); - result.Fields.Add("parentID", "-1"); - result.Fields.Add("path", "-1,1234"); - result.Fields.Add("updateDate", DateTime.Parse("2012-07-16T10:34:09").Ticks.ToString()); + result.Fields.Add("nodeTypeAlias", Constants.Conventions.MediaTypes.Image); + result.Fields.Add("parentID", "-1"); + result.Fields.Add("path", "-1,1234"); + result.Fields.Add("updateDate", DateTime.Parse("2012-07-16T10:34:09").Ticks.ToString()); result.Fields.Add("createDate", DateTime.Parse("2012-07-17T10:34:09").Ticks.ToString()); result.Fields.Add("creatorID", "0"); result.Fields.Add("creatorName", "Shannon"); var store = new PublishedMediaCache(new XmlStore((XmlDocument)null), ServiceContext.MediaService, ServiceContext.UserService, new StaticCacheProvider(), ContentTypesCache); - var doc = store.CreateFromCacheValues(store.ConvertFromSearchResult(result)); + var doc = store.CreateFromCacheValues(store.ConvertFromSearchResult(result)); - DoAssert(doc, 1234, key, 0, 0, "/media/test.jpg", "Image", 0, "Shannon", "Shannon", 0, 0, "-1,1234", DateTime.Parse("2012-07-17T10:34:09"), DateTime.Parse("2012-07-16T10:34:09"), 2); - Assert.AreEqual(null, doc.Parent); - } + DoAssert(doc, 1234, key, 0, 0, "/media/test.jpg", "Image", 0, "Shannon", "Shannon", 0, 0, "-1,1234", DateTime.Parse("2012-07-17T10:34:09"), DateTime.Parse("2012-07-16T10:34:09"), 2); + Assert.AreEqual(null, doc.Parent); + } [Test] public void Convert_From_XPath_Navigator() - { + { var ctx = GetUmbracoContext("/test"); var key = Guid.NewGuid(); - var xmlDoc = GetMediaXml(); + var xmlDoc = GetMediaXml(); ((XmlElement)xmlDoc.DocumentElement.FirstChild).SetAttribute("key", key.ToString()); var navigator = xmlDoc.SelectSingleNode("/root/Image").CreateNavigator(); var cache = new PublishedMediaCache(new XmlStore((XmlDocument)null), ServiceContext.MediaService, ServiceContext.UserService, new StaticCacheProvider(), ContentTypesCache); - var doc = cache.CreateFromCacheValues(cache.ConvertFromXPathNavigator(navigator, true)); + var doc = cache.CreateFromCacheValues(cache.ConvertFromXPathNavigator(navigator, true)); - DoAssert(doc, 2000, key, 0, 2, "image1", "Image", 2044, "Shannon", "Shannon", 33, 33, "-1,2000", DateTime.Parse("2012-06-12T14:13:17"), DateTime.Parse("2012-07-20T18:50:43"), 1); - Assert.AreEqual(null, doc.Parent); - Assert.AreEqual(2, doc.Children.Count()); - Assert.AreEqual(2001, doc.Children.ElementAt(0).Id); - Assert.AreEqual(2002, doc.Children.ElementAt(1).Id); - } + DoAssert(doc, 2000, key, 0, 2, "image1", "Image", 2044, "Shannon", "Shannon", 33, 33, "-1,2000", DateTime.Parse("2012-06-12T14:13:17"), DateTime.Parse("2012-07-20T18:50:43"), 1); + Assert.AreEqual(null, doc.Parent); + Assert.AreEqual(2, doc.Children.Count()); + Assert.AreEqual(2001, doc.Children.ElementAt(0).Id); + Assert.AreEqual(2002, doc.Children.ElementAt(1).Id); + } - private XmlDocument GetMediaXml() - { - var xml = @" + private XmlDocument GetMediaXml() + { + var xml = @" @@ -222,67 +222,67 @@ namespace Umbraco.Tests.Cache.PublishedCache ]> - - - - - - - - - + + + + + + + + + "; - var xmlDoc = new XmlDocument(); - xmlDoc.LoadXml(xml); - return xmlDoc; - } + var xmlDoc = new XmlDocument(); + xmlDoc.LoadXml(xml); + return xmlDoc; + } - private Dictionary GetDictionary( - int id, + private Dictionary GetDictionary( + int id, Guid key, - int parentId, - string idKey, - string templateKey, - string nodeNameKey, - string nodeTypeAliasKey, - string pathKey) - { - return new Dictionary() - { - {idKey, id.ToString()}, + int parentId, + string idKey, + string templateKey, + string nodeNameKey, + string nodeTypeAliasKey, + string pathKey) + { + return new Dictionary() + { + {idKey, id.ToString()}, {"key", key.ToString()}, - {templateKey, "0"}, - {"sortOrder", "44"}, - {nodeNameKey, "Testing"}, - {"urlName", "testing"}, - {nodeTypeAliasKey, "myType"}, - {"nodeType", "22"}, - {"writerName", "Shannon"}, - {"creatorName", "Shannon"}, - {"writerID", "33"}, - {"creatorID", "33"}, - {pathKey, "1,2,3,4,5"}, - {"createDate", "2012-01-02"}, - {"updateDate", "2012-01-02"}, - {"level", "3"}, - {"parentID", parentId.ToString()} - }; - } + {templateKey, "0"}, + {"sortOrder", "44"}, + {nodeNameKey, "Testing"}, + {"urlName", "testing"}, + {nodeTypeAliasKey, "myType"}, + {"nodeType", "22"}, + {"writerName", "Shannon"}, + {"creatorName", "Shannon"}, + {"writerID", "33"}, + {"creatorID", "33"}, + {pathKey, "1,2,3,4,5"}, + {"createDate", "2012-01-02"}, + {"updateDate", "2012-01-02"}, + {"level", "3"}, + {"parentID", parentId.ToString()} + }; + } - private PublishedMediaCache.DictionaryPublishedContent GetDictionaryDocument( - string idKey = "id", - string templateKey = "template", - string nodeNameKey = "nodeName", - string nodeTypeAliasKey = "nodeTypeAlias", - string pathKey = "path", - int idVal = 1234, + private PublishedMediaCache.DictionaryPublishedContent GetDictionaryDocument( + string idKey = "id", + string templateKey = "template", + string nodeNameKey = "nodeName", + string nodeTypeAliasKey = "nodeTypeAlias", + string pathKey = "path", + int idVal = 1234, Guid keyVal = default(Guid), - int parentIdVal = 321, - IEnumerable children = null) - { - if (children == null) - children = new List(); + int parentIdVal = 321, + IEnumerable children = null) + { + if (children == null) + children = new List(); var dicDoc = new PublishedMediaCache.DictionaryPublishedContent( //the dictionary GetDictionary(idVal, keyVal, parentIdVal, idKey, templateKey, nodeNameKey, nodeTypeAliasKey, pathKey), @@ -312,81 +312,81 @@ namespace Umbraco.Tests.Cache.PublishedCache null, // not from examine false); - return dicDoc; - } + return dicDoc; + } - private void DoAssert( - PublishedMediaCache.DictionaryPublishedContent dicDoc, - int idVal = 1234, - Guid keyVal = default(Guid), - int templateIdVal = 0, - int sortOrderVal = 44, - string urlNameVal = "testing", - string nodeTypeAliasVal = "myType", - int nodeTypeIdVal = 22, - string writerNameVal = "Shannon", - string creatorNameVal = "Shannon", - int writerIdVal = 33, - int creatorIdVal = 33, - string pathVal = "1,2,3,4,5", - DateTime? createDateVal = null, - DateTime? updateDateVal = null, - int levelVal = 3, - int parentIdVal = 321) - { - if (!createDateVal.HasValue) - createDateVal = DateTime.Parse("2012-01-02"); - if (!updateDateVal.HasValue) - updateDateVal = DateTime.Parse("2012-01-02"); - - DoAssert((IPublishedContent)dicDoc, idVal, keyVal, templateIdVal, sortOrderVal, urlNameVal, nodeTypeAliasVal, nodeTypeIdVal, writerNameVal, - creatorNameVal, writerIdVal, creatorIdVal, pathVal, createDateVal, updateDateVal, levelVal); - - //now validate the parentId that has been parsed, this doesn't exist on the IPublishedContent - Assert.AreEqual(parentIdVal, dicDoc.ParentId); - } - - private void DoAssert( - IPublishedContent doc, - int idVal = 1234, + private void DoAssert( + PublishedMediaCache.DictionaryPublishedContent dicDoc, + int idVal = 1234, Guid keyVal = default(Guid), int templateIdVal = 0, - int sortOrderVal = 44, - string urlNameVal = "testing", - string nodeTypeAliasVal = "myType", - int nodeTypeIdVal = 22, - string writerNameVal = "Shannon", - string creatorNameVal = "Shannon", - int writerIdVal = 33, - int creatorIdVal = 33, - string pathVal = "1,2,3,4,5", - DateTime? createDateVal = null, - DateTime? updateDateVal = null, - int levelVal = 3) - { - if (!createDateVal.HasValue) - createDateVal = DateTime.Parse("2012-01-02"); - if (!updateDateVal.HasValue) - updateDateVal = DateTime.Parse("2012-01-02"); + int sortOrderVal = 44, + string urlNameVal = "testing", + string nodeTypeAliasVal = "myType", + int nodeTypeIdVal = 22, + string writerNameVal = "Shannon", + string creatorNameVal = "Shannon", + int writerIdVal = 33, + int creatorIdVal = 33, + string pathVal = "1,2,3,4,5", + DateTime? createDateVal = null, + DateTime? updateDateVal = null, + int levelVal = 3, + int parentIdVal = 321) + { + if (!createDateVal.HasValue) + createDateVal = DateTime.Parse("2012-01-02"); + if (!updateDateVal.HasValue) + updateDateVal = DateTime.Parse("2012-01-02"); - Assert.AreEqual(idVal, doc.Id); + DoAssert((IPublishedContent)dicDoc, idVal, keyVal, templateIdVal, sortOrderVal, urlNameVal, nodeTypeAliasVal, nodeTypeIdVal, writerNameVal, + creatorNameVal, writerIdVal, creatorIdVal, pathVal, createDateVal, updateDateVal, levelVal); + + //now validate the parentId that has been parsed, this doesn't exist on the IPublishedContent + Assert.AreEqual(parentIdVal, dicDoc.ParentId); + } + + private void DoAssert( + IPublishedContent doc, + int idVal = 1234, + Guid keyVal = default(Guid), + int templateIdVal = 0, + int sortOrderVal = 44, + string urlNameVal = "testing", + string nodeTypeAliasVal = "myType", + int nodeTypeIdVal = 22, + string writerNameVal = "Shannon", + string creatorNameVal = "Shannon", + int writerIdVal = 33, + int creatorIdVal = 33, + string pathVal = "1,2,3,4,5", + DateTime? createDateVal = null, + DateTime? updateDateVal = null, + int levelVal = 3) + { + if (!createDateVal.HasValue) + createDateVal = DateTime.Parse("2012-01-02"); + if (!updateDateVal.HasValue) + updateDateVal = DateTime.Parse("2012-01-02"); + + Assert.AreEqual(idVal, doc.Id); Assert.AreEqual(keyVal, doc.Key); - Assert.AreEqual(templateIdVal, doc.TemplateId); - Assert.AreEqual(sortOrderVal, doc.SortOrder); - Assert.AreEqual(urlNameVal, doc.UrlName); - Assert.AreEqual(nodeTypeAliasVal, doc.DocumentTypeAlias); - Assert.AreEqual(nodeTypeIdVal, doc.DocumentTypeId); - Assert.AreEqual(writerNameVal, doc.WriterName); - Assert.AreEqual(creatorNameVal, doc.CreatorName); - Assert.AreEqual(writerIdVal, doc.WriterId); - Assert.AreEqual(creatorIdVal, doc.CreatorId); - Assert.AreEqual(pathVal, doc.Path); - Assert.AreEqual(createDateVal.Value, doc.CreateDate); - Assert.AreEqual(updateDateVal.Value, doc.UpdateDate); - Assert.AreEqual(levelVal, doc.Level); + Assert.AreEqual(templateIdVal, doc.TemplateId); + Assert.AreEqual(sortOrderVal, doc.SortOrder); + Assert.AreEqual(urlNameVal, doc.UrlName); + Assert.AreEqual(nodeTypeAliasVal, doc.DocumentTypeAlias); + Assert.AreEqual(nodeTypeIdVal, doc.DocumentTypeId); + Assert.AreEqual(writerNameVal, doc.WriterName); + Assert.AreEqual(creatorNameVal, doc.CreatorName); + Assert.AreEqual(writerIdVal, doc.WriterId); + Assert.AreEqual(creatorIdVal, doc.CreatorId); + Assert.AreEqual(pathVal, doc.Path); + Assert.AreEqual(createDateVal.Value, doc.CreateDate); + Assert.AreEqual(updateDateVal.Value, doc.UpdateDate); + Assert.AreEqual(levelVal, doc.Level); - } + } - } -} \ No newline at end of file + } +} diff --git a/src/Umbraco.Tests/Cache/RuntimeCacheProviderTests.cs b/src/Umbraco.Tests/Cache/RuntimeCacheProviderTests.cs index bbb921f462..09666f4793 100644 --- a/src/Umbraco.Tests/Cache/RuntimeCacheProviderTests.cs +++ b/src/Umbraco.Tests/Cache/RuntimeCacheProviderTests.cs @@ -25,4 +25,4 @@ namespace Umbraco.Tests.Cache Assert.AreEqual(null, Provider.GetCacheItem("DateTimeTest")); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Cache/SingleItemsOnlyCachePolicyTests.cs b/src/Umbraco.Tests/Cache/SingleItemsOnlyCachePolicyTests.cs index f4a05cadc8..b191842a07 100644 --- a/src/Umbraco.Tests/Cache/SingleItemsOnlyCachePolicyTests.cs +++ b/src/Umbraco.Tests/Cache/SingleItemsOnlyCachePolicyTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Web.Caching; using Moq; @@ -53,4 +53,4 @@ namespace Umbraco.Tests.Cache Assert.IsTrue(isCached); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Collections/DeepCloneableListTests.cs b/src/Umbraco.Tests/Collections/DeepCloneableListTests.cs index d478192e02..37e5b2081d 100644 --- a/src/Umbraco.Tests/Collections/DeepCloneableListTests.cs +++ b/src/Umbraco.Tests/Collections/DeepCloneableListTests.cs @@ -149,7 +149,7 @@ namespace Umbraco.Tests.Collections } /// - /// Serves as the default hash function. + /// Serves as the default hash function. /// /// /// A hash code for the current object. diff --git a/src/Umbraco.Tests/Collections/OrderedHashSetTests.cs b/src/Umbraco.Tests/Collections/OrderedHashSetTests.cs index 6f4b47002e..59542f1b22 100644 --- a/src/Umbraco.Tests/Collections/OrderedHashSetTests.cs +++ b/src/Umbraco.Tests/Collections/OrderedHashSetTests.cs @@ -78,4 +78,4 @@ namespace Umbraco.Tests.Collections } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Configurations/DashboardSettings/DashboardSettingsTests.cs b/src/Umbraco.Tests/Configurations/DashboardSettings/DashboardSettingsTests.cs index d69f474b58..fac8cb5ac9 100644 --- a/src/Umbraco.Tests/Configurations/DashboardSettings/DashboardSettingsTests.cs +++ b/src/Umbraco.Tests/Configurations/DashboardSettings/DashboardSettingsTests.cs @@ -15,7 +15,7 @@ namespace Umbraco.Tests.Configurations.DashboardSettings public void Init() { var config = new FileInfo(TestHelper.MapPathForTest("~/Configurations/DashboardSettings/web.config")); - + var fileMap = new ExeConfigurationFileMap() { ExeConfigFilename = config.FullName }; var configuration = ConfigurationManager.OpenMappedExeConfiguration(fileMap, ConfigurationUserLevel.None); @@ -52,7 +52,7 @@ namespace Umbraco.Tests.Configurations.DashboardSettings [Test] public void Test_Section_Access() { - + Assert.AreEqual(3, SettingsSection.Sections.ElementAt(3).AccessRights.Rules.Count()); Assert.AreEqual("translator", SettingsSection.Sections.ElementAt(3).AccessRights.Rules.ElementAt(0).Value); @@ -93,7 +93,7 @@ namespace Umbraco.Tests.Configurations.DashboardSettings Assert.AreEqual(true, SettingsSection.Sections.ElementAt(0).Tabs.ElementAt(0).Controls.ElementAt(0).ShowOnce); Assert.AreEqual(true, SettingsSection.Sections.ElementAt(0).Tabs.ElementAt(0).Controls.ElementAt(0).AddPanel); Assert.AreEqual("hello", SettingsSection.Sections.ElementAt(0).Tabs.ElementAt(0).Controls.ElementAt(0).PanelCaption); - Assert.AreEqual("views/dashboard/settings/settingsdashboardintro.html", + Assert.AreEqual("views/dashboard/settings/settingsdashboardintro.html", SettingsSection.Sections.ElementAt(0).Tabs.ElementAt(0).Controls.ElementAt(0).ControlPath); Assert.AreEqual(false, SettingsSection.Sections.ElementAt(0).Tabs.ElementAt(0).Controls.ElementAt(1).ShowOnce); @@ -113,4 +113,4 @@ namespace Umbraco.Tests.Configurations.DashboardSettings Assert.AreEqual("writer", SettingsSection.Sections.ElementAt(3).Tabs.ElementAt(0).Controls.ElementAt(1).AccessRights.Rules.ElementAt(1).Value); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Configurations/FileSystemProviderTests.cs b/src/Umbraco.Tests/Configurations/FileSystemProviderTests.cs index bbd584b117..488b35a1d7 100644 --- a/src/Umbraco.Tests/Configurations/FileSystemProviderTests.cs +++ b/src/Umbraco.Tests/Configurations/FileSystemProviderTests.cs @@ -8,7 +8,7 @@ using Umbraco.Core.Configuration.UmbracoSettings; namespace Umbraco.Tests.Configurations { - + [TestFixture] public class FileSystemProviderTests { @@ -22,4 +22,4 @@ namespace Umbraco.Tests.Configurations Assert.That(providerConfig.Parameters.AllKeys.Any(), Is.True); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Configurations/GlobalSettingsTests.cs b/src/Umbraco.Tests/Configurations/GlobalSettingsTests.cs index 191de1218b..6c3d5c6eec 100644 --- a/src/Umbraco.Tests/Configurations/GlobalSettingsTests.cs +++ b/src/Umbraco.Tests/Configurations/GlobalSettingsTests.cs @@ -1,4 +1,4 @@ -using System.Web.Mvc; +using System.Web.Mvc; using System.Web.Routing; using NUnit.Framework; using Umbraco.Core.Configuration; @@ -8,23 +8,23 @@ using Umbraco.Tests.TestHelpers; namespace Umbraco.Tests.Configurations { [TestFixture] - public class GlobalSettingsTests : BaseWebTest - { - public override void SetUp() - { - base.SetUp(); + public class GlobalSettingsTests : BaseWebTest + { + public override void SetUp() + { + base.SetUp(); SettingsForTests.UmbracoPath = "~/umbraco"; - } + } - public override void TearDown() - { + public override void TearDown() + { base.TearDown(); //ensure this is reset - SystemDirectories.Root = null; + SystemDirectories.Root = null; SettingsForTests.UmbracoPath = "~/umbraco"; - } + } [Test] public void Is_Debug_Mode() @@ -44,75 +44,75 @@ namespace Umbraco.Tests.Configurations [TestCase("~/customPath", "/MyVirtualDir/", "custompath")] [TestCase("~/some-wacky/nestedPath", "/MyVirtualDir", "some-wacky-nestedpath")] [TestCase("~/some-wacky/nestedPath", "/MyVirtualDir/NestedVDir/", "some-wacky-nestedpath")] - public void Umbraco_Mvc_Area(string path, string rootPath, string outcome) + public void Umbraco_Mvc_Area(string path, string rootPath, string outcome) { SettingsForTests.UmbracoPath = path; SystemDirectories.Root = rootPath; Assert.AreEqual(outcome, Umbraco.Core.Configuration.GlobalSettings.UmbracoMvcArea); } - [TestCase("/umbraco/umbraco.aspx")] - [TestCase("/umbraco/editContent.aspx")] - [TestCase("/install/default.aspx")] - [TestCase("/install/")] - [TestCase("/install")] - [TestCase("/install/?installStep=asdf")] - [TestCase("/install/test.aspx")] - [TestCase("/config/splashes/booting.aspx")] - public void Is_Reserved_Path_Or_Url(string url) - { - Assert.IsTrue(Umbraco.Core.Configuration.GlobalSettings.IsReservedPathOrUrl(url)); - } + [TestCase("/umbraco/umbraco.aspx")] + [TestCase("/umbraco/editContent.aspx")] + [TestCase("/install/default.aspx")] + [TestCase("/install/")] + [TestCase("/install")] + [TestCase("/install/?installStep=asdf")] + [TestCase("/install/test.aspx")] + [TestCase("/config/splashes/booting.aspx")] + public void Is_Reserved_Path_Or_Url(string url) + { + Assert.IsTrue(Umbraco.Core.Configuration.GlobalSettings.IsReservedPathOrUrl(url)); + } - [TestCase("/umbraco_client/Tree/treeIcons.css")] - [TestCase("/umbraco_client/Tree/Themes/umbraco/style.css")] - [TestCase("/umbraco_client/scrollingmenu/style.css")] - [TestCase("/base/somebasehandler")] - [TestCase("/")] - [TestCase("/home.aspx")] - [TestCase("/umbraco-test")] - [TestCase("/install-test")] - [TestCase("/install.aspx")] - public void Is_Not_Reserved_Path_Or_Url(string url) - { - Assert.IsFalse(Umbraco.Core.Configuration.GlobalSettings.IsReservedPathOrUrl(url)); - } + [TestCase("/umbraco_client/Tree/treeIcons.css")] + [TestCase("/umbraco_client/Tree/Themes/umbraco/style.css")] + [TestCase("/umbraco_client/scrollingmenu/style.css")] + [TestCase("/base/somebasehandler")] + [TestCase("/")] + [TestCase("/home.aspx")] + [TestCase("/umbraco-test")] + [TestCase("/install-test")] + [TestCase("/install.aspx")] + public void Is_Not_Reserved_Path_Or_Url(string url) + { + Assert.IsFalse(Umbraco.Core.Configuration.GlobalSettings.IsReservedPathOrUrl(url)); + } - [TestCase("/Do/Not/match", false)] - [TestCase("/Umbraco/RenderMvcs", false)] - [TestCase("/Umbraco/RenderMvc", true)] - [TestCase("/Umbraco/RenderMvc/Index", true)] - [TestCase("/Umbraco/RenderMvc/Index/1234", true)] - [TestCase("/Umbraco/RenderMvc/Index/1234/9876", false)] - [TestCase("/api", true)] - [TestCase("/api/WebApiTest", true)] - [TestCase("/api/WebApiTest/1234", true)] - [TestCase("/api/WebApiTest/Index/1234", false)] - public void Is_Reserved_By_Route(string url, bool shouldMatch) - { - //reset the app config, we only want to test routes not the hard coded paths - Umbraco.Core.Configuration.GlobalSettings.ReservedPaths = ""; - Umbraco.Core.Configuration.GlobalSettings.ReservedUrls = ""; + [TestCase("/Do/Not/match", false)] + [TestCase("/Umbraco/RenderMvcs", false)] + [TestCase("/Umbraco/RenderMvc", true)] + [TestCase("/Umbraco/RenderMvc/Index", true)] + [TestCase("/Umbraco/RenderMvc/Index/1234", true)] + [TestCase("/Umbraco/RenderMvc/Index/1234/9876", false)] + [TestCase("/api", true)] + [TestCase("/api/WebApiTest", true)] + [TestCase("/api/WebApiTest/1234", true)] + [TestCase("/api/WebApiTest/Index/1234", false)] + public void Is_Reserved_By_Route(string url, bool shouldMatch) + { + //reset the app config, we only want to test routes not the hard coded paths + Umbraco.Core.Configuration.GlobalSettings.ReservedPaths = ""; + Umbraco.Core.Configuration.GlobalSettings.ReservedUrls = ""; - var routes = new RouteCollection(); + var routes = new RouteCollection(); - routes.MapRoute( - "Umbraco_default", - "Umbraco/RenderMvc/{action}/{id}", - new { controller = "RenderMvc", action = "Index", id = UrlParameter.Optional }); - routes.MapRoute( - "WebAPI", - "api/{controller}/{id}", - new { controller = "WebApiTestController", action = "Index", id = UrlParameter.Optional }); + routes.MapRoute( + "Umbraco_default", + "Umbraco/RenderMvc/{action}/{id}", + new { controller = "RenderMvc", action = "Index", id = UrlParameter.Optional }); + routes.MapRoute( + "WebAPI", + "api/{controller}/{id}", + new { controller = "WebApiTestController", action = "Index", id = UrlParameter.Optional }); - var context = new FakeHttpContextFactory(url); - + var context = new FakeHttpContextFactory(url); - Assert.AreEqual( - shouldMatch, - Umbraco.Core.Configuration.GlobalSettings.IsReservedPathOrUrl(url, context.HttpContext, routes)); - } - } -} \ No newline at end of file + + Assert.AreEqual( + shouldMatch, + Umbraco.Core.Configuration.GlobalSettings.IsReservedPathOrUrl(url, context.HttpContext, routes)); + } + } +} diff --git a/src/Umbraco.Tests/Configurations/RepositorySettingsTests.cs b/src/Umbraco.Tests/Configurations/RepositorySettingsTests.cs index c25bd853b5..8291a34fad 100644 --- a/src/Umbraco.Tests/Configurations/RepositorySettingsTests.cs +++ b/src/Umbraco.Tests/Configurations/RepositorySettingsTests.cs @@ -29,4 +29,4 @@ namespace Umbraco.Tests.Configurations Assert.That(strategy.Type, Is.EqualTo("Umbraco.Web.Publishing.PublishingStrategy, Umbraco.Web")); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Configurations/UmbracoSettings/ContentElementDefaultTests.cs b/src/Umbraco.Tests/Configurations/UmbracoSettings/ContentElementDefaultTests.cs index c5e360f846..dadccf6413 100644 --- a/src/Umbraco.Tests/Configurations/UmbracoSettings/ContentElementDefaultTests.cs +++ b/src/Umbraco.Tests/Configurations/UmbracoSettings/ContentElementDefaultTests.cs @@ -35,11 +35,11 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings Assert.IsTrue(SettingsSection.Content.ImageAutoFillProperties.ElementAt(0).LengthFieldAlias == "umbracoBytes"); Assert.IsTrue(SettingsSection.Content.ImageAutoFillProperties.ElementAt(0).ExtensionFieldAlias == "umbracoExtension"); } - + [Test] public override void XmlContentCheckForDiskChanges() { Assert.IsTrue(SettingsSection.Content.XmlContentCheckForDiskChanges == false); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Configurations/UmbracoSettings/ContentElementTests.cs b/src/Umbraco.Tests/Configurations/UmbracoSettings/ContentElementTests.cs index 7e7b65108a..4e7889d319 100644 --- a/src/Umbraco.Tests/Configurations/UmbracoSettings/ContentElementTests.cs +++ b/src/Umbraco.Tests/Configurations/UmbracoSettings/ContentElementTests.cs @@ -40,7 +40,7 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings Assert.IsTrue(SettingsSection.Content.Error404Collection.ElementAt(2).ContentKey == new Guid("8560867F-B88F-4C74-A9A4-679D8E5B3BFC")); Assert.IsTrue(SettingsSection.Content.Error404Collection.ElementAt(2).HasContentKey); Assert.IsFalse(SettingsSection.Content.Error404Collection.ElementAt(2).HasContentId); - } + } [Test] public void ScriptFolderPath() @@ -109,8 +109,8 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings { Assert.IsTrue(SettingsSection.Content.EnsureUniqueNaming == true); } - - + + [Test] public void ForceSafeAliases() { @@ -161,12 +161,12 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings { Assert.IsTrue(SettingsSection.Content.MacroErrorBehaviour == MacroErrorBehaviour.Inline); } - + [Test] public void DisallowedUploadFiles() { Assert.IsTrue(SettingsSection.Content.DisallowedUploadFiles.All(x => "ashx,aspx,ascx,config,cshtml,vbhtml,asmx,air,axd".Split(',').Contains(x))); - } + } [Test] public void AllowedUploadFiles() @@ -177,16 +177,16 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings [Test] [TestCase("png", true)] [TestCase("jpg", true)] - [TestCase("gif", true)] + [TestCase("gif", true)] // TODO: Why does it flip to TestingDefaults=true for these two tests on AppVeyor. WHY? //[TestCase("bmp", false)] //[TestCase("php", false)] [TestCase("ashx", false)] [TestCase("config", false)] public void IsFileAllowedForUpload_WithWhitelist(string extension, bool expected) - { + { // Make really sure that defaults are NOT used - TestingDefaults = false; + TestingDefaults = false; Debug.WriteLine("Extension being tested", extension); Debug.WriteLine("AllowedUploadFiles: {0}", SettingsSection.Content.AllowedUploadFiles); diff --git a/src/Umbraco.Tests/Configurations/UmbracoSettings/DeveloperElementDefaultTests.cs b/src/Umbraco.Tests/Configurations/UmbracoSettings/DeveloperElementDefaultTests.cs index 3ed14b1700..a3f8b79aa1 100644 --- a/src/Umbraco.Tests/Configurations/UmbracoSettings/DeveloperElementDefaultTests.cs +++ b/src/Umbraco.Tests/Configurations/UmbracoSettings/DeveloperElementDefaultTests.cs @@ -10,4 +10,4 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings get { return true; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Configurations/UmbracoSettings/DeveloperElementTests.cs b/src/Umbraco.Tests/Configurations/UmbracoSettings/DeveloperElementTests.cs index 13e9f6fb45..aa79ffd965 100644 --- a/src/Umbraco.Tests/Configurations/UmbracoSettings/DeveloperElementTests.cs +++ b/src/Umbraco.Tests/Configurations/UmbracoSettings/DeveloperElementTests.cs @@ -14,4 +14,4 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings x => "cs,vb".Split(',').Contains(x.Extension))); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Configurations/UmbracoSettings/DistributedCallElementDefaultTests.cs b/src/Umbraco.Tests/Configurations/UmbracoSettings/DistributedCallElementDefaultTests.cs index 1d8a8726cf..2c3a843af6 100644 --- a/src/Umbraco.Tests/Configurations/UmbracoSettings/DistributedCallElementDefaultTests.cs +++ b/src/Umbraco.Tests/Configurations/UmbracoSettings/DistributedCallElementDefaultTests.cs @@ -24,4 +24,4 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings Assert.IsTrue(SettingsSection.DistributedCall.Servers.Any() == false); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Configurations/UmbracoSettings/DistributedCallElementTests.cs b/src/Umbraco.Tests/Configurations/UmbracoSettings/DistributedCallElementTests.cs index 61165b077b..c7796a3b0a 100644 --- a/src/Umbraco.Tests/Configurations/UmbracoSettings/DistributedCallElementTests.cs +++ b/src/Umbraco.Tests/Configurations/UmbracoSettings/DistributedCallElementTests.cs @@ -10,7 +10,7 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings public virtual void Enabled() { Assert.IsTrue(SettingsSection.DistributedCall.Enabled == true); - + } [Test] public void UserId() @@ -29,4 +29,4 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Configurations/UmbracoSettings/LoggingElementDefaultTests.cs b/src/Umbraco.Tests/Configurations/UmbracoSettings/LoggingElementDefaultTests.cs index 1df309bb06..b78d0923cc 100644 --- a/src/Umbraco.Tests/Configurations/UmbracoSettings/LoggingElementDefaultTests.cs +++ b/src/Umbraco.Tests/Configurations/UmbracoSettings/LoggingElementDefaultTests.cs @@ -10,7 +10,7 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings { get { return true; } } - + [Test] public override void DisabledLogTypes() { @@ -27,4 +27,4 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings Assert.IsTrue(SettingsSection.Logging.MaxLogAge == -1); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Configurations/UmbracoSettings/LoggingElementTests.cs b/src/Umbraco.Tests/Configurations/UmbracoSettings/LoggingElementTests.cs index f9cf97a911..3cc159a0ca 100644 --- a/src/Umbraco.Tests/Configurations/UmbracoSettings/LoggingElementTests.cs +++ b/src/Umbraco.Tests/Configurations/UmbracoSettings/LoggingElementTests.cs @@ -11,7 +11,7 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings { Assert.IsTrue(SettingsSection.Logging.EnableLogging == true); } - + [Test] public virtual void DisabledLogTypes() { @@ -19,7 +19,7 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings Assert.IsTrue(SettingsSection.Logging.DisabledLogTypes.ElementAt(0).LogTypeAlias == "[alias-of-log-type-in-lowercase]"); Assert.IsTrue(SettingsSection.Logging.DisabledLogTypes.ElementAt(1).LogTypeAlias == "anotherlogalias"); } - + [Test] public void AutoCleanLogs() { @@ -40,4 +40,4 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Configurations/UmbracoSettings/PackageRepositoriesElementDefaultTests.cs b/src/Umbraco.Tests/Configurations/UmbracoSettings/PackageRepositoriesElementDefaultTests.cs index b10a35f5f4..4a96957e2f 100644 --- a/src/Umbraco.Tests/Configurations/UmbracoSettings/PackageRepositoriesElementDefaultTests.cs +++ b/src/Umbraco.Tests/Configurations/UmbracoSettings/PackageRepositoriesElementDefaultTests.cs @@ -20,4 +20,4 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings Assert.IsTrue(SettingsSection.PackageRepositories.Repositories.ElementAt(0).Name == "Umbraco package Repository"); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Configurations/UmbracoSettings/PackageRepositoriesElementTests.cs b/src/Umbraco.Tests/Configurations/UmbracoSettings/PackageRepositoriesElementTests.cs index cb82978c72..6b5d0e2d48 100644 --- a/src/Umbraco.Tests/Configurations/UmbracoSettings/PackageRepositoriesElementTests.cs +++ b/src/Umbraco.Tests/Configurations/UmbracoSettings/PackageRepositoriesElementTests.cs @@ -16,7 +16,7 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings Assert.IsTrue(SettingsSection.PackageRepositories.Repositories.ElementAt(0).HasCustomWebServiceUrl == false); Assert.IsTrue(SettingsSection.PackageRepositories.Repositories.ElementAt(0).WebServiceUrl == "/umbraco/webservices/api/repository.asmx"); Assert.IsTrue(SettingsSection.PackageRepositories.Repositories.ElementAt(0).RepositoryUrl == "http://packages.umbraco.org"); - + Assert.IsTrue(SettingsSection.PackageRepositories.Repositories.ElementAt(1).Id == Guid.Parse("163245E0-CD22-44B6-841A-1B9B9D2E955F")); Assert.IsTrue(SettingsSection.PackageRepositories.Repositories.ElementAt(1).Name == "Test Repo"); Assert.IsTrue(SettingsSection.PackageRepositories.Repositories.ElementAt(1).HasCustomWebServiceUrl == false); @@ -24,4 +24,4 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings Assert.IsTrue(SettingsSection.PackageRepositories.Repositories.ElementAt(0).RepositoryUrl == "http://packages.umbraco.org"); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Configurations/UmbracoSettings/ProvidersElementDefaultTests.cs b/src/Umbraco.Tests/Configurations/UmbracoSettings/ProvidersElementDefaultTests.cs index f85ae7af0c..8b9c48d20f 100644 --- a/src/Umbraco.Tests/Configurations/UmbracoSettings/ProvidersElementDefaultTests.cs +++ b/src/Umbraco.Tests/Configurations/UmbracoSettings/ProvidersElementDefaultTests.cs @@ -11,4 +11,4 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Configurations/UmbracoSettings/ProvidersElementTests.cs b/src/Umbraco.Tests/Configurations/UmbracoSettings/ProvidersElementTests.cs index 0ac4bd0e54..7db522950f 100644 --- a/src/Umbraco.Tests/Configurations/UmbracoSettings/ProvidersElementTests.cs +++ b/src/Umbraco.Tests/Configurations/UmbracoSettings/ProvidersElementTests.cs @@ -12,4 +12,4 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings Assert.IsTrue(SettingsSection.Providers.DefaultBackOfficeUserProvider == "UsersMembershipProvider"); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Configurations/UmbracoSettings/RequestHandlerElementDefaultTests.cs b/src/Umbraco.Tests/Configurations/UmbracoSettings/RequestHandlerElementDefaultTests.cs index 92f1cc4957..e6d4a07650 100644 --- a/src/Umbraco.Tests/Configurations/UmbracoSettings/RequestHandlerElementDefaultTests.cs +++ b/src/Umbraco.Tests/Configurations/UmbracoSettings/RequestHandlerElementDefaultTests.cs @@ -10,4 +10,4 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings get { return true; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Configurations/UmbracoSettings/RequestHandlerElementTests.cs b/src/Umbraco.Tests/Configurations/UmbracoSettings/RequestHandlerElementTests.cs index f3a52e7cf3..343140d2da 100644 --- a/src/Umbraco.Tests/Configurations/UmbracoSettings/RequestHandlerElementTests.cs +++ b/src/Umbraco.Tests/Configurations/UmbracoSettings/RequestHandlerElementTests.cs @@ -11,22 +11,22 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings public void UseDomainPrefixes() { Assert.IsTrue(SettingsSection.RequestHandler.UseDomainPrefixes == false); - + } [Test] public void AddTrailingSlash() { - Assert.IsTrue(SettingsSection.RequestHandler.AddTrailingSlash == true); + Assert.IsTrue(SettingsSection.RequestHandler.AddTrailingSlash == true); } [Test] public void RemoveDoubleDashes() { Assert.IsTrue(SettingsSection.RequestHandler.RemoveDoubleDashes == true); - + } [Test] public void CharCollection() - { + { var chars = @" ,"",',%,.,;,/,\,:,#,+,*,&,?,æ,ø,å,ä,ö,ü,ß,Ä,Ö,|,<,>"; var items = chars.Split(','); Assert.AreEqual(items.Length, SettingsSection.RequestHandler.CharCollection.Count()); @@ -39,6 +39,6 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings Assert.IsTrue(SettingsSection.RequestHandler.CharCollection .All(x => string.IsNullOrEmpty(x.Replacement) || vals.Split(',').Contains(x.Replacement))); } - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Configurations/UmbracoSettings/ScheduledTasksElementDefaultTests.cs b/src/Umbraco.Tests/Configurations/UmbracoSettings/ScheduledTasksElementDefaultTests.cs index 5b9343e6f8..5112b7f652 100644 --- a/src/Umbraco.Tests/Configurations/UmbracoSettings/ScheduledTasksElementDefaultTests.cs +++ b/src/Umbraco.Tests/Configurations/UmbracoSettings/ScheduledTasksElementDefaultTests.cs @@ -17,4 +17,4 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings Assert.IsTrue(SettingsSection.ScheduledTasks.Tasks.Any() == false); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Configurations/UmbracoSettings/ScheduledTasksElementTests.cs b/src/Umbraco.Tests/Configurations/UmbracoSettings/ScheduledTasksElementTests.cs index a44485fdcf..7b404a8e6d 100644 --- a/src/Umbraco.Tests/Configurations/UmbracoSettings/ScheduledTasksElementTests.cs +++ b/src/Umbraco.Tests/Configurations/UmbracoSettings/ScheduledTasksElementTests.cs @@ -21,4 +21,4 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Configurations/UmbracoSettings/SecurityElementDefaultTests.cs b/src/Umbraco.Tests/Configurations/UmbracoSettings/SecurityElementDefaultTests.cs index 787ff5d19b..a5711dca9b 100644 --- a/src/Umbraco.Tests/Configurations/UmbracoSettings/SecurityElementDefaultTests.cs +++ b/src/Umbraco.Tests/Configurations/UmbracoSettings/SecurityElementDefaultTests.cs @@ -10,4 +10,4 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings get { return true; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Configurations/UmbracoSettings/SecurityElementTests.cs b/src/Umbraco.Tests/Configurations/UmbracoSettings/SecurityElementTests.cs index 58a9a438a2..d419d9d320 100644 --- a/src/Umbraco.Tests/Configurations/UmbracoSettings/SecurityElementTests.cs +++ b/src/Umbraco.Tests/Configurations/UmbracoSettings/SecurityElementTests.cs @@ -36,4 +36,4 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings Assert.IsTrue(SettingsSection.Security.AuthCookieName == Constants.Web.AuthCookieName); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Configurations/UmbracoSettings/TemplateElementDefaultTests.cs b/src/Umbraco.Tests/Configurations/UmbracoSettings/TemplateElementDefaultTests.cs index 918437f3d5..42ad1b3c5f 100644 --- a/src/Umbraco.Tests/Configurations/UmbracoSettings/TemplateElementDefaultTests.cs +++ b/src/Umbraco.Tests/Configurations/UmbracoSettings/TemplateElementDefaultTests.cs @@ -10,4 +10,4 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings get { return true; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Configurations/UmbracoSettings/TemplateElementTests.cs b/src/Umbraco.Tests/Configurations/UmbracoSettings/TemplateElementTests.cs index 09c6d85fd3..bfc8f72c6f 100644 --- a/src/Umbraco.Tests/Configurations/UmbracoSettings/TemplateElementTests.cs +++ b/src/Umbraco.Tests/Configurations/UmbracoSettings/TemplateElementTests.cs @@ -18,13 +18,13 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings } [Test] public void DefaultRenderingEngine() - { + { Assert.IsTrue(SettingsSection.Templates.DefaultRenderingEngine == RenderingEngine.Mvc); } [Test] public void EnableTemplateFolders() - { + { Assert.IsTrue(SettingsSection.Templates.EnableTemplateFolders == false); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Configurations/UmbracoSettings/UmbracoSettingsTests.cs b/src/Umbraco.Tests/Configurations/UmbracoSettings/UmbracoSettingsTests.cs index 01768dd903..4facaac2b3 100644 --- a/src/Umbraco.Tests/Configurations/UmbracoSettings/UmbracoSettingsTests.cs +++ b/src/Umbraco.Tests/Configurations/UmbracoSettings/UmbracoSettingsTests.cs @@ -17,7 +17,7 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings var config = new FileInfo(TestHelper.MapPathForTest("~/Configurations/UmbracoSettings/web.config")); var fileMap = new ExeConfigurationFileMap() { ExeConfigFilename = config.FullName }; - var configuration = ConfigurationManager.OpenMappedExeConfiguration(fileMap, ConfigurationUserLevel.None); + var configuration = ConfigurationManager.OpenMappedExeConfiguration(fileMap, ConfigurationUserLevel.None); Debug.WriteLine("Testing defaults? {0}", TestingDefaults); if (TestingDefaults) @@ -34,4 +34,4 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings protected IUmbracoSettingsSection SettingsSection { get; private set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Configurations/UmbracoSettings/WebRoutingElementDefaultTests.cs b/src/Umbraco.Tests/Configurations/UmbracoSettings/WebRoutingElementDefaultTests.cs index 1e568c608e..a6b6cc006e 100644 --- a/src/Umbraco.Tests/Configurations/UmbracoSettings/WebRoutingElementDefaultTests.cs +++ b/src/Umbraco.Tests/Configurations/UmbracoSettings/WebRoutingElementDefaultTests.cs @@ -35,4 +35,4 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings Assert.IsTrue(SettingsSection.WebRouting.DisableRedirectUrlTracking == false); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Configurations/UmbracoSettings/WebRoutingElementTests.cs b/src/Umbraco.Tests/Configurations/UmbracoSettings/WebRoutingElementTests.cs index fbade43b74..ab71713db4 100644 --- a/src/Umbraco.Tests/Configurations/UmbracoSettings/WebRoutingElementTests.cs +++ b/src/Umbraco.Tests/Configurations/UmbracoSettings/WebRoutingElementTests.cs @@ -23,4 +23,4 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings Assert.IsTrue(SettingsSection.WebRouting.UrlProviderMode == "AutoLegacy"); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/CoreThings/DelegateExtensionsTests.cs b/src/Umbraco.Tests/CoreThings/DelegateExtensionsTests.cs index d7177f3e5a..87b2f4c03b 100644 --- a/src/Umbraco.Tests/CoreThings/DelegateExtensionsTests.cs +++ b/src/Umbraco.Tests/CoreThings/DelegateExtensionsTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using Lucene.Net.Index; using NUnit.Framework; using Umbraco.Core; @@ -35,4 +35,4 @@ namespace Umbraco.Tests.CoreThings Assert.AreEqual(2, totalTries); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/CoreThings/EnumerableExtensionsTests.cs b/src/Umbraco.Tests/CoreThings/EnumerableExtensionsTests.cs index e9acf7e257..7d7dcaea71 100644 --- a/src/Umbraco.Tests/CoreThings/EnumerableExtensionsTests.cs +++ b/src/Umbraco.Tests/CoreThings/EnumerableExtensionsTests.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using NUnit.Framework; using Umbraco.Core; @@ -68,53 +68,53 @@ namespace Umbraco.Tests.CoreThings { Children = new List { - new TestItem("1.1") - { - Children = new List - { - new TestItem("1.1.1") - { - Children = new List - { - new TestItem("1.1.1.1") - { - Children = new List - { - new TestItem("1.1.1.1.1"), + new TestItem("1.1") + { + Children = new List + { + new TestItem("1.1.1") + { + Children = new List + { + new TestItem("1.1.1.1") + { + Children = new List + { + new TestItem("1.1.1.1.1"), new TestItem("1.1.1.1.2") - } - } - } - } - } - }, - new TestItem("1.2") - { - Children = new List - { - new TestItem("1.2.1") - { - Children = new List - { - new TestItem("1.2.1.1") - { - Children = new List() - } - } - }, - new TestItem("1.2.2") - { - Children = new List - { - new TestItem("1.2.2.1") - { - Children = new List() - } - } - } - } - } - } + } + } + } + } + } + }, + new TestItem("1.2") + { + Children = new List + { + new TestItem("1.2.1") + { + Children = new List + { + new TestItem("1.2.1.1") + { + Children = new List() + } + } + }, + new TestItem("1.2.2") + { + Children = new List + { + new TestItem("1.2.2.1") + { + Children = new List() + } + } + } + } + } + } }; #pragma warning disable CS0618 // Type or member is obsolete @@ -141,7 +141,7 @@ namespace Umbraco.Tests.CoreThings public IEnumerable Children { get; set; } } - [Test] + [Test] public void InGroupsOf_ReturnsAllElements() { var integers = new[] { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; @@ -198,4 +198,4 @@ namespace Umbraco.Tests.CoreThings Assert.AreEqual(iteratorSource.Count(), iteratorSource.ToList().Count()); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/CoreThings/ObjectExtensionsTests.cs b/src/Umbraco.Tests/CoreThings/ObjectExtensionsTests.cs index 403dd421ad..5fdf4529ce 100644 --- a/src/Umbraco.Tests/CoreThings/ObjectExtensionsTests.cs +++ b/src/Umbraco.Tests/CoreThings/ObjectExtensionsTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Globalization; using System.Linq; @@ -9,9 +9,9 @@ using Umbraco.Core; namespace Umbraco.Tests.CoreThings { - [TestFixture] - public class ObjectExtensionsTests - { + [TestFixture] + public class ObjectExtensionsTests + { private CultureInfo _savedCulture; [SetUp] @@ -41,76 +41,76 @@ namespace Umbraco.Tests.CoreThings Assert.AreEqual(unit, result2.Result); } - [Test] - public void Can_Convert_List_To_Enumerable() - { - var list = new List {"hello", "world", "awesome"}; - var result = list.TryConvertTo>(); - Assert.IsTrue(result.Success); + [Test] + public void Can_Convert_List_To_Enumerable() + { + var list = new List {"hello", "world", "awesome"}; + var result = list.TryConvertTo>(); + Assert.IsTrue(result.Success); Assert.AreEqual(3, result.Result.Count()); - } + } - [Test] - public void ObjectExtensions_Object_To_Dictionary() - { - //Arrange + [Test] + public void ObjectExtensions_Object_To_Dictionary() + { + //Arrange - var obj = new { Key1 = "value1", Key2 = "value2", Key3 = "value3" }; + var obj = new { Key1 = "value1", Key2 = "value2", Key3 = "value3" }; - //Act + //Act - var d = obj.ToDictionary(); + var d = obj.ToDictionary(); - //Assert + //Assert - Assert.IsTrue(d.Keys.Contains("Key1")); - Assert.IsTrue(d.Keys.Contains("Key2")); - Assert.IsTrue(d.Keys.Contains("Key3")); - Assert.AreEqual(d["Key1"], "value1"); - Assert.AreEqual(d["Key2"], "value2"); - Assert.AreEqual(d["Key3"], "value3"); - } + Assert.IsTrue(d.Keys.Contains("Key1")); + Assert.IsTrue(d.Keys.Contains("Key2")); + Assert.IsTrue(d.Keys.Contains("Key3")); + Assert.AreEqual(d["Key1"], "value1"); + Assert.AreEqual(d["Key2"], "value2"); + Assert.AreEqual(d["Key3"], "value3"); + } - [Test] - public void CanConvertIntToNullableInt() - { - var i = 1; - var result = i.TryConvertTo(); - Assert.That(result.Success, Is.True); - } + [Test] + public void CanConvertIntToNullableInt() + { + var i = 1; + var result = i.TryConvertTo(); + Assert.That(result.Success, Is.True); + } - [Test] - public void CanConvertNullableIntToInt() - { - int? i = 1; - var result = i.TryConvertTo(); - Assert.That(result.Success, Is.True); - } + [Test] + public void CanConvertNullableIntToInt() + { + int? i = 1; + var result = i.TryConvertTo(); + Assert.That(result.Success, Is.True); + } - [Test] - public virtual void CanConvertStringToBool() - { - var testCases = new Dictionary - { - {"TRUE", true}, - {"True", true}, - {"true", true}, - {"1", true}, - {"FALSE", false}, - {"False", false}, - {"false", false}, - {"0", false}, - {"", false} - }; + [Test] + public virtual void CanConvertStringToBool() + { + var testCases = new Dictionary + { + {"TRUE", true}, + {"True", true}, + {"true", true}, + {"1", true}, + {"FALSE", false}, + {"False", false}, + {"false", false}, + {"0", false}, + {"", false} + }; - foreach (var testCase in testCases) - { - var result = testCase.Key.TryConvertTo(); + foreach (var testCase in testCases) + { + var result = testCase.Key.TryConvertTo(); - Assert.IsTrue(result.Success, testCase.Key); - Assert.AreEqual(testCase.Value, result.Result, testCase.Key); - } - } + Assert.IsTrue(result.Success, testCase.Key); + Assert.AreEqual(testCase.Value, result.Result, testCase.Key); + } + } [TestCase("2012-11-10", true)] [TestCase("2012/11/10", true)] @@ -122,15 +122,15 @@ namespace Umbraco.Tests.CoreThings [TestCase("Saturday 10, November 2012", true)] [TestCase("2012-11-10 13:14:15", true)] [TestCase("2012-11-10T13:14:15Z", true)] - public virtual void CanConvertStringToDateTime(string date, bool outcome) - { - var dateTime = new DateTime(2012, 11, 10, 13, 14, 15); + public virtual void CanConvertStringToDateTime(string date, bool outcome) + { + var dateTime = new DateTime(2012, 11, 10, 13, 14, 15); var result = date.TryConvertTo(); Assert.IsTrue(result.Success, date); Assert.AreEqual(DateTime.Equals(dateTime.Date, result.Result.Date), outcome, date); - } + } [Test] public virtual void CanConvertBlankStringToNullDateTime() @@ -148,32 +148,32 @@ namespace Umbraco.Tests.CoreThings Assert.IsNull(result.Result); } - [Test] - public virtual void CanConvertBlankStringToDateTime() - { - var result = "".TryConvertTo(); - Assert.IsTrue(result.Success); - Assert.AreEqual(DateTime.MinValue, result.Result); - } + [Test] + public virtual void CanConvertBlankStringToDateTime() + { + var result = "".TryConvertTo(); + Assert.IsTrue(result.Success); + Assert.AreEqual(DateTime.MinValue, result.Result); + } - [Test] - public virtual void CanConvertObjectToString_Using_ToString_Overload() - { - var result = new MyTestObject().TryConvertTo(); + [Test] + public virtual void CanConvertObjectToString_Using_ToString_Overload() + { + var result = new MyTestObject().TryConvertTo(); - Assert.IsTrue(result.Success); - Assert.AreEqual("Hello world", result.Result); - } + Assert.IsTrue(result.Success); + Assert.AreEqual("Hello world", result.Result); + } - [Test] + [Test] public virtual void CanConvertObjectToSameObject() { var obj = new MyTestObject(); var result = obj.TryConvertTo(); - Assert.AreEqual(obj, result.Result); + Assert.AreEqual(obj, result.Result); } - + private class MyTestObject { public override string ToString() @@ -181,5 +181,5 @@ namespace Umbraco.Tests.CoreThings return "Hello world"; } } - } -} \ No newline at end of file + } +} diff --git a/src/Umbraco.Tests/CoreThings/UdiTests.cs b/src/Umbraco.Tests/CoreThings/UdiTests.cs index debb7faaf9..60ac41e87b 100644 --- a/src/Umbraco.Tests/CoreThings/UdiTests.cs +++ b/src/Umbraco.Tests/CoreThings/UdiTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using LightInject; using Moq; @@ -200,4 +200,4 @@ namespace Umbraco.Tests.CoreThings Assert.AreEqual(Constants.DeploySelector.ChildrenOfThis, drange.Selector); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/CoreThings/UriExtensionsTests.cs b/src/Umbraco.Tests/CoreThings/UriExtensionsTests.cs index 2d97faca81..ab10be1a65 100644 --- a/src/Umbraco.Tests/CoreThings/UriExtensionsTests.cs +++ b/src/Umbraco.Tests/CoreThings/UriExtensionsTests.cs @@ -44,7 +44,7 @@ namespace Umbraco.Tests.CoreThings [TestCase("http://www.domain.com/MyVdir/Umbraco/", "myvdir", true)] [TestCase("http://www.domain.com/MyVdir/Umbraco/restServices/blah", "/myvdir", true)] [TestCase("http://www.domain.com/umbraco/webservices/legacyAjaxCalls.asmx/js", "", true)] - [TestCase("http://www.domain.com/umbraco/test/legacyAjaxCalls.ashx?some=query&blah=js", "", true)] + [TestCase("http://www.domain.com/umbraco/test/legacyAjaxCalls.ashx?some=query&blah=js", "", true)] public void Is_Back_Office_Request(string input, string virtualPath, bool expected) { SystemDirectories.Root = virtualPath; diff --git a/src/Umbraco.Tests/CoreThings/VersionExtensionTests.cs b/src/Umbraco.Tests/CoreThings/VersionExtensionTests.cs index 2f90c3da2e..5799e28b87 100644 --- a/src/Umbraco.Tests/CoreThings/VersionExtensionTests.cs +++ b/src/Umbraco.Tests/CoreThings/VersionExtensionTests.cs @@ -10,7 +10,7 @@ namespace Umbraco.Tests.CoreThings [TestCase(1, 0, 0, 0, "0.2147483647.2147483647.2147483647")] [TestCase(1, 1, 0, 0, "1.0.2147483647.2147483647")] [TestCase(1, 1, 1, 0, "1.1.0.2147483647")] - [TestCase(1, 1, 1, 1, "1.1.1.0")] + [TestCase(1, 1, 1, 1, "1.1.1.0")] [TestCase(0, 1, 0, 0, "0.0.2147483647.2147483647")] [TestCase(0, 1, 1, 0, "0.1.0.2147483647")] [TestCase(0, 1, 1, 1, "0.1.1.0")] @@ -27,4 +27,4 @@ namespace Umbraco.Tests.CoreThings Assert.AreEqual(new Version(outcome), result); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/CoreThings/XmlExtensionsTests.cs b/src/Umbraco.Tests/CoreThings/XmlExtensionsTests.cs index b5b1368eb1..42d8f92a5d 100644 --- a/src/Umbraco.Tests/CoreThings/XmlExtensionsTests.cs +++ b/src/Umbraco.Tests/CoreThings/XmlExtensionsTests.cs @@ -45,4 +45,4 @@ namespace Umbraco.Tests.CoreThings Assert.AreEqual(xml, xdoc.OuterXml); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/CoreXml/FrameworkXmlTests.cs b/src/Umbraco.Tests/CoreXml/FrameworkXmlTests.cs index a7cb581eed..e2aedf5d2b 100644 --- a/src/Umbraco.Tests/CoreXml/FrameworkXmlTests.cs +++ b/src/Umbraco.Tests/CoreXml/FrameworkXmlTests.cs @@ -38,7 +38,7 @@ namespace Umbraco.Tests.CoreXml [Test] public void ImportNodeClonesImportedNode() { - var doc1 = new XmlDocument(); + var doc1 = new XmlDocument(); doc1.LoadXml(Xml1); var node1 = doc1.SelectSingleNode("//item2"); diff --git a/src/Umbraco.Tests/CoreXml/NavigableNavigatorTests.cs b/src/Umbraco.Tests/CoreXml/NavigableNavigatorTests.cs index 02dbe558cb..149c28bbde 100644 --- a/src/Umbraco.Tests/CoreXml/NavigableNavigatorTests.cs +++ b/src/Umbraco.Tests/CoreXml/NavigableNavigatorTests.cs @@ -495,7 +495,7 @@ namespace Umbraco.Tests.CoreXml { var source = new TestSource5(); var nav = new NavigableNavigator(source); - + var iter = nav.Select("//* [@id=$id]", new XPathVariable("id", id.ToString(CultureInfo.InvariantCulture))); Assert.IsTrue(iter.MoveNext()); var current = iter.Current as NavigableNavigator; @@ -721,27 +721,27 @@ namespace Umbraco.Tests.CoreXml version=""1.0"" xmlns:xsl=""http://www.w3.org/1999/XSL/Transform"" xmlns:msxml=""urn:schemas-microsoft-com:xslt"" - xmlns:umbraco.library=""urn:umbraco.library"" xmlns:Exslt.ExsltCommon=""urn:Exslt.ExsltCommon"" xmlns:Exslt.ExsltDatesAndTimes=""urn:Exslt.ExsltDatesAndTimes"" xmlns:Exslt.ExsltMath=""urn:Exslt.ExsltMath"" xmlns:Exslt.ExsltRegularExpressions=""urn:Exslt.ExsltRegularExpressions"" xmlns:Exslt.ExsltStrings=""urn:Exslt.ExsltStrings"" xmlns:Exslt.ExsltSets=""urn:Exslt.ExsltSets"" xmlns:Examine=""urn:Examine"" - exclude-result-prefixes=""msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets Examine ""> + xmlns:umbraco.library=""urn:umbraco.library"" xmlns:Exslt.ExsltCommon=""urn:Exslt.ExsltCommon"" xmlns:Exslt.ExsltDatesAndTimes=""urn:Exslt.ExsltDatesAndTimes"" xmlns:Exslt.ExsltMath=""urn:Exslt.ExsltMath"" xmlns:Exslt.ExsltRegularExpressions=""urn:Exslt.ExsltRegularExpressions"" xmlns:Exslt.ExsltStrings=""urn:Exslt.ExsltStrings"" xmlns:Exslt.ExsltSets=""urn:Exslt.ExsltSets"" xmlns:Examine=""urn:Examine"" + exclude-result-prefixes=""msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets Examine ""> - + ! - + !! - + !!! - - - + + + @@ -782,7 +782,7 @@ namespace Umbraco.Tests.CoreXml var x = new XmlDocument(); x.LoadXml(xml); - + macro = new MacroNavigator(new[] { // it even fails like that => macro nav. issue? @@ -829,10 +829,10 @@ namespace Umbraco.Tests.CoreXml - + ooo - ooo + ooo @@ -857,7 +857,7 @@ namespace Umbraco.Tests.CoreXml ooo - ooo + ooo @@ -975,11 +975,11 @@ namespace Umbraco.Tests.CoreXml // null => return null if (value == null) return null; - // attribute => return string value + // attribute => return string value if (isAttr) return value.ToString(); - - // has a converter => use the converter - if (fieldType.XmlStringConverter != null) + + // has a converter => use the converter + if (fieldType.XmlStringConverter != null) return fieldType.XmlStringConverter(value); // not a string => return value as a string @@ -1103,7 +1103,7 @@ namespace Umbraco.Tests.CoreXml Content[2] = new TestContent(type1, 2, 1).WithValues("2:p1", "2:p2", "2:p3"); Root = new TestRootContent(type).WithChildren(1); - } + } } class TestSource4 : TestSourceBase @@ -1166,13 +1166,13 @@ namespace Umbraco.Tests.CoreXml // // // - + public TestSource6() { LastAttributeIndex = -1; var type = new TestRootContentType(this); - var type1 = type.CreateType("wrap", + var type1 = type.CreateType("wrap", new TestPropertyType("item1"), new TestPropertyType("item2"), new TestPropertyType("item2a"), @@ -1187,11 +1187,11 @@ namespace Umbraco.Tests.CoreXml Content[1] = new TestContent(type1, 1, -1) .WithValues( null, - null, - null, - null, - "\n ", - "blah", + null, + null, + null, + "\n ", + "blah", "\n blah\n ", "bam", "\n " @@ -1246,4 +1246,4 @@ namespace Umbraco.Tests.CoreXml } #endregion -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/DependencyInjection/ActionCollectionTests.cs b/src/Umbraco.Tests/DependencyInjection/ActionCollectionTests.cs index 3870750528..6ecc740c06 100644 --- a/src/Umbraco.Tests/DependencyInjection/ActionCollectionTests.cs +++ b/src/Umbraco.Tests/DependencyInjection/ActionCollectionTests.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; using NUnit.Framework; using Umbraco.Web; using Umbraco.Web.UI.Pages; @@ -15,13 +15,13 @@ namespace Umbraco.Tests.DI // which should be ensured by PlugingManagerTests anyway, so this is useless? // maybe not as it seems to handle the "instance" thing... so we test that we respect the singleton? [Test] - public void FindAllActions() + public void FindAllActions() { var collectionBuilder = new ActionCollectionBuilder(); collectionBuilder.SetProducer(() => TypeLoader.ResolveActions()); var actions = collectionBuilder.CreateCollection(); - Assert.AreEqual(2, actions.Count()); + Assert.AreEqual(2, actions.Count()); // order is unspecified, but both must be there var hasAction1 = actions.ElementAt(0) is SingletonAction || actions.ElementAt(1) is SingletonAction; @@ -35,138 +35,138 @@ namespace Umbraco.Tests.DI Assert.AreSame(SingletonAction.Instance, action); } - #region Classes for tests + #region Classes for tests - public class SingletonAction : IAction - { - //create singleton - private static readonly SingletonAction instance = new SingletonAction(); + public class SingletonAction : IAction + { + //create singleton + private static readonly SingletonAction instance = new SingletonAction(); - public static SingletonAction Instance - { - get { return instance; } - } + public static SingletonAction Instance + { + get { return instance; } + } - #region IAction Members + #region IAction Members - public char Letter - { - get - { - return 'I'; - } - } + public char Letter + { + get + { + return 'I'; + } + } - public string JsFunctionName - { - get - { - return string.Format("{0}.actionAssignDomain()", ClientTools.Scripts.GetAppActions); - } - } + public string JsFunctionName + { + get + { + return string.Format("{0}.actionAssignDomain()", ClientTools.Scripts.GetAppActions); + } + } - public string JsSource - { - get - { - return null; - } - } + public string JsSource + { + get + { + return null; + } + } - public string Alias - { - get - { - return "assignDomain"; - } - } + public string Alias + { + get + { + return "assignDomain"; + } + } - public string Icon - { - get - { - return ".sprDomain"; - } - } + public string Icon + { + get + { + return ".sprDomain"; + } + } - public bool ShowInNotifier - { - get - { - return false; - } - } - public bool CanBePermissionAssigned - { - get - { - return true; - } - } - #endregion - } + public bool ShowInNotifier + { + get + { + return false; + } + } + public bool CanBePermissionAssigned + { + get + { + return true; + } + } + #endregion + } - public class NonSingletonAction : IAction - { - #region IAction Members + public class NonSingletonAction : IAction + { + #region IAction Members - public char Letter - { - get - { - return 'Q'; - } - } + public char Letter + { + get + { + return 'Q'; + } + } - public string JsFunctionName - { - get - { - return string.Format("{0}.actionAssignDomain()", ClientTools.Scripts.GetAppActions); - } - } + public string JsFunctionName + { + get + { + return string.Format("{0}.actionAssignDomain()", ClientTools.Scripts.GetAppActions); + } + } - public string JsSource - { - get - { - return null; - } - } + public string JsSource + { + get + { + return null; + } + } - public string Alias - { - get - { - return "asfasdf"; - } - } + public string Alias + { + get + { + return "asfasdf"; + } + } - public string Icon - { - get - { - return ".sprDomain"; - } - } + public string Icon + { + get + { + return ".sprDomain"; + } + } - public bool ShowInNotifier - { - get - { - return false; - } - } - public bool CanBePermissionAssigned - { - get - { - return true; - } - } - #endregion - } + public bool ShowInNotifier + { + get + { + return false; + } + } + public bool CanBePermissionAssigned + { + get + { + return true; + } + } + #endregion + } - #endregion - } -} \ No newline at end of file + #endregion + } +} diff --git a/src/Umbraco.Tests/DependencyInjection/LazyCollectionBuilderTests.cs b/src/Umbraco.Tests/DependencyInjection/LazyCollectionBuilderTests.cs index 9fba1e9e39..cf1ebbabaa 100644 --- a/src/Umbraco.Tests/DependencyInjection/LazyCollectionBuilderTests.cs +++ b/src/Umbraco.Tests/DependencyInjection/LazyCollectionBuilderTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using LightInject; @@ -8,20 +8,20 @@ using Umbraco.Core.Composing; namespace Umbraco.Tests.DI { - [TestFixture] - public class LazyCollectionBuilderTests - { - [SetUp] - public void Initialize() - { + [TestFixture] + public class LazyCollectionBuilderTests + { + [SetUp] + public void Initialize() + { Current.Reset(); } [TearDown] - public void TearDown() - { - Current.Reset(); - } + public void TearDown() + { + Current.Reset(); + } // note // lazy collection builder does not throw on duplicate, just uses distinct types @@ -98,9 +98,9 @@ namespace Umbraco.Tests.DI Assert.IsFalse(values.Contains(o1)); // transient } - [Test] - public void LazyCollectionBuilderThrows() - { + [Test] + public void LazyCollectionBuilderThrows() + { var container = new ServiceContainer(); container.ConfigureUmbracoCore(); @@ -113,12 +113,12 @@ namespace Umbraco.Tests.DI // legal so far... .Add(() => new[] { typeof(TransientObject4) }); - Assert.Throws(() => - { + Assert.Throws(() => + { // but throws here when trying to register the types - var values = container.GetInstance(); - }); - } + var values = container.GetInstance(); + }); + } [Test] public void LazyCollectionBuilderExclude() @@ -145,19 +145,19 @@ namespace Umbraco.Tests.DI Assert.IsFalse(values.Contains(o1)); // transient } - #region Test classes + #region Test classes - private interface ITestInterface - { } + private interface ITestInterface + { } - private class TransientObject1 : ITestInterface - { } + private class TransientObject1 : ITestInterface + { } - private class TransientObject2 : ITestInterface - { } + private class TransientObject2 : ITestInterface + { } - private class TransientObject3 : ITestInterface - { } + private class TransientObject3 : ITestInterface + { } private class TransientObject4 { } @@ -180,6 +180,6 @@ namespace Umbraco.Tests.DI { } } - #endregion - } -} \ No newline at end of file + #endregion + } +} diff --git a/src/Umbraco.Tests/DependencyInjection/PackageActionCollectionTests.cs b/src/Umbraco.Tests/DependencyInjection/PackageActionCollectionTests.cs index 3561fecb4f..0e109d0217 100644 --- a/src/Umbraco.Tests/DependencyInjection/PackageActionCollectionTests.cs +++ b/src/Umbraco.Tests/DependencyInjection/PackageActionCollectionTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using System.Xml; using LightInject; @@ -10,22 +10,22 @@ namespace Umbraco.Tests.DI { [TestFixture] public class PackageActionCollectionTests : ResolverBaseTest - { + { // NOTE // ManyResolverTests ensure that we'll get our actions back and PackageActionResolver works, // so all we're testing here is that plugin manager _does_ find our package actions // which should be ensured by PlugingManagerTests anyway, so this is useless? [Test] - public void FindAllPackageActions() - { + public void FindAllPackageActions() + { var container = new ServiceContainer(); container.ConfigureUmbracoCore(); container.RegisterCollectionBuilder() .Add(() => TypeLoader.GetPackageActions()); - var actions = Current.PackageActions; - Assert.AreEqual(2, actions.Count()); + var actions = Current.PackageActions; + Assert.AreEqual(2, actions.Count()); // order is unspecified, but both must be there bool hasAction1 = actions.ElementAt(0) is PackageAction1 || actions.ElementAt(1) is PackageAction1; @@ -34,54 +34,54 @@ namespace Umbraco.Tests.DI Assert.IsTrue(hasAction2); } - #region Classes for tests + #region Classes for tests - public class PackageAction1 : IPackageAction - { - public bool Execute(string packageName, XmlNode xmlData) - { - throw new NotImplementedException(); - } + public class PackageAction1 : IPackageAction + { + public bool Execute(string packageName, XmlNode xmlData) + { + throw new NotImplementedException(); + } - public string Alias() - { - return "pa1"; - } + public string Alias() + { + return "pa1"; + } - public bool Undo(string packageName, XmlNode xmlData) - { - throw new NotImplementedException(); - } + public bool Undo(string packageName, XmlNode xmlData) + { + throw new NotImplementedException(); + } - public XmlNode SampleXml() - { - throw new NotImplementedException(); - } - } + public XmlNode SampleXml() + { + throw new NotImplementedException(); + } + } - public class PackageAction2 : IPackageAction - { - public bool Execute(string packageName, XmlNode xmlData) - { - throw new NotImplementedException(); - } + public class PackageAction2 : IPackageAction + { + public bool Execute(string packageName, XmlNode xmlData) + { + throw new NotImplementedException(); + } - public string Alias() - { - return "pa2"; - } + public string Alias() + { + return "pa2"; + } - public bool Undo(string packageName, XmlNode xmlData) - { - throw new NotImplementedException(); - } + public bool Undo(string packageName, XmlNode xmlData) + { + throw new NotImplementedException(); + } - public XmlNode SampleXml() - { - throw new NotImplementedException(); - } - } + public XmlNode SampleXml() + { + throw new NotImplementedException(); + } + } #endregion - } -} \ No newline at end of file + } +} diff --git a/src/Umbraco.Tests/DependencyInjection/ResolverBaseTest.cs b/src/Umbraco.Tests/DependencyInjection/ResolverBaseTest.cs index d2ba95ccdf..4c8d9b9a8f 100644 --- a/src/Umbraco.Tests/DependencyInjection/ResolverBaseTest.cs +++ b/src/Umbraco.Tests/DependencyInjection/ResolverBaseTest.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Reflection; using Moq; using NUnit.Framework; @@ -32,10 +32,10 @@ namespace Umbraco.Tests.DI Current.Reset(); } - protected virtual IEnumerable AssembliesToScan - => new[] + protected virtual IEnumerable AssembliesToScan + => new[] { GetType().Assembly // this assembly only }; } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/DependencyInjection/XsltExtensionsResolverTests.cs b/src/Umbraco.Tests/DependencyInjection/XsltExtensionsResolverTests.cs index 4f203d8f5a..e887a787f9 100644 --- a/src/Umbraco.Tests/DependencyInjection/XsltExtensionsResolverTests.cs +++ b/src/Umbraco.Tests/DependencyInjection/XsltExtensionsResolverTests.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; using LightInject; using NUnit.Framework; using Umbraco.Core.Macros; @@ -46,4 +46,4 @@ namespace Umbraco.Tests.DI #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/FrontEnd/UmbracoHelperTests.cs b/src/Umbraco.Tests/FrontEnd/UmbracoHelperTests.cs index 672b9022e5..1c8b943575 100644 --- a/src/Umbraco.Tests/FrontEnd/UmbracoHelperTests.cs +++ b/src/Umbraco.Tests/FrontEnd/UmbracoHelperTests.cs @@ -8,7 +8,7 @@ namespace Umbraco.Tests.FrontEnd [TestFixture] public class UmbracoHelperTests { - + [Test] public void Truncate_Simple() { @@ -75,7 +75,7 @@ namespace Umbraco.Tests.FrontEnd var encryptedRouteString = UmbracoHelper.CreateEncryptedRouteString("FormController", "FormAction", "", additionalRouteValues); var result = encryptedRouteString.DecryptWithMachineKey(); var expectedResult = "c=FormController&a=FormAction&ar=&key1=value1&key2=value2&Key3=Value3&keY4=valuE4"; - + Assert.AreEqual(expectedResult, result); } } diff --git a/src/Umbraco.Tests/IO/AbstractFileSystemTests.cs b/src/Umbraco.Tests/IO/AbstractFileSystemTests.cs index 7018c00f3f..a60986ea0d 100644 --- a/src/Umbraco.Tests/IO/AbstractFileSystemTests.cs +++ b/src/Umbraco.Tests/IO/AbstractFileSystemTests.cs @@ -9,7 +9,7 @@ using Umbraco.Core.IO; namespace Umbraco.Tests.IO { [TestFixture, RequiresSTA] - public abstract class AbstractFileSystemTests + public abstract class AbstractFileSystemTests { protected IFileSystem _fileSystem; diff --git a/src/Umbraco.Tests/IO/FileSystemsTests.cs b/src/Umbraco.Tests/IO/FileSystemsTests.cs index 490eb06117..ef2fa3ce72 100644 --- a/src/Umbraco.Tests/IO/FileSystemsTests.cs +++ b/src/Umbraco.Tests/IO/FileSystemsTests.cs @@ -101,9 +101,9 @@ namespace Umbraco.Tests.IO [Test] public void Exception_Thrown_On_Invalid_Typed_File_System() - { + { Assert.Throws(() => FileSystems.GetFileSystemProvider()); - } + } [Test] public void Exception_Thrown_On_NonConfigured_Typed_File_System() @@ -125,11 +125,11 @@ namespace Umbraco.Tests.IO /// that only accepts a base IFileSystem object /// internal class InvalidTypedFileSystem : FileSystemWrapper - { - public InvalidTypedFileSystem(IFileSystem wrapped, string invalidParam) + { + public InvalidTypedFileSystem(IFileSystem wrapped, string invalidParam) : base(wrapped) - { } - } + { } + } [FileSystemProvider("noconfig")] internal class NonConfiguredTypeFileSystem : FileSystemWrapper diff --git a/src/Umbraco.Tests/IO/IoHelperTests.cs b/src/Umbraco.Tests/IO/IoHelperTests.cs index d637382b23..fb3283718e 100644 --- a/src/Umbraco.Tests/IO/IoHelperTests.cs +++ b/src/Umbraco.Tests/IO/IoHelperTests.cs @@ -11,8 +11,8 @@ namespace Umbraco.Tests.IO [TestCase("~/Scripts", "/Scripts", null)] [TestCase("/Scripts", "/Scripts", null)] [TestCase("../Scripts", "/Scripts", typeof(ArgumentException))] - public void IOHelper_ResolveUrl(string input, string expected, Type expectedExceptionType) - { + public void IOHelper_ResolveUrl(string input, string expected, Type expectedExceptionType) + { if (expectedExceptionType != null) { Assert.Throws(expectedExceptionType, () => IOHelper.ResolveUrl(input)); @@ -22,7 +22,7 @@ namespace Umbraco.Tests.IO var result = IOHelper.ResolveUrl(input); Assert.AreEqual(expected, result); } - } + } /// ///A test for MapPath verifying that HttpContext method (which includes vdirs) matches non-HttpContext method diff --git a/src/Umbraco.Tests/IO/PhysicalFileSystemTests.cs b/src/Umbraco.Tests/IO/PhysicalFileSystemTests.cs index 4ee178a954..ba9ab823b4 100644 --- a/src/Umbraco.Tests/IO/PhysicalFileSystemTests.cs +++ b/src/Umbraco.Tests/IO/PhysicalFileSystemTests.cs @@ -20,7 +20,7 @@ namespace Umbraco.Tests.IO [SetUp] public void Setup() { - + } [TearDown] diff --git a/src/Umbraco.Tests/Integration/GetCultureTests.cs b/src/Umbraco.Tests/Integration/GetCultureTests.cs index 5926817755..ed9be5c9ed 100644 --- a/src/Umbraco.Tests/Integration/GetCultureTests.cs +++ b/src/Umbraco.Tests/Integration/GetCultureTests.cs @@ -110,4 +110,4 @@ namespace Umbraco.Tests.Integration Assert.AreEqual("fr-FR", culture.Name); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Macros/MacroParserTests.cs b/src/Umbraco.Tests/Macros/MacroParserTests.cs index ede4b10a5a..944a585d2a 100644 --- a/src/Umbraco.Tests/Macros/MacroParserTests.cs +++ b/src/Umbraco.Tests/Macros/MacroParserTests.cs @@ -334,7 +334,7 @@ test"" /> --> //

asdfasdf

//
// -//asdfasdf +//asdfasdf //asdfas //asdfasdfasdf //

asdfasdf

@@ -350,7 +350,7 @@ test"" /> -->

asdfasdf

-asdfasdf +asdfasdf asdfas asdfasdfasdf

asdfasdf

@@ -383,7 +383,7 @@ asdfsdf

asdfasdf

-asdfasdf +asdfasdf asdfas asdfasdfasdf

asdfasdf

@@ -431,6 +431,6 @@ asdfsdf Assert.AreEqual(@"", result); } - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Manifest/ManifestParserTests.cs b/src/Umbraco.Tests/Manifest/ManifestParserTests.cs index 01905b6b32..95f1c35061 100644 --- a/src/Umbraco.Tests/Manifest/ManifestParserTests.cs +++ b/src/Umbraco.Tests/Manifest/ManifestParserTests.cs @@ -14,7 +14,7 @@ using Umbraco.Core.PropertyEditors; using Umbraco.Tests.TestHelpers; namespace Umbraco.Tests.Manifest -{ +{ [TestFixture] public class ManifestParserTests { @@ -26,7 +26,7 @@ namespace Umbraco.Tests.Manifest { _parser = new ManifestParser(Mock.Of(), new DirectoryInfo(IOHelper.MapPath("~/App_Plugins")), new NullCacheProvider()); } - + [Test] public void Parse_Property_Editors_With_Pre_Vals() { @@ -34,32 +34,32 @@ namespace Umbraco.Tests.Manifest var a = JsonConvert.DeserializeObject(@"[ { alias: 'Test.Test1', - name: 'Test 1', + name: 'Test 1', editor: { view: '~/App_Plugins/MyPackage/PropertyEditors/MyEditor.html', valueType: 'int', validation: { - 'required': true, + 'required': true, 'Regex': '\\d*' } }, prevalues: { - fields: [ - { + fields: [ + { label: 'Some config 1', - key: 'key1', - view: '~/App_Plugins/MyPackage/PropertyEditors/Views/pre-val1.html', - validation: { + key: 'key1', + view: '~/App_Plugins/MyPackage/PropertyEditors/Views/pre-val1.html', + validation: { required: true } - }, + }, { label: 'Some config 2', - key: 'key2', - view: '~/App_Plugins/MyPackage/PropertyEditors/Views/pre-val2.html' - } - ] - } + key: 'key2', + view: '~/App_Plugins/MyPackage/PropertyEditors/Views/pre-val2.html' + } + ] + } } ]"); var parser = _parser.GetPropertyEditors(a); @@ -70,7 +70,7 @@ namespace Umbraco.Tests.Manifest Assert.AreEqual("Some config 1", parser.ElementAt(0).PreValueEditor.Fields.ElementAt(0).Name); Assert.AreEqual("/App_Plugins/MyPackage/PropertyEditors/Views/pre-val1.html", parser.ElementAt(0).PreValueEditor.Fields.ElementAt(0).View); Assert.AreEqual(1, parser.ElementAt(0).PreValueEditor.Fields.ElementAt(0).Validators.Count); - + Assert.AreEqual("key2", parser.ElementAt(0).PreValueEditor.Fields.ElementAt(1).Key); Assert.AreEqual("Some config 2", parser.ElementAt(0).PreValueEditor.Fields.ElementAt(1).Name); Assert.AreEqual("/App_Plugins/MyPackage/PropertyEditors/Views/pre-val2.html", parser.ElementAt(0).PreValueEditor.Fields.ElementAt(1).View); @@ -83,20 +83,20 @@ namespace Umbraco.Tests.Manifest var a = JsonConvert.DeserializeObject(@"[ { alias: 'Test.Test1', - name: 'Test 1', - view: 'blah', + name: 'Test 1', + view: 'blah', icon: 'hello' }, { alias: 'Test.Test2', - name: 'Test 2', + name: 'Test 2', config: { key1: 'some default val' }, view: '~/hello/world.cshtml', icon: 'helloworld' }, { alias: 'Test.Test3', - name: 'Test 3', + name: 'Test 3', config: { key1: 'some default val' }, view: '/hello/world.html', render: '~/hello/world.cshtml', @@ -129,7 +129,7 @@ namespace Umbraco.Tests.Manifest Assert.AreEqual("/hello/world.cshtml", parser.ElementAt(2).Render); Assert.AreEqual(1, parser.ElementAt(2).Config.Count); Assert.AreEqual("some default val", parser.ElementAt(2).Config["key1"]); - + } [Test] @@ -140,7 +140,7 @@ namespace Umbraco.Tests.Manifest { alias: 'Test.Test1', name: 'Test 1', - icon: 'icon-war', + icon: 'icon-war', editor: { view: '~/App_Plugins/MyPackage/PropertyEditors/MyEditor.html', valueType: 'int', @@ -153,7 +153,7 @@ namespace Umbraco.Tests.Manifest { alias: 'Test.Test2', name: 'Test 2', - group: 'customgroup', + group: 'customgroup', defaultConfig: { key1: 'some default pre val' }, editor: { view: '~/App_Plugins/MyPackage/PropertyEditors/CsvEditor.html', @@ -200,8 +200,8 @@ namespace Umbraco.Tests.Manifest var a = JsonConvert.DeserializeObject(@"[ { alias: 'Test.Test1', - name: 'Test 1', - isParameterEditor: true, + name: 'Test 1', + isParameterEditor: true, defaultConfig: { key1: 'some default val' }, editor: { view: '~/App_Plugins/MyPackage/PropertyEditors/MyEditor.html', @@ -238,7 +238,7 @@ namespace Umbraco.Tests.Manifest var a = JsonConvert.DeserializeObject(@"[ { alias: 'parameter1', - name: 'My Parameter', + name: 'My Parameter', view: '~/App_Plugins/MyPackage/PropertyEditors/MyEditor.html' }, { @@ -266,7 +266,7 @@ namespace Umbraco.Tests.Manifest { var obj1 = JArray.FromObject(new[] { "test1", "test2", "test3" }); var obj2 = JArray.FromObject(new[] { "test1", "test2", "test3", "test4" }); - + ManifestParser.MergeJArrays(obj1, obj2); Assert.AreEqual(4, obj1.Count()); @@ -317,7 +317,7 @@ namespace Umbraco.Tests.Manifest Assert.AreEqual(5, obj1.Properties().Count()); Assert.AreEqual("Value3", obj1.Properties().ElementAt(2).Value.Value()); } - + [TestCase("C:\\Test", "C:\\Test\\MyFolder\\AnotherFolder", 2)] [TestCase("C:\\Test", "C:\\Test\\MyFolder\\AnotherFolder\\YetAnother", 3)] @@ -326,11 +326,11 @@ namespace Umbraco.Tests.Manifest { Assert.AreEqual(expected, _parser.FolderDepth( - new DirectoryInfo(baseFolder), + new DirectoryInfo(baseFolder), new DirectoryInfo(currFolder))); } - + //[Test] //public void Parse_Property_Editor() @@ -342,9 +342,9 @@ namespace Umbraco.Tests.Manifest public void Create_Manifests_Editors() { var package1 = @"{ -propertyEditors: [], +propertyEditors: [], javascript: ['~/test.js', '~/test2.js']}"; - + var package2 = "{css: ['~/style.css', '~/folder-name/sdsdsd/stylesheet.css']}"; var package3 = @"{ @@ -382,39 +382,39 @@ javascript: ['~/test.js', '~/test2.js']}"; var package4 = @"{'propertyEditors': [ { alias: 'Test.Test1', - name: 'Test 1', + name: 'Test 1', editor: { view: '~/App_Plugins/MyPackage/PropertyEditors/MyEditor.html', valueType: 'int', validation: { - 'required': true, + 'required': true, 'Regex': '\\d*' } }, prevalues: { - fields: [ - { + fields: [ + { label: 'Some config 1', - key: 'key1', - view: '~/App_Plugins/MyPackage/PropertyEditors/Views/pre-val1.html', - validation: { + key: 'key1', + view: '~/App_Plugins/MyPackage/PropertyEditors/Views/pre-val1.html', + validation: { required: true } - }, + }, { label: 'Some config 2', - key: 'key2', - view: '~/App_Plugins/MyPackage/PropertyEditors/Views/pre-val2.html' - } - ] - } + key: 'key2', + view: '~/App_Plugins/MyPackage/PropertyEditors/Views/pre-val2.html' + } + ] + } } ]}"; var package5 = @"{'parameterEditors': [ { alias: 'parameter1', - name: 'My Parameter', + name: 'My Parameter', view: '~/App_Plugins/MyPackage/PropertyEditors/MyEditor.html' }, { @@ -430,10 +430,10 @@ javascript: ['~/test.js', '~/test2.js']}"; var paramEditors = result.SelectMany(x => _parser.GetParameterEditors(x.ParameterEditors)).ToArray(); var propEditors = result.SelectMany(x => _parser.GetPropertyEditors(x.PropertyEditors)).ToArray(); var gridEditors = result.SelectMany(x => _parser.GetGridEditors(x.GridEditors)).ToArray(); - + Assert.AreEqual(2, gridEditors.Count()); Assert.AreEqual(2, paramEditors.Count()); - Assert.AreEqual(1, propEditors.Count()); + Assert.AreEqual(1, propEditors.Count()); } @@ -442,20 +442,20 @@ javascript: ['~/test.js', '~/test2.js']}"; { var content4 = @"{ //here's the property editors -propertyEditors: [], +propertyEditors: [], //and here's the javascript javascript: ['~/test.js', '~/test2.js']}"; var result = _parser.CreateManifests(null, content4); - Assert.AreEqual(1, result.Count()); + Assert.AreEqual(1, result.Count()); } [Test] public void Create_Manifest_With_Surround_Comments() { var content4 = @"{ -propertyEditors: []/*we have empty property editors**/, +propertyEditors: []/*we have empty property editors**/, javascript: ['~/test.js',/*** some note about stuff asd09823-4**09234*/ '~/test2.js']}"; var result = _parser.CreateManifests(null, content4); @@ -468,7 +468,7 @@ javascript: ['~/test.js',/*** some note about stuff asd09823-4**09234*/ '~/test2 { //NOTE: This is missing the final closing ] var content4 = @"{ -propertyEditors: []/*we have empty property editors**/, +propertyEditors: []/*we have empty property editors**/, javascript: ['~/test.js',/*** some note about stuff asd09823-4**09234*/ '~/test2.js' }"; var result = _parser.CreateManifests(null, content4); @@ -510,7 +510,7 @@ javascript: ['~/test.js',/*** some note about stuff asd09823-4**09234*/ '~/test2 Assert.AreEqual(2, result.ElementAt(2).StylesheetInitialize.Count); Assert.AreEqual(2, result.ElementAt(3).StylesheetInitialize.Count); } - + } } diff --git a/src/Umbraco.Tests/Membership/MembershipProviderBaseTests.cs b/src/Umbraco.Tests/Membership/MembershipProviderBaseTests.cs index 429737c508..743fc4f968 100644 --- a/src/Umbraco.Tests/Membership/MembershipProviderBaseTests.cs +++ b/src/Umbraco.Tests/Membership/MembershipProviderBaseTests.cs @@ -40,7 +40,7 @@ namespace Umbraco.Tests.Membership [Test] public void Change_Password_Without_AllowManuallyChangingPassword_And_No_Pass_Validation() { - var providerMock = new Mock() { CallBase = true }; + var providerMock = new Mock() { CallBase = true }; providerMock.Setup(@base => @base.AllowManuallyChangingPassword).Returns(false); var provider = providerMock.Object; @@ -50,7 +50,7 @@ namespace Umbraco.Tests.Membership [Test] public void Change_Password_With_AllowManuallyChangingPassword_And_Invalid_Creds() { - var providerMock = new Mock() { CallBase = true }; + var providerMock = new Mock() { CallBase = true }; providerMock.Setup(@base => @base.AllowManuallyChangingPassword).Returns(false); providerMock.Setup(@base => @base.ValidateUser("test", "test")).Returns(false); var provider = providerMock.Object; @@ -58,7 +58,7 @@ namespace Umbraco.Tests.Membership Assert.IsFalse(provider.ChangePassword("test", "test", "test")); } - + [Test] public void ChangePasswordQuestionAndAnswer_Without_RequiresQuestionAndAnswer() { @@ -161,7 +161,7 @@ namespace Umbraco.Tests.Membership [Test] public void Sets_Defaults() { - var providerMock = new Mock() { CallBase = true }; + var providerMock = new Mock() { CallBase = true }; var provider = providerMock.Object; provider.Initialize("test", new NameValueCollection()); @@ -183,7 +183,7 @@ namespace Umbraco.Tests.Membership [Test] public void Throws_Exception_With_Hashed_Password_And_Password_Retrieval() { - var providerMock = new Mock() { CallBase = true }; + var providerMock = new Mock() { CallBase = true }; var provider = providerMock.Object; Assert.Throws(() => provider.Initialize("test", new NameValueCollection() @@ -222,16 +222,16 @@ namespace Umbraco.Tests.Membership for (var i = 0; i < 10000; i++) { var result = MembershipProviderBase.GenerateSalt(); - + if (i > 0) { Assert.AreEqual(lastLength, result.Length); } - lastLength = result.Length; + lastLength = result.Length; } } - + [Test] public void Get_Stored_Password_Hashed() { @@ -368,7 +368,7 @@ namespace Umbraco.Tests.Membership string salt; var pass = "ThisIsAnEncryptedPassword"; var encrypted = provider.EncryptOrHashNewPassword(pass, out salt); - + var result = provider.CheckPassword("ThisIsAnEncryptedPassword", encrypted); Assert.IsTrue(result); @@ -398,7 +398,7 @@ namespace Umbraco.Tests.Membership string salt; var pass = "ThisIsAnEncryptedPassword"; var encrypted = provider.EncryptOrHashNewPassword(pass, out salt); - + var result = provider.DecryptPassword(encrypted); Assert.AreEqual(pass, result); diff --git a/src/Umbraco.Tests/Membership/UmbracoServiceMembershipProviderTests.cs b/src/Umbraco.Tests/Membership/UmbracoServiceMembershipProviderTests.cs index f0525ff55b..b8f1f56675 100644 --- a/src/Umbraco.Tests/Membership/UmbracoServiceMembershipProviderTests.cs +++ b/src/Umbraco.Tests/Membership/UmbracoServiceMembershipProviderTests.cs @@ -175,4 +175,4 @@ namespace Umbraco.Tests.Membership } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Migrations/AlterMigrationTests.cs b/src/Umbraco.Tests/Migrations/AlterMigrationTests.cs index 66fa00e7ce..c7bde15281 100644 --- a/src/Umbraco.Tests/Migrations/AlterMigrationTests.cs +++ b/src/Umbraco.Tests/Migrations/AlterMigrationTests.cs @@ -129,4 +129,4 @@ namespace Umbraco.Tests.Migrations } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Migrations/FindingMigrationsTest.cs b/src/Umbraco.Tests/Migrations/FindingMigrationsTest.cs index f256c5ef98..1d07c98440 100644 --- a/src/Umbraco.Tests/Migrations/FindingMigrationsTest.cs +++ b/src/Umbraco.Tests/Migrations/FindingMigrationsTest.cs @@ -47,7 +47,7 @@ namespace Umbraco.Tests.Migrations } Assert.That(list.Count, Is.EqualTo(3)); - + foreach (var migration1 in list) { var migration = (MigrationBase) migration1; @@ -63,4 +63,4 @@ namespace Umbraco.Tests.Migrations } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Migrations/MigrationIssuesTests.cs b/src/Umbraco.Tests/Migrations/MigrationIssuesTests.cs index 42ca600d2e..870e658f56 100644 --- a/src/Umbraco.Tests/Migrations/MigrationIssuesTests.cs +++ b/src/Umbraco.Tests/Migrations/MigrationIssuesTests.cs @@ -154,4 +154,4 @@ namespace Umbraco.Tests.Migrations { } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Migrations/MigrationRunnerTests.cs b/src/Umbraco.Tests/Migrations/MigrationRunnerTests.cs index f2cbf41ed2..ddb23e9c8c 100644 --- a/src/Umbraco.Tests/Migrations/MigrationRunnerTests.cs +++ b/src/Umbraco.Tests/Migrations/MigrationRunnerTests.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Data.Common; using System.Linq; using Moq; @@ -84,7 +84,7 @@ namespace Umbraco.Tests.Migrations [Migration("5.0.0", 1, "Test")] private class MultiMigration : MigrationBase { - public MultiMigration(IMigrationContext context) + public MultiMigration(IMigrationContext context) : base(context) { } @@ -99,4 +99,4 @@ namespace Umbraco.Tests.Migrations } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Migrations/SqlScripts/SqlResources.Designer.cs b/src/Umbraco.Tests/Migrations/SqlScripts/SqlResources.Designer.cs index 55eec4b23e..a60e2cb99a 100644 --- a/src/Umbraco.Tests/Migrations/SqlScripts/SqlResources.Designer.cs +++ b/src/Umbraco.Tests/Migrations/SqlScripts/SqlResources.Designer.cs @@ -10,8 +10,8 @@ namespace Umbraco.Tests.Migrations.SqlScripts { using System; - - + + /// /// A strongly-typed resource class, for looking up localized strings, etc. /// @@ -23,15 +23,15 @@ namespace Umbraco.Tests.Migrations.SqlScripts { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class SqlResources { - + private static global::System.Resources.ResourceManager resourceMan; - + private static global::System.Globalization.CultureInfo resourceCulture; - + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal SqlResources() { } - + /// /// Returns the cached ResourceManager instance used by this class. /// @@ -45,7 +45,7 @@ namespace Umbraco.Tests.Migrations.SqlScripts { return resourceMan; } } - + /// /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. @@ -59,7 +59,7 @@ namespace Umbraco.Tests.Migrations.SqlScripts { resourceCulture = value; } } - + /// /// Looks up a localized string similar to /******************************************************************************************* /// @@ -70,11 +70,11 @@ namespace Umbraco.Tests.Migrations.SqlScripts { /// /// /// Umbraco database installation script for MySQL - /// + /// ///IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT - /// + /// /// Database version: 4.8.0.4 - /// + /// /// Please increment this version number if ANY change is made to this script, /// so compatibility with scripts for other database systems can be verified easily. /// The first 3 digits depict the Umbraco version, t [rest of string was truncated]";. @@ -84,7 +84,7 @@ namespace Umbraco.Tests.Migrations.SqlScripts { return ResourceManager.GetString("MySqlTotal_480", resourceCulture); } } - + /// /// Looks up a localized string similar to CREATE TABLE [umbracoUserType] ( /// [id] int NOT NULL IDENTITY (5,1) @@ -113,25 +113,25 @@ namespace Umbraco.Tests.Migrations.SqlScripts { return ResourceManager.GetString("SqlCe_SchemaAndData_4110", resourceCulture); } } - + /// - /// Looks up a localized string similar to CREATE TABLE [umbracoRelation] - ///( - ///[id] [int] NOT NULL IDENTITY(1, 1), - ///[parentId] [int] NOT NULL, - ///[childId] [int] NOT NULL, - ///[relType] [int] NOT NULL, - ///[datetime] [datetime] NOT NULL CONSTRAINT [DF_umbracoRelation_datetime] DEFAULT (getdate()), - ///[comment] [nvarchar] (1000) NOT NULL - ///) - /// - ///; - ///ALTER TABLE [umbracoRelation] ADD CONSTRAINT [PK_umbracoRelation] PRIMARY KEY ([id]) - ///; - ///CREATE TABLE [cmsDocument] - ///( - ///[nodeId] [int] NOT NULL, - ///[published] [bit] NOT NULL, + /// Looks up a localized string similar to CREATE TABLE [umbracoRelation] + ///( + ///[id] [int] NOT NULL IDENTITY(1, 1), + ///[parentId] [int] NOT NULL, + ///[childId] [int] NOT NULL, + ///[relType] [int] NOT NULL, + ///[datetime] [datetime] NOT NULL CONSTRAINT [DF_umbracoRelation_datetime] DEFAULT (getdate()), + ///[comment] [nvarchar] (1000) NOT NULL + ///) + /// + ///; + ///ALTER TABLE [umbracoRelation] ADD CONSTRAINT [PK_umbracoRelation] PRIMARY KEY ([id]) + ///; + ///CREATE TABLE [cmsDocument] + ///( + ///[nodeId] [int] NOT NULL, + ///[published] [bit] NOT NULL, ///[documentUser] [int] NOT [rest of string was truncated]";. /// internal static string SqlCeTotal_480 { @@ -139,7 +139,7 @@ namespace Umbraco.Tests.Migrations.SqlScripts { return ResourceManager.GetString("SqlCeTotal_480", resourceCulture); } } - + /// /// Looks up a localized string similar to /******************************************************************************************* /// @@ -150,11 +150,11 @@ namespace Umbraco.Tests.Migrations.SqlScripts { /// /// /// Umbraco database installation script for SQL Server - /// + /// ///IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT - /// + /// /// Database version: 4.8.0.0 - /// + /// /// Please increment this version number if ANY change is made to this script, /// so compatibility with scripts for other database systems can be verified easily. /// The first 3 digits depict the Umbraco versi [rest of string was truncated]";. diff --git a/src/Umbraco.Tests/Migrations/Stubs/AlterUserTableMigrationStub.cs b/src/Umbraco.Tests/Migrations/Stubs/AlterUserTableMigrationStub.cs index afeff08e59..b2d1d36477 100644 --- a/src/Umbraco.Tests/Migrations/Stubs/AlterUserTableMigrationStub.cs +++ b/src/Umbraco.Tests/Migrations/Stubs/AlterUserTableMigrationStub.cs @@ -7,7 +7,7 @@ namespace Umbraco.Tests.Migrations.Stubs [MigrationAttribute("6.0.0", 0, "Test")] public class AlterUserTableMigrationStub : MigrationBase { - public AlterUserTableMigrationStub(IMigrationContext context) + public AlterUserTableMigrationStub(IMigrationContext context) : base(context) { } @@ -22,4 +22,4 @@ namespace Umbraco.Tests.Migrations.Stubs public override void Down() { } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Migrations/Stubs/DropForeignKeyMigrationStub.cs b/src/Umbraco.Tests/Migrations/Stubs/DropForeignKeyMigrationStub.cs index 83bb9cb07a..12ef773914 100644 --- a/src/Umbraco.Tests/Migrations/Stubs/DropForeignKeyMigrationStub.cs +++ b/src/Umbraco.Tests/Migrations/Stubs/DropForeignKeyMigrationStub.cs @@ -20,4 +20,4 @@ namespace Umbraco.Tests.Migrations.Stubs { } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Migrations/Stubs/Dummy.cs b/src/Umbraco.Tests/Migrations/Stubs/Dummy.cs index 3da848311c..7fbe880b0c 100644 --- a/src/Umbraco.Tests/Migrations/Stubs/Dummy.cs +++ b/src/Umbraco.Tests/Migrations/Stubs/Dummy.cs @@ -18,4 +18,4 @@ namespace Umbraco.Tests.Migrations.Stubs throw new System.NotImplementedException(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Migrations/Stubs/FiveZeroMigration.cs b/src/Umbraco.Tests/Migrations/Stubs/FiveZeroMigration.cs index 5bee47e15f..202f7859d0 100644 --- a/src/Umbraco.Tests/Migrations/Stubs/FiveZeroMigration.cs +++ b/src/Umbraco.Tests/Migrations/Stubs/FiveZeroMigration.cs @@ -1,4 +1,4 @@ -using Umbraco.Core.Logging; +using Umbraco.Core.Logging; using Umbraco.Core.Persistence.Migrations; using Umbraco.Core.Persistence.SqlSyntax; @@ -7,7 +7,7 @@ namespace Umbraco.Tests.Migrations.Stubs [Migration("5.0.0", 0, "Test")] public class FiveZeroMigration : MigrationBase { - public FiveZeroMigration(IMigrationContext context) + public FiveZeroMigration(IMigrationContext context) : base(context) { } @@ -19,6 +19,6 @@ namespace Umbraco.Tests.Migrations.Stubs public override void Down() { } - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Migrations/Stubs/FourElevenMigration.cs b/src/Umbraco.Tests/Migrations/Stubs/FourElevenMigration.cs index 23ec792c6d..8aa00a6c66 100644 --- a/src/Umbraco.Tests/Migrations/Stubs/FourElevenMigration.cs +++ b/src/Umbraco.Tests/Migrations/Stubs/FourElevenMigration.cs @@ -1,4 +1,4 @@ -using Umbraco.Core.Logging; +using Umbraco.Core.Logging; using Umbraco.Core.Persistence.Migrations; using Umbraco.Core.Persistence.SqlSyntax; @@ -7,7 +7,7 @@ namespace Umbraco.Tests.Migrations.Stubs [Migration("4.11.0", 0, "Test")] public class FourElevenMigration : MigrationBase { - public FourElevenMigration(IMigrationContext context) + public FourElevenMigration(IMigrationContext context) : base(context) { } @@ -22,6 +22,6 @@ namespace Umbraco.Tests.Migrations.Stubs Alter.Table("umbracoUser").AlterColumn("regularPhone").AsString(255); } - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Migrations/Stubs/SixZeroMigration1.cs b/src/Umbraco.Tests/Migrations/Stubs/SixZeroMigration1.cs index f6b1e6e120..df4a11b950 100644 --- a/src/Umbraco.Tests/Migrations/Stubs/SixZeroMigration1.cs +++ b/src/Umbraco.Tests/Migrations/Stubs/SixZeroMigration1.cs @@ -7,7 +7,7 @@ namespace Umbraco.Tests.Migrations.Stubs [MigrationAttribute("6.0.0", 1, "Test")] public class SixZeroMigration1 : MigrationBase { - public SixZeroMigration1(IMigrationContext context) + public SixZeroMigration1(IMigrationContext context) : base(context) { } @@ -22,4 +22,4 @@ namespace Umbraco.Tests.Migrations.Stubs Alter.Table("umbracoUser").AlterColumn("passwordTip").AsString(100); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Migrations/Stubs/SixZeroMigration2.cs b/src/Umbraco.Tests/Migrations/Stubs/SixZeroMigration2.cs index 8891a27555..a7ccc8af6e 100644 --- a/src/Umbraco.Tests/Migrations/Stubs/SixZeroMigration2.cs +++ b/src/Umbraco.Tests/Migrations/Stubs/SixZeroMigration2.cs @@ -1,4 +1,4 @@ -using Umbraco.Core.Logging; +using Umbraco.Core.Logging; using Umbraco.Core.Persistence.Migrations; using Umbraco.Core.Persistence.SqlSyntax; @@ -7,7 +7,7 @@ namespace Umbraco.Tests.Migrations.Stubs [Migration("6.0.0", 2, "Test")] public class SixZeroMigration2 : MigrationBase { - public SixZeroMigration2(IMigrationContext context) + public SixZeroMigration2(IMigrationContext context) : base(context) { } @@ -22,6 +22,6 @@ namespace Umbraco.Tests.Migrations.Stubs Alter.Table("umbracoUser").AlterColumn("sendEmail").AsBoolean(); } - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Migrations/Upgrades/BaseUpgradeTest.cs b/src/Umbraco.Tests/Migrations/Upgrades/BaseUpgradeTest.cs index f1998c2042..bd0c2ecabe 100644 --- a/src/Umbraco.Tests/Migrations/Upgrades/BaseUpgradeTest.cs +++ b/src/Umbraco.Tests/Migrations/Upgrades/BaseUpgradeTest.cs @@ -108,4 +108,4 @@ namespace Umbraco.Tests.Migrations.Upgrades public abstract IUmbracoDatabase GetConfiguredDatabase(); public abstract string GetDatabaseSpecificSqlScript(); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Migrations/Upgrades/MySqlUpgradeTest.cs b/src/Umbraco.Tests/Migrations/Upgrades/MySqlUpgradeTest.cs index 3b644e174c..56baa9ed9f 100644 --- a/src/Umbraco.Tests/Migrations/Upgrades/MySqlUpgradeTest.cs +++ b/src/Umbraco.Tests/Migrations/Upgrades/MySqlUpgradeTest.cs @@ -34,4 +34,4 @@ namespace Umbraco.Tests.Migrations.Upgrades return SqlScripts.SqlResources.MySqlTotal_480; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Migrations/Upgrades/SqlCeDataUpgradeTest.cs b/src/Umbraco.Tests/Migrations/Upgrades/SqlCeDataUpgradeTest.cs index 9ad39c4b49..971b6b433e 100644 --- a/src/Umbraco.Tests/Migrations/Upgrades/SqlCeDataUpgradeTest.cs +++ b/src/Umbraco.Tests/Migrations/Upgrades/SqlCeDataUpgradeTest.cs @@ -73,4 +73,4 @@ namespace Umbraco.Tests.Migrations.Upgrades return SqlScripts.SqlResources.SqlCe_SchemaAndData_4110; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Migrations/Upgrades/SqlCeUpgradeTest.cs b/src/Umbraco.Tests/Migrations/Upgrades/SqlCeUpgradeTest.cs index 052cf130e4..ef467c241c 100644 --- a/src/Umbraco.Tests/Migrations/Upgrades/SqlCeUpgradeTest.cs +++ b/src/Umbraco.Tests/Migrations/Upgrades/SqlCeUpgradeTest.cs @@ -77,4 +77,4 @@ namespace Umbraco.Tests.Migrations.Upgrades return SqlScripts.SqlResources.SqlCeTotal_480; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Migrations/Upgrades/SqlServerUpgradeTest.cs b/src/Umbraco.Tests/Migrations/Upgrades/SqlServerUpgradeTest.cs index e2db59d975..80307078aa 100644 --- a/src/Umbraco.Tests/Migrations/Upgrades/SqlServerUpgradeTest.cs +++ b/src/Umbraco.Tests/Migrations/Upgrades/SqlServerUpgradeTest.cs @@ -31,4 +31,4 @@ namespace Umbraco.Tests.Migrations.Upgrades return SqlScripts.SqlResources.SqlServerTotal_480; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Migrations/Upgrades/ValidateOlderSchemaTest.cs b/src/Umbraco.Tests/Migrations/Upgrades/ValidateOlderSchemaTest.cs index 740ed45049..1bc7c16236 100644 --- a/src/Umbraco.Tests/Migrations/Upgrades/ValidateOlderSchemaTest.cs +++ b/src/Umbraco.Tests/Migrations/Upgrades/ValidateOlderSchemaTest.cs @@ -108,4 +108,4 @@ namespace Umbraco.Tests.Migrations.Upgrades return SqlScripts.SqlResources.SqlCeTotal_480; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Migrations/Upgrades/ValidateV7UpgradeTest.cs b/src/Umbraco.Tests/Migrations/Upgrades/ValidateV7UpgradeTest.cs index 509661140d..2999e8d7eb 100644 --- a/src/Umbraco.Tests/Migrations/Upgrades/ValidateV7UpgradeTest.cs +++ b/src/Umbraco.Tests/Migrations/Upgrades/ValidateV7UpgradeTest.cs @@ -34,7 +34,7 @@ namespace Umbraco.Tests.Migrations.Upgrades public void Validate_AddIndexToCmsMacroTable() { var migrationContext = new MigrationContext(_database, _logger); - var migration = new AddIndexToCmsMacroTable(true, migrationContext); + var migration = new AddIndexToCmsMacroTable(true, migrationContext); migration.Up(); Assert.AreEqual(1, migrationContext.Expressions.Count); @@ -58,4 +58,4 @@ namespace Umbraco.Tests.Migrations.Upgrades Assert.AreEqual("CREATE UNIQUE NONCLUSTERED INDEX [IX_cmsMacroProperty_Alias] ON [cmsMacroProperty] ([macro],[macroPropertyAlias])", result); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Misc/ApplicationUrlHelperTests.cs b/src/Umbraco.Tests/Misc/ApplicationUrlHelperTests.cs index 46c0a89227..a20b86cc7b 100644 --- a/src/Umbraco.Tests/Misc/ApplicationUrlHelperTests.cs +++ b/src/Umbraco.Tests/Misc/ApplicationUrlHelperTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Configuration; using System.Linq; using LightInject; @@ -267,4 +267,4 @@ namespace Umbraco.Tests.Misc Assert.AreEqual("httpx://whatever.com/umbraco", url); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Misc/HashCodeCombinerTests.cs b/src/Umbraco.Tests/Misc/HashCodeCombinerTests.cs index 4bd2b687c0..6a30e09d84 100644 --- a/src/Umbraco.Tests/Misc/HashCodeCombinerTests.cs +++ b/src/Umbraco.Tests/Misc/HashCodeCombinerTests.cs @@ -6,140 +6,140 @@ using Umbraco.Core; namespace Umbraco.Tests.Misc { - [TestFixture] - public class HashCodeCombinerTests - { + [TestFixture] + public class HashCodeCombinerTests + { - private DirectoryInfo PrepareFolder() - { - var assDir = new FileInfo(Assembly.GetExecutingAssembly().Location).Directory; - var dir = Directory.CreateDirectory(Path.Combine(assDir.FullName, "HashCombiner", Guid.NewGuid().ToString("N"))); - foreach (var f in dir.GetFiles()) - { - f.Delete(); - } - return dir; - } + private DirectoryInfo PrepareFolder() + { + var assDir = new FileInfo(Assembly.GetExecutingAssembly().Location).Directory; + var dir = Directory.CreateDirectory(Path.Combine(assDir.FullName, "HashCombiner", Guid.NewGuid().ToString("N"))); + foreach (var f in dir.GetFiles()) + { + f.Delete(); + } + return dir; + } - [Test] - public void HashCombiner_Test_String() - { - var combiner1 = new HashCodeCombiner(); - combiner1.AddCaseInsensitiveString("Hello"); + [Test] + public void HashCombiner_Test_String() + { + var combiner1 = new HashCodeCombiner(); + combiner1.AddCaseInsensitiveString("Hello"); - var combiner2 = new HashCodeCombiner(); - combiner2.AddCaseInsensitiveString("hello"); + var combiner2 = new HashCodeCombiner(); + combiner2.AddCaseInsensitiveString("hello"); - Assert.AreEqual(combiner1.GetCombinedHashCode(), combiner2.GetCombinedHashCode()); + Assert.AreEqual(combiner1.GetCombinedHashCode(), combiner2.GetCombinedHashCode()); - combiner2.AddCaseInsensitiveString("world"); + combiner2.AddCaseInsensitiveString("world"); - Assert.AreNotEqual(combiner1.GetCombinedHashCode(), combiner2.GetCombinedHashCode()); - } + Assert.AreNotEqual(combiner1.GetCombinedHashCode(), combiner2.GetCombinedHashCode()); + } - [Test] - public void HashCombiner_Test_Int() - { - var combiner1 = new HashCodeCombiner(); - combiner1.AddInt(1234); + [Test] + public void HashCombiner_Test_Int() + { + var combiner1 = new HashCodeCombiner(); + combiner1.AddInt(1234); - var combiner2 = new HashCodeCombiner(); - combiner2.AddInt(1234); + var combiner2 = new HashCodeCombiner(); + combiner2.AddInt(1234); - Assert.AreEqual(combiner1.GetCombinedHashCode(), combiner2.GetCombinedHashCode()); + Assert.AreEqual(combiner1.GetCombinedHashCode(), combiner2.GetCombinedHashCode()); - combiner2.AddInt(1); + combiner2.AddInt(1); - Assert.AreNotEqual(combiner1.GetCombinedHashCode(), combiner2.GetCombinedHashCode()); - } + Assert.AreNotEqual(combiner1.GetCombinedHashCode(), combiner2.GetCombinedHashCode()); + } - [Test] - public void HashCombiner_Test_DateTime() - { - var dt = DateTime.Now; - var combiner1 = new HashCodeCombiner(); - combiner1.AddDateTime(dt); + [Test] + public void HashCombiner_Test_DateTime() + { + var dt = DateTime.Now; + var combiner1 = new HashCodeCombiner(); + combiner1.AddDateTime(dt); - var combiner2 = new HashCodeCombiner(); - combiner2.AddDateTime(dt); + var combiner2 = new HashCodeCombiner(); + combiner2.AddDateTime(dt); - Assert.AreEqual(combiner1.GetCombinedHashCode(), combiner2.GetCombinedHashCode()); + Assert.AreEqual(combiner1.GetCombinedHashCode(), combiner2.GetCombinedHashCode()); - combiner2.AddDateTime(DateTime.Now); + combiner2.AddDateTime(DateTime.Now); - Assert.AreNotEqual(combiner1.GetCombinedHashCode(), combiner2.GetCombinedHashCode()); - } + Assert.AreNotEqual(combiner1.GetCombinedHashCode(), combiner2.GetCombinedHashCode()); + } - [Test] - public void HashCombiner_Test_File() - { - var dir = PrepareFolder(); - var file1Path = Path.Combine(dir.FullName, "hastest1.txt"); - File.Delete(file1Path); - using (var file1 = File.CreateText(Path.Combine(dir.FullName, "hastest1.txt"))) - { - file1.WriteLine("hello"); - } - var file2Path = Path.Combine(dir.FullName, "hastest2.txt"); - File.Delete(file2Path); - using (var file2 = File.CreateText(Path.Combine(dir.FullName, "hastest2.txt"))) - { - //even though files are the same, the dates are different - file2.WriteLine("hello"); - } + [Test] + public void HashCombiner_Test_File() + { + var dir = PrepareFolder(); + var file1Path = Path.Combine(dir.FullName, "hastest1.txt"); + File.Delete(file1Path); + using (var file1 = File.CreateText(Path.Combine(dir.FullName, "hastest1.txt"))) + { + file1.WriteLine("hello"); + } + var file2Path = Path.Combine(dir.FullName, "hastest2.txt"); + File.Delete(file2Path); + using (var file2 = File.CreateText(Path.Combine(dir.FullName, "hastest2.txt"))) + { + //even though files are the same, the dates are different + file2.WriteLine("hello"); + } - var combiner1 = new HashCodeCombiner(); - combiner1.AddFile(new FileInfo(file1Path)); + var combiner1 = new HashCodeCombiner(); + combiner1.AddFile(new FileInfo(file1Path)); - var combiner2 = new HashCodeCombiner(); - combiner2.AddFile(new FileInfo(file1Path)); + var combiner2 = new HashCodeCombiner(); + combiner2.AddFile(new FileInfo(file1Path)); - var combiner3 = new HashCodeCombiner(); - combiner3.AddFile(new FileInfo(file2Path)); + var combiner3 = new HashCodeCombiner(); + combiner3.AddFile(new FileInfo(file2Path)); - Assert.AreEqual(combiner1.GetCombinedHashCode(), combiner2.GetCombinedHashCode()); - Assert.AreNotEqual(combiner1.GetCombinedHashCode(), combiner3.GetCombinedHashCode()); + Assert.AreEqual(combiner1.GetCombinedHashCode(), combiner2.GetCombinedHashCode()); + Assert.AreNotEqual(combiner1.GetCombinedHashCode(), combiner3.GetCombinedHashCode()); - combiner2.AddFile(new FileInfo(file2Path)); + combiner2.AddFile(new FileInfo(file2Path)); - Assert.AreNotEqual(combiner1.GetCombinedHashCode(), combiner2.GetCombinedHashCode()); - } + Assert.AreNotEqual(combiner1.GetCombinedHashCode(), combiner2.GetCombinedHashCode()); + } - [Test] - public void HashCombiner_Test_Folder() - { - var dir = PrepareFolder(); - var file1Path = Path.Combine(dir.FullName, "hastest1.txt"); - File.Delete(file1Path); - using (var file1 = File.CreateText(Path.Combine(dir.FullName, "hastest1.txt"))) - { - file1.WriteLine("hello"); - } + [Test] + public void HashCombiner_Test_Folder() + { + var dir = PrepareFolder(); + var file1Path = Path.Combine(dir.FullName, "hastest1.txt"); + File.Delete(file1Path); + using (var file1 = File.CreateText(Path.Combine(dir.FullName, "hastest1.txt"))) + { + file1.WriteLine("hello"); + } - //first test the whole folder - var combiner1 = new HashCodeCombiner(); - combiner1.AddFolder(dir); + //first test the whole folder + var combiner1 = new HashCodeCombiner(); + combiner1.AddFolder(dir); - var combiner2 = new HashCodeCombiner(); - combiner2.AddFolder(dir); + var combiner2 = new HashCodeCombiner(); + combiner2.AddFolder(dir); - Assert.AreEqual(combiner1.GetCombinedHashCode(), combiner2.GetCombinedHashCode()); + Assert.AreEqual(combiner1.GetCombinedHashCode(), combiner2.GetCombinedHashCode()); - //now add a file to the folder + //now add a file to the folder - var file2Path = Path.Combine(dir.FullName, "hastest2.txt"); - File.Delete(file2Path); - using (var file2 = File.CreateText(Path.Combine(dir.FullName, "hastest2.txt"))) - { - //even though files are the same, the dates are different - file2.WriteLine("hello"); - } + var file2Path = Path.Combine(dir.FullName, "hastest2.txt"); + File.Delete(file2Path); + using (var file2 = File.CreateText(Path.Combine(dir.FullName, "hastest2.txt"))) + { + //even though files are the same, the dates are different + file2.WriteLine("hello"); + } - var combiner3 = new HashCodeCombiner(); - combiner3.AddFolder(dir); + var combiner3 = new HashCodeCombiner(); + combiner3.AddFolder(dir); - Assert.AreNotEqual(combiner1.GetCombinedHashCode(), combiner3.GetCombinedHashCode()); - } + Assert.AreNotEqual(combiner1.GetCombinedHashCode(), combiner3.GetCombinedHashCode()); + } - } + } } diff --git a/src/Umbraco.Tests/Misc/LibraryTests.cs b/src/Umbraco.Tests/Misc/LibraryTests.cs index 7ea0cebc99..24bd494ee6 100644 --- a/src/Umbraco.Tests/Misc/LibraryTests.cs +++ b/src/Umbraco.Tests/Misc/LibraryTests.cs @@ -14,12 +14,12 @@ using Umbraco.Web.PublishedCache.XmlPublishedCache; namespace Umbraco.Tests.Misc { - /// - /// Tests for the legacy library class - /// - [TestFixture] - public class LibraryTests : BaseWebTest - { + /// + /// Tests for the legacy library class + /// + [TestFixture] + public class LibraryTests : BaseWebTest + { public override void SetUp() { base.SetUp(); @@ -42,24 +42,24 @@ namespace Umbraco.Tests.Misc var umbracoContext = GetUmbracoContext("/test"); Umbraco.Web.Composing.Current.UmbracoContextAccessor.UmbracoContext = umbracoContext; - } + } - /// - /// sets up resolvers before resolution is frozen - /// - protected override void Compose() - { - base.Compose(); + /// + /// sets up resolvers before resolution is frozen + /// + protected override void Compose() + { + base.Compose(); // required so we can access property.Value - Container.RegisterCollectionBuilder(); - } + Container.RegisterCollectionBuilder(); + } - [Test] - public void Json_To_Xml_Object() - { - var json = "{ id: 1, name: 'hello', children: [{id: 2, name: 'child1'}, {id:3, name: 'child2'}]}"; - var result = library.JsonToXml(json); + [Test] + public void Json_To_Xml_Object() + { + var json = "{ id: 1, name: 'hello', children: [{id: 2, name: 'child1'}, {id:3, name: 'child2'}]}"; + var result = library.JsonToXml(json); Assert.AreEqual(@" 1 hello @@ -72,7 +72,7 @@ namespace Umbraco.Tests.Misc child2 ".CrLf(), result.Current.OuterXml.CrLf()); - } + } [Test] public void Json_To_Xml_Array() @@ -99,71 +99,71 @@ namespace Umbraco.Tests.Misc Assert.IsTrue(result.Current.OuterXml.StartsWith("")); } - [Test] - public void Get_Item_User_Property() - { - var val = library.GetItem(1173, "content"); - var legacyVal = LegacyGetItem(1173, "content"); - Assert.AreEqual(legacyVal, val); - Assert.AreEqual("
This is some content
", val); - } + [Test] + public void Get_Item_User_Property() + { + var val = library.GetItem(1173, "content"); + var legacyVal = LegacyGetItem(1173, "content"); + Assert.AreEqual(legacyVal, val); + Assert.AreEqual("
This is some content
", val); + } - [Test] - public void Get_Item_Document_Property() - { - //first test a single static val - var val = library.GetItem(1173, "template"); - var legacyVal = LegacyGetItem(1173, "template"); - Assert.AreEqual(legacyVal, val); - Assert.AreEqual("1234", val); + [Test] + public void Get_Item_Document_Property() + { + //first test a single static val + var val = library.GetItem(1173, "template"); + var legacyVal = LegacyGetItem(1173, "template"); + Assert.AreEqual(legacyVal, val); + Assert.AreEqual("1234", val); - //now test them all to see if they all match legacy - foreach(var s in new[]{"id","parentID","level","writerID","template","sortOrder","createDate","updateDate","nodeName","writerName","path"}) - { - val = library.GetItem(1173, s); - legacyVal = LegacyGetItem(1173, s); - Assert.AreEqual(legacyVal, val); - } - } + //now test them all to see if they all match legacy + foreach(var s in new[]{"id","parentID","level","writerID","template","sortOrder","createDate","updateDate","nodeName","writerName","path"}) + { + val = library.GetItem(1173, s); + legacyVal = LegacyGetItem(1173, s); + Assert.AreEqual(legacyVal, val); + } + } - [Test] - public void Get_Item_Invalid_Property() - { - var val = library.GetItem(1173, "dontfindme"); - var legacyVal = LegacyGetItem(1173, "dontfindme"); - Assert.AreEqual(legacyVal, val); - Assert.AreEqual("", val); - } + [Test] + public void Get_Item_Invalid_Property() + { + var val = library.GetItem(1173, "dontfindme"); + var legacyVal = LegacyGetItem(1173, "dontfindme"); + Assert.AreEqual(legacyVal, val); + Assert.AreEqual("", val); + } - /// - /// The old method, just using this to make sure we're returning the correct exact data as before. - /// - /// - /// - /// - private string LegacyGetItem(int nodeId, string alias) - { + /// + /// The old method, just using this to make sure we're returning the correct exact data as before. + /// + /// + /// + /// + private string LegacyGetItem(int nodeId, string alias) + { var cache = UmbracoContext.Current.ContentCache as PublishedContentCache; if (cache == null) throw new Exception("Unsupported IPublishedContentCache, only the Xml one is supported."); var umbracoXML = cache.GetXml(UmbracoContext.Current.InPreviewMode); string xpath = "./{0}"; - if (umbracoXML.GetElementById(nodeId.ToString()) != null) - if ( - ",id,parentID,level,writerID,template,sortOrder,createDate,updateDate,nodeName,writerName,path," - . - IndexOf("," + alias + ",") > -1) - return umbracoXML.GetElementById(nodeId.ToString()).Attributes.GetNamedItem(alias).Value; - else if ( - umbracoXML.GetElementById(nodeId.ToString()).SelectSingleNode(string.Format(xpath, alias)) != - null) - return - umbracoXML.GetElementById(nodeId.ToString()).SelectSingleNode(string.Format(xpath, alias)).ChildNodes[0]. - Value; //.Value + "*"; - else - return string.Empty; - else - return string.Empty; - } - } + if (umbracoXML.GetElementById(nodeId.ToString()) != null) + if ( + ",id,parentID,level,writerID,template,sortOrder,createDate,updateDate,nodeName,writerName,path," + . + IndexOf("," + alias + ",") > -1) + return umbracoXML.GetElementById(nodeId.ToString()).Attributes.GetNamedItem(alias).Value; + else if ( + umbracoXML.GetElementById(nodeId.ToString()).SelectSingleNode(string.Format(xpath, alias)) != + null) + return + umbracoXML.GetElementById(nodeId.ToString()).SelectSingleNode(string.Format(xpath, alias)).ChildNodes[0]. + Value; //.Value + "*"; + else + return string.Empty; + else + return string.Empty; + } + } } diff --git a/src/Umbraco.Tests/Misc/UriUtilityTests.cs b/src/Umbraco.Tests/Misc/UriUtilityTests.cs index 8eb7ee4311..851060ce13 100644 --- a/src/Umbraco.Tests/Misc/UriUtilityTests.cs +++ b/src/Umbraco.Tests/Misc/UriUtilityTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Configuration; using Moq; using NUnit.Framework; @@ -7,132 +7,132 @@ using Umbraco.Web; namespace Umbraco.Tests.Misc { - // fixme - not testing virtual directory! + // fixme - not testing virtual directory! - [TestFixture] - public class UriUtilityTests - { - [TearDown] - public void TearDown() - { + [TestFixture] + public class UriUtilityTests + { + [TearDown] + public void TearDown() + { SettingsForTests.Reset(); - } + } - // test normal urls - [TestCase("http://LocalHost/", "http://localhost/")] - [TestCase("http://LocalHost/?x=y", "http://localhost/?x=y")] - [TestCase("http://LocalHost/Home", "http://localhost/home")] - [TestCase("http://LocalHost/Home?x=y", "http://localhost/home?x=y")] - [TestCase("http://LocalHost/Home/Sub1", "http://localhost/home/sub1")] - [TestCase("http://LocalHost/Home/Sub1?x=y", "http://localhost/home/sub1?x=y")] + // test normal urls + [TestCase("http://LocalHost/", "http://localhost/")] + [TestCase("http://LocalHost/?x=y", "http://localhost/?x=y")] + [TestCase("http://LocalHost/Home", "http://localhost/home")] + [TestCase("http://LocalHost/Home?x=y", "http://localhost/home?x=y")] + [TestCase("http://LocalHost/Home/Sub1", "http://localhost/home/sub1")] + [TestCase("http://LocalHost/Home/Sub1?x=y", "http://localhost/home/sub1?x=y")] - // same with .aspx - [TestCase("http://LocalHost/Home.aspx", "http://localhost/home")] - [TestCase("http://LocalHost/Home.aspx?x=y", "http://localhost/home?x=y")] - [TestCase("http://LocalHost/Home/Sub1.aspx", "http://localhost/home/sub1")] - [TestCase("http://LocalHost/Home/Sub1.aspx?x=y", "http://localhost/home/sub1?x=y")] + // same with .aspx + [TestCase("http://LocalHost/Home.aspx", "http://localhost/home")] + [TestCase("http://LocalHost/Home.aspx?x=y", "http://localhost/home?x=y")] + [TestCase("http://LocalHost/Home/Sub1.aspx", "http://localhost/home/sub1")] + [TestCase("http://LocalHost/Home/Sub1.aspx?x=y", "http://localhost/home/sub1?x=y")] - // test that the trailing slash goes but not on hostname - [TestCase("http://LocalHost/", "http://localhost/")] - [TestCase("http://LocalHost/Home/", "http://localhost/home")] - [TestCase("http://LocalHost/Home/?x=y", "http://localhost/home?x=y")] - [TestCase("http://LocalHost/Home/Sub1/", "http://localhost/home/sub1")] - [TestCase("http://LocalHost/Home/Sub1/?x=y", "http://localhost/home/sub1?x=y")] + // test that the trailing slash goes but not on hostname + [TestCase("http://LocalHost/", "http://localhost/")] + [TestCase("http://LocalHost/Home/", "http://localhost/home")] + [TestCase("http://LocalHost/Home/?x=y", "http://localhost/home?x=y")] + [TestCase("http://LocalHost/Home/Sub1/", "http://localhost/home/sub1")] + [TestCase("http://LocalHost/Home/Sub1/?x=y", "http://localhost/home/sub1?x=y")] - // test that default.aspx goes, even with parameters - [TestCase("http://LocalHost/deFault.aspx", "http://localhost/")] - [TestCase("http://LocalHost/deFault.aspx?x=y", "http://localhost/?x=y")] + // test that default.aspx goes, even with parameters + [TestCase("http://LocalHost/deFault.aspx", "http://localhost/")] + [TestCase("http://LocalHost/deFault.aspx?x=y", "http://localhost/?x=y")] - // test with inner .aspx - [TestCase("http://Localhost/Home/Sub1.aspx/Sub2", "http://localhost/home/sub1/sub2")] - [TestCase("http://Localhost/Home/Sub1.aspx/Sub2?x=y", "http://localhost/home/sub1/sub2?x=y")] - [TestCase("http://Localhost/Home.aspx/Sub1.aspx/Sub2?x=y", "http://localhost/home/sub1/sub2?x=y")] - [TestCase("http://Localhost/deFault.aspx/Home.aspx/deFault.aspx/Sub1.aspx", "http://localhost/home/default/sub1")] + // test with inner .aspx + [TestCase("http://Localhost/Home/Sub1.aspx/Sub2", "http://localhost/home/sub1/sub2")] + [TestCase("http://Localhost/Home/Sub1.aspx/Sub2?x=y", "http://localhost/home/sub1/sub2?x=y")] + [TestCase("http://Localhost/Home.aspx/Sub1.aspx/Sub2?x=y", "http://localhost/home/sub1/sub2?x=y")] + [TestCase("http://Localhost/deFault.aspx/Home.aspx/deFault.aspx/Sub1.aspx", "http://localhost/home/default/sub1")] - public void Uri_To_Umbraco(string sourceUrl, string expectedUrl) - { - UriUtility.SetAppDomainAppVirtualPath("/"); + public void Uri_To_Umbraco(string sourceUrl, string expectedUrl) + { + UriUtility.SetAppDomainAppVirtualPath("/"); - var expectedUri = new Uri(expectedUrl); - var sourceUri = new Uri(sourceUrl); - var resultUri = UriUtility.UriToUmbraco(sourceUri); + var expectedUri = new Uri(expectedUrl); + var sourceUri = new Uri(sourceUrl); + var resultUri = UriUtility.UriToUmbraco(sourceUri); - Assert.AreEqual(expectedUri.ToString(), resultUri.ToString()); - } + Assert.AreEqual(expectedUri.ToString(), resultUri.ToString()); + } - // test directoryUrl false, trailingSlash false - [TestCase("/", "/", false, false)] - [TestCase("/home", "/home.aspx", false, false)] - [TestCase("/home/sub1", "/home/sub1.aspx", false, false)] + // test directoryUrl false, trailingSlash false + [TestCase("/", "/", false, false)] + [TestCase("/home", "/home.aspx", false, false)] + [TestCase("/home/sub1", "/home/sub1.aspx", false, false)] - // test directoryUrl false, trailingSlash true - [TestCase("/", "/", false, true)] - [TestCase("/home", "/home.aspx", false, true)] - [TestCase("/home/sub1", "/home/sub1.aspx", false, true)] + // test directoryUrl false, trailingSlash true + [TestCase("/", "/", false, true)] + [TestCase("/home", "/home.aspx", false, true)] + [TestCase("/home/sub1", "/home/sub1.aspx", false, true)] - // test directoryUrl true, trailingSlash false - [TestCase("/", "/", true, false)] - [TestCase("/home", "/home", true, false)] - [TestCase("/home/sub1", "/home/sub1", true, false)] + // test directoryUrl true, trailingSlash false + [TestCase("/", "/", true, false)] + [TestCase("/home", "/home", true, false)] + [TestCase("/home/sub1", "/home/sub1", true, false)] - // test directoryUrl true, trailingSlash true - [TestCase("/", "/", true, true)] - [TestCase("/home", "/home/", true, true)] - [TestCase("/home/sub1", "/home/sub1/", true, true)] + // test directoryUrl true, trailingSlash true + [TestCase("/", "/", true, true)] + [TestCase("/home", "/home/", true, true)] + [TestCase("/home/sub1", "/home/sub1/", true, true)] - public void Uri_From_Umbraco(string sourceUrl, string expectedUrl, bool directoryUrls, bool trailingSlash) - { - ConfigurationManager.AppSettings.Set("umbracoUseDirectoryUrls", directoryUrls ? "true" : "false"); + public void Uri_From_Umbraco(string sourceUrl, string expectedUrl, bool directoryUrls, bool trailingSlash) + { + ConfigurationManager.AppSettings.Set("umbracoUseDirectoryUrls", directoryUrls ? "true" : "false"); var settings = SettingsForTests.GenerateMockSettings(); var requestMock = Mock.Get(settings.RequestHandler); requestMock.Setup(x => x.AddTrailingSlash).Returns(trailingSlash); SettingsForTests.ConfigureSettings(settings); - + UriUtility.SetAppDomainAppVirtualPath("/"); - var expectedUri = NewUri(expectedUrl); - var sourceUri = NewUri(sourceUrl); - var resultUri = UriUtility.UriFromUmbraco(sourceUri); + var expectedUri = NewUri(expectedUrl); + var sourceUri = NewUri(sourceUrl); + var resultUri = UriUtility.UriFromUmbraco(sourceUri); - Assert.AreEqual(expectedUri.ToString(), resultUri.ToString()); - } + Assert.AreEqual(expectedUri.ToString(), resultUri.ToString()); + } - Uri NewUri(string url) - { - return new Uri(url, url.StartsWith("http:") ? UriKind.Absolute : UriKind.Relative); - } + Uri NewUri(string url) + { + return new Uri(url, url.StartsWith("http:") ? UriKind.Absolute : UriKind.Relative); + } - // - [TestCase("/", "/", "/")] - [TestCase("/", "/foo", "/foo")] - [TestCase("/", "~/foo", "/foo")] - [TestCase("/vdir", "/", "/vdir/")] - [TestCase("/vdir", "/foo", "/vdir/foo")] - [TestCase("/vdir", "/foo/", "/vdir/foo/")] - [TestCase("/vdir", "~/foo", "/vdir/foo")] + // + [TestCase("/", "/", "/")] + [TestCase("/", "/foo", "/foo")] + [TestCase("/", "~/foo", "/foo")] + [TestCase("/vdir", "/", "/vdir/")] + [TestCase("/vdir", "/foo", "/vdir/foo")] + [TestCase("/vdir", "/foo/", "/vdir/foo/")] + [TestCase("/vdir", "~/foo", "/vdir/foo")] - public void Uri_To_Absolute(string virtualPath, string sourceUrl, string expectedUrl) - { - UriUtility.SetAppDomainAppVirtualPath(virtualPath); - var resultUrl = UriUtility.ToAbsolute(sourceUrl); - Assert.AreEqual(expectedUrl, resultUrl); - } + public void Uri_To_Absolute(string virtualPath, string sourceUrl, string expectedUrl) + { + UriUtility.SetAppDomainAppVirtualPath(virtualPath); + var resultUrl = UriUtility.ToAbsolute(sourceUrl); + Assert.AreEqual(expectedUrl, resultUrl); + } - // - [TestCase("/", "/", "/")] - [TestCase("/", "/foo", "/foo")] - [TestCase("/", "/foo/", "/foo/")] - [TestCase("/vdir", "/vdir", "/")] - [TestCase("/vdir", "/vdir/", "/")] - [TestCase("/vdir", "/vdir/foo", "/foo")] - [TestCase("/vdir", "/vdir/foo/", "/foo/")] + // + [TestCase("/", "/", "/")] + [TestCase("/", "/foo", "/foo")] + [TestCase("/", "/foo/", "/foo/")] + [TestCase("/vdir", "/vdir", "/")] + [TestCase("/vdir", "/vdir/", "/")] + [TestCase("/vdir", "/vdir/foo", "/foo")] + [TestCase("/vdir", "/vdir/foo/", "/foo/")] - public void Url_To_App_Relative(string virtualPath, string sourceUrl, string expectedUrl) - { - UriUtility.SetAppDomainAppVirtualPath(virtualPath); - var resultUrl = UriUtility.ToAppRelative(sourceUrl); - Assert.AreEqual(expectedUrl, resultUrl); - } - } -} \ No newline at end of file + public void Url_To_App_Relative(string virtualPath, string sourceUrl, string expectedUrl) + { + UriUtility.SetAppDomainAppVirtualPath(virtualPath); + var resultUrl = UriUtility.ToAppRelative(sourceUrl); + Assert.AreEqual(expectedUrl, resultUrl); + } + } +} diff --git a/src/Umbraco.Tests/Misc/XmlHelperTests.cs b/src/Umbraco.Tests/Misc/XmlHelperTests.cs index 5df954ebea..cb666a72fb 100644 --- a/src/Umbraco.Tests/Misc/XmlHelperTests.cs +++ b/src/Umbraco.Tests/Misc/XmlHelperTests.cs @@ -78,8 +78,8 @@ namespace Umbraco.Tests.Misc var parentNode = (XmlElement)original.Clone(); watch.Start(); XmlHelper.SortNodes( - parentNode, - "./* [@id]", + parentNode, + "./* [@id]", x => x.AttributeValue("sortOrder")); watch.Stop(); totalTime += watch.ElapsedMilliseconds; @@ -112,14 +112,14 @@ namespace Umbraco.Tests.Misc xml.LoadXml(xmlContent); var original = xml.GetElementById(1173.ToString()); Assert.IsNotNull(original); - + var parentNode = (XmlElement)original.Clone(); - + XmlHelper.SortNodes( parentNode, "./* [@id]", x => x.AttributeValue("sortOrder")); - + //do assertions just to make sure it is working properly. var currSort = 0; foreach (var child in parentNode.SelectNodes("./* [@id]").Cast()) @@ -165,105 +165,105 @@ namespace Umbraco.Tests.Misc private string GetXmlContent(int templateId) { return @" - ]> - - - - 1 - - This is some content
]]> - - - - - - - - - - - - + + + + 1 + + This is some content
]]> + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - + + + + + + + "; } } diff --git a/src/Umbraco.Tests/Models/Collections/Item.cs b/src/Umbraco.Tests/Models/Collections/Item.cs index 7f4163218f..7fc014838d 100644 --- a/src/Umbraco.Tests/Models/Collections/Item.cs +++ b/src/Umbraco.Tests/Models/Collections/Item.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; @@ -41,7 +41,7 @@ namespace Umbraco.Tests.Models.Collections /// /// Guid based Id /// - /// The key is currectly used to store the Unique Id from the + /// The key is currectly used to store the Unique Id from the /// umbracoNode table, which many of the entities are based on. [DataMember] public Guid Key @@ -242,10 +242,10 @@ namespace Umbraco.Tests.Models.Collections _hash = !HasIdentity ? new int?(base.GetHashCode()) : new int?(Id.GetHashCode() * 397 ^ GetType().GetHashCode()); return _hash.Value; }*/ - + public object DeepClone() { return this.MemberwiseClone(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Models/Collections/OrderItem.cs b/src/Umbraco.Tests/Models/Collections/OrderItem.cs index 81c770db92..8d010495ac 100644 --- a/src/Umbraco.Tests/Models/Collections/OrderItem.cs +++ b/src/Umbraco.Tests/Models/Collections/OrderItem.cs @@ -1,4 +1,4 @@ -using System; +using System; namespace Umbraco.Tests.Models.Collections { @@ -39,4 +39,4 @@ namespace Umbraco.Tests.Models.Collections UnitPrice * _quantity); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Models/Collections/PropertyCollectionTests.cs b/src/Umbraco.Tests/Models/Collections/PropertyCollectionTests.cs index 2459649a36..03943e8ddc 100644 --- a/src/Umbraco.Tests/Models/Collections/PropertyCollectionTests.cs +++ b/src/Umbraco.Tests/Models/Collections/PropertyCollectionTests.cs @@ -28,7 +28,7 @@ namespace Umbraco.Tests.Models.Collections var collection = new PropertyCollection(); collection.Add(new Property(new PropertyType("propEditor", DataTypeDatabaseType.Nvarchar, "test"))); - + Assert.IsTrue(collection.Contains("Test")); } @@ -49,7 +49,7 @@ namespace Umbraco.Tests.Models.Collections var first = collection.FirstOrDefault(); var second = collection.FirstOrDefault(x => x.Alias.InvariantEquals("Test")); - + Assert.That(first, Is.Null); Assert.That(first == null, Is.True); Assert.That(second == null, Is.True); @@ -86,4 +86,4 @@ namespace Umbraco.Tests.Models.Collections Assert.That(contentType.PropertyGroups.Any(x => x.Name.InvariantEquals("Test")), Is.False); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Models/Collections/SimpleOrder.cs b/src/Umbraco.Tests/Models/Collections/SimpleOrder.cs index 82df104b64..e7b7d4a9bc 100644 --- a/src/Umbraco.Tests/Models/Collections/SimpleOrder.cs +++ b/src/Umbraco.Tests/Models/Collections/SimpleOrder.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Collections.ObjectModel; using System.Collections.Specialized; using System.Linq; @@ -8,10 +8,10 @@ namespace Umbraco.Tests.Models.Collections { public class SimpleOrder : KeyedCollection, INotifyCollectionChanged { - // The parameterless constructor of the base class creates a - // KeyedCollection with an internal dictionary. For this code - // example, no other constructors are exposed. - // + // The parameterless constructor of the base class creates a + // KeyedCollection with an internal dictionary. For this code + // example, no other constructors are exposed. + // public SimpleOrder() : base() { } public SimpleOrder(IEnumerable properties) @@ -19,16 +19,16 @@ namespace Umbraco.Tests.Models.Collections Reset(properties); } - // This is the only method that absolutely must be overridden, - // because without it the KeyedCollection cannot extract the - // keys from the items. The input parameter type is the - // second generic type argument, in this case OrderItem, and - // the return value type is the first generic type argument, - // in this case int. - // + // This is the only method that absolutely must be overridden, + // because without it the KeyedCollection cannot extract the + // keys from the items. The input parameter type is the + // second generic type argument, in this case OrderItem, and + // the return value type is the first generic type argument, + // in this case int. + // protected override int GetKeyForItem(OrderItem item) { - // In this example, the key is the part number. + // In this example, the key is the part number. return item.PartNumber; } @@ -79,4 +79,4 @@ namespace Umbraco.Tests.Models.Collections } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Models/ContentExtensionsTests.cs b/src/Umbraco.Tests/Models/ContentExtensionsTests.cs index 63d76d8d55..a555f0f3de 100644 --- a/src/Umbraco.Tests/Models/ContentExtensionsTests.cs +++ b/src/Umbraco.Tests/Models/ContentExtensionsTests.cs @@ -636,7 +636,7 @@ namespace Umbraco.Tests.Models //Assert.IsFalse(content.WasDirty()); // not impacted by user properties Assert.IsTrue(content.WasDirty()); // now it is! } - + #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Models/ContentTests.cs b/src/Umbraco.Tests/Models/ContentTests.cs index 91a92a2d8b..29e9f791a8 100644 --- a/src/Umbraco.Tests/Models/ContentTests.cs +++ b/src/Umbraco.Tests/Models/ContentTests.cs @@ -897,4 +897,4 @@ namespace Umbraco.Tests.Models Assert.That(addedTextpageParent, Is.False); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Models/ContentTypeTests.cs b/src/Umbraco.Tests/Models/ContentTypeTests.cs index e5b9e975c7..cc97e2307b 100644 --- a/src/Umbraco.Tests/Models/ContentTypeTests.cs +++ b/src/Umbraco.Tests/Models/ContentTypeTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics; using System.Linq; using NUnit.Framework; @@ -15,7 +15,7 @@ namespace Umbraco.Tests.Models [TestFixture] public class ContentTypeTests : UmbracoTestBase { - + [Test] public void Can_Deep_Clone_Content_Type_Sort() @@ -149,7 +149,7 @@ namespace Umbraco.Tests.Models using (proflog.DebugDuration("Cloning content type")) { var clone = (ContentType)contentType.DeepClone(); - } + } } } } @@ -160,7 +160,7 @@ namespace Umbraco.Tests.Models // Arrange var contentType = MockedContentTypes.CreateTextpageContentType(); contentType.Id = 99; - + var i = 200; foreach (var propertyType in contentType.PropertyTypes) { @@ -178,7 +178,7 @@ namespace Umbraco.Tests.Models contentType.SetDefaultTemplate(new Template((string) "Test Template", (string) "testTemplate") { Id = 88 - }); + }); contentType.Description = "test"; contentType.Icon = "icon"; contentType.IsContainer = true; @@ -186,7 +186,7 @@ namespace Umbraco.Tests.Models contentType.Key = Guid.NewGuid(); contentType.Level = 3; contentType.Path = "-1,4,10"; - contentType.SortOrder = 5; + contentType.SortOrder = 5; contentType.Trashed = false; contentType.UpdateDate = DateTime.Now; @@ -237,7 +237,7 @@ namespace Umbraco.Tests.Models Assert.AreEqual(clone.Thumbnail, contentType.Thumbnail); Assert.AreEqual(clone.Icon, contentType.Icon); Assert.AreEqual(clone.IsContainer, contentType.IsContainer); - + //This double verifies by reflection var allProps = clone.GetType().GetProperties(); foreach (var propertyInfo in allProps) @@ -313,7 +313,7 @@ namespace Umbraco.Tests.Models } contentType.Id = 10; contentType.CreateDate = DateTime.Now; - contentType.CreatorId = 22; + contentType.CreatorId = 22; contentType.Description = "test"; contentType.Icon = "icon"; contentType.IsContainer = true; @@ -512,4 +512,4 @@ namespace Umbraco.Tests.Models Debug.Print(json); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Models/ContentXmlTest.cs b/src/Umbraco.Tests/Models/ContentXmlTest.cs index ef083ca378..e03b3becf7 100644 --- a/src/Umbraco.Tests/Models/ContentXmlTest.cs +++ b/src/Umbraco.Tests/Models/ContentXmlTest.cs @@ -54,6 +54,6 @@ namespace Umbraco.Tests.Models Assert.AreEqual(content.Properties["bodyText"].Value.ToString(), element.Elements("bodyText").Single().Value); Assert.AreEqual(content.Properties["keywords"].Value.ToString(), element.Elements("keywords").Single().Value); Assert.AreEqual(content.Properties["description"].Value.ToString(), element.Elements("description").Single().Value); - } + } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Models/DataTypeDefinitionTests.cs b/src/Umbraco.Tests/Models/DataTypeDefinitionTests.cs index 2a5ad55e1b..a6a7827363 100644 --- a/src/Umbraco.Tests/Models/DataTypeDefinitionTests.cs +++ b/src/Umbraco.Tests/Models/DataTypeDefinitionTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics; using NUnit.Framework; @@ -78,6 +78,6 @@ namespace Umbraco.Tests.Models var json = result.ResultStream.ToJsonString(); Debug.Print(json); } - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Models/DeepCloneHelperTests.cs b/src/Umbraco.Tests/Models/DeepCloneHelperTests.cs index cb0a4edde1..1678ef26a8 100644 --- a/src/Umbraco.Tests/Models/DeepCloneHelperTests.cs +++ b/src/Umbraco.Tests/Models/DeepCloneHelperTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.Collections.Generic; using System.Linq; @@ -181,7 +181,7 @@ namespace Umbraco.Tests.Models { public string Name { get; set; } public object[] MyTest1 { get; set; } - + } public class Test4 : BaseCloneable @@ -229,4 +229,4 @@ namespace Umbraco.Tests.Models } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Models/DictionaryItemTests.cs b/src/Umbraco.Tests/Models/DictionaryItemTests.cs index ab60ccd709..924216f7d3 100644 --- a/src/Umbraco.Tests/Models/DictionaryItemTests.cs +++ b/src/Umbraco.Tests/Models/DictionaryItemTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics; using System.Linq; using NUnit.Framework; @@ -134,4 +134,4 @@ namespace Umbraco.Tests.Models Debug.Print(json); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Models/DictionaryTranslationTests.cs b/src/Umbraco.Tests/Models/DictionaryTranslationTests.cs index c69047d94e..d7fcea71f0 100644 --- a/src/Umbraco.Tests/Models/DictionaryTranslationTests.cs +++ b/src/Umbraco.Tests/Models/DictionaryTranslationTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics; using System.Linq; using NUnit.Framework; @@ -38,7 +38,7 @@ namespace Umbraco.Tests.Models Assert.AreEqual(clone.Key, item.Key); Assert.AreEqual(clone.UpdateDate, item.UpdateDate); Assert.AreNotSame(clone.Language, item.Language); - //This is null because we are ignoring it from cloning due to caching/cloning issues - we don't really want + //This is null because we are ignoring it from cloning due to caching/cloning issues - we don't really want // this entity attached to this item but we're stuck with it for now Assert.IsNull(clone.Language); Assert.AreEqual(clone.LanguageId, item.LanguageId); @@ -78,4 +78,4 @@ namespace Umbraco.Tests.Models Debug.Print(json); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Models/LanguageTests.cs b/src/Umbraco.Tests/Models/LanguageTests.cs index dc6b7bf989..5f8d858007 100644 --- a/src/Umbraco.Tests/Models/LanguageTests.cs +++ b/src/Umbraco.Tests/Models/LanguageTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics; using NUnit.Framework; using Umbraco.Core.Models; @@ -19,7 +19,7 @@ namespace Umbraco.Tests.Models Id = 11, IsoCode = "en", Key = Guid.NewGuid(), - UpdateDate = DateTime.Now + UpdateDate = DateTime.Now }; var clone = (Language) item.DeepClone(); @@ -60,4 +60,4 @@ namespace Umbraco.Tests.Models Debug.Print(json); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Models/MacroTests.cs b/src/Umbraco.Tests/Models/MacroTests.cs index f9e37454cb..414b00650d 100644 --- a/src/Umbraco.Tests/Models/MacroTests.cs +++ b/src/Umbraco.Tests/Models/MacroTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using NUnit.Framework; using Umbraco.Core.Models; @@ -62,4 +62,4 @@ namespace Umbraco.Tests.Models } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Models/Mapping/AutoMapperTests.cs b/src/Umbraco.Tests/Models/Mapping/AutoMapperTests.cs index 2470eee7e8..501d0c73c9 100644 --- a/src/Umbraco.Tests/Models/Mapping/AutoMapperTests.cs +++ b/src/Umbraco.Tests/Models/Mapping/AutoMapperTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.IO; using System.Linq; @@ -80,4 +80,4 @@ namespace Umbraco.Tests.Models.Mapping Mapper.AssertConfigurationIsValid(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Models/Mapping/ContentWebModelMappingTests.cs b/src/Umbraco.Tests/Models/Mapping/ContentWebModelMappingTests.cs index 3061c3baf4..56305a5e0a 100644 --- a/src/Umbraco.Tests/Models/Mapping/ContentWebModelMappingTests.cs +++ b/src/Umbraco.Tests/Models/Mapping/ContentWebModelMappingTests.cs @@ -79,7 +79,7 @@ namespace Umbraco.Tests.Models.Mapping var result = Mapper.Map>(content); - AssertContentItem(result, content); + AssertContentItem(result, content); } [Test] @@ -112,7 +112,7 @@ namespace Umbraco.Tests.Models.Mapping foreach (var p in content.Properties) { AssertDisplayProperty(result, p); - } + } Assert.AreEqual(content.PropertyGroups.Count(), result.Tabs.Count() - 1); Assert.IsTrue(result.Tabs.Any(x => x.Label == Current.Services.TextService.Localize("general/properties"))); Assert.IsTrue(result.Tabs.First().IsActive); @@ -123,7 +123,7 @@ namespace Umbraco.Tests.Models.Mapping public void To_Display_Model_With_Non_Grouped_Properties() { var idSeed = 1; - var contentType = MockedContentTypes.CreateSimpleContentType(); + var contentType = MockedContentTypes.CreateSimpleContentType(); //add non-grouped properties contentType.AddPropertyType(new PropertyType(Constants.PropertyEditors.TextboxAlias, DataTypeDatabaseType.Ntext, "nonGrouped1") { Name = "Non Grouped 1", Description = "", Mandatory = false, SortOrder = 1, DataTypeDefinitionId = -88 }); contentType.AddPropertyType(new PropertyType(Constants.PropertyEditors.TextboxAlias, DataTypeDatabaseType.Ntext, "nonGrouped2") { Name = "Non Grouped 2", Description = "", Mandatory = false, SortOrder = 1, DataTypeDefinitionId = -88 }); @@ -171,10 +171,10 @@ namespace Umbraco.Tests.Models.Mapping where TPersisted : IContentBase { AssertBasicProperty(result, p); - + var pDto = result.Properties.SingleOrDefault(x => x.Alias == p.Alias); Assert.IsNotNull(pDto); - + //pDto.Alias = p.Alias; //pDto.Description = p.PropertyType.Description; //pDto.Label = p.PropertyType.Name; diff --git a/src/Umbraco.Tests/Models/MediaXmlTest.cs b/src/Umbraco.Tests/Models/MediaXmlTest.cs index a5fed2a4f5..4d03430fe3 100644 --- a/src/Umbraco.Tests/Models/MediaXmlTest.cs +++ b/src/Umbraco.Tests/Models/MediaXmlTest.cs @@ -72,4 +72,4 @@ namespace Umbraco.Tests.Models Assert.AreEqual(media.Properties[Constants.Conventions.Media.Extension].Value.ToString(), element.Elements(Constants.Conventions.Media.Extension).Single().Value); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Models/MemberGroupTests.cs b/src/Umbraco.Tests/Models/MemberGroupTests.cs index ed208540ff..fc76980890 100644 --- a/src/Umbraco.Tests/Models/MemberGroupTests.cs +++ b/src/Umbraco.Tests/Models/MemberGroupTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics; using NUnit.Framework; using Umbraco.Core.Models; @@ -39,7 +39,7 @@ namespace Umbraco.Tests.Models Assert.AreEqual(clone.Key, group.Key); Assert.AreEqual(clone.UpdateDate, group.UpdateDate); Assert.AreEqual(clone.Name, group.Name); - + //This double verifies by reflection var allProps = clone.GetType().GetProperties(); foreach (var propertyInfo in allProps) @@ -71,4 +71,4 @@ namespace Umbraco.Tests.Models } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Models/MemberTests.cs b/src/Umbraco.Tests/Models/MemberTests.cs index ff1847d8ea..c4e106e9cb 100644 --- a/src/Umbraco.Tests/Models/MemberTests.cs +++ b/src/Umbraco.Tests/Models/MemberTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics; using System.Linq; using NUnit.Framework; @@ -45,7 +45,7 @@ namespace Umbraco.Tests.Models member.SortOrder = 5; member.Trashed = false; member.UpdateDate = DateTime.Now; - member.Version = Guid.NewGuid(); + member.Version = Guid.NewGuid(); ((IUmbracoEntity)member).AdditionalData.Add("test1", 123); ((IUmbracoEntity)member).AdditionalData.Add("test2", "hello"); @@ -154,4 +154,4 @@ namespace Umbraco.Tests.Models Debug.Print(json); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Models/PreValueCollectionTests.cs b/src/Umbraco.Tests/Models/PreValueCollectionTests.cs index c33594b053..e6f35ea3d3 100644 --- a/src/Umbraco.Tests/Models/PreValueCollectionTests.cs +++ b/src/Umbraco.Tests/Models/PreValueCollectionTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using NUnit.Framework; @@ -48,4 +48,4 @@ namespace Umbraco.Tests.Models assert(a, clone2); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Models/PropertyGroupTests.cs b/src/Umbraco.Tests/Models/PropertyGroupTests.cs index e96d116976..cb69becf8b 100644 --- a/src/Umbraco.Tests/Models/PropertyGroupTests.cs +++ b/src/Umbraco.Tests/Models/PropertyGroupTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics; using NUnit.Framework; using Umbraco.Core.Models; @@ -140,4 +140,4 @@ namespace Umbraco.Tests.Models Debug.Print(json); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Models/PropertyTypeTests.cs b/src/Umbraco.Tests/Models/PropertyTypeTests.cs index cb85e0b21f..559d63b5df 100644 --- a/src/Umbraco.Tests/Models/PropertyTypeTests.cs +++ b/src/Umbraco.Tests/Models/PropertyTypeTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics; using NUnit.Framework; using Umbraco.Core.Models; @@ -27,7 +27,7 @@ namespace Umbraco.Tests.Models SortOrder = 9, UpdateDate = DateTime.Now, ValidationRegExp = "xxxx", - DataTypeDatabaseType = DataTypeDatabaseType.Nvarchar + DataTypeDatabaseType = DataTypeDatabaseType.Nvarchar }; var clone = (PropertyType)pt.DeepClone(); @@ -85,4 +85,4 @@ namespace Umbraco.Tests.Models } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Models/RelationTests.cs b/src/Umbraco.Tests/Models/RelationTests.cs index e1d218ef6e..c62dcdc6eb 100644 --- a/src/Umbraco.Tests/Models/RelationTests.cs +++ b/src/Umbraco.Tests/Models/RelationTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics; using NUnit.Framework; using Umbraco.Core.Models; @@ -69,4 +69,4 @@ namespace Umbraco.Tests.Models Debug.Print(json); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Models/RelationTypeTests.cs b/src/Umbraco.Tests/Models/RelationTypeTests.cs index 526dfdb3f6..9d8fdcdf25 100644 --- a/src/Umbraco.Tests/Models/RelationTypeTests.cs +++ b/src/Umbraco.Tests/Models/RelationTypeTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics; using NUnit.Framework; using Umbraco.Core.Models; @@ -19,7 +19,7 @@ namespace Umbraco.Tests.Models IsBidirectional = true, Key = Guid.NewGuid(), Name = "Test", - UpdateDate = DateTime.Now + UpdateDate = DateTime.Now }; var clone = (RelationType)item.DeepClone(); @@ -32,7 +32,7 @@ namespace Umbraco.Tests.Models Assert.AreEqual(clone.Id, item.Id); Assert.AreEqual(clone.Key, item.Key); Assert.AreEqual(clone.Name, item.Name); - Assert.AreNotSame(clone.ParentObjectType, item.ParentObjectType); + Assert.AreNotSame(clone.ParentObjectType, item.ParentObjectType); Assert.AreEqual(clone.UpdateDate, item.UpdateDate); //This double verifies by reflection @@ -63,4 +63,4 @@ namespace Umbraco.Tests.Models Debug.Print(json); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Models/StylesheetTests.cs b/src/Umbraco.Tests/Models/StylesheetTests.cs index ec6761e0e2..2ed72613fb 100644 --- a/src/Umbraco.Tests/Models/StylesheetTests.cs +++ b/src/Umbraco.Tests/Models/StylesheetTests.cs @@ -50,7 +50,7 @@ namespace Umbraco.Tests.Models // Arrange var stylesheet = new Stylesheet("/css/styles.css") { Content = @"body { color:#000; } /**umb_name:Hello*/p{font-size:2em;} .bold {font-weight:bold;}" }; - + Assert.AreEqual(1, stylesheet.Properties.Count()); stylesheet.RemoveProperty("Hello"); @@ -116,4 +116,4 @@ namespace Umbraco.Tests.Models Debug.Print(json); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Models/TaskTests.cs b/src/Umbraco.Tests/Models/TaskTests.cs index 54b62fcfa9..808c2884b7 100644 --- a/src/Umbraco.Tests/Models/TaskTests.cs +++ b/src/Umbraco.Tests/Models/TaskTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics; using NUnit.Framework; using Umbraco.Core.Models; @@ -75,4 +75,4 @@ namespace Umbraco.Tests.Models } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Models/TaskTypeTests.cs b/src/Umbraco.Tests/Models/TaskTypeTests.cs index 26d3a5d3dd..5e31e8a1d8 100644 --- a/src/Umbraco.Tests/Models/TaskTypeTests.cs +++ b/src/Umbraco.Tests/Models/TaskTypeTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics; using NUnit.Framework; using Umbraco.Core.Models; @@ -18,14 +18,14 @@ namespace Umbraco.Tests.Models Alias = "test", CreateDate = DateTime.Now, Key = Guid.NewGuid(), - UpdateDate = DateTime.Now + UpdateDate = DateTime.Now }; var clone = (TaskType)item.DeepClone(); Assert.AreNotSame(clone, item); Assert.AreEqual(clone, item); - Assert.AreEqual(clone.CreateDate, item.CreateDate); + Assert.AreEqual(clone.CreateDate, item.CreateDate); Assert.AreEqual(clone.Id, item.Id); Assert.AreEqual(clone.Key, item.Key); Assert.AreEqual(clone.Alias, item.Alias); @@ -59,4 +59,4 @@ namespace Umbraco.Tests.Models Debug.Print(json); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Models/TemplateTests.cs b/src/Umbraco.Tests/Models/TemplateTests.cs index b6a5803772..0813bc9f4e 100644 --- a/src/Umbraco.Tests/Models/TemplateTests.cs +++ b/src/Umbraco.Tests/Models/TemplateTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics; using System.Linq; using System.Reflection; @@ -18,14 +18,14 @@ namespace Umbraco.Tests.Models var item = new Template("Test", "test") { Id = 3, - CreateDate = DateTime.Now, + CreateDate = DateTime.Now, Key = Guid.NewGuid(), UpdateDate = DateTime.Now, Content = "blah", Path = "-1,3", - IsMasterTemplate = true, + IsMasterTemplate = true, MasterTemplateAlias = "master", - MasterTemplateId = new Lazy(() => 88) + MasterTemplateId = new Lazy(() => 88) }; var clone = (Template)item.DeepClone(); @@ -80,4 +80,4 @@ namespace Umbraco.Tests.Models } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Models/UmbracoEntityTests.cs b/src/Umbraco.Tests/Models/UmbracoEntityTests.cs index d45fa78c37..24ad2a4b08 100644 --- a/src/Umbraco.Tests/Models/UmbracoEntityTests.cs +++ b/src/Umbraco.Tests/Models/UmbracoEntityTests.cs @@ -173,7 +173,7 @@ namespace Umbraco.Tests.Models HasPendingChanges = true, IsDraft = true, IsPublished = true, - NodeObjectTypeId = Guid.NewGuid() + NodeObjectTypeId = Guid.NewGuid() }; item.AdditionalData.Add("test1", 3); item.AdditionalData.Add("test2", "valuie"); @@ -198,7 +198,7 @@ namespace Umbraco.Tests.Models Assert.AreEqual(clone.CreatorId, item.CreatorId); Assert.AreEqual(clone.Id, item.Id); Assert.AreEqual(clone.Key, item.Key); - Assert.AreEqual(clone.Level, item.Level); + Assert.AreEqual(clone.Level, item.Level); Assert.AreEqual(clone.Name, item.Name); Assert.AreEqual(clone.ParentId, item.ParentId); Assert.AreEqual(clone.SortOrder, item.SortOrder); @@ -213,7 +213,7 @@ namespace Umbraco.Tests.Models Assert.AreEqual(clone.UpdateDate, item.UpdateDate); Assert.AreEqual(clone.AdditionalData.Count, item.AdditionalData.Count); Assert.AreEqual(clone.AdditionalData, item.AdditionalData); - + //This double verifies by reflection var allProps = clone.GetType().GetProperties(); foreach (var propertyInfo in allProps) @@ -266,4 +266,4 @@ namespace Umbraco.Tests.Models Debug.Print(json); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Models/UserExtensionsTests.cs b/src/Umbraco.Tests/Models/UserExtensionsTests.cs index 84537987c9..d5e90d1fc4 100644 --- a/src/Umbraco.Tests/Models/UserExtensionsTests.cs +++ b/src/Umbraco.Tests/Models/UserExtensionsTests.cs @@ -26,4 +26,4 @@ namespace Umbraco.Tests.Models Assert.AreEqual(outcome, user.HasPathAccess(content)); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Models/UserTests.cs b/src/Umbraco.Tests/Models/UserTests.cs index 189a4a17a8..b6924c08cd 100644 --- a/src/Umbraco.Tests/Models/UserTests.cs +++ b/src/Umbraco.Tests/Models/UserTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics; using System.Linq; using NUnit.Framework; @@ -15,7 +15,7 @@ namespace Umbraco.Tests.Models { var item = new User(new UserType(){Id = 3}) { - Id = 3, + Id = 3, Key = Guid.NewGuid(), UpdateDate = DateTime.Now, CreateDate = DateTime.Now, @@ -38,9 +38,9 @@ namespace Umbraco.Tests.Models SessionTimeout = 5, StartContentId = 3, StartMediaId = 8, - Username = "username" + Username = "username" }; - + item.AddAllowedSection("test"); var clone = (User)item.DeepClone(); @@ -112,4 +112,4 @@ namespace Umbraco.Tests.Models Debug.Print(json); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Models/UserTypeTests.cs b/src/Umbraco.Tests/Models/UserTypeTests.cs index 72aa0b2efc..0406107fb1 100644 --- a/src/Umbraco.Tests/Models/UserTypeTests.cs +++ b/src/Umbraco.Tests/Models/UserTypeTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics; using System.Linq; using NUnit.Framework; @@ -21,14 +21,14 @@ namespace Umbraco.Tests.Models CreateDate = DateTime.Now, Name = "Test", Alias = "test", - Permissions = new[] {"a", "b", "c"} + Permissions = new[] {"a", "b", "c"} }; var clone = (UserType)item.DeepClone(); Assert.AreNotSame(clone, item); Assert.AreEqual(clone, item); - + //Verify normal properties with reflection var allProps = clone.GetType().GetProperties(); foreach (var propertyInfo in allProps) @@ -58,4 +58,4 @@ namespace Umbraco.Tests.Models Debug.Print(json); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Packaging/PackageInstallationTest.cs b/src/Umbraco.Tests/Packaging/PackageInstallationTest.cs index 78dd1c17d3..fb4d631159 100644 --- a/src/Umbraco.Tests/Packaging/PackageInstallationTest.cs +++ b/src/Umbraco.Tests/Packaging/PackageInstallationTest.cs @@ -55,7 +55,7 @@ namespace Umbraco.Tests.Packaging string test; packageExtraction.Setup(a => a.ReadTextFileFromArchive(pagePath, Constants.Packaging.PackageXmlFileName, out test)).Returns(Xml); - + var fileService = new Mock(); var macroService = new Mock(); var packagingService = new Mock(); diff --git a/src/Umbraco.Tests/Persistence/DatabaseContextTests.cs b/src/Umbraco.Tests/Persistence/DatabaseContextTests.cs index 2c79bbb9d7..d9bb711193 100644 --- a/src/Umbraco.Tests/Persistence/DatabaseContextTests.cs +++ b/src/Umbraco.Tests/Persistence/DatabaseContextTests.cs @@ -18,7 +18,7 @@ namespace Umbraco.Tests.Persistence [TestFixture, RequiresSTA] public class DatabaseContextTests { - private IUmbracoDatabaseFactory _databaseFactory; + private IUmbracoDatabaseFactory _databaseFactory; private ILogger _logger; private SqlCeSyntaxProvider _sqlCeSyntaxProvider; private ISqlSyntaxProvider[] _sqlSyntaxProviders; @@ -26,8 +26,8 @@ namespace Umbraco.Tests.Persistence private IMigrationEntryService _migrationEntryService; [SetUp] - public void Setup() - { + public void Setup() + { // create the database factory and database context _sqlCeSyntaxProvider = new SqlCeSyntaxProvider(); _sqlSyntaxProviders = new[] { (ISqlSyntaxProvider) _sqlCeSyntaxProvider }; @@ -35,13 +35,13 @@ namespace Umbraco.Tests.Persistence _databaseFactory = new UmbracoDatabaseFactory(_sqlSyntaxProviders, _logger, Mock.Of()); _runtime = Mock.Of(); _migrationEntryService = Mock.Of(); - } + } - [TearDown] - public void TearDown() - { - _databaseFactory = null; - } + [TearDown] + public void TearDown() + { + _databaseFactory = null; + } [Test] public void GetDatabaseType() @@ -129,4 +129,4 @@ namespace Umbraco.Tests.Persistence Assert.AreEqual(connectionString, "Server=tcp:kzeej5z8ty.ssmsawacluster4.windowsazure.mscds.com,1433;Database=MyDatabase;User ID=MyUser@kzeej5z8ty;Password=MyPassword"); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Persistence/DatabaseFactoryTests.cs b/src/Umbraco.Tests/Persistence/DatabaseFactoryTests.cs index 4a3337f1b2..ceb82624c2 100644 --- a/src/Umbraco.Tests/Persistence/DatabaseFactoryTests.cs +++ b/src/Umbraco.Tests/Persistence/DatabaseFactoryTests.cs @@ -15,4 +15,4 @@ namespace Umbraco.Tests.Persistence Assert.AreSame(db1, db2); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Persistence/FaultHandling/ConnectionRetryTest.cs b/src/Umbraco.Tests/Persistence/FaultHandling/ConnectionRetryTest.cs index b902635c02..ae6efa4435 100644 --- a/src/Umbraco.Tests/Persistence/FaultHandling/ConnectionRetryTest.cs +++ b/src/Umbraco.Tests/Persistence/FaultHandling/ConnectionRetryTest.cs @@ -44,4 +44,4 @@ namespace Umbraco.Tests.Persistence.FaultHandling } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Persistence/Mappers/ContentMapperTest.cs b/src/Umbraco.Tests/Persistence/Mappers/ContentMapperTest.cs index 8fedf831a0..d3b4997751 100644 --- a/src/Umbraco.Tests/Persistence/Mappers/ContentMapperTest.cs +++ b/src/Umbraco.Tests/Persistence/Mappers/ContentMapperTest.cs @@ -52,4 +52,4 @@ namespace Umbraco.Tests.Persistence.Mappers Assert.That(column, Is.EqualTo("[cmsContentVersion].[VersionId]")); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Persistence/Mappers/ContentTypeMapperTest.cs b/src/Umbraco.Tests/Persistence/Mappers/ContentTypeMapperTest.cs index 2dfa8e24d4..8279e64829 100644 --- a/src/Umbraco.Tests/Persistence/Mappers/ContentTypeMapperTest.cs +++ b/src/Umbraco.Tests/Persistence/Mappers/ContentTypeMapperTest.cs @@ -51,4 +51,4 @@ namespace Umbraco.Tests.Persistence.Mappers Assert.That(column, Is.EqualTo("[cmsContentType].[description]")); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Persistence/Mappers/DataTypeDefinitionMapperTest.cs b/src/Umbraco.Tests/Persistence/Mappers/DataTypeDefinitionMapperTest.cs index 0d3291c56d..261f0d6621 100644 --- a/src/Umbraco.Tests/Persistence/Mappers/DataTypeDefinitionMapperTest.cs +++ b/src/Umbraco.Tests/Persistence/Mappers/DataTypeDefinitionMapperTest.cs @@ -51,4 +51,4 @@ namespace Umbraco.Tests.Persistence.Mappers Assert.That(column, Is.EqualTo("[cmsDataType].[propertyEditorAlias]")); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Persistence/Mappers/DictionaryMapperTest.cs b/src/Umbraco.Tests/Persistence/Mappers/DictionaryMapperTest.cs index f86c4bd383..d25594308c 100644 --- a/src/Umbraco.Tests/Persistence/Mappers/DictionaryMapperTest.cs +++ b/src/Umbraco.Tests/Persistence/Mappers/DictionaryMapperTest.cs @@ -40,4 +40,4 @@ namespace Umbraco.Tests.Persistence.Mappers Assert.That(column, Is.EqualTo("[cmsDictionary].[key]")); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Persistence/Mappers/DictionaryTranslationMapperTest.cs b/src/Umbraco.Tests/Persistence/Mappers/DictionaryTranslationMapperTest.cs index ff3d20de0b..d9e9d3ee96 100644 --- a/src/Umbraco.Tests/Persistence/Mappers/DictionaryTranslationMapperTest.cs +++ b/src/Umbraco.Tests/Persistence/Mappers/DictionaryTranslationMapperTest.cs @@ -40,4 +40,4 @@ namespace Umbraco.Tests.Persistence.Mappers Assert.That(column, Is.EqualTo("[cmsLanguageText].[value]")); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Persistence/Mappers/LanguageMapperTest.cs b/src/Umbraco.Tests/Persistence/Mappers/LanguageMapperTest.cs index 7d0f4ed95b..e2f7f9f4c8 100644 --- a/src/Umbraco.Tests/Persistence/Mappers/LanguageMapperTest.cs +++ b/src/Umbraco.Tests/Persistence/Mappers/LanguageMapperTest.cs @@ -39,4 +39,4 @@ namespace Umbraco.Tests.Persistence.Mappers Assert.That(column, Is.EqualTo("[umbracoLanguage].[languageCultureName]")); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Persistence/Mappers/MediaMapperTest.cs b/src/Umbraco.Tests/Persistence/Mappers/MediaMapperTest.cs index c21b3ea21a..289f8edba4 100644 --- a/src/Umbraco.Tests/Persistence/Mappers/MediaMapperTest.cs +++ b/src/Umbraco.Tests/Persistence/Mappers/MediaMapperTest.cs @@ -40,7 +40,7 @@ namespace Umbraco.Tests.Persistence.Mappers [Test] public void Can_Map_Version_Property() { - + // Act string column = new MediaMapper().Map(new SqlCeSyntaxProvider(), "Version"); @@ -48,4 +48,4 @@ namespace Umbraco.Tests.Persistence.Mappers Assert.That(column, Is.EqualTo("[cmsContentVersion].[VersionId]")); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Persistence/Mappers/PropertyGroupMapperTest.cs b/src/Umbraco.Tests/Persistence/Mappers/PropertyGroupMapperTest.cs index 8178bc9648..efc1290b3f 100644 --- a/src/Umbraco.Tests/Persistence/Mappers/PropertyGroupMapperTest.cs +++ b/src/Umbraco.Tests/Persistence/Mappers/PropertyGroupMapperTest.cs @@ -46,4 +46,4 @@ namespace Umbraco.Tests.Persistence.Mappers Assert.That(column, Is.EqualTo("[cmsPropertyTypeGroup].[text]")); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Persistence/Mappers/PropertyTypeMapperTest.cs b/src/Umbraco.Tests/Persistence/Mappers/PropertyTypeMapperTest.cs index 41c5f67b3b..b3164f720f 100644 --- a/src/Umbraco.Tests/Persistence/Mappers/PropertyTypeMapperTest.cs +++ b/src/Umbraco.Tests/Persistence/Mappers/PropertyTypeMapperTest.cs @@ -67,4 +67,4 @@ namespace Umbraco.Tests.Persistence.Mappers Assert.That(column, Is.EqualTo("[cmsDataType].[dbType]")); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Persistence/Mappers/RelationMapperTest.cs b/src/Umbraco.Tests/Persistence/Mappers/RelationMapperTest.cs index 611c90b334..790359d9fd 100644 --- a/src/Umbraco.Tests/Persistence/Mappers/RelationMapperTest.cs +++ b/src/Umbraco.Tests/Persistence/Mappers/RelationMapperTest.cs @@ -57,4 +57,4 @@ namespace Umbraco.Tests.Persistence.Mappers Assert.That(column, Is.EqualTo("[umbracoRelation].[relType]")); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Persistence/Mappers/RelationTypeMapperTest.cs b/src/Umbraco.Tests/Persistence/Mappers/RelationTypeMapperTest.cs index 213037ed53..7497e356cc 100644 --- a/src/Umbraco.Tests/Persistence/Mappers/RelationTypeMapperTest.cs +++ b/src/Umbraco.Tests/Persistence/Mappers/RelationTypeMapperTest.cs @@ -9,7 +9,7 @@ namespace Umbraco.Tests.Persistence.Mappers { [Test] public void Can_Map_Id_Property() - { + { // Act string column = new RelationTypeMapper().Map(new SqlCeSyntaxProvider(), "Id"); @@ -49,4 +49,4 @@ namespace Umbraco.Tests.Persistence.Mappers Assert.That(column, Is.EqualTo("[umbracoRelationType].[dual]")); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Persistence/Migrations/PostMigrationTests.cs b/src/Umbraco.Tests/Persistence/Migrations/PostMigrationTests.cs index a462333114..9ab9d3ba4a 100644 --- a/src/Umbraco.Tests/Persistence/Migrations/PostMigrationTests.cs +++ b/src/Umbraco.Tests/Persistence/Migrations/PostMigrationTests.cs @@ -30,7 +30,7 @@ namespace Umbraco.Tests.Persistence.Migrations var runner1 = new MigrationRunner(Mock.Of(), Mock.Of(), logger, new SemVersion(1), new SemVersion(2), "Test1", new IMigration[] { Mock.Of() }); var result1 = runner1.Execute(migrationContext /*, false*/); - Assert.AreEqual(1, changed1.CountExecuted); + Assert.AreEqual(1, changed1.CountExecuted); } [Test] @@ -55,7 +55,7 @@ namespace Umbraco.Tests.Persistence.Migrations Assert.AreEqual(0, changed2.CountExecuted); var runner2 = new MigrationRunner(Mock.Of(), Mock.Of(), logger, new SemVersion(1), new SemVersion(2), "Test2", - new IMigration[] { Mock.Of() }); + new IMigration[] { Mock.Of() }); var result2 = runner2.Execute(migrationContext /*, false*/); Assert.AreEqual(1, changed1.CountExecuted); Assert.AreEqual(1, changed2.CountExecuted); diff --git a/src/Umbraco.Tests/Persistence/NPocoExpressionsTests.cs b/src/Umbraco.Tests/Persistence/NPocoExpressionsTests.cs index d941f14e0b..ef8c2ea84c 100644 --- a/src/Umbraco.Tests/Persistence/NPocoExpressionsTests.cs +++ b/src/Umbraco.Tests/Persistence/NPocoExpressionsTests.cs @@ -33,4 +33,4 @@ namespace Umbraco.Tests.Persistence Assert.AreEqual("SELECT *\nFROM [umbracoNode]\nWHERE ([umbracoNode].[text] IN (@0,@1,@2))", sql.SQL); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Persistence/NPocoExtensionsTest.cs b/src/Umbraco.Tests/Persistence/NPocoExtensionsTest.cs index fc908b4620..7085fc2ef4 100644 --- a/src/Umbraco.Tests/Persistence/NPocoExtensionsTest.cs +++ b/src/Umbraco.Tests/Persistence/NPocoExtensionsTest.cs @@ -102,16 +102,16 @@ namespace Umbraco.Tests.Persistence //re-create it dbSqlServer.Execute(@"CREATE TABLE [umbracoServer]( - [id] [int] IDENTITY(1,1) NOT NULL, - [address] [nvarchar](500) NOT NULL, - [computerName] [nvarchar](255) NOT NULL, - [registeredDate] [datetime] NOT NULL CONSTRAINT [DF_umbracoServer_registeredDate] DEFAULT (getdate()), - [lastNotifiedDate] [datetime] NOT NULL, - [isActive] [bit] NOT NULL, - [isMaster] [bit] NOT NULL, - CONSTRAINT [PK_umbracoServer] PRIMARY KEY CLUSTERED + [id] [int] IDENTITY(1,1) NOT NULL, + [address] [nvarchar](500) NOT NULL, + [computerName] [nvarchar](255) NOT NULL, + [registeredDate] [datetime] NOT NULL CONSTRAINT [DF_umbracoServer_registeredDate] DEFAULT (getdate()), + [lastNotifiedDate] [datetime] NOT NULL, + [isActive] [bit] NOT NULL, + [isMaster] [bit] NOT NULL, + CONSTRAINT [PK_umbracoServer] PRIMARY KEY CLUSTERED ( - [id] ASC + [id] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] )"); var data = new List(); @@ -264,4 +264,4 @@ namespace Umbraco.Tests.Persistence } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Persistence/PetaPocoCachesTest.cs b/src/Umbraco.Tests/Persistence/PetaPocoCachesTest.cs index d3e07c8157..4a77a0b22a 100644 --- a/src/Umbraco.Tests/Persistence/PetaPocoCachesTest.cs +++ b/src/Umbraco.Tests/Persistence/PetaPocoCachesTest.cs @@ -198,4 +198,4 @@ namespace Umbraco.Tests.Persistence } #endif } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Persistence/PetaPocoDynamicQueryTests.cs b/src/Umbraco.Tests/Persistence/PetaPocoDynamicQueryTests.cs index eb177981c3..f5f6d5df44 100644 --- a/src/Umbraco.Tests/Persistence/PetaPocoDynamicQueryTests.cs +++ b/src/Umbraco.Tests/Persistence/PetaPocoDynamicQueryTests.cs @@ -1,4 +1,4 @@ -//using System; +//using System; //using System.Linq; //using NUnit.Framework; //using Umbraco.Core.Models; @@ -32,7 +32,7 @@ // //for (int i = 0; i < 2; i++) // //{ // // i1 = DatabaseContext.Database.Fetch("SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES"); -// // r1 = i1.Select(x => x.TABLE_NAME).Cast().ToList(); +// // r1 = i1.Select(x => x.TABLE_NAME).Cast().ToList(); // //} // //var oc21 = Database.PocoData.GetCachedPocoData().Count(); @@ -57,7 +57,7 @@ // // foreach (var content in roots) // // { // // var d = ServiceContext.ContentService.GetDescendants(content); -// // } +// // } // //} // //var oc41 = Database.PocoData.GetCachedPocoData().Count(); @@ -130,4 +130,4 @@ // } // } // } -//} \ No newline at end of file +//} diff --git a/src/Umbraco.Tests/Persistence/Querying/ContentRepositorySqlClausesTest.cs b/src/Umbraco.Tests/Persistence/Querying/ContentRepositorySqlClausesTest.cs index 03ae38f171..671d82fae9 100644 --- a/src/Umbraco.Tests/Persistence/Querying/ContentRepositorySqlClausesTest.cs +++ b/src/Umbraco.Tests/Persistence/Querying/ContentRepositorySqlClausesTest.cs @@ -156,4 +156,4 @@ namespace Umbraco.Tests.Persistence.Querying Debug.Print(sql.SQL); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Persistence/Querying/ContentTypeRepositorySqlClausesTest.cs b/src/Umbraco.Tests/Persistence/Querying/ContentTypeRepositorySqlClausesTest.cs index f6001c50f8..f8e674e5ed 100644 --- a/src/Umbraco.Tests/Persistence/Querying/ContentTypeRepositorySqlClausesTest.cs +++ b/src/Umbraco.Tests/Persistence/Querying/ContentTypeRepositorySqlClausesTest.cs @@ -163,4 +163,4 @@ namespace Umbraco.Tests.Persistence.Querying Debug.Print(sql.SQL); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Persistence/Querying/ContentTypeSqlMappingTests.cs b/src/Umbraco.Tests/Persistence/Querying/ContentTypeSqlMappingTests.cs index 0933b77c32..b6c3a839f8 100644 --- a/src/Umbraco.Tests/Persistence/Querying/ContentTypeSqlMappingTests.cs +++ b/src/Umbraco.Tests/Persistence/Querying/ContentTypeSqlMappingTests.cs @@ -90,7 +90,7 @@ namespace Umbraco.Tests.Persistence.Querying using (var scope = ScopeProvider.CreateScope()) { - scope.Database.Execute(new Sql(string.Format("SET IDENTITY_INSERT {0} ON ", SqlSyntax.GetQuotedTableName("umbracoNode")))); + scope.Database.Execute(new Sql(string.Format("SET IDENTITY_INSERT {0} ON ", SqlSyntax.GetQuotedTableName("umbracoNode")))); scope.Database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = 99997, Trashed = false, ParentId = -1, UserId = 0, Level = 0, Path = "-1,99997", SortOrder = 0, UniqueId = new Guid("BB3241D5-6842-4EFA-A82A-5F56885CF528"), Text = "Test Media Type 1", NodeObjectType = new Guid(Constants.ObjectTypes.MediaType), CreateDate = DateTime.Now }); scope.Database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = 99998, Trashed = false, ParentId = -1, UserId = 0, Level = 0, Path = "-1,99998", SortOrder = 0, UniqueId = new Guid("EEA66B06-302E-49BA-A8B2-EDF07248BC59"), Text = "Test Media Type 2", NodeObjectType = new Guid(Constants.ObjectTypes.MediaType), CreateDate = DateTime.Now }); scope.Database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = 99999, Trashed = false, ParentId = -1, UserId = 0, Level = 0, Path = "-1,99999", SortOrder = 0, UniqueId = new Guid("C45CC083-BB27-4C1C-B448-6F703CC9B799"), Text = "Test Media Type 2", NodeObjectType = new Guid(Constants.ObjectTypes.MediaType), CreateDate = DateTime.Now }); diff --git a/src/Umbraco.Tests/Persistence/Querying/DataTypeDefinitionRepositorySqlClausesTest.cs b/src/Umbraco.Tests/Persistence/Querying/DataTypeDefinitionRepositorySqlClausesTest.cs index c8c30b09c6..cbca9449c0 100644 --- a/src/Umbraco.Tests/Persistence/Querying/DataTypeDefinitionRepositorySqlClausesTest.cs +++ b/src/Umbraco.Tests/Persistence/Querying/DataTypeDefinitionRepositorySqlClausesTest.cs @@ -41,4 +41,4 @@ namespace Umbraco.Tests.Persistence.Querying Debug.Print(sql.SQL); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Persistence/Querying/ExpressionTests.cs b/src/Umbraco.Tests/Persistence/Querying/ExpressionTests.cs index b5eb3b7a0f..2e7c3abcfd 100644 --- a/src/Umbraco.Tests/Persistence/Querying/ExpressionTests.cs +++ b/src/Umbraco.Tests/Persistence/Querying/ExpressionTests.cs @@ -98,7 +98,7 @@ namespace Umbraco.Tests.Persistence.Querying Expression> predicate = content => content.Path.StartsWith("-1"); var modelToSqlExpressionHelper = new ModelToSqlExpressionVisitor(SqlContext.SqlSyntax, Mappers); var result = modelToSqlExpressionHelper.Visit(predicate); - + Assert.AreEqual("upper([umbracoNode].[path]) LIKE upper(@0)", result); Assert.AreEqual("-1%", modelToSqlExpressionHelper.GetSqlParameters()[0]); } @@ -158,7 +158,7 @@ namespace Umbraco.Tests.Persistence.Querying Debug.Print("Model to Sql ExpressionHelper: \n" + result); Assert.AreEqual("upper(`umbracoUser`.`userLogin`) = upper(@0)", result); - Assert.AreEqual("mydomain\\myuser", modelToSqlExpressionHelper.GetSqlParameters()[0]); + Assert.AreEqual("mydomain\\myuser", modelToSqlExpressionHelper.GetSqlParameters()[0]); } [Test] diff --git a/src/Umbraco.Tests/Persistence/Querying/MediaRepositorySqlClausesTest.cs b/src/Umbraco.Tests/Persistence/Querying/MediaRepositorySqlClausesTest.cs index 33214cc3a1..4b10b67e80 100644 --- a/src/Umbraco.Tests/Persistence/Querying/MediaRepositorySqlClausesTest.cs +++ b/src/Umbraco.Tests/Persistence/Querying/MediaRepositorySqlClausesTest.cs @@ -44,4 +44,4 @@ namespace Umbraco.Tests.Persistence.Querying Debug.Print(sql.SQL); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Persistence/Querying/MediaTypeRepositorySqlClausesTest.cs b/src/Umbraco.Tests/Persistence/Querying/MediaTypeRepositorySqlClausesTest.cs index fbf38327b5..97c04f9309 100644 --- a/src/Umbraco.Tests/Persistence/Querying/MediaTypeRepositorySqlClausesTest.cs +++ b/src/Umbraco.Tests/Persistence/Querying/MediaTypeRepositorySqlClausesTest.cs @@ -41,4 +41,4 @@ namespace Umbraco.Tests.Persistence.Querying Debug.Print(sql.SQL); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Persistence/Querying/NPocoSqlTests.cs b/src/Umbraco.Tests/Persistence/Querying/NPocoSqlTests.cs index 461f934bb2..d22777f5c8 100644 --- a/src/Umbraco.Tests/Persistence/Querying/NPocoSqlTests.cs +++ b/src/Umbraco.Tests/Persistence/Querying/NPocoSqlTests.cs @@ -12,7 +12,7 @@ namespace Umbraco.Tests.Persistence.Querying [TestFixture] public class NPocoSqlTests : BaseUsingSqlCeSyntax { - //x => + //x => [Test] public void Where_Clause_With_Starts_With_Additional_Parameters() @@ -23,7 +23,7 @@ namespace Umbraco.Tests.Persistence.Querying Assert.AreEqual("SELECT * FROM [umbracoNode] WHERE (upper([umbracoNode].[path]) LIKE upper(@0))", sql.SQL.Replace("\n", " ")); Assert.AreEqual(1, sql.Arguments.Length); - Assert.AreEqual(content.Path + "%", sql.Arguments[0]); + Assert.AreEqual(content.Path + "%", sql.Arguments[0]); } [Test] @@ -271,4 +271,4 @@ namespace Umbraco.Tests.Persistence.Querying Debug.Print(sql.SQL); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Persistence/Querying/QueryBuilderTests.cs b/src/Umbraco.Tests/Persistence/Querying/QueryBuilderTests.cs index 9d55241d04..9d7a87ca8e 100644 --- a/src/Umbraco.Tests/Persistence/Querying/QueryBuilderTests.cs +++ b/src/Umbraco.Tests/Persistence/Querying/QueryBuilderTests.cs @@ -14,7 +14,7 @@ namespace Umbraco.Tests.Persistence.Querying [TestFixture] public class QueryBuilderTests : BaseUsingSqlCeSyntax { - + [Test] public void Can_Build_StartsWith_Query_For_IContent() @@ -126,4 +126,4 @@ namespace Umbraco.Tests.Persistence.Querying Debug.Print(strResult); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Persistence/Repositories/AuditRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/AuditRepositoryTest.cs index a11f13501c..7c6f3c7b63 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/AuditRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/AuditRepositoryTest.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; using NUnit.Framework; using Umbraco.Core.Models; using Umbraco.Core.Models.Rdbms; @@ -29,4 +29,4 @@ namespace Umbraco.Tests.Persistence.Repositories } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Persistence/Repositories/ContentRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/ContentRepositoryTest.cs index 918213f25c..f690247bf5 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/ContentRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/ContentRepositoryTest.cs @@ -970,4 +970,4 @@ namespace Umbraco.Tests.Persistence.Repositories ServiceContext.ContentService.Save(trashed, 0); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Persistence/Repositories/ContentTypeRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/ContentTypeRepositoryTest.cs index ae00e5dbe5..d607176035 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/ContentTypeRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/ContentTypeRepositoryTest.cs @@ -962,4 +962,4 @@ namespace Umbraco.Tests.Persistence.Repositories ServiceContext.ContentTypeService.Save(textpageContentType); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Persistence/Repositories/DataTypeDefinitionRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/DataTypeDefinitionRepositoryTest.cs index cdee4d5457..cb65d57fe4 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/DataTypeDefinitionRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/DataTypeDefinitionRepositoryTest.cs @@ -548,4 +548,4 @@ namespace Umbraco.Tests.Persistence.Repositories base.TearDown(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Persistence/Repositories/DictionaryRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/DictionaryRepositoryTest.cs index b446e50d2c..324a98c705 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/DictionaryRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/DictionaryRepositoryTest.cs @@ -111,7 +111,7 @@ namespace Umbraco.Tests.Persistence.Repositories //re-get dictionaryItem = repository.Get(dictionaryItem.Id); - + // Assert Assert.That(dictionaryItem, Is.Not.Null); @@ -131,7 +131,7 @@ namespace Umbraco.Tests.Persistence.Repositories using (var unitOfWork = provider.CreateUnitOfWork()) { var repository = CreateRepository(unitOfWork); - var dictionaryItem = (IDictionaryItem) new DictionaryItem("Testing1235"); + var dictionaryItem = (IDictionaryItem) new DictionaryItem("Testing1235"); repository.AddOrUpdate(dictionaryItem); unitOfWork.Flush(); @@ -386,4 +386,4 @@ namespace Umbraco.Tests.Persistence.Repositories ServiceContext.LocalizationService.Save(article);//Id 2 } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Persistence/Repositories/DomainRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/DomainRepositoryTest.cs index 9bb419680e..f2b8e3f1d1 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/DomainRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/DomainRepositoryTest.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Data; using System.Linq; using Moq; @@ -492,4 +492,4 @@ namespace Umbraco.Tests.Persistence.Repositories } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Persistence/Repositories/LanguageRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/LanguageRepositoryTest.cs index ca8917aa7c..b8ec0b8b17 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/LanguageRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/LanguageRepositoryTest.cs @@ -29,10 +29,10 @@ namespace Umbraco.Tests.Persistence.Repositories private LanguageRepository CreateRepository(IScopeUnitOfWork unitOfWork) { - return new LanguageRepository(unitOfWork, CacheHelper.CreateDisabledCacheHelper(), Mock.Of()); + return new LanguageRepository(unitOfWork, CacheHelper.CreateDisabledCacheHelper(), Mock.Of()); } - + [Test] public void Can_Perform_Get_On_LanguageRepository() @@ -51,7 +51,7 @@ namespace Umbraco.Tests.Persistence.Repositories Assert.That(language, Is.Not.Null); Assert.That(language.HasIdentity, Is.True); Assert.That(language.CultureName, Is.EqualTo("en-US")); - Assert.That(language.IsoCode, Is.EqualTo("en-US")); + Assert.That(language.IsoCode, Is.EqualTo("en-US")); } } @@ -71,7 +71,7 @@ namespace Umbraco.Tests.Persistence.Repositories repository.AddOrUpdate(language); unitOfWork.Flush(); - //re-get + //re-get language = repository.GetByIsoCode(au.Name); // Assert @@ -98,7 +98,7 @@ namespace Umbraco.Tests.Persistence.Repositories repository.AddOrUpdate(language); unitOfWork.Flush(); - //re-get + //re-get language = repository.GetByCultureName(au.DisplayName); // Assert @@ -148,7 +148,7 @@ namespace Umbraco.Tests.Persistence.Repositories [Test] public void Can_Perform_GetAll_With_Params_On_LanguageRepository() - { + { // Arrange var provider = TestObjects.GetScopeUnitOfWorkProvider(Logger); using (var unitOfWork = provider.CreateUnitOfWork()) @@ -311,4 +311,4 @@ namespace Umbraco.Tests.Persistence.Repositories ServiceContext.LocalizationService.Save(languagePT);//Id 5 } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Persistence/Repositories/MacroRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/MacroRepositoryTest.cs index f84d5eb20d..6e5eabb059 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/MacroRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/MacroRepositoryTest.cs @@ -453,4 +453,4 @@ namespace Umbraco.Tests.Persistence.Repositories } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Persistence/Repositories/MediaRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/MediaRepositoryTest.cs index f1e3f8edb0..d5368241ca 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/MediaRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/MediaRepositoryTest.cs @@ -240,7 +240,7 @@ namespace Umbraco.Tests.Persistence.Repositories [Test] public void Can_Perform_GetByQuery_On_MediaRepository_With_ContentType_Id_Filter() { - // Arrange + // Arrange var folderMediaType = ServiceContext.MediaTypeService.Get(1031); var provider = TestObjects.GetScopeUnitOfWorkProvider(Logger); using (var unitOfWork = provider.CreateUnitOfWork()) @@ -268,7 +268,7 @@ namespace Umbraco.Tests.Persistence.Repositories [Test] public void Can_Perform_GetByQuery_On_MediaRepository_With_ContentType_Alias_Filter() { - // Arrange + // Arrange var folderMediaType = ServiceContext.MediaTypeService.Get(1031); var provider = TestObjects.GetScopeUnitOfWorkProvider(Logger); using (var unitOfWork = provider.CreateUnitOfWork()) @@ -555,4 +555,4 @@ namespace Umbraco.Tests.Persistence.Repositories ServiceContext.MediaService.Save(file, 0); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Persistence/Repositories/MediaTypeRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/MediaTypeRepositoryTest.cs index ba390392c6..ecd194bc8d 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/MediaTypeRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/MediaTypeRepositoryTest.cs @@ -18,7 +18,7 @@ namespace Umbraco.Tests.Persistence.Repositories { private MediaTypeRepository CreateRepository(IScopeUnitOfWork unitOfWork) { - return new MediaTypeRepository(unitOfWork, DisabledCache, Logger); + return new MediaTypeRepository(unitOfWork, DisabledCache, Logger); } private EntityContainerRepository CreateContainerRepository(IScopeUnitOfWork unitOfWork) @@ -49,7 +49,7 @@ namespace Umbraco.Tests.Persistence.Repositories repository.AddOrUpdate(contentType); unitOfWork.Flush(); - //create a + //create a var contentType2 = (IMediaType)new MediaType(contentType, "hello") { Name = "Blahasdfsadf" @@ -71,7 +71,7 @@ namespace Umbraco.Tests.Persistence.Repositories Assert.AreNotEqual(result.Single(x => x.Entity.Id == contentType.Id).OriginalPath, contentType.Path); Assert.AreNotEqual(result.Single(x => x.Entity.Id == contentType2.Id).OriginalPath, contentType2.Path); } - + } [Test] @@ -192,7 +192,7 @@ namespace Umbraco.Tests.Persistence.Repositories TestHelper.AssertAllPropertyValuesAreEquals(contentType, fetched, "yyyy-MM-dd HH:mm:ss", ignoreProperties: new[] { "UpdateDate" }); } - + } [Test] @@ -289,7 +289,7 @@ namespace Umbraco.Tests.Persistence.Repositories var mediaType = repository.Get(1033); //File // Act - mediaType = repository.Get(mediaType.Key); + mediaType = repository.Get(mediaType.Key); // Assert Assert.That(mediaType, Is.Not.Null); @@ -437,4 +437,4 @@ namespace Umbraco.Tests.Persistence.Repositories base.TearDown(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Persistence/Repositories/MemberRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/MemberRepositoryTest.cs index 4cda25fa37..0e36f2e5d1 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/MemberRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/MemberRepositoryTest.cs @@ -250,7 +250,7 @@ namespace Umbraco.Tests.Persistence.Repositories public void Can_Create_Correct_Subquery() { var provider = TestObjects.GetScopeUnitOfWorkProvider(Logger); - + var query = provider.DatabaseContext.Query().Where(x => ((Member) x).LongStringPropertyValue.Contains("1095") && ((Member) x).PropertyTypeAlias == "headshot"); @@ -368,4 +368,4 @@ namespace Umbraco.Tests.Persistence.Repositories get { return new Guid(Constants.ObjectTypes.Member); } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Persistence/Repositories/MemberTypeRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/MemberTypeRepositoryTest.cs index 7664e600de..a4c7944d49 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/MemberTypeRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/MemberTypeRepositoryTest.cs @@ -59,7 +59,7 @@ namespace Umbraco.Tests.Persistence.Repositories var repository = CreateRepository(unitOfWork); var memberType = (IMemberType)MockedContentTypes.CreateSimpleMemberType(); - + repository.AddOrUpdate(memberType); unitOfWork.Complete(); @@ -297,4 +297,4 @@ namespace Umbraco.Tests.Persistence.Repositories } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Persistence/Repositories/NotificationsRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/NotificationsRepositoryTest.cs index 49d1fe9d50..f6b83f1fe1 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/NotificationsRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/NotificationsRepositoryTest.cs @@ -158,4 +158,4 @@ namespace Umbraco.Tests.Persistence.Repositories } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Persistence/Repositories/PublicAccessRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/PublicAccessRepositoryTest.cs index e09253f996..9c5e938298 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/PublicAccessRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/PublicAccessRepositoryTest.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using Moq; @@ -229,7 +229,7 @@ namespace Umbraco.Tests.Persistence.Repositories allEntries.Add(entry1); } - //now remove a few rules from a few of the items and then add some more, this will put things 'out of order' which + //now remove a few rules from a few of the items and then add some more, this will put things 'out of order' which //we need to verify our sort order is working for the relator // fixme - no "relator" in v8?! for (int i = 0; i < allEntries.Count; i++) @@ -336,4 +336,4 @@ namespace Umbraco.Tests.Persistence.Repositories } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Persistence/Repositories/RelationRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/RelationRepositoryTest.cs index d1bc67a962..a3803b2f63 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/RelationRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/RelationRepositoryTest.cs @@ -295,4 +295,4 @@ namespace Umbraco.Tests.Persistence.Repositories } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Persistence/Repositories/RelationTypeRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/RelationTypeRepositoryTest.cs index 15ccf65df9..b9a983105e 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/RelationTypeRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/RelationTypeRepositoryTest.cs @@ -242,4 +242,4 @@ namespace Umbraco.Tests.Persistence.Repositories } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Persistence/Repositories/ScriptRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/ScriptRepositoryTest.cs index 9d0d57fe98..c77576d8a0 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/ScriptRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/ScriptRepositoryTest.cs @@ -28,7 +28,7 @@ namespace Umbraco.Tests.Persistence.Repositories _fileSystem = new PhysicalFileSystem(SystemDirectories.Scripts); using (var stream = CreateStream("Umbraco.Sys.registerNamespace(\"Umbraco.Utils\");")) { - _fileSystem.AddFile("test-script.js", stream); + _fileSystem.AddFile("test-script.js", stream); } } @@ -357,4 +357,4 @@ namespace Umbraco.Tests.Persistence.Repositories return stream; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Persistence/Repositories/ServerRegistrationRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/ServerRegistrationRepositoryTest.cs index e931cb3f71..9f5772576a 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/ServerRegistrationRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/ServerRegistrationRepositoryTest.cs @@ -261,4 +261,4 @@ namespace Umbraco.Tests.Persistence.Repositories } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Persistence/Repositories/StylesheetRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/StylesheetRepositoryTest.cs index a5235603c1..974339cd5d 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/StylesheetRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/StylesheetRepositoryTest.cs @@ -357,4 +357,4 @@ p{font-size:2em;}")); return stream; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Persistence/Repositories/TagRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/TagRepositoryTest.cs index b36e715e9e..bfb8096761 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/TagRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/TagRepositoryTest.cs @@ -1003,4 +1003,4 @@ namespace Umbraco.Tests.Persistence.Repositories return repository; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Persistence/Repositories/TaskRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/TaskRepositoryTest.cs index aa91938954..388e7c0b56 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/TaskRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/TaskRepositoryTest.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using NUnit.Framework; using Umbraco.Core; @@ -225,4 +225,4 @@ namespace Umbraco.Tests.Persistence.Repositories } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Persistence/Repositories/TaskTypeRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/TaskTypeRepositoryTest.cs index b1bd756741..a9f2564e74 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/TaskTypeRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/TaskTypeRepositoryTest.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using NUnit.Framework; using Umbraco.Core.Models; @@ -44,7 +44,7 @@ namespace Umbraco.Tests.Persistence.Repositories Assert.AreEqual(0, repo.GetAll().Count()); } - + } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Persistence/Repositories/TemplateRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/TemplateRepositoryTest.cs index e161ac205d..681f1b5215 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/TemplateRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/TemplateRepositoryTest.cs @@ -176,7 +176,7 @@ namespace Umbraco.Tests.Persistence.Repositories Assert.That(repository.Get("test"), Is.Not.Null); Assert.That(_viewsFileSystem.FileExists("test.cshtml"), Is.True); Assert.AreEqual( - @"@inherits Umbraco.Web.Mvc.UmbracoTemplatePage @{ Layout = null;}".StripWhitespace(), + @"@inherits Umbraco.Web.Mvc.UmbracoTemplatePage @{ Layout = null;}".StripWhitespace(), template.Content.StripWhitespace()); } @@ -842,4 +842,4 @@ namespace Umbraco.Tests.Persistence.Repositories return new[] {parent, child1, child2, toddler1, toddler2, toddler3, toddler4, baby1, baby2}; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Persistence/Repositories/UserRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/UserRepositoryTest.cs index 0513a1083b..ea34838bcd 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/UserRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/UserRepositoryTest.cs @@ -539,4 +539,4 @@ namespace Umbraco.Tests.Persistence.Repositories } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Persistence/Repositories/UserTypeRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/UserTypeRepositoryTest.cs index 1560875fc3..21b18c913e 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/UserTypeRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/UserTypeRepositoryTest.cs @@ -22,7 +22,7 @@ namespace Umbraco.Tests.Persistence.Repositories { private UserTypeRepository CreateRepository(IScopeUnitOfWork unitOfWork) { - return new UserTypeRepository(unitOfWork, CacheHelper.CreateDisabledCacheHelper(), Mock.Of()); + return new UserTypeRepository(unitOfWork, CacheHelper.CreateDisabledCacheHelper(), Mock.Of()); } [Test] @@ -142,7 +142,7 @@ namespace Umbraco.Tests.Persistence.Repositories var resolved = repository2.Get(id); // Assert - Assert.That(resolved, Is.Null); + Assert.That(resolved, Is.Null); } } @@ -285,4 +285,4 @@ namespace Umbraco.Tests.Persistence.Repositories return new IUserType[] {userType1, userType2, userType3}; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Persistence/SchemaValidationTest.cs b/src/Umbraco.Tests/Persistence/SchemaValidationTest.cs index d5c5ad7ea6..943c5a7532 100644 --- a/src/Umbraco.Tests/Persistence/SchemaValidationTest.cs +++ b/src/Umbraco.Tests/Persistence/SchemaValidationTest.cs @@ -29,4 +29,4 @@ namespace Umbraco.Tests.Persistence Assert.AreEqual(result.DetermineInstalledVersion(), UmbracoVersion.Current); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Persistence/SqlCeTableByTableTest.cs b/src/Umbraco.Tests/Persistence/SqlCeTableByTableTest.cs index aa7f180b20..5bd3266029 100644 --- a/src/Umbraco.Tests/Persistence/SqlCeTableByTableTest.cs +++ b/src/Umbraco.Tests/Persistence/SqlCeTableByTableTest.cs @@ -286,7 +286,7 @@ namespace Umbraco.Tests.Persistence scope.Complete(); } } - + [Test] public void Can_Create_cmsMember_Table() { @@ -596,4 +596,4 @@ namespace Umbraco.Tests.Persistence } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Persistence/SyntaxProvider/SqlCeSyntaxProviderTests.cs b/src/Umbraco.Tests/Persistence/SyntaxProvider/SqlCeSyntaxProviderTests.cs index 107f68838d..d75c4c3554 100644 --- a/src/Umbraco.Tests/Persistence/SyntaxProvider/SqlCeSyntaxProviderTests.cs +++ b/src/Umbraco.Tests/Persistence/SyntaxProvider/SqlCeSyntaxProviderTests.cs @@ -31,7 +31,7 @@ namespace Umbraco.Tests.Persistence.SyntaxProvider .InnerJoin() .On(left => left.NodeId, right => right.NodeId) .Where(dto => dto.NodeObjectType == mediaObjectType); - + var sqlOutput = SqlContext.SqlSyntax.GetDeleteSubquery("cmsContentXml", "nodeId", subQuery); Assert.AreEqual(@"DELETE FROM [cmsContentXml] WHERE [nodeId] IN (SELECT [nodeId] FROM (SELECT DISTINCT cmsContentXml.nodeId @@ -74,7 +74,7 @@ WHERE (([umbracoNode].[nodeObjectType] = @0))) x)".Replace(Environment.NewLine, public void Format_SqlServer_NonClusteredIndexDefinition_AddsNonClusteredDirective() { var sqlSyntax = new SqlServerSyntaxProvider(new Lazy(() => null)); - + var indexDefinition = CreateIndexDefinition(); indexDefinition.IndexType = IndexTypes.NonClustered; @@ -167,6 +167,6 @@ WHERE (([umbracoNode].[nodeObjectType] = @0))) x)".Replace(Environment.NewLine, TableName = "TheTable", SchemaName = "dbo" }; - } + } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Plugins/PluginManagerExtensions.cs b/src/Umbraco.Tests/Plugins/PluginManagerExtensions.cs index e6a54c1161..bfb5560f82 100644 --- a/src/Umbraco.Tests/Plugins/PluginManagerExtensions.cs +++ b/src/Umbraco.Tests/Plugins/PluginManagerExtensions.cs @@ -1,18 +1,18 @@ -using System; +using System; using System.Collections.Generic; using Umbraco.Core; using Umbraco.Core.Composing; namespace Umbraco.Tests.Plugins { - /// - /// Used for PluginTypeResolverTests - /// - internal static class PluginManagerExtensions - { - public static IEnumerable ResolveFindMeTypes(this TypeLoader resolver) - { - return resolver.GetTypes(); - } - } -} \ No newline at end of file + /// + /// Used for PluginTypeResolverTests + /// + internal static class PluginManagerExtensions + { + public static IEnumerable ResolveFindMeTypes(this TypeLoader resolver) + { + return resolver.GetTypes(); + } + } +} diff --git a/src/Umbraco.Tests/Plugins/PluginManagerTests.cs b/src/Umbraco.Tests/Plugins/PluginManagerTests.cs index 35b4ad998c..21e534e72c 100644 --- a/src/Umbraco.Tests/Plugins/PluginManagerTests.cs +++ b/src/Umbraco.Tests/Plugins/PluginManagerTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Globalization; using System.IO; @@ -33,19 +33,19 @@ namespace Umbraco.Tests.Plugins //for testing, we'll specify which assemblies are scanned for the PluginTypeResolver //TODO: Should probably update this so it only searches this assembly and add custom types to be found _manager.AssembliesToScan = new[] - { - this.GetType().Assembly, - typeof(System.Guid).Assembly, - typeof(NUnit.Framework.Assert).Assembly, - typeof(Microsoft.CSharp.CSharpCodeProvider).Assembly, - typeof(System.Xml.NameTable).Assembly, - typeof(System.Configuration.GenericEnumConverter).Assembly, - typeof(System.Web.SiteMap).Assembly, - //typeof(TabPage).Assembly, - typeof(System.Web.Mvc.ActionResult).Assembly, - typeof(TypeFinder).Assembly, - typeof(UmbracoContext).Assembly - }; + { + this.GetType().Assembly, + typeof(System.Guid).Assembly, + typeof(NUnit.Framework.Assert).Assembly, + typeof(Microsoft.CSharp.CSharpCodeProvider).Assembly, + typeof(System.Xml.NameTable).Assembly, + typeof(System.Configuration.GenericEnumConverter).Assembly, + typeof(System.Web.SiteMap).Assembly, + //typeof(TabPage).Assembly, + typeof(System.Web.Mvc.ActionResult).Assembly, + typeof(TypeFinder).Assembly, + typeof(UmbracoContext).Assembly + }; } [TearDown] @@ -68,79 +68,79 @@ namespace Umbraco.Tests.Plugins //[Test] //public void Scan_Vs_Load_Benchmark() //{ - // var typeLoader = new TypeLoader(false); - // var watch = new Stopwatch(); - // watch.Start(); - // for (var i = 0; i < 1000; i++) - // { - // var type2 = Type.GetType("umbraco.macroCacheRefresh, umbraco, Version=1.0.4698.259, Culture=neutral, PublicKeyToken=null"); - // var type3 = Type.GetType("umbraco.templateCacheRefresh, umbraco, Version=1.0.4698.259, Culture=neutral, PublicKeyToken=null"); - // var type4 = Type.GetType("umbraco.presentation.cache.MediaLibraryRefreshers, umbraco, Version=1.0.4698.259, Culture=neutral, PublicKeyToken=null"); - // var type5 = Type.GetType("umbraco.presentation.cache.pageRefresher, umbraco, Version=1.0.4698.259, Culture=neutral, PublicKeyToken=null"); - // } - // watch.Stop(); - // Debug.WriteLine("TOTAL TIME (1st round): " + watch.ElapsedMilliseconds); - // watch.Start(); - // for (var i = 0; i < 1000; i++) - // { - // var type2 = BuildManager.GetType("umbraco.macroCacheRefresh, umbraco, Version=1.0.4698.259, Culture=neutral, PublicKeyToken=null", true); - // var type3 = BuildManager.GetType("umbraco.templateCacheRefresh, umbraco, Version=1.0.4698.259, Culture=neutral, PublicKeyToken=null", true); - // var type4 = BuildManager.GetType("umbraco.presentation.cache.MediaLibraryRefreshers, umbraco, Version=1.0.4698.259, Culture=neutral, PublicKeyToken=null", true); - // var type5 = BuildManager.GetType("umbraco.presentation.cache.pageRefresher, umbraco, Version=1.0.4698.259, Culture=neutral, PublicKeyToken=null", true); - // } - // watch.Stop(); - // Debug.WriteLine("TOTAL TIME (1st round): " + watch.ElapsedMilliseconds); - // watch.Reset(); - // watch.Start(); - // for (var i = 0; i < 1000; i++) - // { - // var refreshers = typeLoader.GetTypes(false); - // } - // watch.Stop(); - // Debug.WriteLine("TOTAL TIME (2nd round): " + watch.ElapsedMilliseconds); + // var typeLoader = new TypeLoader(false); + // var watch = new Stopwatch(); + // watch.Start(); + // for (var i = 0; i < 1000; i++) + // { + // var type2 = Type.GetType("umbraco.macroCacheRefresh, umbraco, Version=1.0.4698.259, Culture=neutral, PublicKeyToken=null"); + // var type3 = Type.GetType("umbraco.templateCacheRefresh, umbraco, Version=1.0.4698.259, Culture=neutral, PublicKeyToken=null"); + // var type4 = Type.GetType("umbraco.presentation.cache.MediaLibraryRefreshers, umbraco, Version=1.0.4698.259, Culture=neutral, PublicKeyToken=null"); + // var type5 = Type.GetType("umbraco.presentation.cache.pageRefresher, umbraco, Version=1.0.4698.259, Culture=neutral, PublicKeyToken=null"); + // } + // watch.Stop(); + // Debug.WriteLine("TOTAL TIME (1st round): " + watch.ElapsedMilliseconds); + // watch.Start(); + // for (var i = 0; i < 1000; i++) + // { + // var type2 = BuildManager.GetType("umbraco.macroCacheRefresh, umbraco, Version=1.0.4698.259, Culture=neutral, PublicKeyToken=null", true); + // var type3 = BuildManager.GetType("umbraco.templateCacheRefresh, umbraco, Version=1.0.4698.259, Culture=neutral, PublicKeyToken=null", true); + // var type4 = BuildManager.GetType("umbraco.presentation.cache.MediaLibraryRefreshers, umbraco, Version=1.0.4698.259, Culture=neutral, PublicKeyToken=null", true); + // var type5 = BuildManager.GetType("umbraco.presentation.cache.pageRefresher, umbraco, Version=1.0.4698.259, Culture=neutral, PublicKeyToken=null", true); + // } + // watch.Stop(); + // Debug.WriteLine("TOTAL TIME (1st round): " + watch.ElapsedMilliseconds); + // watch.Reset(); + // watch.Start(); + // for (var i = 0; i < 1000; i++) + // { + // var refreshers = typeLoader.GetTypes(false); + // } + // watch.Stop(); + // Debug.WriteLine("TOTAL TIME (2nd round): " + watch.ElapsedMilliseconds); //} ////NOTE: This test shows that Type.GetType is 100% faster than Assembly.Load(..).GetType(...) so we'll use that :) //[Test] //public void Load_Type_Benchmark() //{ - // var watch = new Stopwatch(); - // watch.Start(); - // for (var i = 0; i < 1000; i++) - // { - // var type2 = Type.GetType("umbraco.macroCacheRefresh, umbraco, Version=1.0.4698.259, Culture=neutral, PublicKeyToken=null"); - // var type3 = Type.GetType("umbraco.templateCacheRefresh, umbraco, Version=1.0.4698.259, Culture=neutral, PublicKeyToken=null"); - // var type4 = Type.GetType("umbraco.presentation.cache.MediaLibraryRefreshers, umbraco, Version=1.0.4698.259, Culture=neutral, PublicKeyToken=null"); - // var type5 = Type.GetType("umbraco.presentation.cache.pageRefresher, umbraco, Version=1.0.4698.259, Culture=neutral, PublicKeyToken=null"); - // } - // watch.Stop(); - // Debug.WriteLine("TOTAL TIME (1st round): " + watch.ElapsedMilliseconds); - // watch.Reset(); - // watch.Start(); - // for (var i = 0; i < 1000; i++) - // { - // var type2 = Assembly.Load("umbraco, Version=1.0.4698.259, Culture=neutral, PublicKeyToken=null") - // .GetType("umbraco.macroCacheRefresh"); - // var type3 = Assembly.Load("umbraco, Version=1.0.4698.259, Culture=neutral, PublicKeyToken=null") - // .GetType("umbraco.templateCacheRefresh"); - // var type4 = Assembly.Load("umbraco, Version=1.0.4698.259, Culture=neutral, PublicKeyToken=null") - // .GetType("umbraco.presentation.cache.MediaLibraryRefreshers"); - // var type5 = Assembly.Load("umbraco, Version=1.0.4698.259, Culture=neutral, PublicKeyToken=null") - // .GetType("umbraco.presentation.cache.pageRefresher"); - // } - // watch.Stop(); - // Debug.WriteLine("TOTAL TIME (2nd round): " + watch.ElapsedMilliseconds); - // watch.Reset(); - // watch.Start(); - // for (var i = 0; i < 1000; i++) - // { - // var type2 = BuildManager.GetType("umbraco.macroCacheRefresh, umbraco, Version=1.0.4698.259, Culture=neutral, PublicKeyToken=null", true); - // var type3 = BuildManager.GetType("umbraco.templateCacheRefresh, umbraco, Version=1.0.4698.259, Culture=neutral, PublicKeyToken=null", true); - // var type4 = BuildManager.GetType("umbraco.presentation.cache.MediaLibraryRefreshers, umbraco, Version=1.0.4698.259, Culture=neutral, PublicKeyToken=null", true); - // var type5 = BuildManager.GetType("umbraco.presentation.cache.pageRefresher, umbraco, Version=1.0.4698.259, Culture=neutral, PublicKeyToken=null", true); - // } - // watch.Stop(); - // Debug.WriteLine("TOTAL TIME (1st round): " + watch.ElapsedMilliseconds); + // var watch = new Stopwatch(); + // watch.Start(); + // for (var i = 0; i < 1000; i++) + // { + // var type2 = Type.GetType("umbraco.macroCacheRefresh, umbraco, Version=1.0.4698.259, Culture=neutral, PublicKeyToken=null"); + // var type3 = Type.GetType("umbraco.templateCacheRefresh, umbraco, Version=1.0.4698.259, Culture=neutral, PublicKeyToken=null"); + // var type4 = Type.GetType("umbraco.presentation.cache.MediaLibraryRefreshers, umbraco, Version=1.0.4698.259, Culture=neutral, PublicKeyToken=null"); + // var type5 = Type.GetType("umbraco.presentation.cache.pageRefresher, umbraco, Version=1.0.4698.259, Culture=neutral, PublicKeyToken=null"); + // } + // watch.Stop(); + // Debug.WriteLine("TOTAL TIME (1st round): " + watch.ElapsedMilliseconds); + // watch.Reset(); + // watch.Start(); + // for (var i = 0; i < 1000; i++) + // { + // var type2 = Assembly.Load("umbraco, Version=1.0.4698.259, Culture=neutral, PublicKeyToken=null") + // .GetType("umbraco.macroCacheRefresh"); + // var type3 = Assembly.Load("umbraco, Version=1.0.4698.259, Culture=neutral, PublicKeyToken=null") + // .GetType("umbraco.templateCacheRefresh"); + // var type4 = Assembly.Load("umbraco, Version=1.0.4698.259, Culture=neutral, PublicKeyToken=null") + // .GetType("umbraco.presentation.cache.MediaLibraryRefreshers"); + // var type5 = Assembly.Load("umbraco, Version=1.0.4698.259, Culture=neutral, PublicKeyToken=null") + // .GetType("umbraco.presentation.cache.pageRefresher"); + // } + // watch.Stop(); + // Debug.WriteLine("TOTAL TIME (2nd round): " + watch.ElapsedMilliseconds); + // watch.Reset(); + // watch.Start(); + // for (var i = 0; i < 1000; i++) + // { + // var type2 = BuildManager.GetType("umbraco.macroCacheRefresh, umbraco, Version=1.0.4698.259, Culture=neutral, PublicKeyToken=null", true); + // var type3 = BuildManager.GetType("umbraco.templateCacheRefresh, umbraco, Version=1.0.4698.259, Culture=neutral, PublicKeyToken=null", true); + // var type4 = BuildManager.GetType("umbraco.presentation.cache.MediaLibraryRefreshers, umbraco, Version=1.0.4698.259, Culture=neutral, PublicKeyToken=null", true); + // var type5 = BuildManager.GetType("umbraco.presentation.cache.pageRefresher, umbraco, Version=1.0.4698.259, Culture=neutral, PublicKeyToken=null", true); + // } + // watch.Stop(); + // Debug.WriteLine("TOTAL TIME (1st round): " + watch.ElapsedMilliseconds); //} [Test] @@ -341,4 +341,4 @@ AnotherContentFinder } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Plugins/TypeFinderTests.cs b/src/Umbraco.Tests/Plugins/TypeFinderTests.cs index 66449c721d..58ec1d8a1b 100644 --- a/src/Umbraco.Tests/Plugins/TypeFinderTests.cs +++ b/src/Umbraco.Tests/Plugins/TypeFinderTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Collections.ObjectModel; @@ -24,43 +24,43 @@ namespace Umbraco.Tests.Plugins { /// - /// Tests for typefinder - /// - [TestFixture] - public class TypeFinderTests - { - /// - /// List of assemblies to scan - /// - private Assembly[] _assemblies; + /// Tests for typefinder + ///
+ [TestFixture] + public class TypeFinderTests + { + /// + /// List of assemblies to scan + /// + private Assembly[] _assemblies; - [SetUp] - public void Initialize() - { - _assemblies = new[] - { - this.GetType().Assembly, - typeof(System.Guid).Assembly, - typeof(NUnit.Framework.Assert).Assembly, - typeof(Microsoft.CSharp.CSharpCodeProvider).Assembly, - typeof(System.Xml.NameTable).Assembly, - typeof(System.Configuration.GenericEnumConverter).Assembly, - typeof(System.Web.SiteMap).Assembly, - //typeof(TabPage).Assembly, - typeof(System.Web.Mvc.ActionResult).Assembly, - typeof(TypeFinder).Assembly, + [SetUp] + public void Initialize() + { + _assemblies = new[] + { + this.GetType().Assembly, + typeof(System.Guid).Assembly, + typeof(NUnit.Framework.Assert).Assembly, + typeof(Microsoft.CSharp.CSharpCodeProvider).Assembly, + typeof(System.Xml.NameTable).Assembly, + typeof(System.Configuration.GenericEnumConverter).Assembly, + typeof(System.Web.SiteMap).Assembly, + //typeof(TabPage).Assembly, + typeof(System.Web.Mvc.ActionResult).Assembly, + typeof(TypeFinder).Assembly, typeof(global::UmbracoExamine.BaseUmbracoIndexer).Assembly - }; + }; - } + } [Test] - public void Find_Class_Of_Type_With_Attribute() - { + public void Find_Class_Of_Type_With_Attribute() + { - var typesFound = TypeFinder.FindClassesOfTypeWithAttribute(_assemblies); - Assert.AreEqual(2, typesFound.Count()); - } + var typesFound = TypeFinder.FindClassesOfTypeWithAttribute(_assemblies); + Assert.AreEqual(2, typesFound.Count()); + } //[Test] //public void Find_Classes_Of_Type() @@ -93,10 +93,10 @@ namespace Umbraco.Tests.Plugins Assert.AreEqual(22, typesFound.Count()); // 22 classes in Umbraco.Web are marked with [Tree] } - private static ProfilingLogger GetTestProfilingLogger() - { + private static ProfilingLogger GetTestProfilingLogger() + { var logger = new DebugDiagnosticsLogger(); - var profiler = new TestProfiler(); + var profiler = new TestProfiler(); return new ProfilingLogger(logger, profiler); } @@ -409,7 +409,7 @@ namespace Umbraco.Tests.Plugins internal static readonly string[] KnownAssemblyExclusionFilter = new[] { "mscorlib,", - "System.", + "System.", "Antlr3.", "Autofac.", "Autofac,", @@ -430,8 +430,8 @@ namespace Umbraco.Tests.Plugins "SqlCE4Umbraco,", "umbraco.datalayer,", "umbraco.interfaces,", - "umbraco.providers,", - "Umbraco.Web.UI,", + "umbraco.providers,", + "Umbraco.Web.UI,", "umbraco.webservices", "Lucene.", "Examine,", @@ -629,7 +629,7 @@ namespace Umbraco.Tests.Plugins } - } + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Plugins/TypeHelperTests.cs b/src/Umbraco.Tests/Plugins/TypeHelperTests.cs index 82affb5a16..ed68707eb5 100644 --- a/src/Umbraco.Tests/Plugins/TypeHelperTests.cs +++ b/src/Umbraco.Tests/Plugins/TypeHelperTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel; using System.Data.Odbc; @@ -222,7 +222,7 @@ namespace Umbraco.Tests.Plugins Assert.AreEqual("System.Collections.Generic.IDictionary`2[TKey,TValue]", t.ToString()); t = typeof(IDictionary<,>); - t = t.MakeGenericType(t.GetGenericArguments()[0], t.GetGenericArguments()[1]); + t = t.MakeGenericType(t.GetGenericArguments()[0], t.GetGenericArguments()[1]); Assert.AreEqual("IDictionary`2", t.Name); Assert.AreEqual("System.Collections.Generic.IDictionary`2", t.FullName); Assert.AreEqual("System.Collections.Generic.IDictionary`2[TKey,TValue]", t.ToString()); @@ -260,4 +260,4 @@ namespace Umbraco.Tests.Plugins public string Alias { get; set; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Properties/AssemblyInfo.cs b/src/Umbraco.Tests/Properties/AssemblyInfo.cs index 80cbcb1115..b84866c8cf 100644 --- a/src/Umbraco.Tests/Properties/AssemblyInfo.cs +++ b/src/Umbraco.Tests/Properties/AssemblyInfo.cs @@ -2,7 +2,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following +// 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("Umbraco.Tests")] @@ -14,8 +14,8 @@ using System.Runtime.InteropServices; [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 +// 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)] @@ -25,12 +25,12 @@ using System.Runtime.InteropServices; // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // -// You can specify all the values or you can default the Build and Revision Numbers +// 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.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/Umbraco.Tests/PropertyEditors/ColorListValidatorTest.cs b/src/Umbraco.Tests/PropertyEditors/ColorListValidatorTest.cs index a6ef28a40e..636c51c72e 100644 --- a/src/Umbraco.Tests/PropertyEditors/ColorListValidatorTest.cs +++ b/src/Umbraco.Tests/PropertyEditors/ColorListValidatorTest.cs @@ -26,7 +26,7 @@ namespace Umbraco.Tests.PropertyEditors var result = validator.Validate(new JArray("hello", "world"), null, new ColorPickerPropertyEditor(Mock.Of(), Mock.Of())); Assert.AreEqual(0, result.Count()); } - + [Test] public void Validates_Color_Vals() { @@ -40,4 +40,4 @@ namespace Umbraco.Tests.PropertyEditors Assert.AreEqual(2, result.Count()); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/PropertyEditors/EnsureUniqueValuesValidatorTest.cs b/src/Umbraco.Tests/PropertyEditors/EnsureUniqueValuesValidatorTest.cs index bd50d92a94..0f7aed7204 100644 --- a/src/Umbraco.Tests/PropertyEditors/EnsureUniqueValuesValidatorTest.cs +++ b/src/Umbraco.Tests/PropertyEditors/EnsureUniqueValuesValidatorTest.cs @@ -37,7 +37,7 @@ namespace Umbraco.Tests.PropertyEditors [Test] public void Does_Not_Allow_Multiple_Values() - { + { var validator = new ValueListPreValueEditor.EnsureUniqueValuesValidator(); var result = validator.Validate(new JArray(JObject.FromObject(new { value = "hello" }), JObject.FromObject(new { value = "hello" })), null, new ColorPickerPropertyEditor(Mock.Of(), Mock.Of())); @@ -49,7 +49,7 @@ namespace Umbraco.Tests.PropertyEditors { var validator = new ValueListPreValueEditor.EnsureUniqueValuesValidator(); var result = validator.Validate(new JArray( - JObject.FromObject(new { value = "hello" }), + JObject.FromObject(new { value = "hello" }), JObject.FromObject(new { value = "hello" }), JObject.FromObject(new { value = "world" }), JObject.FromObject(new { value = "world" })), @@ -57,4 +57,4 @@ namespace Umbraco.Tests.PropertyEditors Assert.AreEqual(2, result.Count()); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/PropertyEditors/ImageCropperTest.cs b/src/Umbraco.Tests/PropertyEditors/ImageCropperTest.cs index 34776f1c18..fb8e69a1aa 100644 --- a/src/Umbraco.Tests/PropertyEditors/ImageCropperTest.cs +++ b/src/Umbraco.Tests/PropertyEditors/ImageCropperTest.cs @@ -20,7 +20,7 @@ namespace Umbraco.Tests.PropertyEditors [TestFixture] public class ImageCropperTest { - private const string CropperJson1 = "{\"focalPoint\": {\"left\": 0.96,\"top\": 0.80827067669172936},\"src\": \"/media/1005/img_0671.jpg\",\"crops\": [{\"alias\":\"thumb\",\"width\": 100,\"height\": 100,\"coordinates\": {\"x1\": 0.58729977382575338,\"y1\": 0.055768992440203169,\"x2\": 0,\"y2\": 0.32457553600198386}}]}"; + private const string CropperJson1 = "{\"focalPoint\": {\"left\": 0.96,\"top\": 0.80827067669172936},\"src\": \"/media/1005/img_0671.jpg\",\"crops\": [{\"alias\":\"thumb\",\"width\": 100,\"height\": 100,\"coordinates\": {\"x1\": 0.58729977382575338,\"y1\": 0.055768992440203169,\"x2\": 0,\"y2\": 0.32457553600198386}}]}"; private const string CropperJson2 = "{\"focalPoint\": {\"left\": 0.98,\"top\": 0.80827067669172936},\"src\": \"/media/1005/img_0672.jpg\",\"crops\": [{\"alias\":\"thumb\",\"width\": 100,\"height\": 100,\"coordinates\": {\"x1\": 0.58729977382575338,\"y1\": 0.055768992440203169,\"x2\": 0,\"y2\": 0.32457553600198386}}]}"; private const string CropperJson3 = "{\"focalPoint\": {\"left\": 0.98,\"top\": 0.80827067669172936},\"src\": \"/media/1005/img_0672.jpg\",\"crops\": []}"; private const string MediaPath = "/media/1005/img_0671.jpg"; @@ -57,7 +57,7 @@ namespace Umbraco.Tests.PropertyEditors } [TestCase(CropperJson1, CropperJson1, true)] - [TestCase(CropperJson1, CropperJson2, false)] + [TestCase(CropperJson1, CropperJson2, false)] public void CanConvertImageCropperPropertyEditor(string val1, string val2, bool expected) { try @@ -188,7 +188,7 @@ namespace Umbraco.Tests.PropertyEditors var urlStringPad = MediaPath.GetCropUrl(imageCropperValue: CropperJson1, width: 300, height: 150, imageCropMode: ImageCropMode.Pad); var urlString = MediaPath.GetCropUrl(imageCropperValue: CropperJson1, width: 300, height: 150, imageCropMode:ImageCropMode.Max); var urlStringStretch = MediaPath.GetCropUrl(imageCropperValue: CropperJson1, width: 300, height: 150, imageCropMode: ImageCropMode.Stretch); - + Assert.AreEqual(MediaPath + "?mode=min&width=300&height=150", urlStringMin); Assert.AreEqual(MediaPath + "?mode=boxpad&width=300&height=150", urlStringBoxPad); Assert.AreEqual(MediaPath + "?mode=pad&width=300&height=150", urlStringPad); @@ -302,4 +302,4 @@ namespace Umbraco.Tests.PropertyEditors Assert.AreEqual(MediaPath + "?mode=pad&width=400&height=400&bgcolor=fff", urlString); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/PropertyEditors/LegacyPropertyEditorIdToAliasConverterTests.cs b/src/Umbraco.Tests/PropertyEditors/LegacyPropertyEditorIdToAliasConverterTests.cs index e763d72af2..e756438aa6 100644 --- a/src/Umbraco.Tests/PropertyEditors/LegacyPropertyEditorIdToAliasConverterTests.cs +++ b/src/Umbraco.Tests/PropertyEditors/LegacyPropertyEditorIdToAliasConverterTests.cs @@ -67,4 +67,4 @@ namespace Umbraco.Tests.PropertyEditors Assert.AreEqual(36, LegacyPropertyEditorIdToAliasConverter.Count()); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/PropertyEditors/MultiValuePropertyEditorTests.cs b/src/Umbraco.Tests/PropertyEditors/MultiValuePropertyEditorTests.cs index e0ad7a86f1..4e2cfc9b3e 100644 --- a/src/Umbraco.Tests/PropertyEditors/MultiValuePropertyEditorTests.cs +++ b/src/Umbraco.Tests/PropertyEditors/MultiValuePropertyEditorTests.cs @@ -134,4 +134,4 @@ namespace Umbraco.Tests.PropertyEditors } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/PropertyEditors/PropertyEditorValueConverterTests.cs b/src/Umbraco.Tests/PropertyEditors/PropertyEditorValueConverterTests.cs index 863b2c7246..71b8208eba 100644 --- a/src/Umbraco.Tests/PropertyEditors/PropertyEditorValueConverterTests.cs +++ b/src/Umbraco.Tests/PropertyEditors/PropertyEditorValueConverterTests.cs @@ -7,8 +7,8 @@ using Umbraco.Core.PropertyEditors.ValueConverters; namespace Umbraco.Tests.PropertyEditors { [TestFixture] - public class PropertyEditorValueConverterTests - { + public class PropertyEditorValueConverterTests + { // see notes in the converter // only ONE date format is expected here @@ -24,14 +24,14 @@ namespace Umbraco.Tests.PropertyEditors [TestCase("2012-11-10 13:14:15", true)] [TestCase("2012-11-10T13:14:15", true)] [TestCase("", false)] - public void CanConvertDatePickerPropertyEditor(string date, bool expected) - { - var converter = new DatePickerValueConverter(); - var dateTime = new DateTime(2012, 11, 10, 13, 14, 15); - var result = converter.ConvertSourceToInter(null, date, false); // does not use type for conversion + public void CanConvertDatePickerPropertyEditor(string date, bool expected) + { + var converter = new DatePickerValueConverter(); + var dateTime = new DateTime(2012, 11, 10, 13, 14, 15); + var result = converter.ConvertSourceToInter(null, date, false); // does not use type for conversion - if (expected) - Assert.AreEqual(dateTime.Date, ((DateTime) result).Date); + if (expected) + Assert.AreEqual(dateTime.Date, ((DateTime) result).Date); else Assert.AreNotEqual(dateTime.Date, ((DateTime)result).Date); } diff --git a/src/Umbraco.Tests/PropertyEditors/PropertyEditorValueEditorTests.cs b/src/Umbraco.Tests/PropertyEditors/PropertyEditorValueEditorTests.cs index 1e57a9bfc3..7fcfc98d9c 100644 --- a/src/Umbraco.Tests/PropertyEditors/PropertyEditorValueEditorTests.cs +++ b/src/Umbraco.Tests/PropertyEditors/PropertyEditorValueEditorTests.cs @@ -24,7 +24,7 @@ namespace Umbraco.Tests.PropertyEditors var container = new ServiceContainer(); container.ConfigureUmbracoCore(); - container.Register(_ + container.Register(_ => new DefaultShortStringHelper(new DefaultShortStringHelperConfig().WithDefault(SettingsForTests.GetDefault()))); } @@ -55,7 +55,7 @@ namespace Umbraco.Tests.PropertyEditors [TestCase("TEXT", "hello", "hello")] [TestCase("INT", "123", 123)] [TestCase("INTEGER", "123", 123)] - [TestCase("INTEGER", "", null)] //test empty string for int + [TestCase("INTEGER", "", null)] //test empty string for int [TestCase("DATETIME", "", null)] //test empty string for date public void Value_Editor_Can_Convert_To_Clr_Type(string valueType, string val, object expected) { @@ -109,7 +109,7 @@ namespace Umbraco.Tests.PropertyEditors Assert.IsTrue(result.Success); Assert.IsNull(result.Result); } - + [Test] public void Value_Editor_Can_Convert_To_Date_Clr_Type() { @@ -127,7 +127,7 @@ namespace Umbraco.Tests.PropertyEditors [TestCase(PropertyEditorValueTypes.Text, "hello", "hello")] [TestCase(PropertyEditorValueTypes.Integer, 123, "123")] [TestCase(PropertyEditorValueTypes.IntegerAlternative, 123, "123")] - [TestCase(PropertyEditorValueTypes.Integer, "", "")] //test empty string for int + [TestCase(PropertyEditorValueTypes.Integer, "", "")] //test empty string for int [TestCase(PropertyEditorValueTypes.DateTime, "", "")] //test empty string for date public void Value_Editor_Can_Serialize_Value(string valueType, object val, string expected) { @@ -186,4 +186,4 @@ namespace Umbraco.Tests.PropertyEditors Assert.AreEqual(now.ToIsoString(), result); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/PublishedContent/PublishedContentDataTableTests.cs b/src/Umbraco.Tests/PublishedContent/PublishedContentDataTableTests.cs index e7000af1b9..e2991601c9 100644 --- a/src/Umbraco.Tests/PublishedContent/PublishedContentDataTableTests.cs +++ b/src/Umbraco.Tests/PublishedContent/PublishedContentDataTableTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; @@ -12,227 +12,227 @@ using Umbraco.Web; namespace Umbraco.Tests.PublishedContent { - /// - /// Unit tests for IPublishedContent and extensions - /// - [TestFixture] - public class PublishedContentDataTableTests : BaseWebTest + /// + /// Unit tests for IPublishedContent and extensions + /// + [TestFixture] + public class PublishedContentDataTableTests : BaseWebTest { - public override void SetUp() - { - base.SetUp(); + public override void SetUp() + { + base.SetUp(); // need to specify a different callback for testing - PublishedContentExtensions.GetPropertyAliasesAndNames = (services, alias) => - { - var userFields = new Dictionary() - { - {"property1", "Property 1"}, - {"property2", "Property 2"} - }; - if (alias == "Child") - { - userFields.Add("property4", "Property 4"); - } - else - { - userFields.Add("property3", "Property 3"); - } + PublishedContentExtensions.GetPropertyAliasesAndNames = (services, alias) => + { + var userFields = new Dictionary() + { + {"property1", "Property 1"}, + {"property2", "Property 2"} + }; + if (alias == "Child") + { + userFields.Add("property4", "Property 4"); + } + else + { + userFields.Add("property3", "Property 3"); + } - //ensure the standard fields are there - var allFields = new Dictionary() - { - {"Id", "Id"}, - {"NodeName", "NodeName"}, - {"NodeTypeAlias", "NodeTypeAlias"}, - {"CreateDate", "CreateDate"}, - {"UpdateDate", "UpdateDate"}, - {"CreatorName", "CreatorName"}, - {"WriterName", "WriterName"}, - {"Url", "Url"} - }; - foreach (var f in userFields.Where(f => !allFields.ContainsKey(f.Key))) - { - allFields.Add(f.Key, f.Value); - } - return allFields; - }; - var umbracoContext = GetUmbracoContext("/test"); + //ensure the standard fields are there + var allFields = new Dictionary() + { + {"Id", "Id"}, + {"NodeName", "NodeName"}, + {"NodeTypeAlias", "NodeTypeAlias"}, + {"CreateDate", "CreateDate"}, + {"UpdateDate", "UpdateDate"}, + {"CreatorName", "CreatorName"}, + {"WriterName", "WriterName"}, + {"Url", "Url"} + }; + foreach (var f in userFields.Where(f => !allFields.ContainsKey(f.Key))) + { + allFields.Add(f.Key, f.Value); + } + return allFields; + }; + var umbracoContext = GetUmbracoContext("/test"); //set the UmbracoContext.Current since the extension methods rely on it Umbraco.Web.Composing.Current.UmbracoContextAccessor.UmbracoContext = umbracoContext; } - public override void TearDown() - { - base.TearDown(); - Umbraco.Web.PublishedContentExtensions.GetPropertyAliasesAndNames = null; - } + public override void TearDown() + { + base.TearDown(); + Umbraco.Web.PublishedContentExtensions.GetPropertyAliasesAndNames = null; + } - [Test] - public void To_DataTable() - { - var doc = GetContent(true, 1); - var dt = doc.ChildrenAsTable(Current.Services); + [Test] + public void To_DataTable() + { + var doc = GetContent(true, 1); + var dt = doc.ChildrenAsTable(Current.Services); - Assert.AreEqual(11, dt.Columns.Count); - Assert.AreEqual(3, dt.Rows.Count); - Assert.AreEqual("value4", dt.Rows[0]["Property 1"]); - Assert.AreEqual("value5", dt.Rows[0]["Property 2"]); - Assert.AreEqual("value6", dt.Rows[0]["Property 4"]); - Assert.AreEqual("value7", dt.Rows[1]["Property 1"]); - Assert.AreEqual("value8", dt.Rows[1]["Property 2"]); - Assert.AreEqual("value9", dt.Rows[1]["Property 4"]); - Assert.AreEqual("value10", dt.Rows[2]["Property 1"]); - Assert.AreEqual("value11", dt.Rows[2]["Property 2"]); - Assert.AreEqual("value12", dt.Rows[2]["Property 4"]); - } + Assert.AreEqual(11, dt.Columns.Count); + Assert.AreEqual(3, dt.Rows.Count); + Assert.AreEqual("value4", dt.Rows[0]["Property 1"]); + Assert.AreEqual("value5", dt.Rows[0]["Property 2"]); + Assert.AreEqual("value6", dt.Rows[0]["Property 4"]); + Assert.AreEqual("value7", dt.Rows[1]["Property 1"]); + Assert.AreEqual("value8", dt.Rows[1]["Property 2"]); + Assert.AreEqual("value9", dt.Rows[1]["Property 4"]); + Assert.AreEqual("value10", dt.Rows[2]["Property 1"]); + Assert.AreEqual("value11", dt.Rows[2]["Property 2"]); + Assert.AreEqual("value12", dt.Rows[2]["Property 4"]); + } - [Test] - public void To_DataTable_With_Filter() - { - var doc = GetContent(true, 1); - //change a doc type alias - ((TestPublishedContent) doc.Children.ElementAt(0)).DocumentTypeAlias = "DontMatch"; + [Test] + public void To_DataTable_With_Filter() + { + var doc = GetContent(true, 1); + //change a doc type alias + ((TestPublishedContent) doc.Children.ElementAt(0)).DocumentTypeAlias = "DontMatch"; - var dt = doc.ChildrenAsTable(Current.Services, "Child"); + var dt = doc.ChildrenAsTable(Current.Services, "Child"); - Assert.AreEqual(11, dt.Columns.Count); - Assert.AreEqual(2, dt.Rows.Count); - Assert.AreEqual("value7", dt.Rows[0]["Property 1"]); - Assert.AreEqual("value8", dt.Rows[0]["Property 2"]); - Assert.AreEqual("value9", dt.Rows[0]["Property 4"]); - Assert.AreEqual("value10", dt.Rows[1]["Property 1"]); - Assert.AreEqual("value11", dt.Rows[1]["Property 2"]); - Assert.AreEqual("value12", dt.Rows[1]["Property 4"]); - } + Assert.AreEqual(11, dt.Columns.Count); + Assert.AreEqual(2, dt.Rows.Count); + Assert.AreEqual("value7", dt.Rows[0]["Property 1"]); + Assert.AreEqual("value8", dt.Rows[0]["Property 2"]); + Assert.AreEqual("value9", dt.Rows[0]["Property 4"]); + Assert.AreEqual("value10", dt.Rows[1]["Property 1"]); + Assert.AreEqual("value11", dt.Rows[1]["Property 2"]); + Assert.AreEqual("value12", dt.Rows[1]["Property 4"]); + } - [Test] - public void To_DataTable_No_Rows() - { - var doc = GetContent(false, 1); - var dt = doc.ChildrenAsTable(Current.Services); - //will return an empty data table - Assert.AreEqual(0, dt.Columns.Count); - Assert.AreEqual(0, dt.Rows.Count); - } + [Test] + public void To_DataTable_No_Rows() + { + var doc = GetContent(false, 1); + var dt = doc.ChildrenAsTable(Current.Services); + //will return an empty data table + Assert.AreEqual(0, dt.Columns.Count); + Assert.AreEqual(0, dt.Rows.Count); + } - private IPublishedContent GetContent(bool createChildren, int indexVals) - { - var contentTypeAlias = createChildren ? "Parent" : "Child"; - var d = new TestPublishedContent - { - CreateDate = DateTime.Now, - CreatorId = 1, - CreatorName = "Shannon", + private IPublishedContent GetContent(bool createChildren, int indexVals) + { + var contentTypeAlias = createChildren ? "Parent" : "Child"; + var d = new TestPublishedContent + { + CreateDate = DateTime.Now, + CreatorId = 1, + CreatorName = "Shannon", DocumentTypeAlias = contentTypeAlias, - DocumentTypeId = 2, - Id = 3, - SortOrder = 4, - TemplateId = 5, - UpdateDate = DateTime.Now, - Path = "-1,3", - UrlName = "home-page", - Name = "Page" + Guid.NewGuid().ToString(), - Version = Guid.NewGuid(), - WriterId = 1, - WriterName = "Shannon", - Parent = null, - Level = 1, - Properties = new Collection( - new List() - { - new PropertyResult("property1", "value" + indexVals, PropertyResultType.UserProperty), - new PropertyResult("property2", "value" + (indexVals + 1), PropertyResultType.UserProperty) - }), - Children = new List() - }; - if (createChildren) - { - d.Children = new List() - { - GetContent(false, indexVals + 3), - GetContent(false, indexVals + 6), - GetContent(false, indexVals + 9) - }; - } - if (!createChildren) - { - //create additional columns, used to test the different columns for child nodes - ((Collection)d.Properties).Add(new PropertyResult("property4", "value" + (indexVals + 2), PropertyResultType.UserProperty)); - } - else - { + DocumentTypeId = 2, + Id = 3, + SortOrder = 4, + TemplateId = 5, + UpdateDate = DateTime.Now, + Path = "-1,3", + UrlName = "home-page", + Name = "Page" + Guid.NewGuid().ToString(), + Version = Guid.NewGuid(), + WriterId = 1, + WriterName = "Shannon", + Parent = null, + Level = 1, + Properties = new Collection( + new List() + { + new PropertyResult("property1", "value" + indexVals, PropertyResultType.UserProperty), + new PropertyResult("property2", "value" + (indexVals + 1), PropertyResultType.UserProperty) + }), + Children = new List() + }; + if (createChildren) + { + d.Children = new List() + { + GetContent(false, indexVals + 3), + GetContent(false, indexVals + 6), + GetContent(false, indexVals + 9) + }; + } + if (!createChildren) + { + //create additional columns, used to test the different columns for child nodes + ((Collection)d.Properties).Add(new PropertyResult("property4", "value" + (indexVals + 2), PropertyResultType.UserProperty)); + } + else + { ((Collection)d.Properties).Add(new PropertyResult("property3", "value" + (indexVals + 2), PropertyResultType.UserProperty)); - } - return d; - } + } + return d; + } // note - could probably rewrite those tests using SolidPublishedContentCache // l8tr... - private class TestPublishedContent : IPublishedContent - { - public string Url { get; set; } - public PublishedItemType ItemType { get; set; } + private class TestPublishedContent : IPublishedContent + { + public string Url { get; set; } + public PublishedItemType ItemType { get; set; } - IPublishedContent IPublishedContent.Parent - { - get { return Parent; } - } + IPublishedContent IPublishedContent.Parent + { + get { return Parent; } + } - IEnumerable IPublishedContent.Children - { - get { return Children; } - } + IEnumerable IPublishedContent.Children + { + get { return Children; } + } - public IPublishedContent Parent { get; set; } - public int Id { get; set; } + public IPublishedContent Parent { get; set; } + public int Id { get; set; } public Guid Key { get; set; } - public int TemplateId { get; set; } - public int SortOrder { get; set; } - public string Name { get; set; } - public string UrlName { get; set; } - public string DocumentTypeAlias { get; set; } - public int DocumentTypeId { get; set; } - public string WriterName { get; set; } - public string CreatorName { get; set; } - public int WriterId { get; set; } - public int CreatorId { get; set; } - public string Path { get; set; } - public DateTime CreateDate { get; set; } - public DateTime UpdateDate { get; set; } - public Guid Version { get; set; } - public int Level { get; set; } + public int TemplateId { get; set; } + public int SortOrder { get; set; } + public string Name { get; set; } + public string UrlName { get; set; } + public string DocumentTypeAlias { get; set; } + public int DocumentTypeId { get; set; } + public string WriterName { get; set; } + public string CreatorName { get; set; } + public int WriterId { get; set; } + public int CreatorId { get; set; } + public string Path { get; set; } + public DateTime CreateDate { get; set; } + public DateTime UpdateDate { get; set; } + public Guid Version { get; set; } + public int Level { get; set; } public bool IsDraft { get; set; } - + public IEnumerable Properties { get; set; } - public IEnumerable Children { get; set; } + public IEnumerable Children { get; set; } - public IPublishedProperty GetProperty(string alias) - { - return Properties.FirstOrDefault(x => x.PropertyTypeAlias.InvariantEquals(alias)); - } + public IPublishedProperty GetProperty(string alias) + { + return Properties.FirstOrDefault(x => x.PropertyTypeAlias.InvariantEquals(alias)); + } - public IPublishedProperty GetProperty(string alias, bool recurse) - { - var property = GetProperty(alias); - if (recurse == false) return property; + public IPublishedProperty GetProperty(string alias, bool recurse) + { + var property = GetProperty(alias); + if (recurse == false) return property; - IPublishedContent content = this; - while (content != null && (property == null || property.HasValue == false)) - { - content = content.Parent; - property = content == null ? null : content.GetProperty(alias); - } + IPublishedContent content = this; + while (content != null && (property == null || property.HasValue == false)) + { + content = content.Parent; + property = content == null ? null : content.GetProperty(alias); + } - return property; - } + return property; + } - public PublishedContentType ContentType + public PublishedContentType ContentType { get { throw new NotImplementedException(); } } - } - } -} \ No newline at end of file + } + } +} diff --git a/src/Umbraco.Tests/PublishedContent/PublishedContentExtensionTests.cs b/src/Umbraco.Tests/PublishedContent/PublishedContentExtensionTests.cs index 48016a76d7..ac9783b0e1 100644 --- a/src/Umbraco.Tests/PublishedContent/PublishedContentExtensionTests.cs +++ b/src/Umbraco.Tests/PublishedContent/PublishedContentExtensionTests.cs @@ -11,87 +11,87 @@ using Umbraco.Web; namespace Umbraco.Tests.PublishedContent { - [TestFixture] + [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerFixture)] public class PublishedContentExtensionTests : PublishedContentTestBase - { - private UmbracoContext ctx; - private string xmlContent = ""; - private bool createContentTypes = true; - - protected override string GetXmlContent(int templateId) - { - return xmlContent; - } + { + private UmbracoContext ctx; + private string xmlContent = ""; + private bool createContentTypes = true; - [Test] - public void IsDocumentType_NonRecursive_ActualType_ReturnsTrue() - { - InitializeInheritedContentTypes(); + protected override string GetXmlContent(int templateId) + { + return xmlContent; + } - var publishedContent = ctx.ContentCache.GetById(1100); + [Test] + public void IsDocumentType_NonRecursive_ActualType_ReturnsTrue() + { + InitializeInheritedContentTypes(); + + var publishedContent = ctx.ContentCache.GetById(1100); Assert.That(publishedContent.IsDocumentType("inherited", false)); - } + } - [Test] - public void IsDocumentType_NonRecursive_BaseType_ReturnsFalse() - { - InitializeInheritedContentTypes(); + [Test] + public void IsDocumentType_NonRecursive_BaseType_ReturnsFalse() + { + InitializeInheritedContentTypes(); - var publishedContent = ctx.ContentCache.GetById(1100); - Assert.That(publishedContent.IsDocumentType("base", false), Is.False); - } + var publishedContent = ctx.ContentCache.GetById(1100); + Assert.That(publishedContent.IsDocumentType("base", false), Is.False); + } - [Test] - public void IsDocumentType_Recursive_ActualType_ReturnsTrue() - { - InitializeInheritedContentTypes(); + [Test] + public void IsDocumentType_Recursive_ActualType_ReturnsTrue() + { + InitializeInheritedContentTypes(); - var publishedContent = ctx.ContentCache.GetById(1100); - Assert.That(publishedContent.IsDocumentType("inherited", true)); - } + var publishedContent = ctx.ContentCache.GetById(1100); + Assert.That(publishedContent.IsDocumentType("inherited", true)); + } - [Test] - public void IsDocumentType_Recursive_BaseType_ReturnsTrue() - { - InitializeInheritedContentTypes(); + [Test] + public void IsDocumentType_Recursive_BaseType_ReturnsTrue() + { + InitializeInheritedContentTypes(); - var publishedContent = ctx.ContentCache.GetById(1100); - Assert.That(publishedContent.IsDocumentType("base", true)); - } - - [Test] - public void IsDocumentType_Recursive_InvalidBaseType_ReturnsFalse() - { - InitializeInheritedContentTypes(); + var publishedContent = ctx.ContentCache.GetById(1100); + Assert.That(publishedContent.IsDocumentType("base", true)); + } - var publishedContent = ctx.ContentCache.GetById(1100); - Assert.That(publishedContent.IsDocumentType("invalidbase", true), Is.False); - } + [Test] + public void IsDocumentType_Recursive_InvalidBaseType_ReturnsFalse() + { + InitializeInheritedContentTypes(); - private void InitializeInheritedContentTypes() - { - ctx = GetUmbracoContext("/", 1, null, true); - if (createContentTypes) - { - var contentTypeService = Current.Services.ContentTypeService; - var baseType = new ContentType(-1) {Alias = "base", Name = "Base"}; - const string contentTypeAlias = "inherited"; - var inheritedType = new ContentType(baseType, contentTypeAlias) {Alias = contentTypeAlias, Name = "Inherited"}; - contentTypeService.Save(baseType); - contentTypeService.Save(inheritedType); - createContentTypes = false; - } - #region setup xml content - xmlContent = @" - + ]> - + "; - #endregion - } - } + #endregion + } + } } diff --git a/src/Umbraco.Tests/PublishedContent/PublishedContentRequestEngineTests.cs b/src/Umbraco.Tests/PublishedContent/PublishedContentRequestEngineTests.cs index 7e2f41a5b7..cba58d57c2 100644 --- a/src/Umbraco.Tests/PublishedContent/PublishedContentRequestEngineTests.cs +++ b/src/Umbraco.Tests/PublishedContent/PublishedContentRequestEngineTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.Collections.ObjectModel; using System.Globalization; @@ -29,7 +29,7 @@ namespace Umbraco.Tests.PublishedContent var umbracoContext = GetUmbracoContext("/test"); var facadeRouter = CreateFacadeRouter(); var request = facadeRouter.CreateRequest(umbracoContext); - var content = GetPublishedContentMock(); + var content = GetPublishedContentMock(); request.PublishedContent = content.Object; request.Culture = new CultureInfo("en-AU"); request.SetRedirect("/hello"); @@ -48,7 +48,7 @@ namespace Umbraco.Tests.PublishedContent request.PublishedContent = content.Object; request.Culture = new CultureInfo("en-AU"); facadeRouter.ConfigureRequest(request); - + Assert.AreEqual(1, umbracoContext.HttpContext.Items["pageID"]); Assert.AreEqual(request.UmbracoPage.Elements.Count, ((Hashtable) umbracoContext.HttpContext.Items["pageElements"]).Count); } @@ -86,4 +86,4 @@ namespace Umbraco.Tests.PublishedContent return pc; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/PublishedContent/PublishedContentTestBase.cs b/src/Umbraco.Tests/PublishedContent/PublishedContentTestBase.cs index 35ddfc16be..3511df769f 100644 --- a/src/Umbraco.Tests/PublishedContent/PublishedContentTestBase.cs +++ b/src/Umbraco.Tests/PublishedContent/PublishedContentTestBase.cs @@ -1,4 +1,4 @@ -using Umbraco.Core; +using Umbraco.Core; using Umbraco.Core.Composing; using Umbraco.Core.Models.PublishedContent; using Umbraco.Core.PropertyEditors; @@ -42,4 +42,4 @@ namespace Umbraco.Tests.PublishedContent .Append(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/PublishedContent/PublishedContentTests.cs b/src/Umbraco.Tests/PublishedContent/PublishedContentTests.cs index 3cc16c1dbd..e7ade8dfd3 100644 --- a/src/Umbraco.Tests/PublishedContent/PublishedContentTests.cs +++ b/src/Umbraco.Tests/PublishedContent/PublishedContentTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Web; @@ -15,13 +15,13 @@ using Umbraco.Tests.Testing; namespace Umbraco.Tests.PublishedContent { - /// - /// Tests the methods on IPublishedContent using the DefaultPublishedContentStore - /// - [TestFixture] + /// + /// Tests the methods on IPublishedContent using the DefaultPublishedContentStore + /// + [TestFixture] [UmbracoTest(PluginManager = UmbracoTestOptions.PluginManager.PerFixture)] public class PublishedContentTests : PublishedContentTestBase - { + { private TypeLoader _typeLoader; public override void SetUp() @@ -50,30 +50,30 @@ namespace Umbraco.Tests.PublishedContent ContentTypesCache.GetPublishedContentTypeByAlias = alias => type; } - protected override void Compose() - { - base.Compose(); + protected override void Compose() + { + base.Compose(); Container.RegisterSingleton(f => new PublishedContentModelFactory(f.GetInstance().GetTypes())); - } + } - protected override TypeLoader CreatePluginManager(IServiceFactory f) - { - var pluginManager = base.CreatePluginManager(f); + protected override TypeLoader CreatePluginManager(IServiceFactory f) + { + var pluginManager = base.CreatePluginManager(f); - // this is so the model factory looks into the test assembly - pluginManager.AssembliesToScan = pluginManager.AssembliesToScan - .Union(new[] { typeof(PublishedContentTests).Assembly }) - .ToList(); + // this is so the model factory looks into the test assembly + pluginManager.AssembliesToScan = pluginManager.AssembliesToScan + .Union(new[] { typeof(PublishedContentTests).Assembly }) + .ToList(); - return pluginManager; - } + return pluginManager; + } private readonly Guid _node1173Guid = Guid.NewGuid(); - protected override string GetXmlContent(int templateId) - { - return @" + protected override string GetXmlContent(int templateId) + { + return @" @@ -81,49 +81,49 @@ namespace Umbraco.Tests.PublishedContent ]> - - - - 1 - - - This is some content]]> - - - - - - - - - - + + + + 1 + + + This is some content]]> + + + + + + + + + + - + 1 - - - - - - - - - + + + + + + + + + "; - } + } - internal IPublishedContent GetNode(int id) - { - var ctx = GetUmbracoContext("/test"); - var doc = ctx.ContentCache.GetById(id); - Assert.IsNotNull(doc); - return doc; - } + internal IPublishedContent GetNode(int id) + { + var ctx = GetUmbracoContext("/test"); + var doc = ctx.ContentCache.GetById(id); + Assert.IsNotNull(doc); + return doc; + } - [Test] - public void GetNodeByIds() - { + [Test] + public void GetNodeByIds() + { var ctx = GetUmbracoContext("/test"); var contentById = ctx.ContentCache.GetById(1173); Assert.IsNotNull(contentById); @@ -294,18 +294,18 @@ namespace Umbraco.Tests.PublishedContent } } - [Test] - public void Descendants_Ordered_Properly() - { + [Test] + public void Descendants_Ordered_Properly() + { var doc = GetNode(1046); - var expected = new[] {1046, 1173, 1174, 1177, 1178, 1176, 1175, 4444, 1172}; - var exindex = 0; + var expected = new[] {1046, 1173, 1174, 1177, 1178, 1176, 1175, 4444, 1172}; + var exindex = 0; // must respect the XPath descendants-or-self axis! foreach (var d in doc.DescendantsOrSelf()) Assert.AreEqual(expected[exindex++], d.Id); - } + } [Test] public void GetPropertyValueRecursiveTest() @@ -318,88 +318,88 @@ namespace Umbraco.Tests.PublishedContent } [Test] - public void Get_Property_Value_Uses_Converter() - { - var doc = GetNode(1173); + public void Get_Property_Value_Uses_Converter() + { + var doc = GetNode(1173); - var propVal = doc.Value("content"); + var propVal = doc.Value("content"); Assert.IsInstanceOf(typeof(IHtmlString), propVal); - Assert.AreEqual("
This is some content
", propVal.ToString()); + Assert.AreEqual("
This is some content
", propVal.ToString()); - var propVal2 = doc.Value("content"); + var propVal2 = doc.Value("content"); Assert.IsInstanceOf(typeof(IHtmlString), propVal2); Assert.AreEqual("
This is some content
", propVal2.ToString()); var propVal3 = doc.Value("Content"); Assert.IsInstanceOf(typeof(IHtmlString), propVal3); Assert.AreEqual("
This is some content
", propVal3.ToString()); - } + } - [Test] - public void Complex_Linq() - { - var doc = GetNode(1173); + [Test] + public void Complex_Linq() + { + var doc = GetNode(1173); - var result = doc.Ancestors().OrderBy(x => x.Level) - .Single() - .Descendants() - .FirstOrDefault(x => x.Value("selectedNodes", "").Split(',').Contains("1173")); + var result = doc.Ancestors().OrderBy(x => x.Level) + .Single() + .Descendants() + .FirstOrDefault(x => x.Value("selectedNodes", "").Split(',').Contains("1173")); - Assert.IsNotNull(result); - } + Assert.IsNotNull(result); + } - [Test] - public void Children_GroupBy_DocumentTypeAlias() - { - var doc = GetNode(1046); + [Test] + public void Children_GroupBy_DocumentTypeAlias() + { + var doc = GetNode(1046); - var found1 = doc.Children.GroupBy(x => x.DocumentTypeAlias).ToArray(); + var found1 = doc.Children.GroupBy(x => x.DocumentTypeAlias).ToArray(); - Assert.AreEqual(2, found1.Length); - Assert.AreEqual(2, found1.Single(x => x.Key.ToString() == "Home").Count()); - Assert.AreEqual(1, found1.Single(x => x.Key.ToString() == "CustomDocument").Count()); - } + Assert.AreEqual(2, found1.Length); + Assert.AreEqual(2, found1.Single(x => x.Key.ToString() == "Home").Count()); + Assert.AreEqual(1, found1.Single(x => x.Key.ToString() == "CustomDocument").Count()); + } - [Test] - public void Children_Where_DocumentTypeAlias() - { - var doc = GetNode(1046); + [Test] + public void Children_Where_DocumentTypeAlias() + { + var doc = GetNode(1046); - var found1 = doc.Children.Where(x => x.DocumentTypeAlias == "CustomDocument"); - var found2 = doc.Children.Where(x => x.DocumentTypeAlias == "Home"); + var found1 = doc.Children.Where(x => x.DocumentTypeAlias == "CustomDocument"); + var found2 = doc.Children.Where(x => x.DocumentTypeAlias == "Home"); - Assert.AreEqual(1, found1.Count()); - Assert.AreEqual(2, found2.Count()); - } + Assert.AreEqual(1, found1.Count()); + Assert.AreEqual(2, found2.Count()); + } - [Test] - public void Children_Order_By_Update_Date() - { - var doc = GetNode(1173); + [Test] + public void Children_Order_By_Update_Date() + { + var doc = GetNode(1173); - var ordered = doc.Children.OrderBy(x => x.UpdateDate); + var ordered = doc.Children.OrderBy(x => x.UpdateDate); - var correctOrder = new[] { 1178, 1177, 1174, 1176 }; - for (var i = 0; i < correctOrder.Length; i++) - { - Assert.AreEqual(correctOrder[i], ordered.ElementAt(i).Id); - } + var correctOrder = new[] { 1178, 1177, 1174, 1176 }; + for (var i = 0; i < correctOrder.Length; i++) + { + Assert.AreEqual(correctOrder[i], ordered.ElementAt(i).Id); + } - } + } - [Test] - public void FirstChild() - { - var doc = GetNode(1173); // has child nodes - Assert.IsNotNull(doc.FirstChild()); - Assert.IsNotNull(doc.FirstChild(x => true)); - Assert.IsNotNull(doc.FirstChild()); + [Test] + public void FirstChild() + { + var doc = GetNode(1173); // has child nodes + Assert.IsNotNull(doc.FirstChild()); + Assert.IsNotNull(doc.FirstChild(x => true)); + Assert.IsNotNull(doc.FirstChild()); - doc = GetNode(1175); // does not have child nodes - Assert.IsNull(doc.FirstChild()); - Assert.IsNull(doc.FirstChild(x => true)); - Assert.IsNull(doc.FirstChild()); - } + doc = GetNode(1175); // does not have child nodes + Assert.IsNull(doc.FirstChild()); + Assert.IsNull(doc.FirstChild(x => true)); + Assert.IsNull(doc.FirstChild()); + } [Test] public void IsComposedOf() @@ -411,145 +411,145 @@ namespace Umbraco.Tests.PublishedContent Assert.IsTrue(isComposedOf); } - [Test] - public void HasProperty() - { - var doc = GetNode(1173); + [Test] + public void HasProperty() + { + var doc = GetNode(1173); - var hasProp = doc.HasProperty(Constants.Conventions.Content.UrlAlias); + var hasProp = doc.HasProperty(Constants.Conventions.Content.UrlAlias); Assert.IsTrue(hasProp); - } + } - [Test] - public void HasValue() - { - var doc = GetNode(1173); + [Test] + public void HasValue() + { + var doc = GetNode(1173); - var hasValue = doc.HasValue(Constants.Conventions.Content.UrlAlias); - var noValue = doc.HasValue("blahblahblah"); + var hasValue = doc.HasValue(Constants.Conventions.Content.UrlAlias); + var noValue = doc.HasValue("blahblahblah"); - Assert.IsTrue(hasValue); - Assert.IsFalse(noValue); - } + Assert.IsTrue(hasValue); + Assert.IsFalse(noValue); + } - [Test] - public void Ancestors_Where_Visible() - { - var doc = GetNode(1174); + [Test] + public void Ancestors_Where_Visible() + { + var doc = GetNode(1174); - var whereVisible = doc.Ancestors().Where(x => x.IsVisible()); - Assert.AreEqual(1, whereVisible.Count()); + var whereVisible = doc.Ancestors().Where(x => x.IsVisible()); + Assert.AreEqual(1, whereVisible.Count()); - } + } - [Test] - public void Visible() - { - var hidden = GetNode(1046); - var visible = GetNode(1173); + [Test] + public void Visible() + { + var hidden = GetNode(1046); + var visible = GetNode(1173); - Assert.IsFalse(hidden.IsVisible()); - Assert.IsTrue(visible.IsVisible()); - } + Assert.IsFalse(hidden.IsVisible()); + Assert.IsTrue(visible.IsVisible()); + } - [Test] - public void Ancestor_Or_Self() - { - var doc = GetNode(1173); + [Test] + public void Ancestor_Or_Self() + { + var doc = GetNode(1173); - var result = doc.AncestorOrSelf(); + var result = doc.AncestorOrSelf(); - Assert.IsNotNull(result); + Assert.IsNotNull(result); // ancestor-or-self has to be self! Assert.AreEqual(1173, result.Id); - } + } - [Test] - public void U4_4559() - { - var doc = GetNode(1174); - var result = doc.AncestorOrSelf(1); + [Test] + public void U4_4559() + { + var doc = GetNode(1174); + var result = doc.AncestorOrSelf(1); Assert.IsNotNull(result); Assert.AreEqual(1046, result.Id); - } + } - [Test] - public void Ancestors_Or_Self() - { - var doc = GetNode(1174); + [Test] + public void Ancestors_Or_Self() + { + var doc = GetNode(1174); - var result = doc.AncestorsOrSelf().ToArray(); + var result = doc.AncestorsOrSelf().ToArray(); - Assert.IsNotNull(result); + Assert.IsNotNull(result); - Assert.AreEqual(3, result.Length); - Assert.IsTrue(result.Select(x => ((dynamic)x).Id).ContainsAll(new dynamic[] { 1174, 1173, 1046 })); - } + Assert.AreEqual(3, result.Length); + Assert.IsTrue(result.Select(x => ((dynamic)x).Id).ContainsAll(new dynamic[] { 1174, 1173, 1046 })); + } - [Test] - public void Ancestors() - { - var doc = GetNode(1174); + [Test] + public void Ancestors() + { + var doc = GetNode(1174); - var result = doc.Ancestors().ToArray(); + var result = doc.Ancestors().ToArray(); - Assert.IsNotNull(result); + Assert.IsNotNull(result); - Assert.AreEqual(2, result.Length); - Assert.IsTrue(result.Select(x => ((dynamic)x).Id).ContainsAll(new dynamic[] { 1173, 1046 })); - } + Assert.AreEqual(2, result.Length); + Assert.IsTrue(result.Select(x => ((dynamic)x).Id).ContainsAll(new dynamic[] { 1173, 1046 })); + } - [Test] - public void Descendants_Or_Self() - { - var doc = GetNode(1046); + [Test] + public void Descendants_Or_Self() + { + var doc = GetNode(1046); - var result = doc.DescendantsOrSelf().ToArray(); + var result = doc.DescendantsOrSelf().ToArray(); - Assert.IsNotNull(result); + Assert.IsNotNull(result); - Assert.AreEqual(8, result.Length); - Assert.IsTrue(result.Select(x => ((dynamic)x).Id).ContainsAll(new dynamic[] { 1046, 1173, 1174, 1176, 1175 })); - } + Assert.AreEqual(8, result.Length); + Assert.IsTrue(result.Select(x => ((dynamic)x).Id).ContainsAll(new dynamic[] { 1046, 1173, 1174, 1176, 1175 })); + } - [Test] - public void Descendants() - { - var doc = GetNode(1046); + [Test] + public void Descendants() + { + var doc = GetNode(1046); - var result = doc.Descendants().ToArray(); + var result = doc.Descendants().ToArray(); - Assert.IsNotNull(result); + Assert.IsNotNull(result); - Assert.AreEqual(7, result.Length); - Assert.IsTrue(result.Select(x => ((dynamic)x).Id).ContainsAll(new dynamic[] { 1173, 1174, 1176, 1175, 4444 })); - } + Assert.AreEqual(7, result.Length); + Assert.IsTrue(result.Select(x => ((dynamic)x).Id).ContainsAll(new dynamic[] { 1173, 1174, 1176, 1175, 4444 })); + } - [Test] - public void Up() - { - var doc = GetNode(1173); + [Test] + public void Up() + { + var doc = GetNode(1173); - var result = doc.Up(); + var result = doc.Up(); - Assert.IsNotNull(result); + Assert.IsNotNull(result); - Assert.AreEqual(1046, result.Id); - } + Assert.AreEqual(1046, result.Id); + } - [Test] - public void Down() - { - var doc = GetNode(1173); + [Test] + public void Down() + { + var doc = GetNode(1173); - var result = doc.Down(); + var result = doc.Down(); - Assert.IsNotNull(result); + Assert.IsNotNull(result); - Assert.AreEqual(1174, result.Id); - } + Assert.AreEqual(1174, result.Id); + } [Test] public void FragmentProperty() @@ -561,24 +561,24 @@ namespace Umbraco.Tests.PublishedContent Assert.AreEqual(5548, prop.Value); } - public void Fragment1() - { + public void Fragment1() + { var type = ContentTypesCache.Get(PublishedItemType.Content, "detachedSomething"); var values = new Dictionary(); var f = new PublishedFragment(type, Guid.NewGuid(), values, false); } [Test] - public void Fragment2() - { - var pt1 = new PublishedPropertyType("legend", 0, Constants.PropertyEditors.TextboxAlias); - var pt2 = new PublishedPropertyType("image", 0, Constants.PropertyEditors.MediaPickerAlias); + public void Fragment2() + { + var pt1 = new PublishedPropertyType("legend", 0, Constants.PropertyEditors.TextboxAlias); + var pt2 = new PublishedPropertyType("image", 0, Constants.PropertyEditors.MediaPickerAlias); var pt3 = new PublishedPropertyType("size", 0, Constants.PropertyEditors.IntegerAlias); - const string val1 = "boom bam"; - const int val2 = 0; + const string val1 = "boom bam"; + const int val2 = 0; const int val3 = 666; - var guid = Guid.NewGuid(); + var guid = Guid.NewGuid(); var ct = new PublishedContentType(0, "alias", new[] { pt1, pt2, pt3 }); @@ -593,18 +593,18 @@ namespace Umbraco.Tests.PublishedContent Assert.AreEqual(val3, c.Size); } - class ImageWithLegendModel : PublishedFragment - { + class ImageWithLegendModel : PublishedFragment + { public ImageWithLegendModel(PublishedContentType contentType, Guid fragmentKey, Dictionary values, bool previewing) : base(contentType, fragmentKey, values, previewing) - { } + { } public string Legend => this.Value("legend"); - public IPublishedContent Image => this.Value("image"); + public IPublishedContent Image => this.Value("image"); - public int Size => this.Value("size"); - } + public int Size => this.Value("size"); + } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/PublishedContent/PublishedMediaTests.cs b/src/Umbraco.Tests/PublishedContent/PublishedMediaTests.cs index f1dc630271..662d77150e 100644 --- a/src/Umbraco.Tests/PublishedContent/PublishedMediaTests.cs +++ b/src/Umbraco.Tests/PublishedContent/PublishedMediaTests.cs @@ -1,4 +1,4 @@ -using System.Web; +using System.Web; using System.Xml.Linq; using System.Xml.XPath; using Lucene.Net.Store; @@ -158,12 +158,12 @@ namespace Umbraco.Tests.PublishedContent //move item to recycle bin var newXml = XElement.Parse(@" - - 115 - 268 - 10726 - jpg - "); + + 115 + 268 + 10726 + jpg + "); indexer.ReIndexNode(newXml, "media"); session.WaitForChanges(); @@ -449,19 +449,19 @@ namespace Umbraco.Tests.PublishedContent var nodeId = 2112; var xml = XElement.Parse(@" - - 115 - 268 - 10726 - jpg - - - 115 - 268 - 10726 - jpg - - "); + + 115 + 268 + 10726 + jpg + + + 115 + 268 + 10726 + jpg + + "); var node = xml.DescendantsAndSelf("Image").Single(x => (int)x.Attribute("id") == nodeId); var publishedMedia = new PublishedMediaCache(new XmlStore((XmlDocument)null), ServiceContext.MediaService, ServiceContext.UserService, new StaticCacheProvider(), ContentTypesCache); @@ -492,4 +492,4 @@ namespace Umbraco.Tests.PublishedContent } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/PublishedContent/StronglyTypedModels/CallingMethodTests.cs b/src/Umbraco.Tests/PublishedContent/StronglyTypedModels/CallingMethodTests.cs index 4f708ab7bd..2c023743c1 100644 --- a/src/Umbraco.Tests/PublishedContent/StronglyTypedModels/CallingMethodTests.cs +++ b/src/Umbraco.Tests/PublishedContent/StronglyTypedModels/CallingMethodTests.cs @@ -29,7 +29,7 @@ namespace Umbraco.Tests.PublishedContent.StronglyTypedModels return m.Name.Replace("get_", ""); } - // that would be the correct way of doing it, works in RELEASE mode + // that would be the correct way of doing it, works in RELEASE mode // as well as DEBUG and is optimized, etc public string Resolve2([CallerMemberName] string memberName = null) { @@ -48,4 +48,4 @@ namespace Umbraco.Tests.PublishedContent.StronglyTypedModels Assert.AreEqual("AField2", AField2); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/PublishedContent/StronglyTypedModels/Subpage.cs b/src/Umbraco.Tests/PublishedContent/StronglyTypedModels/Subpage.cs index 0cf9202340..f69488d308 100644 --- a/src/Umbraco.Tests/PublishedContent/StronglyTypedModels/Subpage.cs +++ b/src/Umbraco.Tests/PublishedContent/StronglyTypedModels/Subpage.cs @@ -5,12 +5,12 @@ using Umbraco.Core.Models.PublishedContent; namespace Umbraco.Tests.PublishedContent.StronglyTypedModels { /// - /// Represents a Subpage which acts as the strongly typed model for a Doc Type + /// Represents a Subpage which acts as the strongly typed model for a Doc Type /// with alias "Subpage" and "Subpage" as the allowed child type. - /// + /// /// Similar to the Textpage this model could also be generated, but it could also /// act as a Code-First model by using the attributes shown on the various properties, - /// which decorate the model with information about the Document Type, its + /// which decorate the model with information about the Document Type, its /// Property Groups and Property Types. /// public class Subpage : TypedModelBase @@ -39,4 +39,4 @@ namespace Umbraco.Tests.PublishedContent.StronglyTypedModels } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/PublishedContent/StronglyTypedModels/Textpage.cs b/src/Umbraco.Tests/PublishedContent/StronglyTypedModels/Textpage.cs index 93f1a7bec2..26b4d7d72f 100644 --- a/src/Umbraco.Tests/PublishedContent/StronglyTypedModels/Textpage.cs +++ b/src/Umbraco.Tests/PublishedContent/StronglyTypedModels/Textpage.cs @@ -6,13 +6,13 @@ using Umbraco.Core.Models.PublishedContent; namespace Umbraco.Tests.PublishedContent.StronglyTypedModels { /// - /// Represents a Textpage which acts as the strongly typed model for a Doc Type + /// Represents a Textpage which acts as the strongly typed model for a Doc Type /// with alias "Textpage" and "Subpage" as the allowed child type. - /// + /// /// The basic properties are resolved by convention using the Resolve-Type-PropertyTypeAlias /// convention available through the base class' protected Resolve-method and Property-delegate. - /// - /// The Textpage allows the use of Subpage and Textpage as child doc types, which are exposed as a + /// + /// The Textpage allows the use of Subpage and Textpage as child doc types, which are exposed as a /// collection using the Children-Type-ContentTypeAlias convention available through the /// base class' protected Children-method and ContentTypeAlias-delegate. /// @@ -58,4 +58,4 @@ namespace Umbraco.Tests.PublishedContent.StronglyTypedModels } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/PublishedContent/StronglyTypedModels/TypedModelBase.cs b/src/Umbraco.Tests/PublishedContent/StronglyTypedModels/TypedModelBase.cs index 0f5c1bd371..12eea94f7c 100644 --- a/src/Umbraco.Tests/PublishedContent/StronglyTypedModels/TypedModelBase.cs +++ b/src/Umbraco.Tests/PublishedContent/StronglyTypedModels/TypedModelBase.cs @@ -14,16 +14,16 @@ namespace Umbraco.Tests.PublishedContent.StronglyTypedModels /// Represents the abstract base class for a 'TypedModel', which basically wraps IPublishedContent /// underneath a strongly typed model like "Textpage" and "Subpage". /// Because IPublishedContent is used under the hood there is no need for additional mapping, so the - /// only added cost should be the creation of the objects, which the IPublishedContent instance is + /// only added cost should be the creation of the objects, which the IPublishedContent instance is /// passed into. - /// + /// /// This base class exposes a simple way to write property getters by convention without /// using the string alias of a PropertyType (this is resolved by the use of the Property delegate). - /// + /// /// This base class also exposes query options like Parent, Children, Ancestors and Descendants, /// which can be used for collections of strongly typed child models/objects. These types of collections /// typically corresponds to 'allowed child content types' on a Doc Type (at different levels). - /// + /// /// The IPublishedContent properties are also exposed through this base class, but only /// by casting the typed model to IPublishedContent, so the properties doesn't show up by default: /// ie. ((IPublishedContent)textpage).Url @@ -166,4 +166,4 @@ namespace Umbraco.Tests.PublishedContent.StronglyTypedModels return pluralWord; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Publishing/PublishingStrategyTests.cs b/src/Umbraco.Tests/Publishing/PublishingStrategyTests.cs index 36fd09f965..5ee1dbaf90 100644 --- a/src/Umbraco.Tests/Publishing/PublishingStrategyTests.cs +++ b/src/Umbraco.Tests/Publishing/PublishingStrategyTests.cs @@ -19,27 +19,27 @@ namespace Umbraco.Tests.Publishing { base.SetUp(); - //LegacyUmbracoSettings.SettingsFilePath = IOHelper.MapPath(SystemDirectories.Config + Path.DirectorySeparatorChar, false); + //LegacyUmbracoSettings.SettingsFilePath = IOHelper.MapPath(SystemDirectories.Config + Path.DirectorySeparatorChar, false); } [TearDown] public override void TearDown() { - base.TearDown(); - + base.TearDown(); + //ensure event handler is gone - ContentService.Publishing -= StrategyPublishing; + ContentService.Publishing -= StrategyPublishing; } private IContent _homePage; /// - /// in these tests we have a heirarchy of + /// in these tests we have a heirarchy of /// - home /// -- text page 1 /// -- text page 2 /// --- text page 3 - /// + /// /// For this test, none of them are published, then we bulk publish them all, however one of the nodes will fail publishing /// because it is not valid, then it's children won't be published either because it's never been published. /// @@ -55,7 +55,7 @@ namespace Umbraco.Tests.Publishing var subContent = MockedContent.CreateSimpleContent( ServiceContext.ContentTypeService.Get("umbTextpage"), "Sub Sub Sub", mandatorContent.Id); ServiceContext.ContentService.Save(subContent, 0); - + //publish root and nodes at it's children level var listToPublish = ServiceContext.ContentService.GetDescendants(_homePage.Id).Concat(new[] { _homePage }); var evtMsgs = new EventMessages(); @@ -68,14 +68,14 @@ namespace Umbraco.Tests.Publishing } /// - /// in these tests we have a heirarchy of + /// in these tests we have a heirarchy of /// - home /// -- text page 1 /// -- text page 2 /// --- text page 3 - /// + /// /// For this test, none of them are published, then we bulk publish them all, however we cancel the publishing for - /// "text page 2". This internally will ensure that text page 3 doesn't get published either because text page 2 has + /// "text page 2". This internally will ensure that text page 3 doesn't get published either because text page 2 has /// never been published. /// [Test] @@ -90,7 +90,7 @@ namespace Umbraco.Tests.Publishing var evtMsgs = new EventMessages(); var uow = TestObjects.GetUnitOfWorkMock(); var result = ((ContentService)ServiceContext.ContentService).StrategyPublishWithChildren(uow, listToPublish, null, 0, evtMsgs); - + Assert.AreEqual(listToPublish.Count() - 2, result.Count(x => x.Success)); Assert.IsTrue(result.Where(x => x.Success).Select(x => x.Result.ContentItem.Id) .ContainsAll(listToPublish.Where(x => x.Name != "Text Page 2" && x.Name != "Text Page 3").Select(x => x.Id))); @@ -116,12 +116,12 @@ namespace Umbraco.Tests.Publishing Assert.IsTrue(_homePage.Published); foreach (var c in ServiceContext.ContentService.GetChildren(_homePage.Id)) { - var r = ((ContentService)ServiceContext.ContentService).StrategyPublish(uow, c, false, 0, evtMsgs); + var r = ((ContentService)ServiceContext.ContentService).StrategyPublish(uow, c, false, 0, evtMsgs); Assert.IsTrue(r); Assert.IsTrue(c.Published); } - //ok, all are published except the deepest descendant, we will pass in a flag to not include it to + //ok, all are published except the deepest descendant, we will pass in a flag to not include it to //be published - beware that StrategyPublishWithChildren expects content to be ordered by level var content = new[] {_homePage}.Union(ServiceContext.ContentService.GetDescendants(_homePage)); var result = ((ContentService)ServiceContext.ContentService).StrategyPublishWithChildren(uow, content, null, 0, evtMsgs, false); @@ -143,7 +143,7 @@ namespace Umbraco.Tests.Publishing var result1 = ((ContentService)ServiceContext.ContentService).StrategyPublish(uow, _homePage, false, 0, evtMsgs); Assert.IsTrue(result1); Assert.IsTrue(_homePage.Published); - + //NOTE (MCH) This isn't persisted, so not really a good test as it will look like the result should be something else. foreach (var c in ServiceContext.ContentService.GetChildren(_homePage.Id)) { @@ -165,7 +165,7 @@ namespace Umbraco.Tests.Publishing var contents = new[] {_homePage} // top-level MUST be the first one here .Concat(ServiceContext.ContentService.GetDescendants(_homePage)); var result = ((ContentService)ServiceContext.ContentService).StrategyPublishWithChildren(uow, contents, null, 0, evtMsgs, true); - + Assert.AreEqual(4, result.Count(x => x.Result.StatusType == PublishStatusType.Success)); Assert.AreEqual(0, result.Count(x => x.Result.StatusType == PublishStatusType.SuccessAlreadyPublished)); Assert.IsTrue(result.First(x => x.Result.StatusType == PublishStatusType.Success).Success); @@ -208,4 +208,4 @@ namespace Umbraco.Tests.Publishing return new[] {_homePage, subpage, subpage2, subpage3}; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Routing/ContentFinderByAliasTests.cs b/src/Umbraco.Tests/Routing/ContentFinderByAliasTests.cs index d2922fbe39..e93a84ce2d 100644 --- a/src/Umbraco.Tests/Routing/ContentFinderByAliasTests.cs +++ b/src/Umbraco.Tests/Routing/ContentFinderByAliasTests.cs @@ -1,4 +1,4 @@ -using NUnit.Framework; +using NUnit.Framework; using Umbraco.Web.Routing; namespace Umbraco.Tests.Routing @@ -31,91 +31,91 @@ namespace Umbraco.Tests.Routing protected override string GetXmlContent(int templateId) { return @" - ]> - - + + - - This is some content]]> + + This is some content]]> - - + + - - - - - - - - - - - - - This is some content]]> + + + + + + + + + + + + + This is some content]]> - - + + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - This is some content]]> - - - - - - - - - - - - - - - This is some content]]> - - - - - - - - - - - - - - - - + + + + + + + + This is some content]]> + + + + + + + + + + + + + + + This is some content]]> + + + + + + + + + + + + + + + + "; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Routing/ContentFinderByAliasWithDomainsTests.cs b/src/Umbraco.Tests/Routing/ContentFinderByAliasWithDomainsTests.cs index 7f3c1fde8e..149b75d1c0 100644 --- a/src/Umbraco.Tests/Routing/ContentFinderByAliasWithDomainsTests.cs +++ b/src/Umbraco.Tests/Routing/ContentFinderByAliasWithDomainsTests.cs @@ -1,9 +1,9 @@ -using NUnit.Framework; +using NUnit.Framework; using Umbraco.Web.Routing; namespace Umbraco.Tests.Routing { - + [TestFixture] public class ContentFinderByAliasWithDomainsTests : ContentFinderByAliasTests { @@ -44,4 +44,4 @@ namespace Umbraco.Tests.Routing } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Routing/ContentFinderByIdTests.cs b/src/Umbraco.Tests/Routing/ContentFinderByIdTests.cs index f78d378c33..9813e66d45 100644 --- a/src/Umbraco.Tests/Routing/ContentFinderByIdTests.cs +++ b/src/Umbraco.Tests/Routing/ContentFinderByIdTests.cs @@ -1,27 +1,27 @@ -using NUnit.Framework; +using NUnit.Framework; using Umbraco.Tests.TestHelpers; using Umbraco.Web.Routing; namespace Umbraco.Tests.Routing { - [TestFixture] - public class ContentFinderByIdTests : BaseWebTest + [TestFixture] + public class ContentFinderByIdTests : BaseWebTest { - [TestCase("/1046", 1046)] - [TestCase("/1046.aspx", 1046)] - public void Lookup_By_Id(string urlAsString, int nodeMatch) - { - var umbracoContext = GetUmbracoContext(urlAsString); - var facadeRouter = CreateFacadeRouter(); - var frequest = facadeRouter.CreateRequest(umbracoContext); + [TestCase("/1046", 1046)] + [TestCase("/1046.aspx", 1046)] + public void Lookup_By_Id(string urlAsString, int nodeMatch) + { + var umbracoContext = GetUmbracoContext(urlAsString); + var facadeRouter = CreateFacadeRouter(); + var frequest = facadeRouter.CreateRequest(umbracoContext); var lookup = new ContentFinderByIdPath(Logger); - - var result = lookup.TryFindContent(frequest); - Assert.IsTrue(result); - Assert.AreEqual(frequest.PublishedContent.Id, nodeMatch); - } - } -} \ No newline at end of file + var result = lookup.TryFindContent(frequest); + + Assert.IsTrue(result); + Assert.AreEqual(frequest.PublishedContent.Id, nodeMatch); + } + } +} diff --git a/src/Umbraco.Tests/Routing/ContentFinderByNiceUrlAndTemplateTests.cs b/src/Umbraco.Tests/Routing/ContentFinderByNiceUrlAndTemplateTests.cs index 57a51c07ba..bf227d3101 100644 --- a/src/Umbraco.Tests/Routing/ContentFinderByNiceUrlAndTemplateTests.cs +++ b/src/Umbraco.Tests/Routing/ContentFinderByNiceUrlAndTemplateTests.cs @@ -1,4 +1,4 @@ -using NUnit.Framework; +using NUnit.Framework; using Umbraco.Tests.TestHelpers; using Umbraco.Web.Routing; using Umbraco.Core.Models; @@ -7,7 +7,7 @@ using Current = Umbraco.Web.Composing.Current; namespace Umbraco.Tests.Routing { - [TestFixture] + [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerFixture)] public class ContentFinderByNiceUrlAndTemplateTests : BaseWebTest { @@ -19,28 +19,28 @@ namespace Umbraco.Tests.Routing return template; } - [TestCase("/blah")] - [TestCase("/default.aspx/blah")] //this one is actually rather important since this is the path that comes through when we are running in pre-IIS 7 for the root document '/' ! - [TestCase("/home/Sub1/blah")] - [TestCase("/Home/Sub1/Blah")] //different cases - [TestCase("/home/Sub1.aspx/blah")] - public void Match_Document_By_Url_With_Template(string urlAsString) - { + [TestCase("/blah")] + [TestCase("/default.aspx/blah")] //this one is actually rather important since this is the path that comes through when we are running in pre-IIS 7 for the root document '/' ! + [TestCase("/home/Sub1/blah")] + [TestCase("/Home/Sub1/Blah")] //different cases + [TestCase("/home/Sub1.aspx/blah")] + public void Match_Document_By_Url_With_Template(string urlAsString) + { var template1 = CreateTemplate("test"); var template2 = CreateTemplate("blah"); var umbracoContext = GetUmbracoContext(urlAsString, template1.Id); - var facadeRouter = CreateFacadeRouter(); - var frequest = facadeRouter.CreateRequest(umbracoContext); + var facadeRouter = CreateFacadeRouter(); + var frequest = facadeRouter.CreateRequest(umbracoContext); var lookup = new ContentFinderByNiceUrlAndTemplate(Logger); - SettingsForTests.HideTopLevelNodeFromPath = false; + SettingsForTests.HideTopLevelNodeFromPath = false; - var result = lookup.TryFindContent(frequest); + var result = lookup.TryFindContent(frequest); - Assert.IsTrue(result); - Assert.IsNotNull(frequest.PublishedContent); - Assert.IsNotNull(frequest.TemplateAlias); - Assert.AreEqual("blah".ToUpperInvariant(), frequest.TemplateAlias.ToUpperInvariant()); - } - } -} \ No newline at end of file + Assert.IsTrue(result); + Assert.IsNotNull(frequest.PublishedContent); + Assert.IsNotNull(frequest.TemplateAlias); + Assert.AreEqual("blah".ToUpperInvariant(), frequest.TemplateAlias.ToUpperInvariant()); + } + } +} diff --git a/src/Umbraco.Tests/Routing/ContentFinderByNiceUrlTests.cs b/src/Umbraco.Tests/Routing/ContentFinderByNiceUrlTests.cs index 6a395b8135..0a1cda7891 100644 --- a/src/Umbraco.Tests/Routing/ContentFinderByNiceUrlTests.cs +++ b/src/Umbraco.Tests/Routing/ContentFinderByNiceUrlTests.cs @@ -1,63 +1,63 @@ -using NUnit.Framework; +using NUnit.Framework; using Umbraco.Tests.TestHelpers; using Umbraco.Tests.Testing; using Umbraco.Web.Routing; namespace Umbraco.Tests.Routing { - [TestFixture] + [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] public class ContentFinderByNiceUrlTests : BaseWebTest { - [TestCase("/", 1046)] - [TestCase("/default.aspx", 1046)] //this one is actually rather important since this is the path that comes through when we are running in pre-IIS 7 for the root document '/' ! - [TestCase("/Sub1", 1173)] - [TestCase("/sub1", 1173)] - [TestCase("/sub1.aspx", 1173)] - [TestCase("/home/sub1", -1)] // should fail + [TestCase("/", 1046)] + [TestCase("/default.aspx", 1046)] //this one is actually rather important since this is the path that comes through when we are running in pre-IIS 7 for the root document '/' ! + [TestCase("/Sub1", 1173)] + [TestCase("/sub1", 1173)] + [TestCase("/sub1.aspx", 1173)] + [TestCase("/home/sub1", -1)] // should fail - // these two are special. getNiceUrl(1046) returns "/" but getNiceUrl(1172) cannot also return "/" so - // we've made it return "/test-page" => we have to support that url back in the lookup... - [TestCase("/home", 1046)] - [TestCase("/test-page", 1172)] - public void Match_Document_By_Url_Hide_Top_Level(string urlString, int expectedId) - { - var umbracoContext = GetUmbracoContext(urlString); - var facadeRouter = CreateFacadeRouter(); - var frequest = facadeRouter.CreateRequest(umbracoContext); + // these two are special. getNiceUrl(1046) returns "/" but getNiceUrl(1172) cannot also return "/" so + // we've made it return "/test-page" => we have to support that url back in the lookup... + [TestCase("/home", 1046)] + [TestCase("/test-page", 1172)] + public void Match_Document_By_Url_Hide_Top_Level(string urlString, int expectedId) + { + var umbracoContext = GetUmbracoContext(urlString); + var facadeRouter = CreateFacadeRouter(); + var frequest = facadeRouter.CreateRequest(umbracoContext); var lookup = new ContentFinderByNiceUrl(Logger); - SettingsForTests.HideTopLevelNodeFromPath = true; + SettingsForTests.HideTopLevelNodeFromPath = true; Assert.IsTrue(Core.Configuration.GlobalSettings.HideTopLevelNodeFromPath); // fixme debugging - going further down, the routes cache is NOT empty?! - if (urlString == "/home/sub1") - System.Diagnostics.Debugger.Break(); + if (urlString == "/home/sub1") + System.Diagnostics.Debugger.Break(); - var result = lookup.TryFindContent(frequest); + var result = lookup.TryFindContent(frequest); - if (expectedId > 0) - { - Assert.IsTrue(result); - Assert.AreEqual(expectedId, frequest.PublishedContent.Id); - } - else - { - Assert.IsFalse(result); - } - } + if (expectedId > 0) + { + Assert.IsTrue(result); + Assert.AreEqual(expectedId, frequest.PublishedContent.Id); + } + else + { + Assert.IsFalse(result); + } + } - [TestCase("/", 1046)] - [TestCase("/default.aspx", 1046)] //this one is actually rather important since this is the path that comes through when we are running in pre-IIS 7 for the root document '/' ! - [TestCase("/home", 1046)] - [TestCase("/home/Sub1", 1173)] - [TestCase("/Home/Sub1", 1173)] //different cases - [TestCase("/home/Sub1.aspx", 1173)] - public void Match_Document_By_Url(string urlString, int expectedId) - { - var umbracoContext = GetUmbracoContext(urlString); - var facadeRouter = CreateFacadeRouter(); - var frequest = facadeRouter.CreateRequest(umbracoContext); + [TestCase("/", 1046)] + [TestCase("/default.aspx", 1046)] //this one is actually rather important since this is the path that comes through when we are running in pre-IIS 7 for the root document '/' ! + [TestCase("/home", 1046)] + [TestCase("/home/Sub1", 1173)] + [TestCase("/Home/Sub1", 1173)] //different cases + [TestCase("/home/Sub1.aspx", 1173)] + public void Match_Document_By_Url(string urlString, int expectedId) + { + var umbracoContext = GetUmbracoContext(urlString); + var facadeRouter = CreateFacadeRouter(); + var frequest = facadeRouter.CreateRequest(umbracoContext); var lookup = new ContentFinderByNiceUrl(Logger); SettingsForTests.HideTopLevelNodeFromPath = false; @@ -65,8 +65,8 @@ namespace Umbraco.Tests.Routing var result = lookup.TryFindContent(frequest); - Assert.IsTrue(result); - Assert.AreEqual(expectedId, frequest.PublishedContent.Id); - } - } -} \ No newline at end of file + Assert.IsTrue(result); + Assert.AreEqual(expectedId, frequest.PublishedContent.Id); + } + } +} diff --git a/src/Umbraco.Tests/Routing/ContentFinderByNiceUrlWithDomainsTests.cs b/src/Umbraco.Tests/Routing/ContentFinderByNiceUrlWithDomainsTests.cs index 8165af45be..bdffa14251 100644 --- a/src/Umbraco.Tests/Routing/ContentFinderByNiceUrlWithDomainsTests.cs +++ b/src/Umbraco.Tests/Routing/ContentFinderByNiceUrlWithDomainsTests.cs @@ -6,178 +6,178 @@ using Umbraco.Web.Routing; namespace Umbraco.Tests.Routing { - [TestFixture] + [TestFixture] public class ContentFinderByNiceUrlWithDomainsTests : UrlRoutingTestBase - { - void SetDomains3() - { - SetupDomainServiceMock(new[] - { - new UmbracoDomain("domain1.com/") {Id = 1, LanguageId = LangDeId, RootContentId = 1001, LanguageIsoCode = "de-DE"} - }); + { + void SetDomains3() + { + SetupDomainServiceMock(new[] + { + new UmbracoDomain("domain1.com/") {Id = 1, LanguageId = LangDeId, RootContentId = 1001, LanguageIsoCode = "de-DE"} + }); - } + } - void SetDomains4() - { - SetupDomainServiceMock(new[] - { - new UmbracoDomain("domain1.com/") {Id = 1, LanguageId = LangEngId, RootContentId = 1001, LanguageIsoCode = "en-US"}, - new UmbracoDomain("domain1.com/en") {Id = 1, LanguageId = LangEngId, RootContentId = 10011, LanguageIsoCode = "en-US"}, - new UmbracoDomain("domain1.com/fr") {Id = 1, LanguageId = LangFrId, RootContentId = 10012, LanguageIsoCode = "fr-FR"}, - new UmbracoDomain("http://domain3.com/") {Id = 1, LanguageId = LangEngId, RootContentId = 1003, LanguageIsoCode = "en-US"}, - new UmbracoDomain("http://domain3.com/en") {Id = 1, LanguageId = LangEngId, RootContentId = 10031, LanguageIsoCode = "en-US"}, - new UmbracoDomain("http://domain3.com/fr") {Id = 1, LanguageId = LangFrId, RootContentId = 10032, LanguageIsoCode = "fr-FR"} - }); + void SetDomains4() + { + SetupDomainServiceMock(new[] + { + new UmbracoDomain("domain1.com/") {Id = 1, LanguageId = LangEngId, RootContentId = 1001, LanguageIsoCode = "en-US"}, + new UmbracoDomain("domain1.com/en") {Id = 1, LanguageId = LangEngId, RootContentId = 10011, LanguageIsoCode = "en-US"}, + new UmbracoDomain("domain1.com/fr") {Id = 1, LanguageId = LangFrId, RootContentId = 10012, LanguageIsoCode = "fr-FR"}, + new UmbracoDomain("http://domain3.com/") {Id = 1, LanguageId = LangEngId, RootContentId = 1003, LanguageIsoCode = "en-US"}, + new UmbracoDomain("http://domain3.com/en") {Id = 1, LanguageId = LangEngId, RootContentId = 10031, LanguageIsoCode = "en-US"}, + new UmbracoDomain("http://domain3.com/fr") {Id = 1, LanguageId = LangFrId, RootContentId = 10032, LanguageIsoCode = "fr-FR"} + }); - } + } - protected override string GetXmlContent(int templateId) - { - return @" - + ]> - - - - This is some content]]> - - - - - - - - - - - - - - - This is some content]]> - - - - - - - - - - - - - - - - - - - - - - This is some content]]> - - - - - - - - - - - - - - - This is some content]]> - - - - - - - - - - - - - - - - + + + + This is some content]]> + + + + + + + + + + + + + + + This is some content]]> + + + + + + + + + + + + + + + + + + + + + + This is some content]]> + + + + + + + + + + + + + + + This is some content]]> + + + + + + + + + + + + + + + + "; - } + } - [TestCase("http://domain1.com/", 1001)] - [TestCase("http://domain1.com/1001-1", 10011)] - [TestCase("http://domain1.com/1001-2/1001-2-1", 100121)] + [TestCase("http://domain1.com/", 1001)] + [TestCase("http://domain1.com/1001-1", 10011)] + [TestCase("http://domain1.com/1001-2/1001-2-1", 100121)] - public void Lookup_SingleDomain(string url, int expectedId) - { - SetDomains3(); + public void Lookup_SingleDomain(string url, int expectedId) + { + SetDomains3(); - SettingsForTests.HideTopLevelNodeFromPath = true; + SettingsForTests.HideTopLevelNodeFromPath = true; - var umbracoContext = GetUmbracoContext(url); - var facadeRouter = CreateFacadeRouter(Container); - var frequest = facadeRouter.CreateRequest(umbracoContext); + var umbracoContext = GetUmbracoContext(url); + var facadeRouter = CreateFacadeRouter(Container); + var frequest = facadeRouter.CreateRequest(umbracoContext); - // must lookup domain else lookup by url fails - facadeRouter.FindDomain(frequest); + // must lookup domain else lookup by url fails + facadeRouter.FindDomain(frequest); var lookup = new ContentFinderByNiceUrl(Logger); - var result = lookup.TryFindContent(frequest); - Assert.IsTrue(result); - Assert.AreEqual(expectedId, frequest.PublishedContent.Id); - } + var result = lookup.TryFindContent(frequest); + Assert.IsTrue(result); + Assert.AreEqual(expectedId, frequest.PublishedContent.Id); + } - [TestCase("http://domain1.com/", 1001, "en-US")] - [TestCase("http://domain1.com/en", 10011, "en-US")] - [TestCase("http://domain1.com/en/1001-1-1", 100111, "en-US")] - [TestCase("http://domain1.com/fr", 10012, "fr-FR")] - [TestCase("http://domain1.com/fr/1001-2-1", 100121, "fr-FR")] - [TestCase("http://domain1.com/1001-3", 10013, "en-US")] + [TestCase("http://domain1.com/", 1001, "en-US")] + [TestCase("http://domain1.com/en", 10011, "en-US")] + [TestCase("http://domain1.com/en/1001-1-1", 100111, "en-US")] + [TestCase("http://domain1.com/fr", 10012, "fr-FR")] + [TestCase("http://domain1.com/fr/1001-2-1", 100121, "fr-FR")] + [TestCase("http://domain1.com/1001-3", 10013, "en-US")] - [TestCase("http://domain2.com/1002", 1002, null)] + [TestCase("http://domain2.com/1002", 1002, null)] - [TestCase("http://domain3.com/", 1003, "en-US")] - [TestCase("http://domain3.com/en", 10031, "en-US")] - [TestCase("http://domain3.com/en/1003-1-1", 100311, "en-US")] - [TestCase("http://domain3.com/fr", 10032, "fr-FR")] - [TestCase("http://domain3.com/fr/1003-2-1", 100321, "fr-FR")] - [TestCase("http://domain3.com/1003-3", 10033, "en-US")] + [TestCase("http://domain3.com/", 1003, "en-US")] + [TestCase("http://domain3.com/en", 10031, "en-US")] + [TestCase("http://domain3.com/en/1003-1-1", 100311, "en-US")] + [TestCase("http://domain3.com/fr", 10032, "fr-FR")] + [TestCase("http://domain3.com/fr/1003-2-1", 100321, "fr-FR")] + [TestCase("http://domain3.com/1003-3", 10033, "en-US")] - [TestCase("https://domain1.com/", 1001, "en-US")] - [TestCase("https://domain3.com/", 1001, null)] // because domain3 is explicitely set on http + [TestCase("https://domain1.com/", 1001, "en-US")] + [TestCase("https://domain3.com/", 1001, null)] // because domain3 is explicitely set on http - public void Lookup_NestedDomains(string url, int expectedId, string expectedCulture) - { - SetDomains4(); + public void Lookup_NestedDomains(string url, int expectedId, string expectedCulture) + { + SetDomains4(); // defaults depend on test environment expectedCulture = expectedCulture ?? System.Threading.Thread.CurrentThread.CurrentUICulture.Name; SettingsForTests.HideTopLevelNodeFromPath = true; - var umbracoContext = GetUmbracoContext(url); - var facadeRouter = CreateFacadeRouter(Container); - var frequest = facadeRouter.CreateRequest(umbracoContext); + var umbracoContext = GetUmbracoContext(url); + var facadeRouter = CreateFacadeRouter(Container); + var frequest = facadeRouter.CreateRequest(umbracoContext); - // must lookup domain else lookup by url fails - facadeRouter.FindDomain(frequest); - Assert.AreEqual(expectedCulture, frequest.Culture.Name); + // must lookup domain else lookup by url fails + facadeRouter.FindDomain(frequest); + Assert.AreEqual(expectedCulture, frequest.Culture.Name); var lookup = new ContentFinderByNiceUrl(Logger); - var result = lookup.TryFindContent(frequest); - Assert.IsTrue(result); - Assert.AreEqual(expectedId, frequest.PublishedContent.Id); - } - } + var result = lookup.TryFindContent(frequest); + Assert.IsTrue(result); + Assert.AreEqual(expectedId, frequest.PublishedContent.Id); + } + } } diff --git a/src/Umbraco.Tests/Routing/ContentFinderByPageIdQueryTests.cs b/src/Umbraco.Tests/Routing/ContentFinderByPageIdQueryTests.cs index 47a650015e..d1179e5e05 100644 --- a/src/Umbraco.Tests/Routing/ContentFinderByPageIdQueryTests.cs +++ b/src/Umbraco.Tests/Routing/ContentFinderByPageIdQueryTests.cs @@ -1,35 +1,35 @@ -using Moq; +using Moq; using NUnit.Framework; using Umbraco.Tests.TestHelpers; using Umbraco.Web.Routing; namespace Umbraco.Tests.Routing { - [TestFixture] - public class ContentFinderByPageIdQueryTests : BaseWebTest + [TestFixture] + public class ContentFinderByPageIdQueryTests : BaseWebTest { - [TestCase("/?umbPageId=1046", 1046)] - [TestCase("/?UMBPAGEID=1046", 1046)] - [TestCase("/default.aspx?umbPageId=1046", 1046)] //TODO: Should this match?? - [TestCase("/some/other/page?umbPageId=1046", 1046)] //TODO: Should this match?? - [TestCase("/some/other/page.aspx?umbPageId=1046", 1046)] //TODO: Should this match?? - public void Lookup_By_Page_Id(string urlAsString, int nodeMatch) - { - var umbracoContext = GetUmbracoContext(urlAsString); - var facadeRouter = CreateFacadeRouter(); - var frequest = facadeRouter.CreateRequest(umbracoContext); - var lookup = new ContentFinderByPageIdQuery(); + [TestCase("/?umbPageId=1046", 1046)] + [TestCase("/?UMBPAGEID=1046", 1046)] + [TestCase("/default.aspx?umbPageId=1046", 1046)] //TODO: Should this match?? + [TestCase("/some/other/page?umbPageId=1046", 1046)] //TODO: Should this match?? + [TestCase("/some/other/page.aspx?umbPageId=1046", 1046)] //TODO: Should this match?? + public void Lookup_By_Page_Id(string urlAsString, int nodeMatch) + { + var umbracoContext = GetUmbracoContext(urlAsString); + var facadeRouter = CreateFacadeRouter(); + var frequest = facadeRouter.CreateRequest(umbracoContext); + var lookup = new ContentFinderByPageIdQuery(); - //we need to manually stub the return output of HttpContext.Request["umbPageId"] - var requestMock = Mock.Get(umbracoContext.HttpContext.Request); + //we need to manually stub the return output of HttpContext.Request["umbPageId"] + var requestMock = Mock.Get(umbracoContext.HttpContext.Request); requestMock.Setup(x => x["umbPageID"]) - .Returns(umbracoContext.HttpContext.Request.QueryString["umbPageID"]); + .Returns(umbracoContext.HttpContext.Request.QueryString["umbPageID"]); - var result = lookup.TryFindContent(frequest); + var result = lookup.TryFindContent(frequest); - Assert.IsTrue(result); - Assert.AreEqual(frequest.PublishedContent.Id, nodeMatch); - } - } -} \ No newline at end of file + Assert.IsTrue(result); + Assert.AreEqual(frequest.PublishedContent.Id, nodeMatch); + } + } +} diff --git a/src/Umbraco.Tests/Routing/DomainsAndCulturesTests.cs b/src/Umbraco.Tests/Routing/DomainsAndCulturesTests.cs index 8923fd7651..31107530b6 100644 --- a/src/Umbraco.Tests/Routing/DomainsAndCulturesTests.cs +++ b/src/Umbraco.Tests/Routing/DomainsAndCulturesTests.cs @@ -122,131 +122,131 @@ namespace Umbraco.Tests.Routing ]> - - + - - This is some content]]> + This is some content]]> - - + - - + - - + - - - + + - - - - - + + + + - This is some content]]> + This is some content]]> - - + - - + - - + - - - + + - - - - - + + + + - - - + + - - + - - + - This is some content]]> - This is some content]]> + - - - + + - - + - - - + + - - - - - + + + + - This is some content]]> - This is some content]]> + - - - + + - - + - - - + + - - - - - + + + + - - + + "; } @@ -375,4 +375,4 @@ namespace Umbraco.Tests.Routing Assert.AreEqual(expectedCulture, culture.Name); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Routing/NiceUrlProviderTests.cs b/src/Umbraco.Tests/Routing/NiceUrlProviderTests.cs index 4a9810a7fd..0898392484 100644 --- a/src/Umbraco.Tests/Routing/NiceUrlProviderTests.cs +++ b/src/Umbraco.Tests/Routing/NiceUrlProviderTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using Moq; using NUnit.Framework; @@ -10,7 +10,7 @@ using Umbraco.Web.Routing; namespace Umbraco.Tests.Routing { - [TestFixture] + [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerFixture)] public class NiceUrlProviderTests : BaseWebTest { @@ -31,108 +31,108 @@ namespace Umbraco.Tests.Routing SettingsForTests.ConfigureSettings(_umbracoSettings); } - /// - /// This checks that when we retrieve a NiceUrl for multiple items that there are no issues with cache overlap - /// and that they are all cached correctly. + /// + /// This checks that when we retrieve a NiceUrl for multiple items that there are no issues with cache overlap + /// and that they are all cached correctly. /// - [Test] - public void Ensure_Cache_Is_Correct() - { - var umbracoContext = GetUmbracoContext("/test", 1111, urlProviders: new [] { new DefaultUrlProvider(_umbracoSettings.RequestHandler, Logger) }); - SettingsForTests.UseDirectoryUrls = true; - SettingsForTests.HideTopLevelNodeFromPath = false; + [Test] + public void Ensure_Cache_Is_Correct() + { + var umbracoContext = GetUmbracoContext("/test", 1111, urlProviders: new [] { new DefaultUrlProvider(_umbracoSettings.RequestHandler, Logger) }); + SettingsForTests.UseDirectoryUrls = true; + SettingsForTests.HideTopLevelNodeFromPath = false; var requestHandlerMock = Mock.Get(_umbracoSettings.RequestHandler); requestHandlerMock.Setup(x => x.AddTrailingSlash).Returns(false);// (cached routes have none) - var samples = new Dictionary { - { 1046, "/home" }, - { 1173, "/home/sub1" }, - { 1174, "/home/sub1/sub2" }, - { 1176, "/home/sub1/sub-3" }, - { 1177, "/home/sub1/custom-sub-1" }, - { 1178, "/home/sub1/custom-sub-2" }, - { 1175, "/home/sub-2" }, - { 1172, "/test-page" } - }; + var samples = new Dictionary { + { 1046, "/home" }, + { 1173, "/home/sub1" }, + { 1174, "/home/sub1/sub2" }, + { 1176, "/home/sub1/sub-3" }, + { 1177, "/home/sub1/custom-sub-1" }, + { 1178, "/home/sub1/custom-sub-2" }, + { 1175, "/home/sub-2" }, + { 1172, "/test-page" } + }; - foreach (var sample in samples) - { - var result = umbracoContext.UrlProvider.GetUrl(sample.Key); - Assert.AreEqual(sample.Value, result); - } + foreach (var sample in samples) + { + var result = umbracoContext.UrlProvider.GetUrl(sample.Key); + Assert.AreEqual(sample.Value, result); + } - var randomSample = new KeyValuePair(1177, "/home/sub1/custom-sub-1"); - for (int i = 0; i < 5; i++) - { - var result = umbracoContext.UrlProvider.GetUrl(randomSample.Key); - Assert.AreEqual(randomSample.Value, result); - } + var randomSample = new KeyValuePair(1177, "/home/sub1/custom-sub-1"); + for (int i = 0; i < 5; i++) + { + var result = umbracoContext.UrlProvider.GetUrl(randomSample.Key); + Assert.AreEqual(randomSample.Value, result); + } var cache = umbracoContext.ContentCache as PublishedContentCache; if (cache == null) throw new Exception("Unsupported IPublishedContentCache, only the Xml one is supported."); var cachedRoutes = cache.RoutesCache.GetCachedRoutes(); - Assert.AreEqual(8, cachedRoutes.Count); + Assert.AreEqual(8, cachedRoutes.Count); - foreach (var sample in samples) - { - Assert.IsTrue(cachedRoutes.ContainsKey(sample.Key)); - Assert.AreEqual(sample.Value, cachedRoutes[sample.Key]); - } + foreach (var sample in samples) + { + Assert.IsTrue(cachedRoutes.ContainsKey(sample.Key)); + Assert.AreEqual(sample.Value, cachedRoutes[sample.Key]); + } - var cachedIds = cache.RoutesCache.GetCachedIds(); - Assert.AreEqual(0, cachedIds.Count); - } + var cachedIds = cache.RoutesCache.GetCachedIds(); + Assert.AreEqual(0, cachedIds.Count); + } - // test hideTopLevelNodeFromPath false - [TestCase(1046, "/home/")] - [TestCase(1173, "/home/sub1/")] - [TestCase(1174, "/home/sub1/sub2/")] - [TestCase(1176, "/home/sub1/sub-3/")] - [TestCase(1177, "/home/sub1/custom-sub-1/")] - [TestCase(1178, "/home/sub1/custom-sub-2/")] - [TestCase(1175, "/home/sub-2/")] - [TestCase(1172, "/test-page/")] - public void Get_Nice_Url_Not_Hiding_Top_Level(int nodeId, string niceUrlMatch) - { - var umbracoContext = GetUmbracoContext("/test", 1111, urlProviders: new[] { new DefaultUrlProvider(_umbracoSettings.RequestHandler, Logger) }); + // test hideTopLevelNodeFromPath false + [TestCase(1046, "/home/")] + [TestCase(1173, "/home/sub1/")] + [TestCase(1174, "/home/sub1/sub2/")] + [TestCase(1176, "/home/sub1/sub-3/")] + [TestCase(1177, "/home/sub1/custom-sub-1/")] + [TestCase(1178, "/home/sub1/custom-sub-2/")] + [TestCase(1175, "/home/sub-2/")] + [TestCase(1172, "/test-page/")] + public void Get_Nice_Url_Not_Hiding_Top_Level(int nodeId, string niceUrlMatch) + { + var umbracoContext = GetUmbracoContext("/test", 1111, urlProviders: new[] { new DefaultUrlProvider(_umbracoSettings.RequestHandler, Logger) }); - SettingsForTests.UseDirectoryUrls = true; - SettingsForTests.HideTopLevelNodeFromPath = false; + SettingsForTests.UseDirectoryUrls = true; + SettingsForTests.HideTopLevelNodeFromPath = false; var requestMock = Mock.Get(_umbracoSettings.RequestHandler); requestMock.Setup(x => x.UseDomainPrefixes).Returns(false); - var result = umbracoContext.UrlProvider.GetUrl(nodeId); - Assert.AreEqual(niceUrlMatch, result); - } + var result = umbracoContext.UrlProvider.GetUrl(nodeId); + Assert.AreEqual(niceUrlMatch, result); + } - // no need for umbracoUseDirectoryUrls test = should be handled by UriUtilityTests + // no need for umbracoUseDirectoryUrls test = should be handled by UriUtilityTests - // test hideTopLevelNodeFromPath true - [TestCase(1046, "/")] - [TestCase(1173, "/sub1/")] - [TestCase(1174, "/sub1/sub2/")] - [TestCase(1176, "/sub1/sub-3/")] - [TestCase(1177, "/sub1/custom-sub-1/")] - [TestCase(1178, "/sub1/custom-sub-2/")] - [TestCase(1175, "/sub-2/")] - [TestCase(1172, "/test-page/")] // not hidden because not first root - public void Get_Nice_Url_Hiding_Top_Level(int nodeId, string niceUrlMatch) - { - var umbracoContext = GetUmbracoContext("/test", 1111, urlProviders: new[] { new DefaultUrlProvider(_umbracoSettings.RequestHandler, Logger) }); + // test hideTopLevelNodeFromPath true + [TestCase(1046, "/")] + [TestCase(1173, "/sub1/")] + [TestCase(1174, "/sub1/sub2/")] + [TestCase(1176, "/sub1/sub-3/")] + [TestCase(1177, "/sub1/custom-sub-1/")] + [TestCase(1178, "/sub1/custom-sub-2/")] + [TestCase(1175, "/sub-2/")] + [TestCase(1172, "/test-page/")] // not hidden because not first root + public void Get_Nice_Url_Hiding_Top_Level(int nodeId, string niceUrlMatch) + { + var umbracoContext = GetUmbracoContext("/test", 1111, urlProviders: new[] { new DefaultUrlProvider(_umbracoSettings.RequestHandler, Logger) }); SettingsForTests.UseDirectoryUrls = true; SettingsForTests.HideTopLevelNodeFromPath = true; var requestMock = Mock.Get(_umbracoSettings.RequestHandler); requestMock.Setup(x => x.UseDomainPrefixes).Returns(false); - var result = umbracoContext.UrlProvider.GetUrl(nodeId); - Assert.AreEqual(niceUrlMatch, result); - } + var result = umbracoContext.UrlProvider.GetUrl(nodeId); + Assert.AreEqual(niceUrlMatch, result); + } - [Test] - public void Get_Nice_Url_Relative_Or_Absolute() - { + [Test] + public void Get_Nice_Url_Relative_Or_Absolute() + { SettingsForTests.UseDirectoryUrls = true; SettingsForTests.HideTopLevelNodeFromPath = false; var requestMock = Mock.Get(_umbracoSettings.RequestHandler); @@ -140,20 +140,20 @@ namespace Umbraco.Tests.Routing var umbracoContext = GetUmbracoContext("http://example.com/test", 1111, umbracoSettings: _umbracoSettings, urlProviders: new[] { new DefaultUrlProvider(_umbracoSettings.RequestHandler, Logger) }); - Assert.AreEqual("/home/sub1/custom-sub-1/", umbracoContext.UrlProvider.GetUrl(1177)); + Assert.AreEqual("/home/sub1/custom-sub-1/", umbracoContext.UrlProvider.GetUrl(1177)); requestMock.Setup(x => x.UseDomainPrefixes).Returns(true); - Assert.AreEqual("http://example.com/home/sub1/custom-sub-1/", umbracoContext.UrlProvider.GetUrl(1177)); + Assert.AreEqual("http://example.com/home/sub1/custom-sub-1/", umbracoContext.UrlProvider.GetUrl(1177)); requestMock.Setup(x => x.UseDomainPrefixes).Returns(false); umbracoContext.UrlProvider.Mode = UrlProviderMode.Absolute; - Assert.AreEqual("http://example.com/home/sub1/custom-sub-1/", umbracoContext.UrlProvider.GetUrl(1177)); - } + Assert.AreEqual("http://example.com/home/sub1/custom-sub-1/", umbracoContext.UrlProvider.GetUrl(1177)); + } - [Test] - public void Get_Nice_Url_Unpublished() - { - var umbracoContext = GetUmbracoContext("http://example.com/test", 1111, urlProviders: new[] { new DefaultUrlProvider(_umbracoSettings.RequestHandler, Logger) }); + [Test] + public void Get_Nice_Url_Unpublished() + { + var umbracoContext = GetUmbracoContext("http://example.com/test", 1111, urlProviders: new[] { new DefaultUrlProvider(_umbracoSettings.RequestHandler, Logger) }); SettingsForTests.UseDirectoryUrls = true; SettingsForTests.HideTopLevelNodeFromPath = false; @@ -162,7 +162,7 @@ namespace Umbraco.Tests.Routing var requestMock = Mock.Get(_umbracoSettings.RequestHandler); requestMock.Setup(x => x.UseDomainPrefixes).Returns(false); - Assert.AreEqual("#", umbracoContext.UrlProvider.GetUrl(999999)); + Assert.AreEqual("#", umbracoContext.UrlProvider.GetUrl(999999)); requestMock.Setup(x => x.UseDomainPrefixes).Returns(true); @@ -173,6 +173,6 @@ namespace Umbraco.Tests.Routing umbracoContext.UrlProvider.Mode = UrlProviderMode.Absolute; Assert.AreEqual("#", umbracoContext.UrlProvider.GetUrl(999999)); - } - } + } + } } diff --git a/src/Umbraco.Tests/Routing/NiceUrlRoutesTests.cs b/src/Umbraco.Tests/Routing/NiceUrlRoutesTests.cs index aff999a183..7d45a0e85b 100644 --- a/src/Umbraco.Tests/Routing/NiceUrlRoutesTests.cs +++ b/src/Umbraco.Tests/Routing/NiceUrlRoutesTests.cs @@ -24,25 +24,25 @@ namespace Umbraco.Tests.Routing ]> - - - - + + + + - - - + + + - + - - + + - + @@ -64,72 +64,72 @@ namespace Umbraco.Tests.Routing GetByRoute(route, hide = null): - route is "[id]/[path]" + route is "[id]/[path]" - hide = hide ?? global.hide + hide = hide ?? global.hide - root = id ? node(id) : document + root = id ? node(id) : document - content = cached(route) ?? DetermineIdByRoute(route, hide) + content = cached(route) ?? DetermineIdByRoute(route, hide) - # route is "1234/path/to/content", finds "content" - # but if there is domain 5678 on "to", the *true* route of "content" is "5678/content" - # so although the route does match, we don't cache it - # there are not other reason not to cache it + # route is "1234/path/to/content", finds "content" + # but if there is domain 5678 on "to", the *true* route of "content" is "5678/content" + # so although the route does match, we don't cache it + # there are not other reason not to cache it - if content and no domain between root and content: - cache route (as trusted) + if content and no domain between root and content: + cache route (as trusted) - return content + return content DetermineIdByRoute(route, hide): - route is "[id]/[path]" + route is "[id]/[path]" - try return NavigateRoute(id ?? 0, path, hide:hide) - return null + try return NavigateRoute(id ?? 0, path, hide:hide) + return null NavigateRoute(id, path, hide): - if path: - if id: - start = node(id) - else: - start = document + if path: + if id: + start = node(id) + else: + start = document - # 'navigate ... from ...' uses lowest sortOrder in case of collision + # 'navigate ... from ...' uses lowest sortOrder in case of collision - if hide and ![id]: - # if hiding, then for "/foo" we want to look for "/[any]/foo" - for each child of start: - try return navigate path from child + if hide and ![id]: + # if hiding, then for "/foo" we want to look for "/[any]/foo" + for each child of start: + try return navigate path from child - # but if it fails, we also want to try "/foo" - # fail now if more than one part eg "/foo/bar" - if path is "/[any]/...": - fail + # but if it fails, we also want to try "/foo" + # fail now if more than one part eg "/foo/bar" + if path is "/[any]/...": + fail - try return navigate path from start + try return navigate path from start - else: - if id: - return node(id) - else: - return root node with lowest sortOrder + else: + if id: + return node(id) + else: + return root node with lowest sortOrder GetRouteById(id): route = cached(id) - if route: - return route + if route: + return route - # never cache the route, it may be colliding + # never cache the route, it may be colliding - route = DetermineRouteById(id) + route = DetermineRouteById(id) if route: cache route (as not trusted) @@ -144,20 +144,20 @@ DetermineRouteById(id): walk up from node to domain or root, assemble parts = url segments - if !domain and global.hide: - if id.parent: - # got /top/[path]content, can remove /top - remove top part - else: - # got /content, should remove only if it is the - # node with lowest sort order - root = root node with lowest sortOrder - if root == node: - remove top part + if !domain and global.hide: + if id.parent: + # got /top/[path]content, can remove /top + remove top part + else: + # got /content, should remove only if it is the + # node with lowest sort order + root = root node with lowest sortOrder + if root == node: + remove top part compose path from parts route = assemble "[domain.id]/[path]" - return route + return route */ diff --git a/src/Umbraco.Tests/Routing/NiceUrlsProviderWithDomainsTests.cs b/src/Umbraco.Tests/Routing/NiceUrlsProviderWithDomainsTests.cs index b16adfd13c..349d1011e4 100644 --- a/src/Umbraco.Tests/Routing/NiceUrlsProviderWithDomainsTests.cs +++ b/src/Umbraco.Tests/Routing/NiceUrlsProviderWithDomainsTests.cs @@ -26,9 +26,9 @@ namespace Umbraco.Tests.Routing void SetDomains1() { SetupDomainServiceMock(new[] - { - new UmbracoDomain("domain1.com") {Id = 1, LanguageId = LangFrId, RootContentId = 1001, LanguageIsoCode = "fr-FR"} - }); + { + new UmbracoDomain("domain1.com") {Id = 1, LanguageId = LangFrId, RootContentId = 1001, LanguageIsoCode = "fr-FR"} + }); } void SetDomains2() @@ -83,78 +83,78 @@ namespace Umbraco.Tests.Routing ]> - - - - This is some content]]> - - - - - - - - - - - - - - - This is some content]]> - - - - - - - - - - - - - - - - - - - - - - This is some content]]> - - - - - - - - - - - - - - - This is some content]]> - - - - - - - - - - - - - - - - + + + + This is some content]]> + + + + + + + + + + + + + + + This is some content]]> + + + + + + + + + + + + + + + + + + + + + + This is some content]]> + + + + + + + + + + + + + + + This is some content]]> + + + + + + + + + + + + + + + + "; } diff --git a/src/Umbraco.Tests/Routing/RenderRouteHandlerTests.cs b/src/Umbraco.Tests/Routing/RenderRouteHandlerTests.cs index df6168c27d..2e0ae4e595 100644 --- a/src/Umbraco.Tests/Routing/RenderRouteHandlerTests.cs +++ b/src/Umbraco.Tests/Routing/RenderRouteHandlerTests.cs @@ -22,40 +22,40 @@ using Current = Umbraco.Web.Composing.Current; namespace Umbraco.Tests.Routing { - [TestFixture] + [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerFixture)] public class RenderRouteHandlerTests : BaseWebTest { - public override void SetUp() - { - base.SetUp(); + public override void SetUp() + { + base.SetUp(); - SettingsForTests.UmbracoPath = "~/umbraco"; + SettingsForTests.UmbracoPath = "~/umbraco"; WebRuntimeComponent.CreateRoutes( new TestUmbracoContextAccessor(), new SurfaceControllerTypeCollection(Enumerable.Empty()), new UmbracoApiControllerTypeCollection(Enumerable.Empty())); - } + } - public class TestRuntime : WebRuntime - { - public TestRuntime(UmbracoApplicationBase umbracoApplication) + public class TestRuntime : WebRuntime + { + public TestRuntime(UmbracoApplicationBase umbracoApplication) : base(umbracoApplication) - { } + { } - public override void Boot(ServiceContainer container) - { + public override void Boot(ServiceContainer container) + { // do it before anything else - this is the only place where it's possible - var logger = Mock.Of(); + var logger = Mock.Of(); container.RegisterInstance(logger); - var profiler = Mock.Of(); + var profiler = Mock.Of(); container.RegisterInstance(profiler); container.RegisterInstance(new ProfilingLogger(logger, profiler)); base.Boot(container); - } - } + } + } protected override void Compose() { @@ -73,11 +73,11 @@ namespace Umbraco.Tests.Routing Container.RegisterSingleton(_ => new DefaultShortStringHelper(SettingsForTests.GetDefault())); } - public override void TearDown() - { - base.TearDown(); + public override void TearDown() + { + base.TearDown(); RouteTable.Routes.Clear(); - } + } Template CreateTemplate(string alias) { @@ -89,100 +89,100 @@ namespace Umbraco.Tests.Routing return template; } - /// - /// Will route to the default controller and action since no custom controller is defined for this node route - /// - [Test] - public void Umbraco_Route_Umbraco_Defined_Controller_Action() - { + /// + /// Will route to the default controller and action since no custom controller is defined for this node route + /// + [Test] + public void Umbraco_Route_Umbraco_Defined_Controller_Action() + { var template = CreateTemplate("homePage"); - var route = RouteTable.Routes["Umbraco_default"]; - var routeData = new RouteData { Route = route }; - var umbracoContext = GetUmbracoContext("~/dummy-page", template.Id, routeData); - var facadeRouter = CreateFacadeRouter(); - var frequest = facadeRouter.CreateRequest(umbracoContext); - frequest.PublishedContent = umbracoContext.ContentCache.GetById(1174); - frequest.TemplateModel = template; - frequest.RenderingEngine = RenderingEngine.Mvc; + var route = RouteTable.Routes["Umbraco_default"]; + var routeData = new RouteData { Route = route }; + var umbracoContext = GetUmbracoContext("~/dummy-page", template.Id, routeData); + var facadeRouter = CreateFacadeRouter(); + var frequest = facadeRouter.CreateRequest(umbracoContext); + frequest.PublishedContent = umbracoContext.ContentCache.GetById(1174); + frequest.TemplateModel = template; + frequest.RenderingEngine = RenderingEngine.Mvc; - var handler = new RenderRouteHandler(umbracoContext, new TestControllerFactory(umbracoContext, Mock.Of())); + var handler = new RenderRouteHandler(umbracoContext, new TestControllerFactory(umbracoContext, Mock.Of())); - handler.GetHandlerForRoute(umbracoContext.HttpContext.Request.RequestContext, frequest); - Assert.AreEqual("RenderMvc", routeData.Values["controller"].ToString()); + handler.GetHandlerForRoute(umbracoContext.HttpContext.Request.RequestContext, frequest); + Assert.AreEqual("RenderMvc", routeData.Values["controller"].ToString()); //the route action will still be the one we've asked for because our RenderActionInvoker is the thing that decides // if the action matches. Assert.AreEqual("homePage", routeData.Values["action"].ToString()); - } + } - //test all template name styles to match the ActionName + //test all template name styles to match the ActionName //[TestCase("home-\\234^^*32page")] //TODO: This fails! [TestCase("home-page")] [TestCase("home-page")] [TestCase("home-page")] - [TestCase("Home-Page")] - [TestCase("HomePage")] - [TestCase("homePage")] + [TestCase("Home-Page")] + [TestCase("HomePage")] + [TestCase("homePage")] [TestCase("site1/template2")] [TestCase("site1\\template2")] public void Umbraco_Route_User_Defined_Controller_Action(string templateName) - { + { // NOTE - here we create templates with crazy aliases... assuming that these // could exist in the database... yet creating templates should sanitize // aliases one way or another... var template = CreateTemplate(templateName); var route = RouteTable.Routes["Umbraco_default"]; - var routeData = new RouteData() {Route = route}; - var umbracoContext = GetUmbracoContext("~/dummy-page", template.Id, routeData, true); - var facadeRouter = CreateFacadeRouter(); - var frequest = facadeRouter.CreateRequest(umbracoContext); - frequest.PublishedContent = umbracoContext.ContentCache.GetById(1172); - frequest.TemplateModel = template; + var routeData = new RouteData() {Route = route}; + var umbracoContext = GetUmbracoContext("~/dummy-page", template.Id, routeData, true); + var facadeRouter = CreateFacadeRouter(); + var frequest = facadeRouter.CreateRequest(umbracoContext); + frequest.PublishedContent = umbracoContext.ContentCache.GetById(1172); + frequest.TemplateModel = template; - var handler = new RenderRouteHandler(umbracoContext, new TestControllerFactory(umbracoContext, Mock.Of())); + var handler = new RenderRouteHandler(umbracoContext, new TestControllerFactory(umbracoContext, Mock.Of())); - handler.GetHandlerForRoute(umbracoContext.HttpContext.Request.RequestContext, frequest); - Assert.AreEqual("CustomDocument", routeData.Values["controller"].ToString()); - Assert.AreEqual( + handler.GetHandlerForRoute(umbracoContext.HttpContext.Request.RequestContext, frequest); + Assert.AreEqual("CustomDocument", routeData.Values["controller"].ToString()); + Assert.AreEqual( //global::umbraco.cms.helpers.Casing.SafeAlias(template.Alias), template.Alias.ToSafeAlias(), - routeData.Values["action"].ToString()); - } + routeData.Values["action"].ToString()); + } - #region Internal classes + #region Internal classes - ///// - ///// Used to test a user route (non-umbraco) - ///// - //private class CustomUserController : Controller - //{ + ///// + ///// Used to test a user route (non-umbraco) + ///// + //private class CustomUserController : Controller + //{ - // public ActionResult Index() - // { - // return View(); - // } + // public ActionResult Index() + // { + // return View(); + // } - // public ActionResult Test(int id) - // { - // return View(); - // } + // public ActionResult Test(int id) + // { + // return View(); + // } - //} + //} - /// - /// Used to test a user route umbraco route - /// - public class CustomDocumentController : RenderMvcController - { + /// + /// Used to test a user route umbraco route + /// + public class CustomDocumentController : RenderMvcController + { public ActionResult HomePage(ContentModel model) - { - return View(); - } + { + return View(); + } - } + } - #endregion - } + #endregion + } } diff --git a/src/Umbraco.Tests/Routing/RouteTestExtensions.cs b/src/Umbraco.Tests/Routing/RouteTestExtensions.cs index a47ed3ef02..d71277d07c 100644 --- a/src/Umbraco.Tests/Routing/RouteTestExtensions.cs +++ b/src/Umbraco.Tests/Routing/RouteTestExtensions.cs @@ -1,58 +1,58 @@ -using System.Web; +using System.Web; using System.Web.Routing; using Moq; using Umbraco.Tests.TestHelpers; namespace Umbraco.Tests.Routing { - public static class RouteTestExtensions - { + public static class RouteTestExtensions + { - /// - /// Return the route data for the url based on a mocked context - /// - /// - /// - /// - public static RouteData GetDataForRoute(this RouteCollection routes, string requestUrl) - { - var context = new FakeHttpContextFactory(requestUrl); - return routes.GetDataForRoute(context.HttpContext); - } + /// + /// Return the route data for the url based on a mocked context + /// + /// + /// + /// + public static RouteData GetDataForRoute(this RouteCollection routes, string requestUrl) + { + var context = new FakeHttpContextFactory(requestUrl); + return routes.GetDataForRoute(context.HttpContext); + } - /// - /// Get the route data based on the url and http context - /// - /// - /// - /// - public static RouteData GetDataForRoute(this RouteCollection routes, HttpContextBase httpContext) - { - var data = routes.GetRouteData(httpContext); + /// + /// Get the route data based on the url and http context + /// + /// + /// + /// + public static RouteData GetDataForRoute(this RouteCollection routes, HttpContextBase httpContext) + { + var data = routes.GetRouteData(httpContext); - //set the route data on the request context - var requestMock = Mock.Get(httpContext.Request.RequestContext); + //set the route data on the request context + var requestMock = Mock.Get(httpContext.Request.RequestContext); requestMock.Setup(x => x.RouteData).Returns(data); - return data; - } + return data; + } - /// - /// Checks if the URL will be ignored in the RouteTable - /// - /// - /// - /// - /// MVCContrib has a similar one but is faulty: - /// http://mvccontrib.codeplex.com/workitem/7173 - /// - public static bool ShouldIgnoreRoute(this string url) - { - var http = new FakeHttpContextFactory(url); - var r = RouteTable.Routes.GetRouteData(http.HttpContext); - if (r == null) return false; - return (r.RouteHandler is StopRoutingHandler); - } + /// + /// Checks if the URL will be ignored in the RouteTable + /// + /// + /// + /// + /// MVCContrib has a similar one but is faulty: + /// http://mvccontrib.codeplex.com/workitem/7173 + /// + public static bool ShouldIgnoreRoute(this string url) + { + var http = new FakeHttpContextFactory(url); + var r = RouteTable.Routes.GetRouteData(http.HttpContext); + if (r == null) return false; + return (r.RouteHandler is StopRoutingHandler); + } - } -} \ No newline at end of file + } +} diff --git a/src/Umbraco.Tests/Routing/UmbracoModuleTests.cs b/src/Umbraco.Tests/Routing/UmbracoModuleTests.cs index eb61d02a6b..56ab73e6f3 100644 --- a/src/Umbraco.Tests/Routing/UmbracoModuleTests.cs +++ b/src/Umbraco.Tests/Routing/UmbracoModuleTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.IO; using Moq; using NUnit.Framework; @@ -12,135 +12,135 @@ using Umbraco.Core.Sync; namespace Umbraco.Tests.Routing { - [TestFixture, RequiresSTA] - public class UmbracoModuleTests : BaseWebTest + [TestFixture, RequiresSTA] + public class UmbracoModuleTests : BaseWebTest { - private UmbracoModule _module; + private UmbracoModule _module; - public override void SetUp() - { - base.SetUp(); - - //create the module - _module = new UmbracoModule(); + public override void SetUp() + { + base.SetUp(); + + //create the module + _module = new UmbracoModule(); // test - _module.Logger = Mock.Of(); + _module.Logger = Mock.Of(); var runtime = new RuntimeState(_module.Logger, new Lazy(), new Lazy()); - _module.Runtime = runtime; + _module.Runtime = runtime; runtime.Level = RuntimeLevel.Run; - SettingsForTests.ConfigurationStatus = UmbracoVersion.SemanticVersion.ToSemanticString(); + SettingsForTests.ConfigurationStatus = UmbracoVersion.SemanticVersion.ToSemanticString(); //SettingsForTests.ReservedPaths = "~/umbraco,~/install/"; //SettingsForTests.ReservedUrls = "~/config/splashes/booting.aspx,~/install/default.aspx,~/config/splashes/noNodes.aspx,~/VSEnterpriseHelper.axd"; - Directory.CreateDirectory(Path.GetDirectoryName(IOHelper.MapPath(SystemFiles.NotFoundhandlersConfig, false))); + Directory.CreateDirectory(Path.GetDirectoryName(IOHelper.MapPath(SystemFiles.NotFoundhandlersConfig, false))); - //create the not found handlers config - using (var sw = File.CreateText(IOHelper.MapPath(SystemFiles.NotFoundhandlersConfig, false))) - { - sw.Write(@" - - - - + //create the not found handlers config + using (var sw = File.CreateText(IOHelper.MapPath(SystemFiles.NotFoundhandlersConfig, false))) + { + sw.Write(@" + + + + "); - } - } + } + } - public override void TearDown() - { - base.TearDown(); + public override void TearDown() + { + base.TearDown(); - _module.DisposeIfDisposable(); - } + _module.DisposeIfDisposable(); + } - // do not test for /base here as it's handled before EnsureUmbracoRoutablePage is called - [TestCase("/umbraco_client/Tree/treeIcons.css", false)] - [TestCase("/umbraco_client/Tree/Themes/umbraco/style.css?cdv=37", false)] - [TestCase("/umbraco_client/scrollingmenu/style.css?cdv=37", false)] - [TestCase("/umbraco/umbraco.aspx", false)] - [TestCase("/umbraco/editContent.aspx", false)] - [TestCase("/install/default.aspx", false)] - [TestCase("/install/?installStep=license", false)] - [TestCase("/install?installStep=license", false)] - [TestCase("/install/test.aspx", false)] - [TestCase("/config/splashes/noNodes.aspx", false)] - [TestCase("/", true)] - [TestCase("/home.aspx", true)] - [TestCase("/umbraco-test", true)] - [TestCase("/install-test", true)] - public void Ensure_Request_Routable(string url, bool assert) - { - var httpContextFactory = new FakeHttpContextFactory(url); - var httpContext = httpContextFactory.HttpContext; - var umbracoContext = GetUmbracoContext(url); - - var result = _module.EnsureUmbracoRoutablePage(umbracoContext, httpContext); + // do not test for /base here as it's handled before EnsureUmbracoRoutablePage is called + [TestCase("/umbraco_client/Tree/treeIcons.css", false)] + [TestCase("/umbraco_client/Tree/Themes/umbraco/style.css?cdv=37", false)] + [TestCase("/umbraco_client/scrollingmenu/style.css?cdv=37", false)] + [TestCase("/umbraco/umbraco.aspx", false)] + [TestCase("/umbraco/editContent.aspx", false)] + [TestCase("/install/default.aspx", false)] + [TestCase("/install/?installStep=license", false)] + [TestCase("/install?installStep=license", false)] + [TestCase("/install/test.aspx", false)] + [TestCase("/config/splashes/noNodes.aspx", false)] + [TestCase("/", true)] + [TestCase("/home.aspx", true)] + [TestCase("/umbraco-test", true)] + [TestCase("/install-test", true)] + public void Ensure_Request_Routable(string url, bool assert) + { + var httpContextFactory = new FakeHttpContextFactory(url); + var httpContext = httpContextFactory.HttpContext; + var umbracoContext = GetUmbracoContext(url); - Assert.AreEqual(assert, result.Success); - } + var result = _module.EnsureUmbracoRoutablePage(umbracoContext, httpContext); - [TestCase("/favicon.ico", true)] - [TestCase("/umbraco_client/Tree/treeIcons.css", true)] - [TestCase("/umbraco_client/Tree/Themes/umbraco/style.css?cdv=37", true)] - [TestCase("/umbraco_client/scrollingmenu/style.css?cdv=37", true)] - [TestCase("/base/somebasehandler", false)] - [TestCase("/", false)] - [TestCase("/home.aspx", false)] - public void Is_Client_Side_Request(string url, bool assert) - { - var uri = new Uri("http://test.com" + url); - var result = uri.IsClientSideRequest(); - Assert.AreEqual(assert, result); - } + Assert.AreEqual(assert, result.Success); + } + + [TestCase("/favicon.ico", true)] + [TestCase("/umbraco_client/Tree/treeIcons.css", true)] + [TestCase("/umbraco_client/Tree/Themes/umbraco/style.css?cdv=37", true)] + [TestCase("/umbraco_client/scrollingmenu/style.css?cdv=37", true)] + [TestCase("/base/somebasehandler", false)] + [TestCase("/", false)] + [TestCase("/home.aspx", false)] + public void Is_Client_Side_Request(string url, bool assert) + { + var uri = new Uri("http://test.com" + url); + var result = uri.IsClientSideRequest(); + Assert.AreEqual(assert, result); + } - //NOTE: This test shows how we can test most of the HttpModule, it however is testing a method that no longer exists and is testing too much, - // we need to write unit tests for each of the components: NiceUrlProvider, all of the Lookup classes, etc... - // to ensure that each one is individually tested. + //NOTE: This test shows how we can test most of the HttpModule, it however is testing a method that no longer exists and is testing too much, + // we need to write unit tests for each of the components: NiceUrlProvider, all of the Lookup classes, etc... + // to ensure that each one is individually tested. - //[TestCase("/", 1046)] - //[TestCase("/home.aspx", 1046)] - //[TestCase("/home/sub1.aspx", 1173)] - //[TestCase("/home.aspx?altTemplate=blah", 1046)] - //public void Process_Front_End_Document_Request_Match_Node(string url, int nodeId) - //{ - // var httpContextFactory = new FakeHttpContextFactory(url); - // var httpContext = httpContextFactory.HttpContext; - // var umbracoContext = new UmbracoContext(httpContext, ApplicationContext.Current, new NullRoutesCache()); - // var contentStore = new ContentStore(umbracoContext); - // var niceUrls = new NiceUrlProvider(contentStore, umbracoContext); - // umbracoContext.RoutingContext = new RoutingContext( - // new IPublishedContentLookup[] {new LookupByNiceUrl()}, - // new DefaultLastChanceLookup(), - // contentStore, - // niceUrls); + //[TestCase("/", 1046)] + //[TestCase("/home.aspx", 1046)] + //[TestCase("/home/sub1.aspx", 1173)] + //[TestCase("/home.aspx?altTemplate=blah", 1046)] + //public void Process_Front_End_Document_Request_Match_Node(string url, int nodeId) + //{ + // var httpContextFactory = new FakeHttpContextFactory(url); + // var httpContext = httpContextFactory.HttpContext; + // var umbracoContext = new UmbracoContext(httpContext, ApplicationContext.Current, new NullRoutesCache()); + // var contentStore = new ContentStore(umbracoContext); + // var niceUrls = new NiceUrlProvider(contentStore, umbracoContext); + // umbracoContext.RoutingContext = new RoutingContext( + // new IPublishedContentLookup[] {new LookupByNiceUrl()}, + // new DefaultLastChanceLookup(), + // contentStore, + // niceUrls); - // StateHelper.HttpContext = httpContext; + // StateHelper.HttpContext = httpContext; - // //because of so much dependency on the db, we need to create som stuff here, i originally abstracted out stuff but - // //was turning out to be quite a deep hole because ultimately we'd have to abstract the old 'Domain' and 'Language' classes - // Domain.MakeNew("Test.com", 1000, Language.GetByCultureCode("en-US").id); + // //because of so much dependency on the db, we need to create som stuff here, i originally abstracted out stuff but + // //was turning out to be quite a deep hole because ultimately we'd have to abstract the old 'Domain' and 'Language' classes + // Domain.MakeNew("Test.com", 1000, Language.GetByCultureCode("en-US").id); - // //need to create a template with id 1045 - // var template = Template.MakeNew("test", new User(0)); + // //need to create a template with id 1045 + // var template = Template.MakeNew("test", new User(0)); - // SetupUmbracoContextForTest(umbracoContext, template); + // SetupUmbracoContextForTest(umbracoContext, template); - // _module.AssignDocumentRequest(httpContext, umbracoContext, httpContext.Request.Url); + // _module.AssignDocumentRequest(httpContext, umbracoContext, httpContext.Request.Url); - // Assert.IsNotNull(umbracoContext.PublishedContentRequest); - // Assert.IsNotNull(umbracoContext.PublishedContentRequest.XmlNode); - // Assert.IsFalse(umbracoContext.PublishedContentRequest.IsRedirect); - // Assert.IsFalse(umbracoContext.PublishedContentRequest.Is404); - // Assert.AreEqual(umbracoContext.PublishedContentRequest.Culture, Thread.CurrentThread.CurrentCulture); - // Assert.AreEqual(umbracoContext.PublishedContentRequest.Culture, Thread.CurrentThread.CurrentUICulture); - // Assert.AreEqual(nodeId, umbracoContext.PublishedContentRequest.NodeId); - - //} + // Assert.IsNotNull(umbracoContext.PublishedContentRequest); + // Assert.IsNotNull(umbracoContext.PublishedContentRequest.XmlNode); + // Assert.IsFalse(umbracoContext.PublishedContentRequest.IsRedirect); + // Assert.IsFalse(umbracoContext.PublishedContentRequest.Is404); + // Assert.AreEqual(umbracoContext.PublishedContentRequest.Culture, Thread.CurrentThread.CurrentCulture); + // Assert.AreEqual(umbracoContext.PublishedContentRequest.Culture, Thread.CurrentThread.CurrentUICulture); + // Assert.AreEqual(nodeId, umbracoContext.PublishedContentRequest.NodeId); - } -} \ No newline at end of file + //} + + } +} diff --git a/src/Umbraco.Tests/Routing/UrlRoutingTestBase.cs b/src/Umbraco.Tests/Routing/UrlRoutingTestBase.cs index ea86d15b6a..6965c4dce9 100644 --- a/src/Umbraco.Tests/Routing/UrlRoutingTestBase.cs +++ b/src/Umbraco.Tests/Routing/UrlRoutingTestBase.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using Moq; using NUnit.Framework; @@ -15,7 +15,7 @@ namespace Umbraco.Tests.Routing public abstract class UrlRoutingTestBase : BaseWebTest { /// - /// Sets up the mock domain service + /// Sets up the mock domain service /// /// protected IDomainService SetupDomainServiceMock(IEnumerable allDomains) @@ -46,10 +46,10 @@ namespace Umbraco.Tests.Routing domainService.Setup(service => service.GetAll(It.IsAny())) .Returns((bool incWildcards) => new[] { - new UmbracoDomain("domain1.com/"){Id = 1, LanguageId = LangDeId, RootContentId = 1001, LanguageIsoCode = "de-DE"}, - new UmbracoDomain("domain1.com/en"){Id = 1, LanguageId = LangEngId, RootContentId = 10011, LanguageIsoCode = "en-US"}, + new UmbracoDomain("domain1.com/"){Id = 1, LanguageId = LangDeId, RootContentId = 1001, LanguageIsoCode = "de-DE"}, + new UmbracoDomain("domain1.com/en"){Id = 1, LanguageId = LangEngId, RootContentId = 10011, LanguageIsoCode = "en-US"}, new UmbracoDomain("domain1.com/fr"){Id = 1, LanguageId = LangFrId, RootContentId = 10012, LanguageIsoCode = "fr-FR"} - }); + }); return serviceContext; } @@ -61,4 +61,4 @@ namespace Umbraco.Tests.Routing public const int LangNlId = 337; public const int LangDkId = 338; } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Routing/UrlsWithNestedDomains.cs b/src/Umbraco.Tests/Routing/UrlsWithNestedDomains.cs index 40123f9ab4..6f374cb514 100644 --- a/src/Umbraco.Tests/Routing/UrlsWithNestedDomains.cs +++ b/src/Umbraco.Tests/Routing/UrlsWithNestedDomains.cs @@ -10,24 +10,24 @@ using Umbraco.Core.Composing; namespace Umbraco.Tests.Routing { - [TestFixture] + [TestFixture] public class UrlsWithNestedDomains : UrlRoutingTestBase - { - // in the case of nested domains more than 1 url may resolve to a document - // but only one route can be cached - the 'canonical' route ie the route - // using the closest domain to the node - here we test that if we request - // a non-canonical route, it is not cached / the cache is not polluted + { + // in the case of nested domains more than 1 url may resolve to a document + // but only one route can be cached - the 'canonical' route ie the route + // using the closest domain to the node - here we test that if we request + // a non-canonical route, it is not cached / the cache is not polluted - protected override void Compose() - { + protected override void Compose() + { base.Compose(); Container.RegisterSingleton(_ => Mock.Of()); Container.Register(); } [Test] - public void DoNotPolluteCache() - { + public void DoNotPolluteCache() + { SettingsForTests.UseDirectoryUrls = true; SettingsForTests.HideTopLevelNodeFromPath = false; // ignored w/domains @@ -35,134 +35,134 @@ namespace Umbraco.Tests.Routing var request = Mock.Get(settings.RequestHandler); request.Setup(x => x.UseDomainPrefixes).Returns(true); - SetDomains1(); + SetDomains1(); - const string url = "http://domain1.com/1001-1/1001-1-1"; + const string url = "http://domain1.com/1001-1/1001-1-1"; - // get the nice url for 100111 - var umbracoContext = GetUmbracoContext(url, 9999, umbracoSettings: settings, urlProviders: new [] { new DefaultUrlProvider(settings.RequestHandler, Logger) }); - Assert.AreEqual("http://domain2.com/1001-1-1/", umbracoContext.UrlProvider.GetUrl(100111, true)); + // get the nice url for 100111 + var umbracoContext = GetUmbracoContext(url, 9999, umbracoSettings: settings, urlProviders: new [] { new DefaultUrlProvider(settings.RequestHandler, Logger) }); + Assert.AreEqual("http://domain2.com/1001-1-1/", umbracoContext.UrlProvider.GetUrl(100111, true)); - // check that the proper route has been cached - var cache = umbracoContext.ContentCache as PublishedContentCache; + // check that the proper route has been cached + var cache = umbracoContext.ContentCache as PublishedContentCache; if (cache == null) throw new Exception("Unsupported IPublishedContentCache, only the Xml one is supported."); - var cachedRoutes = cache.RoutesCache.GetCachedRoutes(); - Assert.AreEqual("10011/1001-1-1", cachedRoutes[100111]); + var cachedRoutes = cache.RoutesCache.GetCachedRoutes(); + Assert.AreEqual("10011/1001-1-1", cachedRoutes[100111]); // route a rogue url var facadeRouter = CreateFacadeRouter(); var frequest = facadeRouter.CreateRequest(umbracoContext); - facadeRouter.FindDomain(frequest); - Assert.IsTrue(frequest.HasDomain); + facadeRouter.FindDomain(frequest); + Assert.IsTrue(frequest.HasDomain); - // check that it's been routed - var lookup = new ContentFinderByNiceUrl(Logger); - var result = lookup.TryFindContent(frequest); - Assert.IsTrue(result); - Assert.AreEqual(100111, frequest.PublishedContent.Id); + // check that it's been routed + var lookup = new ContentFinderByNiceUrl(Logger); + var result = lookup.TryFindContent(frequest); + Assert.IsTrue(result); + Assert.AreEqual(100111, frequest.PublishedContent.Id); - // has the cache been polluted? + // has the cache been polluted? cachedRoutes = cache.RoutesCache.GetCachedRoutes(); - Assert.AreEqual("10011/1001-1-1", cachedRoutes[100111]); // no - //Assert.AreEqual("1001/1001-1/1001-1-1", cachedRoutes[100111]); // yes + Assert.AreEqual("10011/1001-1-1", cachedRoutes[100111]); // no + //Assert.AreEqual("1001/1001-1/1001-1-1", cachedRoutes[100111]); // yes - // what's the nice url now? - Assert.AreEqual("http://domain2.com/1001-1-1/", umbracoContext.UrlProvider.GetUrl(100111)); // good - //Assert.AreEqual("http://domain1.com/1001-1/1001-1-1", routingContext.NiceUrlProvider.GetNiceUrl(100111, true)); // bad - } + // what's the nice url now? + Assert.AreEqual("http://domain2.com/1001-1-1/", umbracoContext.UrlProvider.GetUrl(100111)); // good + //Assert.AreEqual("http://domain1.com/1001-1/1001-1-1", routingContext.NiceUrlProvider.GetNiceUrl(100111, true)); // bad + } void SetDomains1() - { + { SetupDomainServiceMock(new[] { new UmbracoDomain("http://domain1.com/") {Id = 1, LanguageId = LangEngId, RootContentId = 1001, LanguageIsoCode = "en-US"}, new UmbracoDomain("http://domain2.com/") {Id = 1, LanguageId = LangEngId, RootContentId = 10011, LanguageIsoCode = "en-US"} }); - } + } - protected override string GetXmlContent(int templateId) - { - return @" + protected override string GetXmlContent(int templateId) + { + return @" ]> - - - - This is some content]]> - - - - - - - - - - - - - - - This is some content]]> - - - - - - - - - - - - - - - - - - - - - - This is some content]]> - - - - - - - - - - - - - - - This is some content]]> - - - - - - - - - - - - - - - - + + + + This is some content]]> + + + + + + + + + + + + + + + This is some content]]> + + + + + + + + + + + + + + + + + + + + + + This is some content]]> + + + + + + + + + + + + + + + This is some content]]> + + + + + + + + + + + + + + + + "; - } - } + } + } } diff --git a/src/Umbraco.Tests/Runtimes/WebRuntimeTests.cs b/src/Umbraco.Tests/Runtimes/WebRuntimeTests.cs index 1472fd93a2..7717dc178e 100644 --- a/src/Umbraco.Tests/Runtimes/WebRuntimeTests.cs +++ b/src/Umbraco.Tests/Runtimes/WebRuntimeTests.cs @@ -7,63 +7,63 @@ using Umbraco.Web.Mvc; namespace Umbraco.Tests.Runtimes { - [TestFixture] - public class WebRuntimeTests - { - [Test] - public void WrapViewEngines_HasEngines_WrapsAll() - { - IList engines = new List - { - new RenderViewEngine(), - new PluginViewEngine() - }; - - WebRuntimeComponent.WrapViewEngines(engines); - - Assert.That(engines.Count, Is.EqualTo(2)); - Assert.That(engines[0], Is.InstanceOf()); - Assert.That(engines[1], Is.InstanceOf()); - } - - [Test] - public void WrapViewEngines_HasEngines_KeepsSortOrder() - { + [TestFixture] + public class WebRuntimeTests + { + [Test] + public void WrapViewEngines_HasEngines_WrapsAll() + { IList engines = new List - { - new RenderViewEngine(), - new PluginViewEngine() - }; + { + new RenderViewEngine(), + new PluginViewEngine() + }; WebRuntimeComponent.WrapViewEngines(engines); - Assert.That(engines.Count, Is.EqualTo(2)); - Assert.That(((ProfilingViewEngine)engines[0]).Inner, Is.InstanceOf()); - Assert.That(((ProfilingViewEngine)engines[1]).Inner, Is.InstanceOf()); - } + Assert.That(engines.Count, Is.EqualTo(2)); + Assert.That(engines[0], Is.InstanceOf()); + Assert.That(engines[1], Is.InstanceOf()); + } - - [Test] - public void WrapViewEngines_HasProfiledEngine_AddsSameInstance() - { - var profiledEngine = new ProfilingViewEngine(new PluginViewEngine()); - IList engines = new List - { - profiledEngine - }; + [Test] + public void WrapViewEngines_HasEngines_KeepsSortOrder() + { + IList engines = new List + { + new RenderViewEngine(), + new PluginViewEngine() + }; WebRuntimeComponent.WrapViewEngines(engines); - Assert.That(engines[0], Is.SameAs(profiledEngine)); - } + Assert.That(engines.Count, Is.EqualTo(2)); + Assert.That(((ProfilingViewEngine)engines[0]).Inner, Is.InstanceOf()); + Assert.That(((ProfilingViewEngine)engines[1]).Inner, Is.InstanceOf()); + } - [Test] - public void WrapViewEngines_CollectionIsNull_DoesNotThrow() - { - IList engines = null; - Assert.DoesNotThrow(() => WebRuntimeComponent.WrapViewEngines(engines)); - Assert.That(engines, Is.Null); - } - } -} \ No newline at end of file + [Test] + public void WrapViewEngines_HasProfiledEngine_AddsSameInstance() + { + var profiledEngine = new ProfilingViewEngine(new PluginViewEngine()); + IList engines = new List + { + profiledEngine + }; + + WebRuntimeComponent.WrapViewEngines(engines); + + Assert.That(engines[0], Is.SameAs(profiledEngine)); + } + + [Test] + public void WrapViewEngines_CollectionIsNull_DoesNotThrow() + { + IList engines = null; + Assert.DoesNotThrow(() => WebRuntimeComponent.WrapViewEngines(engines)); + Assert.That(engines, Is.Null); + } + + } +} diff --git a/src/Umbraco.Tests/Scheduling/BackgroundTaskRunnerTests2.cs b/src/Umbraco.Tests/Scheduling/BackgroundTaskRunnerTests2.cs index 740b369474..8e886d7dc9 100644 --- a/src/Umbraco.Tests/Scheduling/BackgroundTaskRunnerTests2.cs +++ b/src/Umbraco.Tests/Scheduling/BackgroundTaskRunnerTests2.cs @@ -175,4 +175,4 @@ namespace Umbraco.Tests.Scheduling Assert.IsTrue(triggered); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Scoping/EventNameExtractorTests.cs b/src/Umbraco.Tests/Scoping/EventNameExtractorTests.cs index 3faeb51d17..82c74db64a 100644 --- a/src/Umbraco.Tests/Scoping/EventNameExtractorTests.cs +++ b/src/Umbraco.Tests/Scoping/EventNameExtractorTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using NUnit.Framework; using Umbraco.Core.Events; @@ -37,7 +37,7 @@ namespace Umbraco.Tests.Scoping var found = EventNameExtractor.FindEvent(this, new SaveEventArgs(0), EventNameExtractor.MatchIngNames); Assert.IsFalse(found.Success); Assert.AreEqual(EventNameExtractorError.NoneFound, found.Result.Error); - } + } public static event EventHandler> FindingMe; public static event EventHandler> FoundMe; @@ -48,4 +48,4 @@ namespace Umbraco.Tests.Scoping public static event EventHandler> SavingThat; public static event EventHandler> SavedThat; } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Scoping/PassThroughEventDispatcherTests.cs b/src/Umbraco.Tests/Scoping/PassThroughEventDispatcherTests.cs index 2cec2135c4..68e69f4cd6 100644 --- a/src/Umbraco.Tests/Scoping/PassThroughEventDispatcherTests.cs +++ b/src/Umbraco.Tests/Scoping/PassThroughEventDispatcherTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using Moq; using NUnit.Framework; using Umbraco.Core.Events; @@ -61,4 +61,4 @@ namespace Umbraco.Tests.Scoping // public event EventHandler DoThing2; // public event TypedEventHandler DoThing3; } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Scoping/ScopeEventDispatcherTests.cs b/src/Umbraco.Tests/Scoping/ScopeEventDispatcherTests.cs index a1ea644a45..9cab37f39e 100644 --- a/src/Umbraco.Tests/Scoping/ScopeEventDispatcherTests.cs +++ b/src/Umbraco.Tests/Scoping/ScopeEventDispatcherTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using LightInject; using Moq; @@ -408,4 +408,4 @@ namespace Umbraco.Tests.Scoping } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Scoping/ScopeTests.cs b/src/Umbraco.Tests/Scoping/ScopeTests.cs index bf7e611ebe..3f2740291b 100644 --- a/src/Umbraco.Tests/Scoping/ScopeTests.cs +++ b/src/Umbraco.Tests/Scoping/ScopeTests.cs @@ -468,7 +468,7 @@ namespace Umbraco.Tests.Scoping Assert.IsNull(scopeProvider.AmbientContext); // back to original thread - ScopeProviderStatic.HttpContextItemsGetter = () => httpContextItems; + ScopeProviderStatic.HttpContextItemsGetter = () => httpContextItems; } Assert.IsNotNull(scopeProvider.AmbientScope); Assert.AreSame(scope, scopeProvider.AmbientScope); @@ -674,4 +674,4 @@ namespace Umbraco.Tests.Scoping Assert.IsNull(scopeProvider.AmbientContext); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Scoping/ScopedRepositoryTests.cs b/src/Umbraco.Tests/Scoping/ScopedRepositoryTests.cs index ddde5117d1..5b85b2d626 100644 --- a/src/Umbraco.Tests/Scoping/ScopedRepositoryTests.cs +++ b/src/Umbraco.Tests/Scoping/ScopedRepositoryTests.cs @@ -331,7 +331,7 @@ namespace Umbraco.Tests.Scoping public class LocalServerMessenger : ServerMessengerBase { - public LocalServerMessenger() + public LocalServerMessenger() : base(false) { } diff --git a/src/Umbraco.Tests/Scoping/ScopedXmlTests.cs b/src/Umbraco.Tests/Scoping/ScopedXmlTests.cs index 1f7efab2ef..8f2199c921 100644 --- a/src/Umbraco.Tests/Scoping/ScopedXmlTests.cs +++ b/src/Umbraco.Tests/Scoping/ScopedXmlTests.cs @@ -19,7 +19,7 @@ using Umbraco.Web.PublishedCache.XmlPublishedCache; namespace Umbraco.Tests.Scoping { [TestFixture] - [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest, FacadeServiceRepositoryEvents = true)] + [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest, FacadeServiceRepositoryEvents = true)] public class ScopedXmlTests : TestWithDatabaseBase { private CacheRefresherComponent _cacheRefresher; diff --git a/src/Umbraco.Tests/Security/BackOfficeCookieManagerTests.cs b/src/Umbraco.Tests/Security/BackOfficeCookieManagerTests.cs index b0b523043a..4aa4f6871e 100644 --- a/src/Umbraco.Tests/Security/BackOfficeCookieManagerTests.cs +++ b/src/Umbraco.Tests/Security/BackOfficeCookieManagerTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Configuration; using System.Web; @@ -64,4 +64,4 @@ namespace Umbraco.Tests.Security //TODO : Write remaining tests for `ShouldAuthenticateRequest` } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Security/UmbracoBackOfficeIdentityTests.cs b/src/Umbraco.Tests/Security/UmbracoBackOfficeIdentityTests.cs index 813653fb7c..5ec4dea802 100644 --- a/src/Umbraco.Tests/Security/UmbracoBackOfficeIdentityTests.cs +++ b/src/Umbraco.Tests/Security/UmbracoBackOfficeIdentityTests.cs @@ -23,12 +23,12 @@ namespace Umbraco.Tests.Security { var sessionId = Guid.NewGuid().ToString(); var claimsIdentity = new ClaimsIdentity(new[] - { + { //This is the id that 'identity' uses to check for the user id - new Claim(ClaimTypes.NameIdentifier, "1234", ClaimValueTypes.Integer32, TestIssuer, TestIssuer), + new Claim(ClaimTypes.NameIdentifier, "1234", ClaimValueTypes.Integer32, TestIssuer, TestIssuer), //This is the id that 'identity' uses to check for the username - new Claim(ClaimTypes.Name, "testing", ClaimValueTypes.String, TestIssuer, TestIssuer), - new Claim(ClaimTypes.GivenName, "hello world", ClaimValueTypes.String, TestIssuer, TestIssuer), + new Claim(ClaimTypes.Name, "testing", ClaimValueTypes.String, TestIssuer, TestIssuer), + new Claim(ClaimTypes.GivenName, "hello world", ClaimValueTypes.String, TestIssuer, TestIssuer), new Claim(Constants.Security.StartContentNodeIdClaimType, "-1", ClaimValueTypes.Integer32, TestIssuer, TestIssuer), new Claim(Constants.Security.StartMediaNodeIdClaimType, "5543", ClaimValueTypes.Integer32, TestIssuer, TestIssuer), new Claim(Constants.Security.AllowedApplicationsClaimType, "content", ClaimValueTypes.String, TestIssuer, TestIssuer), @@ -37,7 +37,7 @@ namespace Umbraco.Tests.Security new Claim(Constants.Security.SessionIdClaimType, sessionId, Constants.Security.SessionIdClaimType, TestIssuer, TestIssuer), new Claim(ClaimsIdentity.DefaultRoleClaimType, "admin", ClaimValueTypes.String, TestIssuer, TestIssuer), }); - + var backofficeIdentity = UmbracoBackOfficeIdentity.FromClaimsIdentity(claimsIdentity); Assert.AreEqual("1234", backofficeIdentity.Id); @@ -57,9 +57,9 @@ namespace Umbraco.Tests.Security public void Create_From_Claims_Identity_Missing_Required_Claim() { var claimsIdentity = new ClaimsIdentity(new[] - { - new Claim(ClaimTypes.NameIdentifier, "1234", ClaimValueTypes.Integer32, TestIssuer, TestIssuer), - new Claim(ClaimTypes.Name, "testing", ClaimValueTypes.String, TestIssuer, TestIssuer), + { + new Claim(ClaimTypes.NameIdentifier, "1234", ClaimValueTypes.Integer32, TestIssuer, TestIssuer), + new Claim(ClaimTypes.Name, "testing", ClaimValueTypes.String, TestIssuer, TestIssuer), }); Assert.Throws(() => UmbracoBackOfficeIdentity.FromClaimsIdentity(claimsIdentity)); @@ -70,11 +70,11 @@ namespace Umbraco.Tests.Security { var sessionId = Guid.NewGuid().ToString(); var claimsIdentity = new ClaimsIdentity(new[] - { + { //null or empty - new Claim(ClaimTypes.NameIdentifier, "", ClaimValueTypes.Integer32, TestIssuer, TestIssuer), - new Claim(ClaimTypes.Name, "testing", ClaimValueTypes.String, TestIssuer, TestIssuer), - new Claim(ClaimTypes.GivenName, "hello world", ClaimValueTypes.String, TestIssuer, TestIssuer), + new Claim(ClaimTypes.NameIdentifier, "", ClaimValueTypes.Integer32, TestIssuer, TestIssuer), + new Claim(ClaimTypes.Name, "testing", ClaimValueTypes.String, TestIssuer, TestIssuer), + new Claim(ClaimTypes.GivenName, "hello world", ClaimValueTypes.String, TestIssuer, TestIssuer), new Claim(Constants.Security.StartContentNodeIdClaimType, "-1", ClaimValueTypes.Integer32, TestIssuer, TestIssuer), new Claim(Constants.Security.StartMediaNodeIdClaimType, "5543", ClaimValueTypes.Integer32, TestIssuer, TestIssuer), new Claim(Constants.Security.AllowedApplicationsClaimType, "content", ClaimValueTypes.String, TestIssuer, TestIssuer), @@ -125,8 +125,8 @@ namespace Umbraco.Tests.Security }; var claimsIdentity = new ClaimsIdentity(new[] - { - new Claim("TestClaim1", "test", ClaimValueTypes.Integer32, TestIssuer, TestIssuer), + { + new Claim("TestClaim1", "test", ClaimValueTypes.Integer32, TestIssuer, TestIssuer), new Claim("TestClaim1", "test", ClaimValueTypes.Integer32, TestIssuer, TestIssuer) }); diff --git a/src/Umbraco.Tests/Services/CachedDataTypeServiceTests.cs b/src/Umbraco.Tests/Services/CachedDataTypeServiceTests.cs index 66d32ade5b..17ca466541 100644 --- a/src/Umbraco.Tests/Services/CachedDataTypeServiceTests.cs +++ b/src/Umbraco.Tests/Services/CachedDataTypeServiceTests.cs @@ -1,4 +1,4 @@ -using NUnit.Framework; +using NUnit.Framework; using Umbraco.Core.Models; using Umbraco.Tests.Testing; @@ -31,4 +31,4 @@ namespace Umbraco.Tests.Services Assert.Pass(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Services/ContentServicePerformanceTest.cs b/src/Umbraco.Tests/Services/ContentServicePerformanceTest.cs index 97021cf415..411b43f5d0 100644 --- a/src/Umbraco.Tests/Services/ContentServicePerformanceTest.cs +++ b/src/Umbraco.Tests/Services/ContentServicePerformanceTest.cs @@ -289,4 +289,4 @@ namespace Umbraco.Tests.Services ServiceContext.ContentTypeService.Save(contentType); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Services/ContentServiceTests.cs b/src/Umbraco.Tests/Services/ContentServiceTests.cs index 9dcdabc9a3..613795c75e 100644 --- a/src/Umbraco.Tests/Services/ContentServiceTests.cs +++ b/src/Umbraco.Tests/Services/ContentServiceTests.cs @@ -639,9 +639,9 @@ namespace Umbraco.Tests.Services } } - [Test] - public void Can_Replace_Tag_Data_To_Published_Content() - { + [Test] + public void Can_Replace_Tag_Data_To_Published_Content() + { //Arrange var contentService = ServiceContext.ContentService; var contentTypeService = ServiceContext.ContentTypeService; @@ -662,16 +662,16 @@ namespace Umbraco.Tests.Services // Assert Assert.AreEqual(4, content.Properties["tags"].Value.ToString().Split(',').Distinct().Count()); - var propertyTypeId = contentType.PropertyTypes.Single(x => x.Alias == "tags").Id; - using (var scope = ScopeProvider.CreateScope()) - { - Assert.AreEqual(4, scope.Database.ExecuteScalar( - "SELECT COUNT(*) FROM cmsTagRelationship WHERE nodeId=@nodeId AND propertyTypeId=@propTypeId", - new { nodeId = content.Id, propTypeId = propertyTypeId })); + var propertyTypeId = contentType.PropertyTypes.Single(x => x.Alias == "tags").Id; + using (var scope = ScopeProvider.CreateScope()) + { + Assert.AreEqual(4, scope.Database.ExecuteScalar( + "SELECT COUNT(*) FROM cmsTagRelationship WHERE nodeId=@nodeId AND propertyTypeId=@propTypeId", + new { nodeId = content.Id, propTypeId = propertyTypeId })); scope.Complete(); - } - } + } + } [Test] public void Can_Append_Tag_Data_To_Published_Content() @@ -741,9 +741,9 @@ namespace Umbraco.Tests.Services } } - [Test] - public void Can_Remove_Property_Type() - { + [Test] + public void Can_Remove_Property_Type() + { // Arrange var contentService = ServiceContext.ContentService; @@ -753,9 +753,9 @@ namespace Umbraco.Tests.Services // Assert Assert.That(content, Is.Not.Null); Assert.That(content.HasIdentity, Is.False); - } + } - [Test] + [Test] public void Can_Create_Content() { // Arrange @@ -1310,9 +1310,9 @@ namespace Umbraco.Tests.Services contentService.Save(hierarchy, 0); Assert.That(hierarchy.Any(), Is.True); - Assert.That(hierarchy.Any(x => x.HasIdentity == false), Is.False); - //all parent id's should be ok, they are lazy and if they equal zero an exception will be thrown - Assert.DoesNotThrow(() => hierarchy.Any(x => x.ParentId != 0)); + Assert.That(hierarchy.Any(x => x.HasIdentity == false), Is.False); + //all parent id's should be ok, they are lazy and if they equal zero an exception will be thrown + Assert.DoesNotThrow(() => hierarchy.Any(x => x.ParentId != 0)); } @@ -1677,20 +1677,20 @@ namespace Umbraco.Tests.Services Assert.That(hasPublishedVersion, Is.True); } - [Test] - public void Can_Verify_Property_Types_On_Content() - { + [Test] + public void Can_Verify_Property_Types_On_Content() + { // Arrange - var contentTypeService = ServiceContext.ContentTypeService; + var contentTypeService = ServiceContext.ContentTypeService; var contentType = MockedContentTypes.CreateAllTypesContentType("allDataTypes", "All DataTypes"); contentTypeService.Save(contentType); - var contentService = ServiceContext.ContentService; - var content = MockedContent.CreateAllTypesContent(contentType, "Random Content", -1); + var contentService = ServiceContext.ContentService; + var content = MockedContent.CreateAllTypesContent(contentType, "Random Content", -1); contentService.Save(content); - var id = content.Id; + var id = content.Id; // Act - var sut = contentService.GetById(id); + var sut = contentService.GetById(id); // Arrange Assert.That(sut.GetValue("isTrue"), Is.True); @@ -1705,7 +1705,7 @@ namespace Umbraco.Tests.Services Assert.That(sut.GetValue("dateTime").ToString("G"), Is.EqualTo(content.GetValue("dateTime").ToString("G"))); Assert.That(sut.GetValue("colorPicker"), Is.EqualTo("black")); //that one is gone in 7.4 - //Assert.That(sut.GetValue("folderBrowser"), Is.Null); + //Assert.That(sut.GetValue("folderBrowser"), Is.Null); Assert.That(sut.GetValue("ddlMultiple"), Is.EqualTo("1234,1235")); Assert.That(sut.GetValue("rbList"), Is.EqualTo("random")); Assert.That(sut.GetValue("date").ToString("G"), Is.EqualTo(content.GetValue("date").ToString("G"))); @@ -1716,23 +1716,23 @@ namespace Umbraco.Tests.Services Assert.That(sut.GetValue("memberPicker"), Is.EqualTo(1092)); Assert.That(sut.GetValue("relatedLinks"), Is.EqualTo("")); Assert.That(sut.GetValue("tags"), Is.EqualTo("this,is,tags")); - } + } - [Test] - public void Can_Delete_Previous_Versions_Not_Latest() - { + [Test] + public void Can_Delete_Previous_Versions_Not_Latest() + { // Arrange var contentService = ServiceContext.ContentService; var content = contentService.GetById(NodeDto.NodeIdSeed + 4); - var version = content.Version; + var version = content.Version; - // Act + // Act contentService.DeleteVersion(NodeDto.NodeIdSeed + 4, version, true, 0); var sut = contentService.GetById(NodeDto.NodeIdSeed + 4); // Assert Assert.That(sut.Version, Is.EqualTo(version)); - } + } [Test] public void Ensure_Content_Xml_Created() @@ -1900,7 +1900,7 @@ namespace Umbraco.Tests.Services var contentType = MockedContentTypes.CreateSimpleContentType(); ServiceContext.ContentTypeService.Save(contentType); - // only add 9 as we also add a content with children + // only add 9 as we also add a content with children for (int i = 0; i < 9; i++) { var c1 = MockedContent.CreateSimpleContent(contentType); @@ -1938,11 +1938,11 @@ namespace Umbraco.Tests.Services var contentType = ServiceContext.ContentTypeService.Get("umbTextpage"); var root = ServiceContext.ContentService.GetById(NodeDto.NodeIdSeed + 1); - var list = new List(); + var list = new List(); for (int i = 0; i < 10; i++) { - var content = MockedContent.CreateSimpleContent(contentType, "Hierarchy Simple Text Page " + i, root); + var content = MockedContent.CreateSimpleContent(contentType, "Hierarchy Simple Text Page " + i, root); list.Add(content); list.AddRange(CreateChildrenOf(contentType, content, 4)); @@ -1953,12 +1953,12 @@ namespace Umbraco.Tests.Services return list; } - private IEnumerable CreateChildrenOf(IContentType contentType, IContent content, int depth) + private IEnumerable CreateChildrenOf(IContentType contentType, IContent content, int depth) { var list = new List(); for (int i = 0; i < depth; i++) { - var c = MockedContent.CreateSimpleContent(contentType, "Hierarchy Simple Text Subpage " + i, content); + var c = MockedContent.CreateSimpleContent(contentType, "Hierarchy Simple Text Subpage " + i, content); list.Add(c); Debug.Print("Created: 'Hierarchy Simple Text Subpage {0}' - Depth: {1}", i, depth); @@ -1975,4 +1975,4 @@ namespace Umbraco.Tests.Services return repository; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Services/ContentTypeServiceExtensionsTests.cs b/src/Umbraco.Tests/Services/ContentTypeServiceExtensionsTests.cs index ba4485638e..70a45aaffc 100644 --- a/src/Umbraco.Tests/Services/ContentTypeServiceExtensionsTests.cs +++ b/src/Umbraco.Tests/Services/ContentTypeServiceExtensionsTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using Moq; using NUnit.Framework; @@ -104,7 +104,7 @@ namespace Umbraco.Tests.Services ct.PropertyGroups.Add(pg); }; - var ct1 = MockedContentTypes.CreateBasicContentType("ct1", "CT1", null); + var ct1 = MockedContentTypes.CreateBasicContentType("ct1", "CT1", null); var ct2 = MockedContentTypes.CreateBasicContentType("ct2", "CT2", null); addPropType(ct2); var ct3 = MockedContentTypes.CreateBasicContentType("ct3", "CT3", null); @@ -130,7 +130,7 @@ namespace Umbraco.Tests.Services [Test] public void GetAvailableCompositeContentTypes_Not_Itself() { - var ct1 = MockedContentTypes.CreateBasicContentType("ct1", "CT1", null); + var ct1 = MockedContentTypes.CreateBasicContentType("ct1", "CT1", null); var ct2 = MockedContentTypes.CreateBasicContentType("ct2", "CT2", null); var ct3 = MockedContentTypes.CreateBasicContentType("ct3", "CT3", null); ct1.Id = 1; @@ -266,4 +266,4 @@ namespace Umbraco.Tests.Services Assert.AreEqual(ct4.Id, availableTypes.ElementAt(2).Id); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Services/ContentTypeServiceTests.cs b/src/Umbraco.Tests/Services/ContentTypeServiceTests.cs index 4f3f231122..af7f71a23c 100644 --- a/src/Umbraco.Tests/Services/ContentTypeServiceTests.cs +++ b/src/Umbraco.Tests/Services/ContentTypeServiceTests.cs @@ -1,4 +1,4 @@ -using System.Runtime.Remoting; +using System.Runtime.Remoting; using NUnit.Framework; using System; using System.Collections.Generic; @@ -1797,4 +1797,4 @@ namespace Umbraco.Tests.Services return list.ToArray(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Services/DataTypeServiceTests.cs b/src/Umbraco.Tests/Services/DataTypeServiceTests.cs index 012828ba91..90e13f6f87 100644 --- a/src/Umbraco.Tests/Services/DataTypeServiceTests.cs +++ b/src/Umbraco.Tests/Services/DataTypeServiceTests.cs @@ -42,7 +42,7 @@ namespace Umbraco.Tests.Services var dataTypeService = ServiceContext.DataTypeService; var textfieldId = "Umbraco.Textbox"; var dataTypeDefinitions = dataTypeService.GetDataTypeDefinitionByPropertyEditorAlias(textfieldId); - + // Act var definition = dataTypeDefinitions.First(); var definitionId = definition.Id; @@ -184,7 +184,7 @@ namespace Umbraco.Tests.Services // Assert Assert.AreEqual(1, preValsAgain.FormatAsDictionary().Count); - Assert.AreEqual(preVals.PreValuesAsDictionary.Values.First().Id, preValsAgain.PreValuesAsDictionary.Values.First().Id); + Assert.AreEqual(preVals.PreValuesAsDictionary.Values.First().Id, preValsAgain.PreValuesAsDictionary.Values.First().Id); Assert.AreEqual("preVal1", preValsAgain.PreValuesAsDictionary.Keys.First()); } @@ -201,7 +201,7 @@ namespace Umbraco.Tests.Services dataTypeService.Save(dataTypeDefinition); dataTypeService.SavePreValues(dataTypeDefinition.Id, new[] {"preVal1", "preVal2"}); - //re-get + //re-get dataTypeDefinition = dataTypeService.GetDataTypeDefinitionById(dataTypeDefinition.Id); var preVals = dataTypeService.GetPreValuesCollectionByDataTypeId(dataTypeDefinition.Id); @@ -211,7 +211,7 @@ namespace Umbraco.Tests.Services Assert.AreEqual(false, preVals.IsDictionaryBased); Assert.AreEqual(2, preVals.PreValuesAsArray.Count()); Assert.AreEqual("preVal1", preVals.PreValuesAsArray.First().Value); - Assert.AreEqual("preVal2", preVals.PreValuesAsArray.Last().Value); + Assert.AreEqual("preVal2", preVals.PreValuesAsArray.Last().Value); } [Test] @@ -227,4 +227,4 @@ namespace Umbraco.Tests.Services Assert.Throws(() => dataTypeService.Save(dataTypeDefinition)); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Services/EntityServiceTests.cs b/src/Umbraco.Tests/Services/EntityServiceTests.cs index 329d32d550..fa31da0e3c 100644 --- a/src/Umbraco.Tests/Services/EntityServiceTests.cs +++ b/src/Umbraco.Tests/Services/EntityServiceTests.cs @@ -595,4 +595,4 @@ namespace Umbraco.Tests.Services } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Services/Importing/ImportResources.Designer.cs b/src/Umbraco.Tests/Services/Importing/ImportResources.Designer.cs index 822b3262e4..263aaab5bc 100644 --- a/src/Umbraco.Tests/Services/Importing/ImportResources.Designer.cs +++ b/src/Umbraco.Tests/Services/Importing/ImportResources.Designer.cs @@ -10,8 +10,8 @@ namespace Umbraco.Tests.Services.Importing { using System; - - + + /// /// A strongly-typed resource class, for looking up localized strings, etc. /// @@ -23,15 +23,15 @@ namespace Umbraco.Tests.Services.Importing { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class ImportResources { - + private static global::System.Resources.ResourceManager resourceMan; - + private static global::System.Globalization.CultureInfo resourceCulture; - + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal ImportResources() { } - + /// /// Returns the cached ResourceManager instance used by this class. /// @@ -45,7 +45,7 @@ namespace Umbraco.Tests.Services.Importing { return resourceMan; } } - + /// /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. @@ -59,7 +59,7 @@ namespace Umbraco.Tests.Services.Importing { resourceCulture = value; } } - + /// /// Looks up a localized string similar to <?xml version="1.0" encoding="UTF-8" standalone="no"?> ///<umbPackage> @@ -87,7 +87,7 @@ namespace Umbraco.Tests.Services.Importing { return ResourceManager.GetString("CheckboxList_Content_Package", resourceCulture); } } - + /// /// Looks up a localized string similar to <?xml version="1.0" encoding="UTF-8" standalone="no"?> ///<umbPackage> @@ -113,7 +113,7 @@ namespace Umbraco.Tests.Services.Importing { return ResourceManager.GetString("CompositionsTestPackage", resourceCulture); } } - + /// /// Looks up a localized string similar to <?xml version="1.0" encoding="UTF-8" standalone="no"?> ///<umbPackage> @@ -141,7 +141,7 @@ namespace Umbraco.Tests.Services.Importing { return ResourceManager.GetString("CompositionsTestPackage_Random", resourceCulture); } } - + /// /// Looks up a localized string similar to <?xml version="1.0" encoding="utf-8" ?> ///<umbPackage> @@ -167,7 +167,7 @@ namespace Umbraco.Tests.Services.Importing { return ResourceManager.GetString("Dictionary_Package", resourceCulture); } } - + /// /// Looks up a localized string similar to <?xml version="1.0" encoding="UTF-8" standalone="no"?> ///<umbPackage> @@ -195,7 +195,7 @@ namespace Umbraco.Tests.Services.Importing { return ResourceManager.GetString("Fanoe_Package", resourceCulture); } } - + /// /// Looks up a localized string similar to <?xml version="1.0" encoding="UTF-8" standalone="no"?> ///<umbPackage> @@ -220,7 +220,7 @@ namespace Umbraco.Tests.Services.Importing { return ResourceManager.GetString("InheritedDocTypes_Package", resourceCulture); } } - + /// /// Looks up a localized string similar to <?xml version="1.0" encoding="utf-8" ?> ///<DocumentType> @@ -248,7 +248,7 @@ namespace Umbraco.Tests.Services.Importing { return ResourceManager.GetString("SingleDocType", resourceCulture); } } - + /// /// Looks up a localized string similar to <?xml version="1.0" encoding="UTF-8" standalone="no"?> ///<umbPackage> @@ -275,7 +275,7 @@ namespace Umbraco.Tests.Services.Importing { return ResourceManager.GetString("StandardMvc_Package", resourceCulture); } } - + /// /// Looks up a localized string similar to <?xml version="1.0" encoding="UTF-8" standalone="no"?> ///<umbPackage> @@ -301,7 +301,7 @@ namespace Umbraco.Tests.Services.Importing { return ResourceManager.GetString("TemplateOnly_Package", resourceCulture); } } - + /// /// Looks up a localized string similar to <?xml version="1.0" encoding="UTF-8" standalone="no"?> ///<umbPackage> @@ -327,7 +327,7 @@ namespace Umbraco.Tests.Services.Importing { return ResourceManager.GetString("TemplateOnly_Updated_Package", resourceCulture); } } - + /// /// Looks up a localized string similar to <?xml version="1.0" encoding="UTF-8" standalone="no"?> ///<umbPackage> @@ -352,7 +352,7 @@ namespace Umbraco.Tests.Services.Importing { return ResourceManager.GetString("uBlogsy_Package", resourceCulture); } } - + /// /// Looks up a localized string similar to <?xml version="1.0" encoding="UTF-8" standalone="no"?> ///<umbPackage> diff --git a/src/Umbraco.Tests/Services/Importing/PackageImportTests.cs b/src/Umbraco.Tests/Services/Importing/PackageImportTests.cs index 481924f122..bbb1ac1f53 100644 --- a/src/Umbraco.Tests/Services/Importing/PackageImportTests.cs +++ b/src/Umbraco.Tests/Services/Importing/PackageImportTests.cs @@ -282,14 +282,14 @@ namespace Umbraco.Tests.Services.Importing Assert.That(contents.Any(), Is.True); Assert.That(contents.Count(), Is.EqualTo(numberOfDocs)); } - + [Test] public void PackagingService_Can_Import_CheckboxList_Content_Package_Xml_With_Property_Editor_Aliases() { AssertCheckBoxListTests(ImportResources.CheckboxList_Content_Package); } - + private void AssertCheckBoxListTests(string strXml) { @@ -426,7 +426,7 @@ namespace Umbraco.Tests.Services.Importing var templates = packagingService.ImportTemplates(templateElement); var templatesAfterUpdate = packagingService.ImportTemplates(templateElementUpdated); var allTemplates = fileService.GetTemplates(); - + // Assert Assert.That(templates.Any(), Is.True); Assert.That(templates.Count(), Is.EqualTo(numberOfTemplates)); @@ -480,7 +480,7 @@ namespace Umbraco.Tests.Services.Importing var parentDictionaryItem = ServiceContext.LocalizationService.GetDictionaryItemByKey(parentKey); var childDictionaryItem = ServiceContext.LocalizationService.GetDictionaryItemByKey(childKey); - + Assert.That(parentDictionaryItem.ParentId, Is.Not.EqualTo(childDictionaryItem.ParentId)); Assert.That(childDictionaryItem.ParentId, Is.EqualTo(parentDictionaryItem.Key)); } @@ -703,4 +703,4 @@ namespace Umbraco.Tests.Services.Importing ); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Services/LocalizationServiceTests.cs b/src/Umbraco.Tests/Services/LocalizationServiceTests.cs index 5d2e8ab4a8..b7f958cb8e 100644 --- a/src/Umbraco.Tests/Services/LocalizationServiceTests.cs +++ b/src/Umbraco.Tests/Services/LocalizationServiceTests.cs @@ -242,9 +242,9 @@ namespace Umbraco.Tests.Services Assert.Greater(allLangs.Count(), 0); foreach (var language in allLangs) { - Assert.AreEqual("Hellooooo", item.Translations.Single(x => x.Language.CultureName == language.CultureName).Value); + Assert.AreEqual("Hellooooo", item.Translations.Single(x => x.Language.CultureName == language.CultureName).Value); } - + } [Test] @@ -325,11 +325,11 @@ namespace Umbraco.Tests.Services { // Arrange var localizationService = ServiceContext.LocalizationService; - + // Act var languages = localizationService.GetAllLanguages(); - // Assert + // Assert Assert.That(3, Is.EqualTo(languages.Count())); } @@ -415,4 +415,4 @@ namespace Umbraco.Tests.Services } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Services/LocalizedTextServiceTests.cs b/src/Umbraco.Tests/Services/LocalizedTextServiceTests.cs index ea8c6d7855..ec15f9298b 100644 --- a/src/Umbraco.Tests/Services/LocalizedTextServiceTests.cs +++ b/src/Umbraco.Tests/Services/LocalizedTextServiceTests.cs @@ -249,7 +249,7 @@ namespace Umbraco.Tests.Services { culture, new Lazy(() => new XDocument( new XElement("area", new XAttribute("alias", "testArea"), - new XElement("key", new XAttribute("alias", "testKey"), + new XElement("key", new XAttribute("alias", "testKey"), "testValue")))) } }, Mock.Of()); @@ -269,7 +269,7 @@ namespace Umbraco.Tests.Services { culture, new Lazy(() => new XDocument( new XElement("area", new XAttribute("alias", "testArea"), - new XElement("key", new XAttribute("alias", "testKey"), + new XElement("key", new XAttribute("alias", "testKey"), "testValue")))) } }, Mock.Of()); @@ -289,7 +289,7 @@ namespace Umbraco.Tests.Services { culture, new Lazy(() => new XDocument( new XElement("area", new XAttribute("alias", "testArea"), - new XElement("key", new XAttribute("alias", "testKey"), + new XElement("key", new XAttribute("alias", "testKey"), "testValue")))) } }, Mock.Of()); @@ -310,7 +310,7 @@ namespace Umbraco.Tests.Services { culture, new Lazy(() => new XDocument( new XElement("area", new XAttribute("alias", "testArea"), - new XElement("key", new XAttribute("alias", "testKey"), + new XElement("key", new XAttribute("alias", "testKey"), "testValue")))) } }, Mock.Of()); @@ -330,7 +330,7 @@ namespace Umbraco.Tests.Services { culture, new Lazy(() => new XDocument( new XElement("area", new XAttribute("alias", "testArea"), - new XElement("key", new XAttribute("alias", "testKey"), + new XElement("key", new XAttribute("alias", "testKey"), "Hello %0%, you are such a %1% %2%")))) } }, Mock.Of()); @@ -374,7 +374,7 @@ namespace Umbraco.Tests.Services { culture, new Lazy(() => new XDocument( new XElement("area", new XAttribute("alias", "testArea"), - new XElement("key", new XAttribute("alias", "testKey"), + new XElement("key", new XAttribute("alias", "testKey"), "testValue")))) } }, Mock.Of()); diff --git a/src/Umbraco.Tests/Services/MacroServiceTests.cs b/src/Umbraco.Tests/Services/MacroServiceTests.cs index 968c085d6b..18fa688fbf 100644 --- a/src/Umbraco.Tests/Services/MacroServiceTests.cs +++ b/src/Umbraco.Tests/Services/MacroServiceTests.cs @@ -269,4 +269,4 @@ namespace Umbraco.Tests.Services //} } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Services/MediaServiceTests.cs b/src/Umbraco.Tests/Services/MediaServiceTests.cs index 68f3c992b2..01643c6c60 100644 --- a/src/Umbraco.Tests/Services/MediaServiceTests.cs +++ b/src/Umbraco.Tests/Services/MediaServiceTests.cs @@ -122,7 +122,7 @@ namespace Umbraco.Tests.Services mediaService.Save(media); using (var uow = UowProvider.CreateUnitOfWork()) - { + { Assert.IsTrue(uow.Database.Exists(media.Id)); } } @@ -139,7 +139,7 @@ namespace Umbraco.Tests.Services var mediaPath = "/media/test-image.png"; var resolvedMedia = mediaService.GetMediaByPath(mediaPath); - + Assert.IsNotNull(resolvedMedia); Assert.That(resolvedMedia.GetValue(Constants.Conventions.Media.File).ToString() == mediaPath); } @@ -231,22 +231,22 @@ namespace Umbraco.Tests.Services var folderMediaType = ServiceContext.MediaTypeService.Get(1031); var folder = MockedMedia.CreateMediaFolder(folderMediaType, -1); ServiceContext.MediaService.Save(folder); - + //Create and Save folder-Media -> 1051 var folder2 = MockedMedia.CreateMediaFolder(folderMediaType, -1); ServiceContext.MediaService.Save(folder2); - + //Create and Save image-Media -> 1052 var imageMediaType = ServiceContext.MediaTypeService.Get(1032); var image = (Media)MockedMedia.CreateMediaImage(imageMediaType, 1050); ServiceContext.MediaService.Save(image); - + //Create and Save folder-Media that is trashed -> 1053 var folderTrashed = (Media)MockedMedia.CreateMediaFolder(folderMediaType, -21); folderTrashed.Trashed = true; ServiceContext.MediaService.Save(folderTrashed); - - //Create and Save image-Media child of folderTrashed -> 1054 + + //Create and Save image-Media child of folderTrashed -> 1054 var imageTrashed = (Media)MockedMedia.CreateMediaImage(imageMediaType, folderTrashed.Id); imageTrashed.Trashed = true; ServiceContext.MediaService.Save(imageTrashed); diff --git a/src/Umbraco.Tests/Services/MemberServiceTests.cs b/src/Umbraco.Tests/Services/MemberServiceTests.cs index aec7780e82..a5f48e348c 100644 --- a/src/Umbraco.Tests/Services/MemberServiceTests.cs +++ b/src/Umbraco.Tests/Services/MemberServiceTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using NPoco; @@ -1140,4 +1140,4 @@ namespace Umbraco.Tests.Services } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Services/MemberTypeServiceTests.cs b/src/Umbraco.Tests/Services/MemberTypeServiceTests.cs index cc5c127128..8e7166a81b 100644 --- a/src/Umbraco.Tests/Services/MemberTypeServiceTests.cs +++ b/src/Umbraco.Tests/Services/MemberTypeServiceTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using NUnit.Framework; @@ -454,4 +454,4 @@ namespace Umbraco.Tests.Services // return list; //} } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Services/PackagingServiceTests.cs b/src/Umbraco.Tests/Services/PackagingServiceTests.cs index 5804478455..dbe2f9a8cb 100644 --- a/src/Umbraco.Tests/Services/PackagingServiceTests.cs +++ b/src/Umbraco.Tests/Services/PackagingServiceTests.cs @@ -148,4 +148,4 @@ namespace Umbraco.Tests.Services ServiceContext.LocalizationService.Save(childItem); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Services/PerformanceTests.cs b/src/Umbraco.Tests/Services/PerformanceTests.cs index da9e9f95bc..51f6d4c920 100644 --- a/src/Umbraco.Tests/Services/PerformanceTests.cs +++ b/src/Umbraco.Tests/Services/PerformanceTests.cs @@ -18,7 +18,7 @@ using Umbraco.Tests.Testing; namespace Umbraco.Tests.Services { - /// + /// /// Tests covering all methods in the ContentService class. /// This is more of an integration test as it involves multiple layers /// as well as configuration. @@ -48,11 +48,11 @@ namespace Umbraco.Tests.Services { } - [TearDown] - public override void TearDown() - { - base.TearDown(); - } + [TearDown] + public override void TearDown() + { + base.TearDown(); + } private static ProfilingLogger GetTestProfilingLogger() { @@ -358,4 +358,4 @@ namespace Umbraco.Tests.Services "; } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Services/PreValueConverterTests.cs b/src/Umbraco.Tests/Services/PreValueConverterTests.cs index b4eb34ee9f..21c989150d 100644 --- a/src/Umbraco.Tests/Services/PreValueConverterTests.cs +++ b/src/Umbraco.Tests/Services/PreValueConverterTests.cs @@ -89,4 +89,4 @@ namespace Umbraco.Tests.Services } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Services/PublicAccessServiceTests.cs b/src/Umbraco.Tests/Services/PublicAccessServiceTests.cs index 4b1b763546..deb3cd187a 100644 --- a/src/Umbraco.Tests/Services/PublicAccessServiceTests.cs +++ b/src/Umbraco.Tests/Services/PublicAccessServiceTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using NUnit.Framework; using Umbraco.Core.Models; @@ -73,7 +73,7 @@ namespace Umbraco.Tests.Services //re-get entry = publicAccessService.GetEntryForContent(c); - // Assert + // Assert Assert.IsTrue(updated.Success); Assert.AreEqual(OperationStatusType.Success, updated.Result.StatusType); Assert.AreEqual(2, entry.Rules.Count()); @@ -107,7 +107,7 @@ namespace Umbraco.Tests.Services //re-get entry = publicAccessService.GetEntryForContent(c); - // Assert + // Assert Assert.IsTrue(updated1.Success); Assert.IsTrue(updated2.Success); Assert.AreEqual(OperationStatusType.Success, updated1.Result.StatusType); @@ -139,14 +139,14 @@ namespace Umbraco.Tests.Services RuleValue = "TestValue2" }, }); - publicAccessService.Save(entry); + publicAccessService.Save(entry); // Act var removed = publicAccessService.RemoveRule(c, "TestType", "TestValue1"); //re-get entry = publicAccessService.GetEntryForContent(c); - // Assert + // Assert Assert.IsTrue(removed.Success); Assert.AreEqual(OperationStatusType.Success, removed.Result.StatusType); Assert.AreEqual(1, entry.Rules.Count()); @@ -154,4 +154,4 @@ namespace Umbraco.Tests.Services } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Services/RelationServiceTests.cs b/src/Umbraco.Tests/Services/RelationServiceTests.cs index c4ae8023ec..4f22f7eda1 100644 --- a/src/Umbraco.Tests/Services/RelationServiceTests.cs +++ b/src/Umbraco.Tests/Services/RelationServiceTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using NUnit.Framework; using Umbraco.Core; using Umbraco.Core.Models; @@ -22,4 +22,4 @@ namespace Umbraco.Tests.Services Assert.AreEqual(rt.Name, "repeatedEventOccurence"); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Services/TagServiceTests.cs b/src/Umbraco.Tests/Services/TagServiceTests.cs index 6084ee985b..9426dc96ee 100644 --- a/src/Umbraco.Tests/Services/TagServiceTests.cs +++ b/src/Umbraco.Tests/Services/TagServiceTests.cs @@ -43,7 +43,7 @@ namespace Umbraco.Tests.Services content3.SetTags("tags", new[] { "cow" }, true); contentService.Publish(content3); - // Act + // Act var tags = tagService.GetAllContentTags() .OrderByDescending(x => x.NodeCount) .ToList(); @@ -58,4 +58,4 @@ namespace Umbraco.Tests.Services Assert.AreEqual(1, tags[2].NodeCount); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Services/TestWithSomeContentBase.cs b/src/Umbraco.Tests/Services/TestWithSomeContentBase.cs index 41c63c3ead..afdbeb7c5d 100644 --- a/src/Umbraco.Tests/Services/TestWithSomeContentBase.cs +++ b/src/Umbraco.Tests/Services/TestWithSomeContentBase.cs @@ -1,4 +1,4 @@ -using System; +using System; using NUnit.Framework; using Umbraco.Core.Models; using Umbraco.Tests.TestHelpers; @@ -6,43 +6,43 @@ using Umbraco.Tests.TestHelpers.Entities; namespace Umbraco.Tests.Services { - [TestFixture, RequiresSTA] - public abstract class TestWithSomeContentBase : TestWithDatabaseBase - { - public override void SetUp() - { + [TestFixture, RequiresSTA] + public abstract class TestWithSomeContentBase : TestWithDatabaseBase + { + public override void SetUp() + { base.SetUp(); CreateTestData(); } public virtual void CreateTestData() - { - //NOTE Maybe not the best way to create/save test data as we are using the services, which are being tested. + { + //NOTE Maybe not the best way to create/save test data as we are using the services, which are being tested. - //Create and Save ContentType "umbTextpage" -> 1060 - ContentType contentType = MockedContentTypes.CreateSimpleContentType("umbTextpage", "Textpage"); - contentType.Key = new Guid("1D3A8E6E-2EA9-4CC1-B229-1AEE19821522"); - ServiceContext.ContentTypeService.Save(contentType); + //Create and Save ContentType "umbTextpage" -> 1060 + ContentType contentType = MockedContentTypes.CreateSimpleContentType("umbTextpage", "Textpage"); + contentType.Key = new Guid("1D3A8E6E-2EA9-4CC1-B229-1AEE19821522"); + ServiceContext.ContentTypeService.Save(contentType); - //Create and Save Content "Homepage" based on "umbTextpage" -> 1061 - Content textpage = MockedContent.CreateSimpleContent(contentType); - textpage.Key = new Guid("B58B3AD4-62C2-4E27-B1BE-837BD7C533E0"); - ServiceContext.ContentService.Save(textpage, 0); + //Create and Save Content "Homepage" based on "umbTextpage" -> 1061 + Content textpage = MockedContent.CreateSimpleContent(contentType); + textpage.Key = new Guid("B58B3AD4-62C2-4E27-B1BE-837BD7C533E0"); + ServiceContext.ContentService.Save(textpage, 0); - //Create and Save Content "Text Page 1" based on "umbTextpage" -> 1062 - Content subpage = MockedContent.CreateSimpleContent(contentType, "Text Page 1", textpage.Id); - subpage.ReleaseDate = DateTime.Now.AddMinutes(-5); + //Create and Save Content "Text Page 1" based on "umbTextpage" -> 1062 + Content subpage = MockedContent.CreateSimpleContent(contentType, "Text Page 1", textpage.Id); + subpage.ReleaseDate = DateTime.Now.AddMinutes(-5); subpage.ChangePublishedState(PublishedState.Saving); - ServiceContext.ContentService.Save(subpage, 0); + ServiceContext.ContentService.Save(subpage, 0); - //Create and Save Content "Text Page 1" based on "umbTextpage" -> 1063 - Content subpage2 = MockedContent.CreateSimpleContent(contentType, "Text Page 2", textpage.Id); - ServiceContext.ContentService.Save(subpage2, 0); + //Create and Save Content "Text Page 1" based on "umbTextpage" -> 1063 + Content subpage2 = MockedContent.CreateSimpleContent(contentType, "Text Page 2", textpage.Id); + ServiceContext.ContentService.Save(subpage2, 0); - //Create and Save Content "Text Page Deleted" based on "umbTextpage" -> 1064 - Content trashed = MockedContent.CreateSimpleContent(contentType, "Text Page Deleted", -20); - trashed.Trashed = true; - ServiceContext.ContentService.Save(trashed, 0); + //Create and Save Content "Text Page Deleted" based on "umbTextpage" -> 1064 + Content trashed = MockedContent.CreateSimpleContent(contentType, "Text Page Deleted", -20); + trashed.Trashed = true; + ServiceContext.ContentService.Save(trashed, 0); } - } -} \ No newline at end of file + } +} diff --git a/src/Umbraco.Tests/Services/ThreadSafetyServiceTest.cs b/src/Umbraco.Tests/Services/ThreadSafetyServiceTest.cs index 62b507a7ca..5198f8cd67 100644 --- a/src/Umbraco.Tests/Services/ThreadSafetyServiceTest.cs +++ b/src/Umbraco.Tests/Services/ThreadSafetyServiceTest.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; @@ -25,15 +25,15 @@ namespace Umbraco.Tests.Services // as I could not figure out _why_ and it does not look like we are // causing it, getting into __sysObjects locks, no idea why - [TestFixture, RequiresSTA] + [TestFixture, RequiresSTA] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] public class ThreadSafetyServiceTest : TestWithDatabaseBase - { - public override void SetUp() - { - base.SetUp(); - CreateTestData(); - } + { + public override void SetUp() + { + base.SetUp(); + CreateTestData(); + } // not sure this is doing anything really protected override string GetDbConnectionString() @@ -45,60 +45,60 @@ namespace Umbraco.Tests.Services private const int MaxThreadCount = 20; private void Save(ContentService service, IContent content) - { - using (var scope = ScopeProvider.CreateScope()) - { - scope.Database.Execute("SET LOCK_TIMEOUT 60000"); - service.Save(content); - scope.Complete(); - } + { + using (var scope = ScopeProvider.CreateScope()) + { + scope.Database.Execute("SET LOCK_TIMEOUT 60000"); + service.Save(content); + scope.Complete(); + } } - private void Save(MediaService service, IMedia media) - { - using (var scope = ScopeProvider.CreateScope()) - { - scope.Database.Execute("SET LOCK_TIMEOUT 60000"); - service.Save(media); - scope.Complete(); - } - } + private void Save(MediaService service, IMedia media) + { + using (var scope = ScopeProvider.CreateScope()) + { + scope.Database.Execute("SET LOCK_TIMEOUT 60000"); + service.Save(media); + scope.Complete(); + } + } - private ManualResetEventSlim TraceLocks() - { - var done = new ManualResetEventSlim(false); + private ManualResetEventSlim TraceLocks() + { + var done = new ManualResetEventSlim(false); // comment out to trace locks - return done; + return done; - new Thread(() => - { + new Thread(() => + { using (var scope = ScopeProvider.CreateScope()) - while (done.IsSet == false) - { - var db = scope.Database; - var info = db.Query("SELECT * FROM sys.lock_information;"); - Console.WriteLine("LOCKS:"); - foreach (var row in info) - { - Console.WriteLine("> " + row.request_spid + " " + row.resource_type + " " + row.resource_description + " " + row.request_mode + " " + row.resource_table + " " + row.resource_table_id + " " + row.request_status); - } - Thread.Sleep(50); - } - }).Start(); - return done; - } + while (done.IsSet == false) + { + var db = scope.Database; + var info = db.Query("SELECT * FROM sys.lock_information;"); + Console.WriteLine("LOCKS:"); + foreach (var row in info) + { + Console.WriteLine("> " + row.request_spid + " " + row.resource_type + " " + row.resource_description + " " + row.request_mode + " " + row.resource_table + " " + row.resource_table_id + " " + row.request_status); + } + Thread.Sleep(50); + } + }).Start(); + return done; + } - [Test] - public void Ensure_All_Threads_Execute_Successfully_Content_Service() - { + [Test] + public void Ensure_All_Threads_Execute_Successfully_Content_Service() + { if (Environment.GetEnvironmentVariable("UMBRACO_TMP") != null) Assert.Ignore("Do not run on VSTS."); - // the ServiceContext in that each repository in a service (i.e. ContentService) is a singleton - var contentService = (ContentService)ServiceContext.ContentService; + // the ServiceContext in that each repository in a service (i.e. ContentService) is a singleton + var contentService = (ContentService)ServiceContext.ContentService; - var threads = new List(); + var threads = new List(); var exceptions = new List(); Debug.WriteLine("Starting..."); @@ -106,9 +106,9 @@ namespace Umbraco.Tests.Services var done = TraceLocks(); for (var i = 0; i < MaxThreadCount; i++) - { - var t = new Thread(() => - { + { + var t = new Thread(() => + { try { Debug.WriteLine("[{0}] Running...", Thread.CurrentThread.ManagedThreadId); @@ -132,8 +132,8 @@ namespace Umbraco.Tests.Services lock (exceptions) { exceptions.Add(e); } } }); - threads.Add(t); - } + threads.Add(t); + } // start all threads Debug.WriteLine("Starting threads"); @@ -143,40 +143,40 @@ namespace Umbraco.Tests.Services Debug.WriteLine("Joining threads"); threads.ForEach(x => x.Join()); - done.Set(); + done.Set(); Debug.WriteLine("Checking exceptions"); if (exceptions.Count == 0) - { - //now look up all items, there should be 40! - var items = contentService.GetRootContent(); - Assert.AreEqual(2 * MaxThreadCount, items.Count()); - } - else - { - throw new Exception("Exceptions!", exceptions.First()); // rethrow the first one... - } - } + { + //now look up all items, there should be 40! + var items = contentService.GetRootContent(); + Assert.AreEqual(2 * MaxThreadCount, items.Count()); + } + else + { + throw new Exception("Exceptions!", exceptions.First()); // rethrow the first one... + } + } - [Test] - public void Ensure_All_Threads_Execute_Successfully_Media_Service() - { + [Test] + public void Ensure_All_Threads_Execute_Successfully_Media_Service() + { if (Environment.GetEnvironmentVariable("UMBRACO_TMP") != null) Assert.Ignore("Do not run on VSTS."); - // mimick the ServiceContext in that each repository in a service (i.e. ContentService) is a singleton - var mediaService = (MediaService)ServiceContext.MediaService; + // mimick the ServiceContext in that each repository in a service (i.e. ContentService) is a singleton + var mediaService = (MediaService)ServiceContext.MediaService; - var threads = new List(); + var threads = new List(); var exceptions = new List(); Debug.WriteLine("Starting..."); var done = TraceLocks(); - for (var i = 0; i < MaxThreadCount; i++) - { - var t = new Thread(() => - { + for (var i = 0; i < MaxThreadCount; i++) + { + var t = new Thread(() => + { try { Debug.WriteLine("[{0}] Running...", Thread.CurrentThread.ManagedThreadId); @@ -198,8 +198,8 @@ namespace Umbraco.Tests.Services lock (exceptions) { exceptions.Add(e); } } }); - threads.Add(t); - } + threads.Add(t); + } //start all threads threads.ForEach(x => x.Start()); @@ -209,25 +209,25 @@ namespace Umbraco.Tests.Services done.Set(); - if (exceptions.Count == 0) - { - // now look up all items, there should be 40! - var items = mediaService.GetRootMedia(); - Assert.AreEqual(2 * MaxThreadCount, items.Count()); - } - else - { + if (exceptions.Count == 0) + { + // now look up all items, there should be 40! + var items = mediaService.GetRootMedia(); + Assert.AreEqual(2 * MaxThreadCount, items.Count()); + } + else + { throw new Exception("Exceptions!", exceptions.First()); // rethrow the first one... } - } + } - public void CreateTestData() - { - // Create and Save ContentType "umbTextpage" -> 1045 - var contentType = MockedContentTypes.CreateSimpleContentType("umbTextpage", "Textpage"); - contentType.Key = new Guid("1D3A8E6E-2EA9-4CC1-B229-1AEE19821522"); - ServiceContext.ContentTypeService.Save(contentType); - } + public void CreateTestData() + { + // Create and Save ContentType "umbTextpage" -> 1045 + var contentType = MockedContentTypes.CreateSimpleContentType("umbTextpage", "Textpage"); + contentType.Key = new Guid("1D3A8E6E-2EA9-4CC1-B229-1AEE19821522"); + ServiceContext.ContentTypeService.Save(contentType); + } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Services/UserServiceTests.cs b/src/Umbraco.Tests/Services/UserServiceTests.cs index ca50abadff..d279f257b8 100644 --- a/src/Umbraco.Tests/Services/UserServiceTests.cs +++ b/src/Umbraco.Tests/Services/UserServiceTests.cs @@ -81,14 +81,14 @@ namespace Umbraco.Tests.Services Assert.AreEqual(2, permissions.ElementAt(1).AssignedPermissions.Count()); Assert.AreEqual(1, permissions.ElementAt(2).AssignedPermissions.Count()); } - + [Test] public void Can_Delete_User() { var userType = MockedUserType.CreateUserType(); ServiceContext.UserService.SaveUserType(userType); var user = ServiceContext.UserService.CreateUserWithIdentity("JohnDoe", "john@umbraco.io", userType); - + ServiceContext.UserService.Delete(user, true); var deleted = ServiceContext.UserService.GetUserById(user.Id); @@ -418,12 +418,12 @@ namespace Umbraco.Tests.Services [Test] public void Can_Remove_Section_From_All_Assigned_Users() - { + { var userType = ServiceContext.UserService.GetUserTypeByAlias("admin"); var user1 = ServiceContext.UserService.CreateUserWithIdentity("test1", "test1@test.com", userType); var user2 = ServiceContext.UserService.CreateUserWithIdentity("test2", "test2@test.com", userType); - + //adds some allowed sections user1.AddAllowedSection("test"); user2.AddAllowedSection("test"); diff --git a/src/Umbraco.Tests/Strings/StringExtensionsTests.cs b/src/Umbraco.Tests/Strings/StringExtensionsTests.cs index f79bba72b9..be64ecbbd6 100644 --- a/src/Umbraco.Tests/Strings/StringExtensionsTests.cs +++ b/src/Umbraco.Tests/Strings/StringExtensionsTests.cs @@ -13,13 +13,13 @@ namespace Umbraco.Tests.Strings [TestFixture] public class StringExtensionsTests : UmbracoTestBase { - public override void SetUp() - { + public override void SetUp() + { base.SetUp(); // fixme - in "compose"? Container.RegisterSingleton(_ => new MockShortStringHelper()); - } + } [Test] public void CurrentHelper() @@ -63,36 +63,36 @@ namespace Umbraco.Tests.Strings Assert.AreEqual(stripped, result); } - [TestCase("This is a string to encrypt")] - [TestCase("This is a string to encrypt\nThis is a second line")] - [TestCase(" White space is preserved ")] - [TestCase("\nWhite space is preserved\n")] - public void Encrypt_And_Decrypt(string input) - { - var encrypted = input.EncryptWithMachineKey(); - var decrypted = encrypted.DecryptWithMachineKey(); - Assert.AreNotEqual(input, encrypted); - Assert.AreEqual(input, decrypted); - } + [TestCase("This is a string to encrypt")] + [TestCase("This is a string to encrypt\nThis is a second line")] + [TestCase(" White space is preserved ")] + [TestCase("\nWhite space is preserved\n")] + public void Encrypt_And_Decrypt(string input) + { + var encrypted = input.EncryptWithMachineKey(); + var decrypted = encrypted.DecryptWithMachineKey(); + Assert.AreNotEqual(input, encrypted); + Assert.AreEqual(input, decrypted); + } - [Test()] - public void Encrypt_And_Decrypt_Long_Value() - { - // Generate a really long string - char[] chars = { 'a', 'b', 'c', '1', '2', '3', '\n' }; + [Test()] + public void Encrypt_And_Decrypt_Long_Value() + { + // Generate a really long string + char[] chars = { 'a', 'b', 'c', '1', '2', '3', '\n' }; - string valueToTest = string.Empty; + string valueToTest = string.Empty; - // Create a string 7035 chars long - for (int i = 0; i < 1005; i++) - for (int j = 0; j < chars.Length; j++) - valueToTest += chars[j].ToString(); + // Create a string 7035 chars long + for (int i = 0; i < 1005; i++) + for (int j = 0; j < chars.Length; j++) + valueToTest += chars[j].ToString(); - var encrypted = valueToTest.EncryptWithMachineKey(); - var decrypted = encrypted.DecryptWithMachineKey(); - Assert.AreNotEqual(valueToTest, encrypted); - Assert.AreEqual(valueToTest, decrypted); - } + var encrypted = valueToTest.EncryptWithMachineKey(); + var decrypted = encrypted.DecryptWithMachineKey(); + Assert.AreNotEqual(valueToTest, encrypted); + Assert.AreEqual(valueToTest, decrypted); + } [TestCase("Hello this is my string", " string", "Hello this is my")] [TestCase("Hello this is my string strung", " string", "Hello this is my string strung")] diff --git a/src/Umbraco.Tests/Strings/StringValidationTests.cs b/src/Umbraco.Tests/Strings/StringValidationTests.cs index b38c99a610..710042b188 100644 --- a/src/Umbraco.Tests/Strings/StringValidationTests.cs +++ b/src/Umbraco.Tests/Strings/StringValidationTests.cs @@ -1,4 +1,4 @@ -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; using NUnit.Framework; using Umbraco.Tests.TestHelpers; using Umbraco.Tests.Testing; @@ -27,4 +27,4 @@ namespace Umbraco.Tests.Strings } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Strings/StylesheetHelperTests.cs b/src/Umbraco.Tests/Strings/StylesheetHelperTests.cs index ef046c1a94..c2e17c7755 100644 --- a/src/Umbraco.Tests/Strings/StylesheetHelperTests.cs +++ b/src/Umbraco.Tests/Strings/StylesheetHelperTests.cs @@ -67,18 +67,18 @@ p { [TestCase("Test", "p", @"font-size: 1em; color:red; font-weight:bold; -text-align:left;", @"/** umb_name: Test */ p { font-size: 1em; +text-align:left;", @"/** umb_name: Test */ p { font-size: 1em; color:red; font-weight:bold; -text-align:left; +text-align:left; }")] // All on one line with no spaces [TestCase("Test", "p", "font-size: 1em;", @"/**UMB_NAME:Test*/p{font-size: 1em;}")] // Has a name with spaces - [TestCase("Hello world", "p", "font-size: 1em;", @"/**UMB_NAME:Hello world */p{font-size: 1em;}")] + [TestCase("Hello world", "p", "font-size: 1em;", @"/**UMB_NAME:Hello world */p{font-size: 1em;}")] // Every part on a new line - [TestCase("Test", "p", "font-size: 1em;", @"/** + [TestCase("Test", "p", "font-size: 1em;", @"/** umb_name: Test */ @@ -88,7 +88,7 @@ font-size: 1em; }")] public void ParseRules_Parses(string name, string selector, string styles, string css) { - + // Act var results = StylesheetHelper.ParseRules(css); @@ -119,12 +119,12 @@ p, h2 //Only a single asterisk [TestCase("/* umb_name: Test */ p { font-size: 1em; }")] // Has a name with spaces over multiple lines - [TestCase(@"/**UMB_NAME:Hello + [TestCase(@"/**UMB_NAME:Hello world */p{font-size: 1em;}")] public void ParseRules_DoesntParse(string css) { - + // Act var results = StylesheetHelper.ParseRules(css); diff --git a/src/Umbraco.Tests/Templates/MasterPageHelperTests.cs b/src/Umbraco.Tests/Templates/MasterPageHelperTests.cs index ce369f7ea6..0adf29670d 100644 --- a/src/Umbraco.Tests/Templates/MasterPageHelperTests.cs +++ b/src/Umbraco.Tests/Templates/MasterPageHelperTests.cs @@ -3,19 +3,19 @@ using Umbraco.Core.IO; namespace Umbraco.Tests.Templates { - [TestFixture] - public class MasterPageHelperTests - { + [TestFixture] + public class MasterPageHelperTests + { - [TestCase(@"<%@ master language=""C#"" masterpagefile=""~/masterpages/umbMaster.master"" autoeventwireup=""true"" %>")] - [TestCase(@"<%@ Master language=""C#"" masterpagefile=""~/masterpages/umbMaster.master"" autoeventwireup=""true"" %>")] - [TestCase(@"<%@Master language=""C#"" masterpagefile=""~/masterpages/umbMaster.master"" autoeventwireup=""true"" %>")] - [TestCase(@"<%@ Master language=""C#"" masterpagefile=""~/masterpages/umbMaster.master"" autoeventwireup=""true"" %>")] - [TestCase(@"<%@master language=""C#"" masterpagefile=""~/masterpages/umbMaster.master"" autoeventwireup=""true"" %>")] - public void IsMasterPageSyntax(string design) - { - Assert.IsTrue(MasterPageHelper.IsMasterPageSyntax(design)); - } + [TestCase(@"<%@ master language=""C#"" masterpagefile=""~/masterpages/umbMaster.master"" autoeventwireup=""true"" %>")] + [TestCase(@"<%@ Master language=""C#"" masterpagefile=""~/masterpages/umbMaster.master"" autoeventwireup=""true"" %>")] + [TestCase(@"<%@Master language=""C#"" masterpagefile=""~/masterpages/umbMaster.master"" autoeventwireup=""true"" %>")] + [TestCase(@"<%@ Master language=""C#"" masterpagefile=""~/masterpages/umbMaster.master"" autoeventwireup=""true"" %>")] + [TestCase(@"<%@master language=""C#"" masterpagefile=""~/masterpages/umbMaster.master"" autoeventwireup=""true"" %>")] + public void IsMasterPageSyntax(string design) + { + Assert.IsTrue(MasterPageHelper.IsMasterPageSyntax(design)); + } - } + } } diff --git a/src/Umbraco.Tests/TestHelpers/BaseUsingSqlCeSyntax.cs b/src/Umbraco.Tests/TestHelpers/BaseUsingSqlCeSyntax.cs index 3546911ba6..f631ccbf38 100644 --- a/src/Umbraco.Tests/TestHelpers/BaseUsingSqlCeSyntax.cs +++ b/src/Umbraco.Tests/TestHelpers/BaseUsingSqlCeSyntax.cs @@ -65,4 +65,4 @@ namespace Umbraco.Tests.TestHelpers Current.Reset(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/TestHelpers/BaseWebTest.cs b/src/Umbraco.Tests/TestHelpers/BaseWebTest.cs index c3650314ef..9af5fa1801 100644 --- a/src/Umbraco.Tests/TestHelpers/BaseWebTest.cs +++ b/src/Umbraco.Tests/TestHelpers/BaseWebTest.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using LightInject; using Moq; @@ -36,28 +36,28 @@ namespace Umbraco.Tests.TestHelpers ]> - - - - 1 - - This is some content]]> - - - - - - - - - - - - - - - - + + + + 1 + + This is some content]]> + + + + + + + + + + + + + + + + "; } diff --git a/src/Umbraco.Tests/TestHelpers/Entities/MockedContent.cs b/src/Umbraco.Tests/TestHelpers/Entities/MockedContent.cs index 96826e47f6..285b36dbba 100644 --- a/src/Umbraco.Tests/TestHelpers/Entities/MockedContent.cs +++ b/src/Umbraco.Tests/TestHelpers/Entities/MockedContent.cs @@ -51,23 +51,23 @@ namespace Umbraco.Tests.TestHelpers.Entities return content; } - public static Content CreateSimpleContent(IContentType contentType, string name, IContent parent) - { - var content = new Content(name, parent, contentType) { CreatorId = 0, WriterId = 0 }; - object obj = - new - { - title = name + " Subpage", - bodyText = "This is a subpage", - author = "John Doe" - }; + public static Content CreateSimpleContent(IContentType contentType, string name, IContent parent) + { + var content = new Content(name, parent, contentType) { CreatorId = 0, WriterId = 0 }; + object obj = + new + { + title = name + " Subpage", + bodyText = "This is a subpage", + author = "John Doe" + }; - content.PropertyValues(obj); + content.PropertyValues(obj); content.ResetDirtyProperties(false); - return content; - } + return content; + } public static Content CreateTextpageContent(IContentType contentType, string name, int parentId) { @@ -159,4 +159,4 @@ namespace Umbraco.Tests.TestHelpers.Entities return list; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/TestHelpers/Entities/MockedContentTypes.cs b/src/Umbraco.Tests/TestHelpers/Entities/MockedContentTypes.cs index 5707b8eb5b..e225b1ae10 100644 --- a/src/Umbraco.Tests/TestHelpers/Entities/MockedContentTypes.cs +++ b/src/Umbraco.Tests/TestHelpers/Entities/MockedContentTypes.cs @@ -182,19 +182,19 @@ namespace Umbraco.Tests.TestHelpers.Entities } public static ContentType CreateSimpleContentType(string alias, string name, IContentType parent = null, bool randomizeAliases = false, string propertyGroupName = "Content") - { - var contentType = parent == null ? new ContentType(-1) : new ContentType(parent, alias); + { + var contentType = parent == null ? new ContentType(-1) : new ContentType(parent, alias); - contentType.Alias = alias; - contentType.Name = name; - contentType.Description = "ContentType used for simple text pages"; - contentType.Icon = ".sprTreeDoc3"; - contentType.Thumbnail = "doc2.png"; - contentType.SortOrder = 1; - contentType.CreatorId = 0; - contentType.Trashed = false; - - var contentCollection = new PropertyTypeCollection(); + contentType.Alias = alias; + contentType.Name = name; + contentType.Description = "ContentType used for simple text pages"; + contentType.Icon = ".sprTreeDoc3"; + contentType.Thumbnail = "doc2.png"; + contentType.SortOrder = 1; + contentType.CreatorId = 0; + contentType.Trashed = false; + + var contentCollection = new PropertyTypeCollection(); contentCollection.Add(new PropertyType(Constants.PropertyEditors.TextboxAlias, DataTypeDatabaseType.Ntext) { Alias = RandomAlias("title", randomizeAliases), Name = "Title", Description = "", Mandatory = false, SortOrder = 1, DataTypeDefinitionId = -88 }); contentCollection.Add(new PropertyType(Constants.PropertyEditors.TinyMCEAlias, DataTypeDatabaseType.Ntext) { Alias = RandomAlias("bodyText", randomizeAliases), Name = "Body Text", Description = "", Mandatory = false, SortOrder = 2, DataTypeDefinitionId = -87 }); contentCollection.Add(new PropertyType(Constants.PropertyEditors.TextboxAlias, DataTypeDatabaseType.Ntext) { Alias = RandomAlias("author", randomizeAliases) , Name = "Author", Description = "Name of the author", Mandatory = false, SortOrder = 3, DataTypeDefinitionId = -88 }); @@ -207,8 +207,8 @@ namespace Umbraco.Tests.TestHelpers.Entities contentType.SetDefaultTemplate(new Template("Textpage", "textpage")); - return contentType; - } + return contentType; + } public static MediaType CreateSimpleMediaType(string alias, string name, IMediaType parent = null, bool randomizeAliases = false, string propertyGroupName = "Content") { @@ -236,7 +236,7 @@ namespace Umbraco.Tests.TestHelpers.Entities return contentType; } - + public static ContentType CreateSimpleContentType(string alias, string name, bool mandatory) { var contentType = new ContentType(-1) @@ -352,7 +352,7 @@ namespace Umbraco.Tests.TestHelpers.Entities contentCollection.Add(new PropertyType(Constants.PropertyEditors.CheckBoxListAlias, DataTypeDatabaseType.Nvarchar) { Alias = "chklist", Name = "Checkbox List", Mandatory = false, SortOrder = 15, DataTypeDefinitionId = -43 }); contentCollection.Add(new PropertyType(Constants.PropertyEditors.ContentPicker2Alias, DataTypeDatabaseType.Integer) { Alias = "contentPicker", Name = "Content Picker", Mandatory = false, SortOrder = 16, DataTypeDefinitionId = 1046 }); contentCollection.Add(new PropertyType(Constants.PropertyEditors.MediaPicker2Alias, DataTypeDatabaseType.Integer) { Alias = "mediaPicker", Name = "Media Picker", Mandatory = false, SortOrder = 17, DataTypeDefinitionId = 1048 }); - contentCollection.Add(new PropertyType(Constants.PropertyEditors.MemberPicker2Alias, DataTypeDatabaseType.Integer) { Alias = "memberPicker", Name = "Member Picker", Mandatory = false, SortOrder = 18, DataTypeDefinitionId = 1047 }); + contentCollection.Add(new PropertyType(Constants.PropertyEditors.MemberPicker2Alias, DataTypeDatabaseType.Integer) { Alias = "memberPicker", Name = "Member Picker", Mandatory = false, SortOrder = 18, DataTypeDefinitionId = 1047 }); contentCollection.Add(new PropertyType(Constants.PropertyEditors.RelatedLinks2Alias, DataTypeDatabaseType.Ntext) { Alias = "relatedLinks", Name = "Related Links", Mandatory = false, SortOrder = 21, DataTypeDefinitionId = 1050 }); contentCollection.Add(new PropertyType(Constants.PropertyEditors.TagsAlias, DataTypeDatabaseType.Ntext) { Alias = "tags", Name = "Tags", Mandatory = false, SortOrder = 22, DataTypeDefinitionId = 1041 }); @@ -474,4 +474,4 @@ namespace Umbraco.Tests.TestHelpers.Entities return alias; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/TestHelpers/Entities/MockedEntity.cs b/src/Umbraco.Tests/TestHelpers/Entities/MockedEntity.cs index 4e39798ef5..d139ec398c 100644 --- a/src/Umbraco.Tests/TestHelpers/Entities/MockedEntity.cs +++ b/src/Umbraco.Tests/TestHelpers/Entities/MockedEntity.cs @@ -23,4 +23,4 @@ namespace Umbraco.Tests.TestHelpers.Entities [DataMember] public string Title { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/TestHelpers/Entities/MockedMedia.cs b/src/Umbraco.Tests/TestHelpers/Entities/MockedMedia.cs index b6dd42603f..66fdaaae73 100644 --- a/src/Umbraco.Tests/TestHelpers/Entities/MockedMedia.cs +++ b/src/Umbraco.Tests/TestHelpers/Entities/MockedMedia.cs @@ -79,4 +79,4 @@ namespace Umbraco.Tests.TestHelpers.Entities return media; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/TestHelpers/Entities/MockedMember.cs b/src/Umbraco.Tests/TestHelpers/Entities/MockedMember.cs index 7308c5c01e..0bbaea224b 100644 --- a/src/Umbraco.Tests/TestHelpers/Entities/MockedMember.cs +++ b/src/Umbraco.Tests/TestHelpers/Entities/MockedMember.cs @@ -49,11 +49,11 @@ namespace Umbraco.Tests.TestHelpers.Entities } member.ResetDirtyProperties(false); - + list.Add(member); } return list; - } + } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/TestHelpers/Entities/MockedPropertyTypes.cs b/src/Umbraco.Tests/TestHelpers/Entities/MockedPropertyTypes.cs index b60afe77c9..7635d1026c 100644 --- a/src/Umbraco.Tests/TestHelpers/Entities/MockedPropertyTypes.cs +++ b/src/Umbraco.Tests/TestHelpers/Entities/MockedPropertyTypes.cs @@ -63,4 +63,4 @@ namespace Umbraco.Tests.TestHelpers.Entities }; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/TestHelpers/Entities/MockedUser.cs b/src/Umbraco.Tests/TestHelpers/Entities/MockedUser.cs index 15d1ab76fd..bd199eaa38 100644 --- a/src/Umbraco.Tests/TestHelpers/Entities/MockedUser.cs +++ b/src/Umbraco.Tests/TestHelpers/Entities/MockedUser.cs @@ -39,7 +39,7 @@ namespace Umbraco.Tests.TestHelpers.Entities else { user.AddAllowedSection("content"); - user.AddAllowedSection("media"); + user.AddAllowedSection("media"); } return user; @@ -53,7 +53,7 @@ namespace Umbraco.Tests.TestHelpers.Entities { var name = "Member No-" + i; var user = new User(name, "test" + i + "@test.com", "test" + i, "test" + i, userType); - + if (onCreating != null) { onCreating(i, user); @@ -67,4 +67,4 @@ namespace Umbraco.Tests.TestHelpers.Entities return list; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/TestHelpers/Entities/MockedUserType.cs b/src/Umbraco.Tests/TestHelpers/Entities/MockedUserType.cs index 153ec40b20..69458e8715 100644 --- a/src/Umbraco.Tests/TestHelpers/Entities/MockedUserType.cs +++ b/src/Umbraco.Tests/TestHelpers/Entities/MockedUserType.cs @@ -14,4 +14,4 @@ namespace Umbraco.Tests.TestHelpers.Entities }; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/TestHelpers/FakeHttpContextFactory.cs b/src/Umbraco.Tests/TestHelpers/FakeHttpContextFactory.cs index d987ced4aa..fdc250e31e 100644 --- a/src/Umbraco.Tests/TestHelpers/FakeHttpContextFactory.cs +++ b/src/Umbraco.Tests/TestHelpers/FakeHttpContextFactory.cs @@ -15,91 +15,91 @@ namespace Umbraco.Tests.TestHelpers /// Creates a mock http context with supporting other contexts to test against /// public class FakeHttpContextFactory - { + { - [SecuritySafeCritical] - public FakeHttpContextFactory(Uri fullUrl) - { - CreateContext(fullUrl); - } + [SecuritySafeCritical] + public FakeHttpContextFactory(Uri fullUrl) + { + CreateContext(fullUrl); + } - [SecuritySafeCritical] - public FakeHttpContextFactory(string path) - { - if (path.StartsWith("http://") || path.StartsWith("https://")) - CreateContext(new Uri(path)); - else - CreateContext(new Uri("http://mysite" + VirtualPathUtility.ToAbsolute(path, "/"))); - } + [SecuritySafeCritical] + public FakeHttpContextFactory(string path) + { + if (path.StartsWith("http://") || path.StartsWith("https://")) + CreateContext(new Uri(path)); + else + CreateContext(new Uri("http://mysite" + VirtualPathUtility.ToAbsolute(path, "/"))); + } - [SecuritySafeCritical] - public FakeHttpContextFactory(string path, RouteData routeData) - { - if (path.StartsWith("http://") || path.StartsWith("https://")) - CreateContext(new Uri(path), routeData); - else - CreateContext(new Uri("http://mysite" + VirtualPathUtility.ToAbsolute(path, "/")), routeData); - } + [SecuritySafeCritical] + public FakeHttpContextFactory(string path, RouteData routeData) + { + if (path.StartsWith("http://") || path.StartsWith("https://")) + CreateContext(new Uri(path), routeData); + else + CreateContext(new Uri("http://mysite" + VirtualPathUtility.ToAbsolute(path, "/")), routeData); + } - public HttpContextBase HttpContext { get; private set; } - public RequestContext RequestContext { get; private set; } + public HttpContextBase HttpContext { get; private set; } + public RequestContext RequestContext { get; private set; } - /// - /// Mocks the http context to test against - /// - /// - /// - /// - private void CreateContext(Uri fullUrl, RouteData routeData = null) - { - //Request context + /// + /// Mocks the http context to test against + /// + /// + /// + /// + private void CreateContext(Uri fullUrl, RouteData routeData = null) + { + //Request context var requestContextMock = new Mock(); RequestContext = requestContextMock.Object; //Cookie collection - var cookieCollection = new HttpCookieCollection(); + var cookieCollection = new HttpCookieCollection(); cookieCollection.Add(new HttpCookie("UMB_UCONTEXT", "FBA996E7-D6BE-489B-B199-2B0F3D2DD826")); - //Request + //Request var requestMock = new Mock(); requestMock.Setup(x => x.AppRelativeCurrentExecutionFilePath).Returns("~" + fullUrl.AbsolutePath); - requestMock.Setup(x => x.PathInfo).Returns(string.Empty); + requestMock.Setup(x => x.PathInfo).Returns(string.Empty); requestMock.Setup(x => x.RawUrl).Returns(VirtualPathUtility.ToAbsolute("~" + fullUrl.AbsolutePath, "/")); requestMock.Setup(x => x.RequestContext).Returns(RequestContext); requestMock.Setup(x => x.Url).Returns(fullUrl); requestMock.Setup(x => x.ApplicationPath).Returns("/"); requestMock.Setup(x => x.Cookies).Returns(cookieCollection); requestMock.Setup(x => x.ServerVariables).Returns(new NameValueCollection()); - var queryStrings = HttpUtility.ParseQueryString(fullUrl.Query); + var queryStrings = HttpUtility.ParseQueryString(fullUrl.Query); requestMock.Setup(x => x.QueryString).Returns(queryStrings); requestMock.Setup(x => x.Form).Returns(new NameValueCollection()); - //Cache + //Cache var cacheMock = new Mock(); - //Response - //var response = new FakeHttpResponse(); + //Response + //var response = new FakeHttpResponse(); var responseMock = new Mock(); responseMock.Setup(x => x.ApplyAppPathModifier(It.IsAny())).Returns((string s) => s); responseMock.Setup(x => x.Cache).Returns(cacheMock.Object); - //Server + //Server - var serverMock = new Mock(); - serverMock.Setup(x => x.MapPath(It.IsAny())).Returns(Environment.CurrentDirectory); + var serverMock = new Mock(); + serverMock.Setup(x => x.MapPath(It.IsAny())).Returns(Environment.CurrentDirectory); //User - var user = new Mock().Object; + var user = new Mock().Object; - //HTTP Context + //HTTP Context var httpContextMock = new Mock(); httpContextMock.Setup(x => x.Cache).Returns(HttpRuntime.Cache); //note: foreach on Items should return DictionaryEntries! //httpContextMock.Setup(x => x.Items).Returns(new Dictionary()); - httpContextMock.Setup(x => x.Items).Returns(new Hashtable()); + httpContextMock.Setup(x => x.Items).Returns(new Hashtable()); httpContextMock.Setup(x => x.Request).Returns(requestMock.Object); httpContextMock.Setup(x => x.Server).Returns(serverMock.Object); httpContextMock.Setup(x => x.Response).Returns(responseMock.Object); @@ -109,13 +109,13 @@ namespace Umbraco.Tests.TestHelpers requestContextMock.Setup(x => x.HttpContext).Returns(httpContextMock.Object); - if (routeData != null) - { + if (routeData != null) + { requestContextMock.Setup(x => x.RouteData).Returns(routeData); - } - - - } + } - } + + } + + } } diff --git a/src/Umbraco.Tests/TestHelpers/NoHttpContextAccessor.cs b/src/Umbraco.Tests/TestHelpers/NoHttpContextAccessor.cs index a2ee80a113..b77f8f828c 100644 --- a/src/Umbraco.Tests/TestHelpers/NoHttpContextAccessor.cs +++ b/src/Umbraco.Tests/TestHelpers/NoHttpContextAccessor.cs @@ -7,4 +7,4 @@ namespace Umbraco.Tests.TestHelpers { public HttpContext HttpContext { get; set; } = null; } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/TestHelpers/SettingsForTests.cs b/src/Umbraco.Tests/TestHelpers/SettingsForTests.cs index 0e26ab4d50..88b5a1d70d 100644 --- a/src/Umbraco.Tests/TestHelpers/SettingsForTests.cs +++ b/src/Umbraco.Tests/TestHelpers/SettingsForTests.cs @@ -63,7 +63,7 @@ namespace Umbraco.Tests.TestHelpers settings.Setup(x => x.Content.UmbracoLibraryCacheDuration).Returns(1800); settings.Setup(x => x.WebRouting.UrlProviderMode).Returns("AutoLegacy"); settings.Setup(x => x.Templates.DefaultRenderingEngine).Returns(RenderingEngine.Mvc); - + return settings.Object; } diff --git a/src/Umbraco.Tests/TestHelpers/Stubs/TestControllerFactory.cs b/src/Umbraco.Tests/TestHelpers/Stubs/TestControllerFactory.cs index c378739ec2..5e2ce24863 100644 --- a/src/Umbraco.Tests/TestHelpers/Stubs/TestControllerFactory.cs +++ b/src/Umbraco.Tests/TestHelpers/Stubs/TestControllerFactory.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Reflection; @@ -12,60 +12,60 @@ using Umbraco.Web; namespace Umbraco.Tests.TestHelpers.Stubs { - /// - /// Used in place of the UmbracoControllerFactory which relies on BuildManager which throws exceptions in a unit test context - /// - internal class TestControllerFactory : IControllerFactory - { - private readonly UmbracoContext _umbracoContext; - private readonly ILogger _logger; + /// + /// Used in place of the UmbracoControllerFactory which relies on BuildManager which throws exceptions in a unit test context + /// + internal class TestControllerFactory : IControllerFactory + { + private readonly UmbracoContext _umbracoContext; + private readonly ILogger _logger; - public TestControllerFactory(UmbracoContext umbracoContext, ILogger logger) - { - _umbracoContext = umbracoContext; - _logger = logger; - } + public TestControllerFactory(UmbracoContext umbracoContext, ILogger logger) + { + _umbracoContext = umbracoContext; + _logger = logger; + } - public IController CreateController(RequestContext requestContext, string controllerName) - { - var types = TypeFinder.FindClassesOfType(new[] { Assembly.GetExecutingAssembly() }); + public IController CreateController(RequestContext requestContext, string controllerName) + { + var types = TypeFinder.FindClassesOfType(new[] { Assembly.GetExecutingAssembly() }); - var controllerTypes = types.Where(x => x.Name.Equals(controllerName + "Controller", StringComparison.InvariantCultureIgnoreCase)); - var t = controllerTypes.SingleOrDefault(); + var controllerTypes = types.Where(x => x.Name.Equals(controllerName + "Controller", StringComparison.InvariantCultureIgnoreCase)); + var t = controllerTypes.SingleOrDefault(); - if (t == null) - return null; + if (t == null) + return null; - var possibleParams = new object[] - { - _umbracoContext, _logger - }; - var ctors = t.GetConstructors(); - foreach (var ctor in ctors.OrderByDescending(x => x.GetParameters().Length)) - { - var args = new List(); - var allParams = ctor.GetParameters().ToArray(); - foreach (var parameter in allParams) - { - var found = possibleParams.SingleOrDefault(x => x.GetType() == parameter.ParameterType); - if (found != null) args.Add(found); - } - if (args.Count == allParams.Length) - { + var possibleParams = new object[] + { + _umbracoContext, _logger + }; + var ctors = t.GetConstructors(); + foreach (var ctor in ctors.OrderByDescending(x => x.GetParameters().Length)) + { + var args = new List(); + var allParams = ctor.GetParameters().ToArray(); + foreach (var parameter in allParams) + { + var found = possibleParams.SingleOrDefault(x => x.GetType() == parameter.ParameterType); + if (found != null) args.Add(found); + } + if (args.Count == allParams.Length) + { return Activator.CreateInstance(t, args.ToArray()) as IController; - } - } - return null; - } + } + } + return null; + } - public SessionStateBehavior GetControllerSessionBehavior(RequestContext requestContext, string controllerName) - { - return SessionStateBehavior.Disabled; - } + public SessionStateBehavior GetControllerSessionBehavior(RequestContext requestContext, string controllerName) + { + return SessionStateBehavior.Disabled; + } - public void ReleaseController(IController controller) - { - controller.DisposeIfDisposable(); - } - } -} \ No newline at end of file + public void ReleaseController(IController controller) + { + controller.DisposeIfDisposable(); + } + } +} diff --git a/src/Umbraco.Tests/TestHelpers/Stubs/TestIndexCollectionAccessor.cs b/src/Umbraco.Tests/TestHelpers/Stubs/TestIndexCollectionAccessor.cs index 3d554275b5..ec0ccbd608 100644 --- a/src/Umbraco.Tests/TestHelpers/Stubs/TestIndexCollectionAccessor.cs +++ b/src/Umbraco.Tests/TestHelpers/Stubs/TestIndexCollectionAccessor.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using Examine; using UmbracoExamine; @@ -8,4 +8,4 @@ namespace Umbraco.Tests.TestHelpers.Stubs { public IReadOnlyDictionary Indexes => new Dictionary(); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/TestHelpers/Stubs/TestLastChanceFinder.cs b/src/Umbraco.Tests/TestHelpers/Stubs/TestLastChanceFinder.cs index 14d7325c8d..56821f7884 100644 --- a/src/Umbraco.Tests/TestHelpers/Stubs/TestLastChanceFinder.cs +++ b/src/Umbraco.Tests/TestHelpers/Stubs/TestLastChanceFinder.cs @@ -1,12 +1,12 @@ -using Umbraco.Web.Routing; +using Umbraco.Web.Routing; namespace Umbraco.Tests.TestHelpers.Stubs { - internal class TestLastChanceFinder : IContentLastChanceFinder - { - public bool TryFindContent(PublishedContentRequest frequest) - { - return false; - } - } -} \ No newline at end of file + internal class TestLastChanceFinder : IContentLastChanceFinder + { + public bool TryFindContent(PublishedContentRequest frequest) + { + return false; + } + } +} diff --git a/src/Umbraco.Tests/TestHelpers/Stubs/TestProfiler.cs b/src/Umbraco.Tests/TestHelpers/Stubs/TestProfiler.cs index 13334d54cf..0ffcfb7a3f 100644 --- a/src/Umbraco.Tests/TestHelpers/Stubs/TestProfiler.cs +++ b/src/Umbraco.Tests/TestHelpers/Stubs/TestProfiler.cs @@ -1,4 +1,4 @@ -using System; +using System; using StackExchange.Profiling; using StackExchange.Profiling.SqlFormatters; using Umbraco.Core.Logging; @@ -44,4 +44,4 @@ namespace Umbraco.Tests.TestHelpers.Stubs MiniProfiler.Stop(discardResults); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/TestHelpers/Stubs/TestUmbracoContextAccessor.cs b/src/Umbraco.Tests/TestHelpers/Stubs/TestUmbracoContextAccessor.cs index dedba75cbc..eaf8912fda 100644 --- a/src/Umbraco.Tests/TestHelpers/Stubs/TestUmbracoContextAccessor.cs +++ b/src/Umbraco.Tests/TestHelpers/Stubs/TestUmbracoContextAccessor.cs @@ -1,4 +1,4 @@ -using Umbraco.Web; +using Umbraco.Web; namespace Umbraco.Tests.TestHelpers.Stubs { @@ -6,4 +6,4 @@ namespace Umbraco.Tests.TestHelpers.Stubs { public UmbracoContext UmbracoContext { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/TestHelpers/TestHelper.cs b/src/Umbraco.Tests/TestHelpers/TestHelper.cs index fec5b7f801..370e9b13d1 100644 --- a/src/Umbraco.Tests/TestHelpers/TestHelper.cs +++ b/src/Umbraco.Tests/TestHelpers/TestHelper.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; @@ -15,52 +15,52 @@ using Umbraco.Core.Models.EntityBase; namespace Umbraco.Tests.TestHelpers { /// - /// Common helper properties and methods useful to testing - /// - public static class TestHelper - { + /// Common helper properties and methods useful to testing + /// + public static class TestHelper + { - - /// - /// Gets the current assembly directory. - /// - /// The assembly directory. - static public string CurrentAssemblyDirectory - { - get - { - var codeBase = typeof(TestHelper).Assembly.CodeBase; - var uri = new Uri(codeBase); - var path = uri.LocalPath; - return Path.GetDirectoryName(path); - } - } - /// - /// Maps the given making it rooted on . must start with ~/ - /// - /// The relative path. - /// - public static string MapPathForTest(string relativePath) - { - if (!relativePath.StartsWith("~/")) - throw new ArgumentException("relativePath must start with '~/'", "relativePath"); + /// + /// Gets the current assembly directory. + /// + /// The assembly directory. + static public string CurrentAssemblyDirectory + { + get + { + var codeBase = typeof(TestHelper).Assembly.CodeBase; + var uri = new Uri(codeBase); + var path = uri.LocalPath; + return Path.GetDirectoryName(path); + } + } - return relativePath.Replace("~/", CurrentAssemblyDirectory + "/"); - } + /// + /// Maps the given making it rooted on . must start with ~/ + /// + /// The relative path. + /// + public static string MapPathForTest(string relativePath) + { + if (!relativePath.StartsWith("~/")) + throw new ArgumentException("relativePath must start with '~/'", "relativePath"); - public static void InitializeContentDirectories() + return relativePath.Replace("~/", CurrentAssemblyDirectory + "/"); + } + + public static void InitializeContentDirectories() { CreateDirectories(new[] { SystemDirectories.Masterpages, SystemDirectories.MvcViews, SystemDirectories.Media, SystemDirectories.AppPlugins }); } - public static void CleanContentDirectories() - { - CleanDirectories(new[] { SystemDirectories.Masterpages, SystemDirectories.MvcViews, SystemDirectories.Media }); - } + public static void CleanContentDirectories() + { + CleanDirectories(new[] { SystemDirectories.Masterpages, SystemDirectories.MvcViews, SystemDirectories.Media }); + } - public static void CreateDirectories(string[] directories) + public static void CreateDirectories(string[] directories) { foreach (var directory in directories) { @@ -70,13 +70,13 @@ namespace Umbraco.Tests.TestHelpers } } - public static void CleanDirectories(string[] directories) - { - var preserves = new Dictionary - { - { SystemDirectories.Masterpages, new[] {"dummy.txt"} }, - { SystemDirectories.MvcViews, new[] {"dummy.txt"} } - }; + public static void CleanDirectories(string[] directories) + { + var preserves = new Dictionary + { + { SystemDirectories.Masterpages, new[] {"dummy.txt"} }, + { SystemDirectories.MvcViews, new[] {"dummy.txt"} } + }; foreach (var directory in directories) { var directoryInfo = new DirectoryInfo(IOHelper.MapPath(directory)); @@ -86,7 +86,7 @@ namespace Umbraco.Tests.TestHelpers } } - public static void CleanUmbracoSettingsConfig() + public static void CleanUmbracoSettingsConfig() { var currDir = new DirectoryInfo(CurrentAssemblyDirectory); @@ -150,7 +150,7 @@ namespace Umbraco.Tests.TestHelpers return enumerable; } }; - } + } var actualListEx = sorter(actualList).Cast().ToList(); var expectedListEx = sorter(expectedList).Cast().ToList(); @@ -224,4 +224,4 @@ namespace Umbraco.Tests.TestHelpers } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/TestHelpers/TestObjects-Mocks.cs b/src/Umbraco.Tests/TestHelpers/TestObjects-Mocks.cs index 1f8952f5fc..9b1f14ae3d 100644 --- a/src/Umbraco.Tests/TestHelpers/TestObjects-Mocks.cs +++ b/src/Umbraco.Tests/TestHelpers/TestObjects-Mocks.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Data; using System.Data.Common; using System.Linq; @@ -176,4 +176,4 @@ namespace Umbraco.Tests.TestHelpers #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/TestHelpers/TestWithDatabaseBase.cs b/src/Umbraco.Tests/TestHelpers/TestWithDatabaseBase.cs index 73ec924617..02f3e6fe06 100644 --- a/src/Umbraco.Tests/TestHelpers/TestWithDatabaseBase.cs +++ b/src/Umbraco.Tests/TestHelpers/TestWithDatabaseBase.cs @@ -374,29 +374,29 @@ namespace Umbraco.Tests.TestHelpers ]> - - - - 1 - - This is some content]]> - - - - - - - - - - - - - - - - + + + + 1 + + This is some content]]> + + + + + + + + + + + + + + + + "; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Testing/UmbracoTestOptions.cs b/src/Umbraco.Tests/Testing/UmbracoTestOptions.cs index 9dede6ea43..3f57ac14d8 100644 --- a/src/Umbraco.Tests/Testing/UmbracoTestOptions.cs +++ b/src/Umbraco.Tests/Testing/UmbracoTestOptions.cs @@ -34,4 +34,4 @@ PerTest } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/TreesAndSections/ApplicationTreeTest.cs b/src/Umbraco.Tests/TreesAndSections/ApplicationTreeTest.cs index 01aea73e74..cba3ec9383 100644 --- a/src/Umbraco.Tests/TreesAndSections/ApplicationTreeTest.cs +++ b/src/Umbraco.Tests/TreesAndSections/ApplicationTreeTest.cs @@ -10,8 +10,8 @@ using Current = Umbraco.Web.Composing.Current; namespace Umbraco.Tests.TreesAndSections { - - + + /// ///This is a test class for ApplicationTreeTest and is intended ///to contain all ApplicationTreeTest Unit Tests @@ -46,7 +46,7 @@ namespace Umbraco.Tests.TreesAndSections if (Directory.Exists(TestHelper.MapPathForTest("~/TEMP/TreesAndSections"))) { - Directory.Delete(TestHelper.MapPathForTest("~/TEMP/TreesAndSections"), true); + Directory.Delete(TestHelper.MapPathForTest("~/TEMP/TreesAndSections"), true); } ApplicationTreeService.TreeConfigFilePath = null; SectionService.AppConfigFilePath = null; @@ -359,11 +359,11 @@ namespace Umbraco.Tests.TreesAndSections // actual = target.Type; // Assert.AreEqual(expected, actual); // Assert.Inconclusive("Verify the correctness of this test method."); - //} + //} #endregion #region Additional test attributes - // + // //You can use the following additional attributes as you write your tests: // //Use ClassInitialize to run code before running the first test in the class diff --git a/src/Umbraco.Tests/TreesAndSections/ResourceFiles.Designer.cs b/src/Umbraco.Tests/TreesAndSections/ResourceFiles.Designer.cs index c09ce53b04..3969e1a904 100644 --- a/src/Umbraco.Tests/TreesAndSections/ResourceFiles.Designer.cs +++ b/src/Umbraco.Tests/TreesAndSections/ResourceFiles.Designer.cs @@ -10,8 +10,8 @@ namespace Umbraco.Tests.TreesAndSections { using System; - - + + /// /// A strongly-typed resource class, for looking up localized strings, etc. /// @@ -23,15 +23,15 @@ namespace Umbraco.Tests.TreesAndSections { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class ResourceFiles { - + private static global::System.Resources.ResourceManager resourceMan; - + private static global::System.Globalization.CultureInfo resourceCulture; - + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal ResourceFiles() { } - + /// /// Returns the cached ResourceManager instance used by this class. /// @@ -45,7 +45,7 @@ namespace Umbraco.Tests.TreesAndSections { return resourceMan; } } - + /// /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. @@ -59,7 +59,7 @@ namespace Umbraco.Tests.TreesAndSections { resourceCulture = value; } } - + /// /// Looks up a localized string similar to <?xml version="1.0" encoding="utf-8"?> ///<applications> @@ -74,7 +74,7 @@ namespace Umbraco.Tests.TreesAndSections { return ResourceManager.GetString("applications", resourceCulture); } } - + /// /// Looks up a localized string similar to <?xml version="1.0" encoding="utf-8"?> ///<trees> diff --git a/src/Umbraco.Tests/TreesAndSections/SectionTests.cs b/src/Umbraco.Tests/TreesAndSections/SectionTests.cs index 89f21e1fe7..8030534401 100644 --- a/src/Umbraco.Tests/TreesAndSections/SectionTests.cs +++ b/src/Umbraco.Tests/TreesAndSections/SectionTests.cs @@ -64,7 +64,7 @@ namespace Umbraco.Tests.TreesAndSections { var name = Guid.NewGuid().ToString("N"); ServiceContext.SectionService.MakeNew(name, name, "icon.jpg"); - + //check if it exists var app = ServiceContext.SectionService.GetByAlias(name); Assert.IsNotNull(app); @@ -75,24 +75,24 @@ namespace Umbraco.Tests.TreesAndSections } /// - /// Creates a new user, assigns the user to existing application, + /// Creates a new user, assigns the user to existing application, /// then deletes the user /// [Test()] public void Application_Create_New_User_Assign_Application() { var name = Guid.NewGuid().ToString("N"); - + //new user var ut = ServiceContext.UserService.GetAllUserTypes().First(); var user = ServiceContext.UserService.CreateUserWithIdentity(name, name + "@example.com", ut); - + //assign the app user.AddAllowedSection(Constants.Applications.Content); ServiceContext.UserService.Save(user); //ensure it's added - Assert.AreEqual(1, user.AllowedSections.Count(x => x == Constants.Applications.Content)); + Assert.AreEqual(1, user.AllowedSections.Count(x => x == Constants.Applications.Content)); } /// @@ -118,7 +118,7 @@ namespace Umbraco.Tests.TreesAndSections ServiceContext.UserService.Save(user); //ensure it's added Assert.AreEqual(1, user.AllowedSections.Count(x => x == app.Alias)); - + } #region Tests to write @@ -158,7 +158,7 @@ namespace Umbraco.Tests.TreesAndSections // Assert.Inconclusive("A method that does not return a value cannot be verified."); //} - + ///// /////A test for MakeNew @@ -264,11 +264,11 @@ namespace Umbraco.Tests.TreesAndSections // actual = target.name; // Assert.AreEqual(expected, actual); // Assert.Inconclusive("Verify the correctness of this test method."); - //} + //} #endregion #region Additional test attributes - // + // //You can use the following additional attributes as you write your tests: // //Use ClassInitialize to run code before running the first test in the class diff --git a/src/Umbraco.Tests/UmbracoExamine/EventsTest.cs b/src/Umbraco.Tests/UmbracoExamine/EventsTest.cs index 59e1f20539..2a71e51a80 100644 --- a/src/Umbraco.Tests/UmbracoExamine/EventsTest.cs +++ b/src/Umbraco.Tests/UmbracoExamine/EventsTest.cs @@ -52,4 +52,4 @@ namespace Umbraco.Tests.UmbracoExamine } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/UmbracoExamine/ExamineBaseTest.cs b/src/Umbraco.Tests/UmbracoExamine/ExamineBaseTest.cs index 5c91208096..d078f04bc6 100644 --- a/src/Umbraco.Tests/UmbracoExamine/ExamineBaseTest.cs +++ b/src/Umbraco.Tests/UmbracoExamine/ExamineBaseTest.cs @@ -35,4 +35,4 @@ namespace Umbraco.Tests.UmbracoExamine Container.RegisterSingleton(_ => new DefaultShortStringHelper(SettingsForTests.GetDefault())); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/UmbracoExamine/ExamineDemoDataContentService.cs b/src/Umbraco.Tests/UmbracoExamine/ExamineDemoDataContentService.cs index 94d388aed3..07619fd12e 100644 --- a/src/Umbraco.Tests/UmbracoExamine/ExamineDemoDataContentService.cs +++ b/src/Umbraco.Tests/UmbracoExamine/ExamineDemoDataContentService.cs @@ -11,43 +11,43 @@ namespace Umbraco.Tests.UmbracoExamine { //TODO: This is ultra hack and still left over from legacy but still works for testing atm public class ExamineDemoDataContentService - { - public const int ProtectedNode = 1142; + { + public const int ProtectedNode = 1142; - public ExamineDemoDataContentService(string contentXml = null) - { + public ExamineDemoDataContentService(string contentXml = null) + { if (contentXml == null) { contentXml = TestFiles.umbraco; } _xContent = XDocument.Parse(contentXml); - } - - /// - /// Return the XDocument containing the xml from the umbraco.config xml file - /// - /// - /// - /// - /// This is no different in the test suite as published content - /// - public XDocument GetLatestContentByXPath(string xpath) - { - var xdoc = XDocument.Parse(""); - xdoc.Root.Add(_xContent.XPathSelectElements(xpath)); + } - return xdoc; - } + /// + /// Return the XDocument containing the xml from the umbraco.config xml file + /// + /// + /// + /// + /// This is no different in the test suite as published content + /// + public XDocument GetLatestContentByXPath(string xpath) + { + var xdoc = XDocument.Parse(""); + xdoc.Root.Add(_xContent.XPathSelectElements(xpath)); - /// - /// Return the XDocument containing the xml from the umbraco.config xml file - /// - /// - /// - public XDocument GetPublishedContentByXPath(string xpath) - { - return GetContentByXPath(xpath, _xContent); - } + return xdoc; + } + + /// + /// Return the XDocument containing the xml from the umbraco.config xml file + /// + /// + /// + public XDocument GetPublishedContentByXPath(string xpath) + { + return GetContentByXPath(xpath, _xContent); + } private XDocument GetContentByXPath(string xpath, XDocument content) { @@ -55,10 +55,10 @@ namespace Umbraco.Tests.UmbracoExamine xdoc.Root.Add(content.XPathSelectElements(xpath)); return xdoc; - } - - private readonly XDocument _xContent; + } + + private readonly XDocument _xContent; - } -} \ No newline at end of file + } +} diff --git a/src/Umbraco.Tests/UmbracoExamine/ExamineDemoDataMediaService.cs b/src/Umbraco.Tests/UmbracoExamine/ExamineDemoDataMediaService.cs index 5e691e1b43..8dcb170816 100644 --- a/src/Umbraco.Tests/UmbracoExamine/ExamineDemoDataMediaService.cs +++ b/src/Umbraco.Tests/UmbracoExamine/ExamineDemoDataMediaService.cs @@ -8,24 +8,24 @@ using System.Xml.XPath; namespace Umbraco.Tests.UmbracoExamine { //TODO: This is ultra hack and still left over from legacy but still works for testing atm - internal class ExamineDemoDataMediaService - { - public ExamineDemoDataMediaService() - { - _doc = XDocument.Parse(TestFiles.media); - } + internal class ExamineDemoDataMediaService + { + public ExamineDemoDataMediaService() + { + _doc = XDocument.Parse(TestFiles.media); + } - #region IMediaService Members + #region IMediaService Members - public XDocument GetLatestMediaByXpath(string xpath) - { - var xdoc = XDocument.Parse(""); - xdoc.Root.Add(_doc.XPathSelectElements(xpath)); - return xdoc; - } + public XDocument GetLatestMediaByXpath(string xpath) + { + var xdoc = XDocument.Parse(""); + xdoc.Root.Add(_doc.XPathSelectElements(xpath)); + return xdoc; + } - #endregion + #endregion - private readonly XDocument _doc; - } + private readonly XDocument _doc; + } } diff --git a/src/Umbraco.Tests/UmbracoExamine/IndexInitializer.cs b/src/Umbraco.Tests/UmbracoExamine/IndexInitializer.cs index 05f60dc99e..c2b519c922 100644 --- a/src/Umbraco.Tests/UmbracoExamine/IndexInitializer.cs +++ b/src/Umbraco.Tests/UmbracoExamine/IndexInitializer.cs @@ -28,14 +28,14 @@ using Version = Lucene.Net.Util.Version; namespace Umbraco.Tests.UmbracoExamine { - /// - /// Used internally by test classes to initialize a new index from the template - /// - internal static class IndexInitializer - { - public static UmbracoContentIndexer GetUmbracoIndexer( + /// + /// Used internally by test classes to initialize a new index from the template + /// + internal static class IndexInitializer + { + public static UmbracoContentIndexer GetUmbracoIndexer( ProfilingLogger profilingLogger, - Directory luceneDir, + Directory luceneDir, Analyzer analyzer = null, IContentService contentService = null, IMediaService mediaService = null, @@ -44,11 +44,11 @@ namespace Umbraco.Tests.UmbracoExamine IContentTypeService contentTypeService = null, IMediaTypeService mediaTypeService = null, UmbracoContentIndexerOptions options = null) - { - if (contentService == null) - { + { + if (contentService == null) + { long longTotalRecs; - var demoData = new ExamineDemoDataContentService(); + var demoData = new ExamineDemoDataContentService(); var allRecs = demoData.GetLatestContentByXPath("//*[@isDoc]") .Root @@ -82,10 +82,10 @@ namespace Umbraco.Tests.UmbracoExamine == allRecs); } - if (userService == null) - { - userService = Mock.Of(x => x.GetProfileById(It.IsAny()) == Mock.Of(p => p.Id == (object)0 && p.Name == "admin")); - } + if (userService == null) + { + userService = Mock.Of(x => x.GetProfileById(It.IsAny()) == Mock.Of(p => p.Id == (object)0 && p.Name == "admin")); + } if (mediaService == null) { long totalRecs; @@ -111,7 +111,7 @@ namespace Umbraco.Tests.UmbracoExamine mt.Alias == (string) x.Attribute("nodeTypeAlias") && mt.Id == (int) x.Attribute("nodeType")))) .ToArray(); - + // MOCK! var mediaServiceMock = new Mock(); @@ -131,30 +131,30 @@ namespace Umbraco.Tests.UmbracoExamine mediaService = mediaServiceMock.Object; } - + if (analyzer == null) { analyzer = new StandardAnalyzer(Version.LUCENE_30); } - //var indexSet = new IndexSet(); + //var indexSet = new IndexSet(); // var indexCriteria = indexSet.ToIndexCriteria(dataService, UmbracoContentIndexer.IndexFieldPolicies); - - //var i = new UmbracoContentIndexer(indexCriteria, - // luceneDir, //custom lucene directory + + //var i = new UmbracoContentIndexer(indexCriteria, + // luceneDir, //custom lucene directory // dataService, // contentService, // mediaService, // dataTypeService, // userService, // new[] { new DefaultUrlSegmentProvider() }, - // analyzer, - // false); + // analyzer, + // false); - //i.IndexSecondsInterval = 1; + //i.IndexSecondsInterval = 1; - if (options == null) - { + if (options == null) + { options = new UmbracoContentIndexerOptions(false, false, null); } @@ -176,45 +176,45 @@ namespace Umbraco.Tests.UmbracoExamine // .Setup(x => x.GetWhereClauses()) // .Returns(new List> { new Tuple("cmsDocument.published", new object[] { 1 }) }); var scopeProvider = new Mock(); - //scopeProvider - // .Setup(x => x.Query()) - // .Returns(query.Object); + //scopeProvider + // .Setup(x => x.Query()) + // .Returns(query.Object); - var i = new UmbracoContentIndexer( - new[] { new FieldDefinition("", FieldDefinitionTypes.FullText) }, - luceneDir, - analyzer, - profilingLogger, - contentService, - mediaService, - userService, - new[] {new DefaultUrlSegmentProvider()}, - new UmbracoContentValueSetValidator(options, Mock.Of()), - options, + var i = new UmbracoContentIndexer( + new[] { new FieldDefinition("", FieldDefinitionTypes.FullText) }, + luceneDir, + analyzer, + profilingLogger, + contentService, + mediaService, + userService, + new[] {new DefaultUrlSegmentProvider()}, + new UmbracoContentValueSetValidator(options, Mock.Of()), + options, scopeProvider.Object); - i.IndexingError += IndexingError; + i.IndexingError += IndexingError; - return i; - } - - public static LuceneSearcher GetLuceneSearcher(Directory luceneDir) - { - return new LuceneSearcher(luceneDir, new StandardAnalyzer(Version.LUCENE_29)); - } - - public static MultiIndexSearcher GetMultiSearcher(Directory pdfDir, Directory simpleDir, Directory conventionDir, Directory cwsDir) - { - var i = new MultiIndexSearcher(new[] { pdfDir, simpleDir, conventionDir, cwsDir }, new StandardAnalyzer(Version.LUCENE_29)); - return i; - } + return i; + } + + public static LuceneSearcher GetLuceneSearcher(Directory luceneDir) + { + return new LuceneSearcher(luceneDir, new StandardAnalyzer(Version.LUCENE_29)); + } + + public static MultiIndexSearcher GetMultiSearcher(Directory pdfDir, Directory simpleDir, Directory conventionDir, Directory cwsDir) + { + var i = new MultiIndexSearcher(new[] { pdfDir, simpleDir, conventionDir, cwsDir }, new StandardAnalyzer(Version.LUCENE_29)); + return i; + } - internal static void IndexingError(object sender, IndexingErrorEventArgs e) - { - throw new ApplicationException(e.Message, e.Exception); - } + internal static void IndexingError(object sender, IndexingErrorEventArgs e) + { + throw new ApplicationException(e.Message, e.Exception); + } - } -} \ No newline at end of file + } +} diff --git a/src/Umbraco.Tests/UmbracoExamine/IndexTest.cs b/src/Umbraco.Tests/UmbracoExamine/IndexTest.cs index fd6f7a1de3..8ab60a4a9f 100644 --- a/src/Umbraco.Tests/UmbracoExamine/IndexTest.cs +++ b/src/Umbraco.Tests/UmbracoExamine/IndexTest.cs @@ -18,35 +18,35 @@ namespace Umbraco.Tests.UmbracoExamine [TestFixture, RequiresSTA] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] public class IndexTest : ExamineBaseTest - { + { - [Test] - public void Rebuild_Index() - { + [Test] + public void Rebuild_Index() + { - using (var luceneDir = new RAMDirectory()) - using (var indexer = IndexInitializer.GetUmbracoIndexer(ProfilingLogger, luceneDir, options: new UmbracoContentIndexerOptions(true, false, null))) - using (var session = new ThreadScopedIndexSession(indexer.SearcherContext)) - { - var searcher = indexer.GetSearcher(); + using (var luceneDir = new RAMDirectory()) + using (var indexer = IndexInitializer.GetUmbracoIndexer(ProfilingLogger, luceneDir, options: new UmbracoContentIndexerOptions(true, false, null))) + using (var session = new ThreadScopedIndexSession(indexer.SearcherContext)) + { + var searcher = indexer.GetSearcher(); //create the whole thing indexer.RebuildIndex(); - session.WaitForChanges(); + session.WaitForChanges(); - var result = searcher.Find(searcher.CreateCriteria().All().Compile()); + var result = searcher.Find(searcher.CreateCriteria().All().Compile()); Assert.AreEqual(29, result.TotalItemCount); } - } + } - ///// + ///// /// /// Check that the node signalled as protected in the content service is not present in the index. /// [Test] - public void Index_Protected_Content_Not_Indexed() - { + public void Index_Protected_Content_Not_Indexed() + { using (var luceneDir = new RAMDirectory()) using (var indexer = IndexInitializer.GetUmbracoIndexer(ProfilingLogger, luceneDir)) @@ -75,11 +75,11 @@ namespace Umbraco.Tests.UmbracoExamine Assert.AreEqual(0, collector.TotalHits, "Protected node should not be indexed"); } - } + } - [Test] - public void Index_Move_Media_From_Non_Indexable_To_Indexable_ParentID() - { + [Test] + public void Index_Move_Media_From_Non_Indexable_To_Indexable_ParentID() + { using (var luceneDir = new RAMDirectory()) using (var indexer = IndexInitializer.GetUmbracoIndexer(ProfilingLogger, luceneDir, //make parent id 1116 @@ -121,11 +121,11 @@ namespace Umbraco.Tests.UmbracoExamine results = searcher.Search(searcher.CreateSearchCriteria().Id(2112).Compile()); Assert.AreEqual(1, results.Count()); } - } + } - [Test] - public void Index_Move_Media_To_Non_Indexable_ParentID() - { + [Test] + public void Index_Move_Media_To_Non_Indexable_ParentID() + { using (var luceneDir = new RAMDirectory()) using (var indexer1 = IndexInitializer.GetUmbracoIndexer(ProfilingLogger, luceneDir, //make parent id 2222 @@ -166,16 +166,16 @@ namespace Umbraco.Tests.UmbracoExamine results = searcher.Search(searcher.CreateSearchCriteria().Id(2112).Compile()); Assert.AreEqual(0, results.Count()); } - } + } - /// - /// This will ensure that all 'Content' (not media) is cleared from the index using the Lucene API directly. - /// We then call the Examine method to re-index Content and do some comparisons to ensure that it worked correctly. - /// - [Test] - public void Index_Reindex_Content() - { + /// + /// This will ensure that all 'Content' (not media) is cleared from the index using the Lucene API directly. + /// We then call the Examine method to re-index Content and do some comparisons to ensure that it worked correctly. + /// + [Test] + public void Index_Reindex_Content() + { using (var luceneDir = new RAMDirectory()) using (var indexer = IndexInitializer.GetUmbracoIndexer(ProfilingLogger, luceneDir, options: new UmbracoContentIndexerOptions(true, false, null))) using (var session = new ThreadScopedIndexSession(indexer.SearcherContext)) @@ -213,12 +213,12 @@ namespace Umbraco.Tests.UmbracoExamine } - /// - /// This will delete an item from the index and ensure that all children of the node are deleted too! - /// - [Test] - public void Index_Delete_Index_Item_Ensure_Heirarchy_Removed() - { + /// + /// This will delete an item from the index and ensure that all children of the node are deleted too! + /// + [Test] + public void Index_Delete_Index_Item_Ensure_Heirarchy_Removed() + { using (var luceneDir = new RAMDirectory()) using (var indexer = IndexInitializer.GetUmbracoIndexer(ProfilingLogger, luceneDir)) using (var session = new ThreadScopedIndexSession(indexer.SearcherContext)) @@ -248,4 +248,4 @@ namespace Umbraco.Tests.UmbracoExamine private readonly ExamineDemoDataMediaService _mediaService = new ExamineDemoDataMediaService(); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/UmbracoExamine/SearchTests.cs b/src/Umbraco.Tests/UmbracoExamine/SearchTests.cs index 26d9ddf326..d1ebf68871 100644 --- a/src/Umbraco.Tests/UmbracoExamine/SearchTests.cs +++ b/src/Umbraco.Tests/UmbracoExamine/SearchTests.cs @@ -42,7 +42,7 @@ namespace Umbraco.Tests.UmbracoExamine m.Name == (string)x.Attribute("nodeName") && m.Path == (string)x.Attribute("path") && m.Properties == new PropertyCollection() && - m.Published == true && + m.Published == true && m.ContentType == Mock.Of(mt => mt.Icon == "test" && mt.Alias == x.Name.LocalName && @@ -61,7 +61,7 @@ namespace Umbraco.Tests.UmbracoExamine indexer.RebuildIndex(); session.WaitForChanges(); - var searcher = indexer.GetSearcher(); + var searcher = indexer.GetSearcher(); var numberSortedCriteria = searcher.CreateSearchCriteria() .ParentId(1148).And() @@ -104,7 +104,7 @@ namespace Umbraco.Tests.UmbracoExamine // var indexer = IndexInitializer.GetUmbracoIndexer(luceneDir, // new GermanAnalyzer()); // indexer.RebuildIndex(); - // var searcher = IndexInitializer.GetUmbracoSearcher(luceneDir); + // var searcher = IndexInitializer.GetUmbracoSearcher(luceneDir); // } //} diff --git a/src/Umbraco.Tests/UmbracoExamine/TestDataService.cs b/src/Umbraco.Tests/UmbracoExamine/TestDataService.cs index 2e2ddb2b85..f7019ad15a 100644 --- a/src/Umbraco.Tests/UmbracoExamine/TestDataService.cs +++ b/src/Umbraco.Tests/UmbracoExamine/TestDataService.cs @@ -4,29 +4,29 @@ //namespace Umbraco.Tests.UmbracoExamine //{ -// public class TestDataService : IDataService -// { +// public class TestDataService : IDataService +// { -// public TestDataService() -// { -// ContentService = new TestContentService(); -// LogService = new TestLogService(); -// MediaService = new TestMediaService(); -// } +// public TestDataService() +// { +// ContentService = new TestContentService(); +// LogService = new TestLogService(); +// MediaService = new TestMediaService(); +// } -// #region IDataService Members +// #region IDataService Members -// public IContentService ContentService { get; internal set; } +// public IContentService ContentService { get; internal set; } // public ILogService LogService { get; internal set; } // public IMediaService MediaService { get; internal set; } -// public string MapPath(string virtualPath) -// { -// return new DirectoryInfo(TestHelper.CurrentAssemblyDirectory) + "\\" + virtualPath.Replace("/", "\\"); -// } +// public string MapPath(string virtualPath) +// { +// return new DirectoryInfo(TestHelper.CurrentAssemblyDirectory) + "\\" + virtualPath.Replace("/", "\\"); +// } -// #endregion -// } -//} \ No newline at end of file +// #endregion +// } +//} diff --git a/src/Umbraco.Tests/UmbracoExamine/TestFiles.Designer.cs b/src/Umbraco.Tests/UmbracoExamine/TestFiles.Designer.cs index d79535420a..a8ce73e7a8 100644 --- a/src/Umbraco.Tests/UmbracoExamine/TestFiles.Designer.cs +++ b/src/Umbraco.Tests/UmbracoExamine/TestFiles.Designer.cs @@ -10,8 +10,8 @@ namespace Umbraco.Tests.UmbracoExamine { using System; - - + + /// /// A strongly-typed resource class, for looking up localized strings, etc. /// @@ -23,15 +23,15 @@ namespace Umbraco.Tests.UmbracoExamine { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class TestFiles { - + private static global::System.Resources.ResourceManager resourceMan; - + private static global::System.Globalization.CultureInfo resourceCulture; - + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal TestFiles() { } - + /// /// Returns the cached ResourceManager instance used by this class. /// @@ -45,7 +45,7 @@ namespace Umbraco.Tests.UmbracoExamine { return resourceMan; } } - + /// /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. @@ -59,23 +59,23 @@ namespace Umbraco.Tests.UmbracoExamine { resourceCulture = value; } } - + /// /// Looks up a localized string similar to <?xml version="1.0" encoding="utf-8"?> ///<media> - /// <node id="1111" version="902e13f7-5793-482a-9e06-cd94eebd1de0" parentID="-1" level="1" writerID="0" nodeType="1031" template="0" sortOrder="2" createDate="2010-05-19T15:26:08" updateDate="2010-05-19T15:26:09" nodeName="Product Images" urlName="productimages" writerName="Administrator" nodeTypeAlias="Folder" path="-1,1111"> - /// <data alias="contents"></data> - /// <node id="2222" version="902e13f7-5793-482a-9e06-cd94eebd1de0" parentID="1111" level="2" writerID="0 [rest of string was truncated]";. + /// <node id="1111" version="902e13f7-5793-482a-9e06-cd94eebd1de0" parentID="-1" level="1" writerID="0" nodeType="1031" template="0" sortOrder="2" createDate="2010-05-19T15:26:08" updateDate="2010-05-19T15:26:09" nodeName="Product Images" urlName="productimages" writerName="Administrator" nodeTypeAlias="Folder" path="-1,1111"> + /// <data alias="contents"></data> + /// <node id="2222" version="902e13f7-5793-482a-9e06-cd94eebd1de0" parentID="1111" level="2" writerID="0 [rest of string was truncated]";. /// internal static string media { get { return ResourceManager.GetString("media", resourceCulture); } } - + /// /// Looks up a localized string similar to <?xml version="1.0" encoding="utf-8"?> - ///<!DOCTYPE root[ + ///<!DOCTYPE root[ ///<!ELEMENT CWS_Contact ANY> ///<!ATTLIST CWS_Contact id ID #REQUIRED> ///<!ELEMENT CWS_EmailAFriend ANY> @@ -88,17 +88,18 @@ namespace Umbraco.Tests.UmbracoExamine { ///<!ATTLIST CWS_Gallery id ID #REQUIRED> ///<!ELEMENT CWS_Home ANY> ///<!ATTLIST CWS_Home id ID #REQUIRED> - ///<!ELEMENT CWS_NewsEventsList ANY> /// [rest of string was truncated]";. + ///<!ELEMENT CWS_NewsEventsList ANY> + /// [rest of string was truncated]";. /// internal static string umbraco { get { return ResourceManager.GetString("umbraco", resourceCulture); } } - + /// /// Looks up a localized string similar to <?xml version="1.0" encoding="utf-8"?> - ///<!DOCTYPE root[ + ///<!DOCTYPE root[ ///<!ELEMENT CWS_Contact ANY> ///<!ATTLIST CWS_Contact id ID #REQUIRED> ///<!ELEMENT CWS_EmailAFriend ANY> @@ -111,7 +112,8 @@ namespace Umbraco.Tests.UmbracoExamine { ///<!ATTLIST CWS_Gallery id ID #REQUIRED> ///<!ELEMENT CWS_Home ANY> ///<!ATTLIST CWS_Home id ID #REQUIRED> - ///<!ELEMENT CWS_NewsEventsList ANY> /// [rest of string was truncated]";. + ///<!ELEMENT CWS_NewsEventsList ANY> + /// [rest of string was truncated]";. /// internal static string umbraco_sort { get { diff --git a/src/Umbraco.Tests/UmbracoExamine/TestIndexField.cs b/src/Umbraco.Tests/UmbracoExamine/TestIndexField.cs index ee648f180a..b2e2d7d823 100644 --- a/src/Umbraco.Tests/UmbracoExamine/TestIndexField.cs +++ b/src/Umbraco.Tests/UmbracoExamine/TestIndexField.cs @@ -2,10 +2,10 @@ namespace Umbraco.Tests.UmbracoExamine { - public class TestIndexField : IIndexField - { - public string Name { get; set; } - public bool EnableSorting { get; set; } - public string Type { get; set; } - } -} \ No newline at end of file + public class TestIndexField : IIndexField + { + public string Name { get; set; } + public bool EnableSorting { get; set; } + public string Type { get; set; } + } +} diff --git a/src/Umbraco.Tests/Web/AngularIntegration/AngularAntiForgeryTests.cs b/src/Umbraco.Tests/Web/AngularIntegration/AngularAntiForgeryTests.cs index 1503a1d43b..780a3e90fd 100644 --- a/src/Umbraco.Tests/Web/AngularIntegration/AngularAntiForgeryTests.cs +++ b/src/Umbraco.Tests/Web/AngularIntegration/AngularAntiForgeryTests.cs @@ -27,9 +27,9 @@ namespace Umbraco.Tests.Web.AngularIntegration string cookieToken, headerToken; AngularAntiForgeryHelper.GetTokens(out cookieToken, out headerToken); - Assert.AreEqual(true, AngularAntiForgeryHelper.ValidateTokens(cookieToken, headerToken)); + Assert.AreEqual(true, AngularAntiForgeryHelper.ValidateTokens(cookieToken, headerToken)); } - + } [Test] diff --git a/src/Umbraco.Tests/Web/AngularIntegration/ContentModelSerializationTests.cs b/src/Umbraco.Tests/Web/AngularIntegration/ContentModelSerializationTests.cs index fdad2a9815..fcc434a596 100644 --- a/src/Umbraco.Tests/Web/AngularIntegration/ContentModelSerializationTests.cs +++ b/src/Umbraco.Tests/Web/AngularIntegration/ContentModelSerializationTests.cs @@ -31,7 +31,7 @@ namespace Umbraco.Tests.Web.AngularIntegration Description = "Description " + propertyIndex, View = "~/Views/View" + propertyIndex, HideLabel = false - }); + }); } tabs.Add(new Tab() { @@ -70,7 +70,7 @@ namespace Umbraco.Tests.Web.AngularIntegration Assert.AreEqual("Description " + prop, jObject["tabs"][tab]["properties"][prop]["description"].ToString()); Assert.AreEqual(false, jObject["tabs"][tab]["properties"][prop]["hideLabel"].Value()); } - } + } } } diff --git a/src/Umbraco.Tests/Web/AngularIntegration/ServerVariablesParserTests.cs b/src/Umbraco.Tests/Web/AngularIntegration/ServerVariablesParserTests.cs index e078be033e..0bf07a83c6 100644 --- a/src/Umbraco.Tests/Web/AngularIntegration/ServerVariablesParserTests.cs +++ b/src/Umbraco.Tests/Web/AngularIntegration/ServerVariablesParserTests.cs @@ -8,7 +8,7 @@ namespace Umbraco.Tests.Web.AngularIntegration [TestFixture] public class ServerVariablesParserTests { - + [Test] public void Parse() @@ -31,4 +31,4 @@ namespace Umbraco.Tests.Web.AngularIntegration } ;".StripWhitespace())); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Web/Controllers/BackOfficeControllerUnitTests.cs b/src/Umbraco.Tests/Web/Controllers/BackOfficeControllerUnitTests.cs index d068c2466a..850870f395 100644 --- a/src/Umbraco.Tests/Web/Controllers/BackOfficeControllerUnitTests.cs +++ b/src/Umbraco.Tests/Web/Controllers/BackOfficeControllerUnitTests.cs @@ -38,4 +38,4 @@ namespace Umbraco.Tests.Web.Controllers Assert.That(jsUrls.Last().StartsWith("~/") == false); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Web/Controllers/PluginControllerAreaTests.cs b/src/Umbraco.Tests/Web/Controllers/PluginControllerAreaTests.cs index 5105301b0d..f42a02efe4 100644 --- a/src/Umbraco.Tests/Web/Controllers/PluginControllerAreaTests.cs +++ b/src/Umbraco.Tests/Web/Controllers/PluginControllerAreaTests.cs @@ -6,83 +6,83 @@ using Umbraco.Web.Mvc; namespace Umbraco.Tests.Web.Controllers { - [TestFixture] - public class PluginControllerAreaTests : BaseWebTest - { - - [Test] - public void Ensure_Same_Area1() - { - Assert.Throws(() => - new PluginControllerArea(new PluginControllerMetadata[] - { - PluginController.GetMetadata(typeof(Plugin1Controller)), - PluginController.GetMetadata(typeof(Plugin2Controller)), - PluginController.GetMetadata(typeof(Plugin3Controller)) //not same area - })); - } + [TestFixture] + public class PluginControllerAreaTests : BaseWebTest + { - [Test] - public void Ensure_Same_Area3() - { - Assert.Throws(() => - new PluginControllerArea(new PluginControllerMetadata[] - { - PluginController.GetMetadata(typeof(Plugin1Controller)), - PluginController.GetMetadata(typeof(Plugin2Controller)), - PluginController.GetMetadata(typeof(Plugin4Controller)) //no area assigned - })); - } + [Test] + public void Ensure_Same_Area1() + { + Assert.Throws(() => + new PluginControllerArea(new PluginControllerMetadata[] + { + PluginController.GetMetadata(typeof(Plugin1Controller)), + PluginController.GetMetadata(typeof(Plugin2Controller)), + PluginController.GetMetadata(typeof(Plugin3Controller)) //not same area + })); + } - [Test] - public void Ensure_Same_Area2() - { - var area = new PluginControllerArea(new PluginControllerMetadata[] - { - PluginController.GetMetadata(typeof(Plugin1Controller)), - PluginController.GetMetadata(typeof(Plugin2Controller)) - }); - Assert.Pass(); - } + [Test] + public void Ensure_Same_Area3() + { + Assert.Throws(() => + new PluginControllerArea(new PluginControllerMetadata[] + { + PluginController.GetMetadata(typeof(Plugin1Controller)), + PluginController.GetMetadata(typeof(Plugin2Controller)), + PluginController.GetMetadata(typeof(Plugin4Controller)) //no area assigned + })); + } - #region Test classes + [Test] + public void Ensure_Same_Area2() + { + var area = new PluginControllerArea(new PluginControllerMetadata[] + { + PluginController.GetMetadata(typeof(Plugin1Controller)), + PluginController.GetMetadata(typeof(Plugin2Controller)) + }); + Assert.Pass(); + } - [PluginController("Area1")] - public class Plugin1Controller : PluginController - { - public Plugin1Controller(UmbracoContext umbracoContext) - { + #region Test classes + + [PluginController("Area1")] + public class Plugin1Controller : PluginController + { + public Plugin1Controller(UmbracoContext umbracoContext) + { UmbracoContext = umbracoContext; } } - [PluginController("Area1")] - public class Plugin2Controller : PluginController - { - public Plugin2Controller(UmbracoContext umbracoContext) - { + [PluginController("Area1")] + public class Plugin2Controller : PluginController + { + public Plugin2Controller(UmbracoContext umbracoContext) + { UmbracoContext = umbracoContext; } } - [PluginController("Area2")] - public class Plugin3Controller : PluginController - { - public Plugin3Controller(UmbracoContext umbracoContext) - { + [PluginController("Area2")] + public class Plugin3Controller : PluginController + { + public Plugin3Controller(UmbracoContext umbracoContext) + { UmbracoContext = umbracoContext; } } - public class Plugin4Controller : PluginController - { - public Plugin4Controller(UmbracoContext umbracoContext) - { - UmbracoContext = umbracoContext; - } - } + public class Plugin4Controller : PluginController + { + public Plugin4Controller(UmbracoContext umbracoContext) + { + UmbracoContext = umbracoContext; + } + } - #endregion + #endregion - } + } } diff --git a/src/Umbraco.Tests/Web/Controllers/WebApiEditors/ContentControllerUnitTests.cs b/src/Umbraco.Tests/Web/Controllers/WebApiEditors/ContentControllerUnitTests.cs index 4b78df671d..322c851cfc 100644 --- a/src/Umbraco.Tests/Web/Controllers/WebApiEditors/ContentControllerUnitTests.cs +++ b/src/Umbraco.Tests/Web/Controllers/WebApiEditors/ContentControllerUnitTests.cs @@ -48,11 +48,11 @@ namespace Umbraco.Tests.Web.Controllers.WebApiEditors var contentServiceMock = new Mock(); contentServiceMock.Setup(x => x.GetById(0)).Returns(content); var contentService = contentServiceMock.Object; - var userServiceMock = new Mock(); + var userServiceMock = new Mock(); var permissions = new List(); userServiceMock.Setup(x => x.GetPermissions(user, 1234)).Returns(permissions); var userService = userServiceMock.Object; - + //act/assert Assert.Throws(() => ContentController.CheckPermissions(new Dictionary(), user, userService, contentService, 1234, new[] { 'F' })); } @@ -71,7 +71,7 @@ namespace Umbraco.Tests.Web.Controllers.WebApiEditors var contentServiceMock = new Mock(); contentServiceMock.Setup(x => x.GetById(1234)).Returns(content); var contentService = contentServiceMock.Object; - var userServiceMock = new Mock(); + var userServiceMock = new Mock(); var permissions = new List(); userServiceMock.Setup(x => x.GetPermissions(user, 1234)).Returns(permissions); var userService = userServiceMock.Object; @@ -97,7 +97,7 @@ namespace Umbraco.Tests.Web.Controllers.WebApiEditors var contentServiceMock = new Mock(); contentServiceMock.Setup(x => x.GetById(1234)).Returns(content); var contentService = contentServiceMock.Object; - var userServiceMock = new Mock(); + var userServiceMock = new Mock(); var permissions = new List { new EntityPermission(9, 1234, new string[]{ "A", "B", "C" }) @@ -126,7 +126,7 @@ namespace Umbraco.Tests.Web.Controllers.WebApiEditors var contentServiceMock = new Mock(); contentServiceMock.Setup(x => x.GetById(1234)).Returns(content); var contentService = contentServiceMock.Object; - var userServiceMock = new Mock(); + var userServiceMock = new Mock(); var permissions = new List { new EntityPermission(9, 1234, new string[]{ "A", "F", "C" }) @@ -149,7 +149,7 @@ namespace Umbraco.Tests.Web.Controllers.WebApiEditors userMock.Setup(u => u.Id).Returns(0); userMock.Setup(u => u.StartContentId).Returns(-1); var user = userMock.Object; - + //act var result = ContentController.CheckPermissions(new Dictionary(), user, null, null, -1); @@ -165,7 +165,7 @@ namespace Umbraco.Tests.Web.Controllers.WebApiEditors userMock.Setup(u => u.Id).Returns(0); userMock.Setup(u => u.StartContentId).Returns(-1); var user = userMock.Object; - + //act var result = ContentController.CheckPermissions(new Dictionary(), user, null, null, -20); @@ -359,7 +359,7 @@ namespace Umbraco.Tests.Web.Controllers.WebApiEditors // var result = await client.SendAsync(request); // } - + // } //} diff --git a/src/Umbraco.Tests/Web/Controllers/WebApiEditors/FilterAllowedOutgoingContentAttributeTests.cs b/src/Umbraco.Tests/Web/Controllers/WebApiEditors/FilterAllowedOutgoingContentAttributeTests.cs index 1ebe2fc748..513054cde6 100644 --- a/src/Umbraco.Tests/Web/Controllers/WebApiEditors/FilterAllowedOutgoingContentAttributeTests.cs +++ b/src/Umbraco.Tests/Web/Controllers/WebApiEditors/FilterAllowedOutgoingContentAttributeTests.cs @@ -23,8 +23,8 @@ namespace Umbraco.Tests.Web.Controllers.WebApiEditors var val = new List() {new ContentItemBasic()}; var result = att.GetValueFromResponse( new ObjectContent(typeof (IEnumerable), - val, - new JsonMediaTypeFormatter(), + val, + new JsonMediaTypeFormatter(), new MediaTypeHeaderValue("html/text"))); Assert.AreEqual(val, result); @@ -85,11 +85,11 @@ namespace Umbraco.Tests.Web.Controllers.WebApiEditors userMock.Setup(u => u.Id).Returns(9); userMock.Setup(u => u.StartContentId).Returns(5); var user = userMock.Object; - + att.FilterBasedOnStartNode(list, user); Assert.AreEqual(5, list.Count); - + } [Test] @@ -102,7 +102,7 @@ namespace Umbraco.Tests.Web.Controllers.WebApiEditors list.Add(new ContentItemBasic{Id = i, Name = "Test" + i, ParentId = -1}); } var ids = list.Select(x => (int)x.Id).ToArray(); - + var userMock = new Mock(); userMock.Setup(u => u.Id).Returns(9); userMock.Setup(u => u.StartContentId).Returns(-1); @@ -127,10 +127,10 @@ namespace Umbraco.Tests.Web.Controllers.WebApiEditors Assert.AreEqual(2, list.ElementAt(1).Id); Assert.AreEqual(3, list.ElementAt(2).Id); } - + private class MyTestClass { - public IEnumerable MyList { get; set; } + public IEnumerable MyList { get; set; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Web/Controllers/WebApiEditors/MediaControllerUnitTests.cs b/src/Umbraco.Tests/Web/Controllers/WebApiEditors/MediaControllerUnitTests.cs index 2d5420409c..1221b51cfc 100644 --- a/src/Umbraco.Tests/Web/Controllers/WebApiEditors/MediaControllerUnitTests.cs +++ b/src/Umbraco.Tests/Web/Controllers/WebApiEditors/MediaControllerUnitTests.cs @@ -23,7 +23,7 @@ namespace Umbraco.Tests.Web.Controllers.WebApiEditors var mediaMock = new Mock(); mediaMock.Setup(m => m.Path).Returns("-1,1234,5678"); var media = mediaMock.Object; - var mediaServiceMock = new Mock(); + var mediaServiceMock = new Mock(); mediaServiceMock.Setup(x => x.GetById(1234)).Returns(media); var mediaService = mediaServiceMock.Object; @@ -48,7 +48,7 @@ namespace Umbraco.Tests.Web.Controllers.WebApiEditors var mediaServiceMock = new Mock(); mediaServiceMock.Setup(x => x.GetById(0)).Returns(media); var mediaService = mediaServiceMock.Object; - + //act/assert Assert.Throws(() => MediaController.CheckPermissions(new Dictionary(), user, mediaService, 1234)); } @@ -67,7 +67,7 @@ namespace Umbraco.Tests.Web.Controllers.WebApiEditors var mediaServiceMock = new Mock(); mediaServiceMock.Setup(x => x.GetById(1234)).Returns(media); var mediaService = mediaServiceMock.Object; - + //act var result = MediaController.CheckPermissions(new Dictionary(), user, mediaService, 1234); @@ -83,7 +83,7 @@ namespace Umbraco.Tests.Web.Controllers.WebApiEditors userMock.Setup(u => u.Id).Returns(0); userMock.Setup(u => u.StartMediaId).Returns(-1); var user = userMock.Object; - + //act var result = MediaController.CheckPermissions(new Dictionary(), user, null, -1); @@ -139,4 +139,4 @@ namespace Umbraco.Tests.Web.Controllers.WebApiEditors Assert.IsFalse(result); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Web/Mvc/HtmlHelperExtensionMethodsTests.cs b/src/Umbraco.Tests/Web/Mvc/HtmlHelperExtensionMethodsTests.cs index adf5772f76..ba19f41e74 100644 --- a/src/Umbraco.Tests/Web/Mvc/HtmlHelperExtensionMethodsTests.cs +++ b/src/Umbraco.Tests/Web/Mvc/HtmlHelperExtensionMethodsTests.cs @@ -1,33 +1,33 @@ -using System.Web.Mvc; +using System.Web.Mvc; using NUnit.Framework; using Umbraco.Web; namespace Umbraco.Tests.Web.Mvc { - [TestFixture] - public class HtmlHelperExtensionMethodsTests - { - [SetUp] - public virtual void Initialize() - { - //create an empty htmlHelper - _htmlHelper = new HtmlHelper(new ViewContext(), new ViewPage()); - } + [TestFixture] + public class HtmlHelperExtensionMethodsTests + { + [SetUp] + public virtual void Initialize() + { + //create an empty htmlHelper + _htmlHelper = new HtmlHelper(new ViewContext(), new ViewPage()); + } - private HtmlHelper _htmlHelper; + private HtmlHelper _htmlHelper; - [Test] - public void Wrap_Simple() - { - var output = _htmlHelper.Wrap("div", "hello world"); - Assert.AreEqual("
hello world
", output.ToHtmlString()); - } + [Test] + public void Wrap_Simple() + { + var output = _htmlHelper.Wrap("div", "hello world"); + Assert.AreEqual("
hello world
", output.ToHtmlString()); + } - [Test] - public void Wrap_Object_Attributes() - { - var output = _htmlHelper.Wrap("div", "hello world", new {style = "color:red;", onclick = "void();"}); - Assert.AreEqual("
hello world
", output.ToHtmlString()); - } - } -} \ No newline at end of file + [Test] + public void Wrap_Object_Attributes() + { + var output = _htmlHelper.Wrap("div", "hello world", new {style = "color:red;", onclick = "void();"}); + Assert.AreEqual("
hello world
", output.ToHtmlString()); + } + } +} diff --git a/src/Umbraco.Tests/Web/Mvc/MergeParentContextViewDataAttributeTests.cs b/src/Umbraco.Tests/Web/Mvc/MergeParentContextViewDataAttributeTests.cs index 8358a1a768..019f95ba75 100644 --- a/src/Umbraco.Tests/Web/Mvc/MergeParentContextViewDataAttributeTests.cs +++ b/src/Umbraco.Tests/Web/Mvc/MergeParentContextViewDataAttributeTests.cs @@ -34,7 +34,7 @@ namespace Umbraco.Tests.Web.Mvc var filter = new ResultExecutingContext(controllerCtx, new ContentResult()) {RouteData = controllerCtx.RouteData}; var att = new MergeParentContextViewDataAttribute(); - + Assert.IsTrue(filter.IsChildAction); att.OnResultExecuting(filter); @@ -80,7 +80,7 @@ namespace Umbraco.Tests.Web.Mvc internal class MyController : Controller { - + } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Web/Mvc/RenderIndexActionSelectorAttributeTests.cs b/src/Umbraco.Tests/Web/Mvc/RenderIndexActionSelectorAttributeTests.cs index 05e5ab9a49..1b5cc4066f 100644 --- a/src/Umbraco.Tests/Web/Mvc/RenderIndexActionSelectorAttributeTests.cs +++ b/src/Umbraco.Tests/Web/Mvc/RenderIndexActionSelectorAttributeTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using System.Reflection; using System.Threading.Tasks; @@ -169,4 +169,4 @@ namespace Umbraco.Tests.Web.Mvc } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Web/Mvc/RenderModelBinderTests.cs b/src/Umbraco.Tests/Web/Mvc/RenderModelBinderTests.cs index c24e44928b..4532ed3679 100644 --- a/src/Umbraco.Tests/Web/Mvc/RenderModelBinderTests.cs +++ b/src/Umbraco.Tests/Web/Mvc/RenderModelBinderTests.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Globalization; using System.Web; using System.Web.Mvc; @@ -34,7 +34,7 @@ namespace Umbraco.Tests.Web.Mvc { var binder = new ContentModelBinder(); var found = binder.GetBinder(typeof (IPublishedContent)); - Assert.IsNotNull(found); + Assert.IsNotNull(found); found = binder.GetBinder(typeof(ContentModel)); Assert.IsNotNull(found); found = binder.GetBinder(typeof(MyContent)); @@ -45,7 +45,7 @@ namespace Umbraco.Tests.Web.Mvc found = binder.GetBinder(typeof(MyOtherContent)); Assert.IsNull(found); found = binder.GetBinder(typeof(MyCustomContentModel)); - Assert.IsNull(found); + Assert.IsNull(found); found = binder.GetBinder(typeof(IContentModel)); Assert.IsNull(found); } @@ -138,15 +138,15 @@ namespace Umbraco.Tests.Web.Mvc routeData.DataTokens[Core.Constants.Web.UmbracoDataToken] = content; //the value provider is the default implementation - var valueProvider = new Mock(); + var valueProvider = new Mock(); //also IUnvalidatedValueProvider var invalidatedValueProvider = valueProvider.As(); invalidatedValueProvider.Setup(x => x.GetValue(It.IsAny(), It.IsAny())).Returns(() => new ValueProviderResult(content, "content", CultureInfo.CurrentCulture)); var controllerCtx = new ControllerContext( - Mock.Of(http => http.Items == new Dictionary()), - routeData, + Mock.Of(http => http.Items == new Dictionary()), + routeData, Mock.Of()); var result = binder.BindModel(controllerCtx, new ModelBindingContext @@ -159,15 +159,15 @@ namespace Umbraco.Tests.Web.Mvc } public class MyCustomContentModel : ContentModel - { - public MyCustomContentModel(IPublishedContent content) + { + public MyCustomContentModel(IPublishedContent content) : base(content) { } } - + public class MyOtherContent { - + } public class MyContent : PublishedContentWrapped @@ -177,4 +177,4 @@ namespace Umbraco.Tests.Web.Mvc } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Web/Mvc/SurfaceControllerTests.cs b/src/Umbraco.Tests/Web/Mvc/SurfaceControllerTests.cs index daa804de70..df1c927fc2 100644 --- a/src/Umbraco.Tests/Web/Mvc/SurfaceControllerTests.cs +++ b/src/Umbraco.Tests/Web/Mvc/SurfaceControllerTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using System.Web; using System.Web.Mvc; @@ -200,4 +200,4 @@ namespace Umbraco.Tests.Web.Mvc } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Tests/Web/TemplateUtilitiesTests.cs b/src/Umbraco.Tests/Web/TemplateUtilitiesTests.cs index e86b866f11..e5aff59f56 100644 --- a/src/Umbraco.Tests/Web/TemplateUtilitiesTests.cs +++ b/src/Umbraco.Tests/Web/TemplateUtilitiesTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Web; using LightInject; using Moq; @@ -92,4 +92,4 @@ namespace Umbraco.Tests.Web } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web.UI/Properties/AssemblyInfo.cs b/src/Umbraco.Web.UI/Properties/AssemblyInfo.cs index ca3533f8e0..8cc09e4fcd 100644 --- a/src/Umbraco.Web.UI/Properties/AssemblyInfo.cs +++ b/src/Umbraco.Web.UI/Properties/AssemblyInfo.cs @@ -1,9 +1,9 @@ -using System.Reflection; +using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // -// General Information about an assembly is controlled through the following +// 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. // @@ -12,8 +12,8 @@ using System.Runtime.InteropServices; [assembly: AssemblyConfiguration("")] [assembly: AssemblyProduct("Umbraco CMS")] -// 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 +// 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)] @@ -22,4 +22,4 @@ using System.Runtime.InteropServices; //[assembly: System.Security.SecurityRules(System.Security.SecurityRuleSet.Level1)] -[assembly: log4net.Config.XmlConfigurator(Watch = false)] \ No newline at end of file +[assembly: log4net.Config.XmlConfigurator(Watch = false)] diff --git a/src/Umbraco.Web.UI/Properties/Settings.Designer.cs b/src/Umbraco.Web.UI/Properties/Settings.Designer.cs index 11dc1e00c3..d318fd8cba 100644 --- a/src/Umbraco.Web.UI/Properties/Settings.Designer.cs +++ b/src/Umbraco.Web.UI/Properties/Settings.Designer.cs @@ -9,20 +9,20 @@ //------------------------------------------------------------------------------ namespace Umbraco.Web.UI.Properties { - - + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { - + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - + public static Settings Default { get { return defaultInstance; } } - + [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("http://our.umbraco.org/umbraco/webservices/api/repository.asmx")] diff --git a/src/Umbraco.Web.UI/Umbraco/create/PartialView.ascx.cs b/src/Umbraco.Web.UI/Umbraco/create/PartialView.ascx.cs index d5f380a504..7991ca1bee 100644 --- a/src/Umbraco.Web.UI/Umbraco/create/PartialView.ascx.cs +++ b/src/Umbraco.Web.UI/Umbraco/create/PartialView.ascx.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Web.UI.WebControls; using Umbraco.Core; using Umbraco.Core.Services; @@ -6,27 +6,27 @@ using umbraco.presentation.create; namespace Umbraco.Web.UI.Umbraco.Create { - public partial class PartialView : UI.Controls.UmbracoUserControl - { - protected override void OnLoad(EventArgs e) - { - base.OnLoad(e); - DataBind(); + public partial class PartialView : UI.Controls.UmbracoUserControl + { + protected override void OnLoad(EventArgs e) + { + base.OnLoad(e); + DataBind(); - LoadTemplates(PartialViewTemplate); + LoadTemplates(PartialViewTemplate); // Enable new item in folders to place items in that folder. - if (Request["nodeType"] == "partialViewsFolder") - FileName.Text = Request["nodeId"].EnsureEndsWith('/'); - } + if (Request["nodeType"] == "partialViewsFolder") + FileName.Text = Request["nodeId"].EnsureEndsWith('/'); + } private void LoadTemplates(ListControl list) { var fileService = (FileService)Services.FileService; var snippets = fileService.GetPartialViewSnippetNames( //ignore these - "Gallery", - "ListChildPagesFromChangeableSource", + "Gallery", + "ListChildPagesFromChangeableSource", "ListChildPagesOrderedByProperty", "ListImagesFromMediaFolder"); @@ -37,25 +37,25 @@ namespace Umbraco.Web.UI.Umbraco.Create } } - protected void SubmitButton_Click(object sender, System.EventArgs e) - { - if (Page.IsValid) - { - //Seriously, need to overhaul create dialogs, this is rediculous: - // http://issues.umbraco.org/issue/U4-1373 + protected void SubmitButton_Click(object sender, System.EventArgs e) + { + if (Page.IsValid) + { + //Seriously, need to overhaul create dialogs, this is rediculous: + // http://issues.umbraco.org/issue/U4-1373 - var createMacroVal = 0; + var createMacroVal = 0; string returnUrl = dialogHandler_temp.Create(Request.GetItemAsString("nodeType"), createMacroVal, //apparently we need to pass this value to 'ParentID'... of course! :P then we'll extract it in PartialViewTasks to create it. PartialViewTemplate.SelectedValue + "|||" + FileName.Text); - - ClientTools - .ChangeContentFrameUrl(returnUrl) - .ChildNodeCreated() - .CloseModalWindow(); - } - } - } -} \ No newline at end of file + ClientTools + .ChangeContentFrameUrl(returnUrl) + .ChildNodeCreated() + .CloseModalWindow(); + } + + } + } +} diff --git a/src/Umbraco.Web.UI/Umbraco/create/PartialView.ascx.designer.cs b/src/Umbraco.Web.UI/Umbraco/create/PartialView.ascx.designer.cs index 56b2690536..08ab84c128 100644 --- a/src/Umbraco.Web.UI/Umbraco/create/PartialView.ascx.designer.cs +++ b/src/Umbraco.Web.UI/Umbraco/create/PartialView.ascx.designer.cs @@ -3,15 +3,15 @@ // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace Umbraco.Web.UI.Umbraco.Create { - - + + public partial class PartialView { - + /// /// FileName control. /// @@ -20,7 +20,7 @@ namespace Umbraco.Web.UI.Umbraco.Create { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.TextBox FileName; - + /// /// RequiredFieldValidator1 control. /// @@ -29,7 +29,7 @@ namespace Umbraco.Web.UI.Umbraco.Create { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator1; - + /// /// EndsWithValidator control. /// @@ -38,7 +38,7 @@ namespace Umbraco.Web.UI.Umbraco.Create { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.RegularExpressionValidator EndsWithValidator; - + /// /// PartialViewTemplate control. /// @@ -47,7 +47,7 @@ namespace Umbraco.Web.UI.Umbraco.Create { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.ListBox PartialViewTemplate; - + /// /// Textbox1 control. /// @@ -56,7 +56,7 @@ namespace Umbraco.Web.UI.Umbraco.Create { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.TextBox Textbox1; - + /// /// sbmt control. /// diff --git a/src/Umbraco.Web.UI/Umbraco/dashboard/UserControlProxy.aspx.cs b/src/Umbraco.Web.UI/Umbraco/dashboard/UserControlProxy.aspx.cs index 3b390fa8d7..6dae54f6e9 100644 --- a/src/Umbraco.Web.UI/Umbraco/dashboard/UserControlProxy.aspx.cs +++ b/src/Umbraco.Web.UI/Umbraco/dashboard/UserControlProxy.aspx.cs @@ -37,4 +37,4 @@ namespace Umbraco.Web.UI.Umbraco.Dashboard } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web.UI/Umbraco/dashboard/UserControlProxy.aspx.designer.cs b/src/Umbraco.Web.UI/Umbraco/dashboard/UserControlProxy.aspx.designer.cs index 4a8e6e0c99..4da77ecf8d 100644 --- a/src/Umbraco.Web.UI/Umbraco/dashboard/UserControlProxy.aspx.designer.cs +++ b/src/Umbraco.Web.UI/Umbraco/dashboard/UserControlProxy.aspx.designer.cs @@ -3,15 +3,15 @@ // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace Umbraco.Web.UI.Umbraco.Dashboard { - - + + public partial class UserControlProxy { - + /// /// ClientLoader control. /// @@ -20,7 +20,7 @@ namespace Umbraco.Web.UI.Umbraco.Dashboard { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web.UI.JavaScript.UmbracoClientDependencyLoader ClientLoader; - + /// /// CssInclude1 control. /// @@ -29,7 +29,7 @@ namespace Umbraco.Web.UI.Umbraco.Dashboard { /// To modify move field declaration from designer file to code-behind file. /// protected global::ClientDependency.Core.Controls.CssInclude CssInclude1; - + /// /// JsInclude1 control. /// @@ -38,7 +38,7 @@ namespace Umbraco.Web.UI.Umbraco.Dashboard { /// To modify move field declaration from designer file to code-behind file. /// protected global::ClientDependency.Core.Controls.JsInclude JsInclude1; - + /// /// JsInclude3 control. /// @@ -47,7 +47,7 @@ namespace Umbraco.Web.UI.Umbraco.Dashboard { /// To modify move field declaration from designer file to code-behind file. /// protected global::ClientDependency.Core.Controls.JsInclude JsInclude3; - + /// /// JsInclude4 control. /// @@ -56,7 +56,7 @@ namespace Umbraco.Web.UI.Umbraco.Dashboard { /// To modify move field declaration from designer file to code-behind file. /// protected global::ClientDependency.Core.Controls.JsInclude JsInclude4; - + /// /// JsInclude6 control. /// @@ -65,7 +65,7 @@ namespace Umbraco.Web.UI.Umbraco.Dashboard { /// To modify move field declaration from designer file to code-behind file. /// protected global::ClientDependency.Core.Controls.JsInclude JsInclude6; - + /// /// JsInclude11 control. /// @@ -74,7 +74,7 @@ namespace Umbraco.Web.UI.Umbraco.Dashboard { /// To modify move field declaration from designer file to code-behind file. /// protected global::ClientDependency.Core.Controls.JsInclude JsInclude11; - + /// /// JsInclude12 control. /// @@ -83,7 +83,7 @@ namespace Umbraco.Web.UI.Umbraco.Dashboard { /// To modify move field declaration from designer file to code-behind file. /// protected global::ClientDependency.Core.Controls.JsInclude JsInclude12; - + /// /// JsInclude2 control. /// @@ -92,7 +92,7 @@ namespace Umbraco.Web.UI.Umbraco.Dashboard { /// To modify move field declaration from designer file to code-behind file. /// protected global::ClientDependency.Core.Controls.JsInclude JsInclude2; - + /// /// form1 control. /// @@ -101,7 +101,7 @@ namespace Umbraco.Web.UI.Umbraco.Dashboard { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.HtmlControls.HtmlForm form1; - + /// /// container control. /// diff --git a/src/Umbraco.Web.UI/Umbraco/umbraco.aspx.cs b/src/Umbraco.Web.UI/Umbraco/umbraco.aspx.cs index 91bc61dc6f..a148ac6e05 100644 --- a/src/Umbraco.Web.UI/Umbraco/umbraco.aspx.cs +++ b/src/Umbraco.Web.UI/Umbraco/umbraco.aspx.cs @@ -16,4 +16,4 @@ namespace Umbraco.Web.UI.Umbraco Response.AddHeader("Location", GlobalSettings.Path); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web.UI/Umbraco/umbraco.aspx.designer.cs b/src/Umbraco.Web.UI/Umbraco/umbraco.aspx.designer.cs index e98415eb53..26c655944a 100644 --- a/src/Umbraco.Web.UI/Umbraco/umbraco.aspx.designer.cs +++ b/src/Umbraco.Web.UI/Umbraco/umbraco.aspx.designer.cs @@ -3,13 +3,13 @@ // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace Umbraco.Web.UI.Umbraco { - - + + public partial class umbraco { } } diff --git a/src/Umbraco.Web.UI/config/splashes/NoNodes.aspx.cs b/src/Umbraco.Web.UI/config/splashes/NoNodes.aspx.cs index 23b810bc67..a3865b0196 100644 --- a/src/Umbraco.Web.UI/config/splashes/NoNodes.aspx.cs +++ b/src/Umbraco.Web.UI/config/splashes/NoNodes.aspx.cs @@ -15,11 +15,11 @@ namespace Umbraco.Web.UI.Config.Splashes var store = UmbracoContext.Current.ContentCache; if (store.HasContent()) - { + { //if there is actually content, go to the root - Response.Redirect("~/"); - } + Response.Redirect("~/"); + } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web.UI/config/splashes/NoNodes.aspx.designer.cs b/src/Umbraco.Web.UI/config/splashes/NoNodes.aspx.designer.cs index 0063e40629..6984906cfe 100644 --- a/src/Umbraco.Web.UI/config/splashes/NoNodes.aspx.designer.cs +++ b/src/Umbraco.Web.UI/config/splashes/NoNodes.aspx.designer.cs @@ -3,15 +3,15 @@ // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace Umbraco.Web.UI.Config.Splashes { - - + + public partial class NoNodes { - + /// /// Form1 control. /// diff --git a/src/Umbraco.Web.UI/umbraco/Create.aspx.cs b/src/Umbraco.Web.UI/umbraco/Create.aspx.cs index b1c636cc9a..0f8f954f60 100644 --- a/src/Umbraco.Web.UI/umbraco/Create.aspx.cs +++ b/src/Umbraco.Web.UI/umbraco/Create.aspx.cs @@ -37,4 +37,4 @@ namespace Umbraco.Web.UI.Umbraco } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web.UI/umbraco/Create.aspx.designer.cs b/src/Umbraco.Web.UI/umbraco/Create.aspx.designer.cs index 1e11eaf00d..8a0224003d 100644 --- a/src/Umbraco.Web.UI/umbraco/Create.aspx.designer.cs +++ b/src/Umbraco.Web.UI/umbraco/Create.aspx.designer.cs @@ -3,7 +3,7 @@ // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ @@ -12,7 +12,7 @@ namespace Umbraco.Web.UI.Umbraco { public partial class CreateDialog { - + /// /// AccessError control. /// diff --git a/src/Umbraco.Web.UI/umbraco/TreeInit.aspx.cs b/src/Umbraco.Web.UI/umbraco/TreeInit.aspx.cs index 0f90e84996..7d3a832299 100644 --- a/src/Umbraco.Web.UI/umbraco/TreeInit.aspx.cs +++ b/src/Umbraco.Web.UI/umbraco/TreeInit.aspx.cs @@ -8,7 +8,7 @@ namespace Umbraco.Web.UI.Umbraco { [Obsolete("Used the TreeControl control instead. This does however get used by the TreeService when requesting the tree init url.")] public partial class TreeInit : Pages.UmbracoEnsuredPage - { + { protected override void OnLoad(EventArgs e) { base.OnLoad(e); @@ -17,5 +17,5 @@ namespace Umbraco.Web.UI.Umbraco } protected TreeService TreeParams { get; private set; } - } -} \ No newline at end of file + } +} diff --git a/src/Umbraco.Web.UI/umbraco/TreeInit.aspx.designer.cs b/src/Umbraco.Web.UI/umbraco/TreeInit.aspx.designer.cs index d76968cf88..27cb26636b 100644 --- a/src/Umbraco.Web.UI/umbraco/TreeInit.aspx.designer.cs +++ b/src/Umbraco.Web.UI/umbraco/TreeInit.aspx.designer.cs @@ -3,15 +3,15 @@ // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace Umbraco.Web.UI.Umbraco { - - + + public partial class TreeInit { - + /// /// Head1 control. /// @@ -20,7 +20,7 @@ namespace Umbraco.Web.UI.Umbraco { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.HtmlControls.HtmlHead Head1; - + /// /// ClientLoader control. /// @@ -29,7 +29,7 @@ namespace Umbraco.Web.UI.Umbraco { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web.UI.JavaScript.UmbracoClientDependencyLoader ClientLoader; - + /// /// CssInclude1 control. /// @@ -38,7 +38,7 @@ namespace Umbraco.Web.UI.Umbraco { /// To modify move field declaration from designer file to code-behind file. /// protected global::ClientDependency.Core.Controls.CssInclude CssInclude1; - + /// /// form1 control. /// @@ -47,7 +47,7 @@ namespace Umbraco.Web.UI.Umbraco { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.HtmlControls.HtmlForm form1; - + /// /// ScriptManager1 control. /// @@ -56,7 +56,7 @@ namespace Umbraco.Web.UI.Umbraco { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.ScriptManager ScriptManager1; - + /// /// JTree control. /// diff --git a/src/Umbraco.Web.UI/umbraco/controls/PasswordChanger.ascx.cs b/src/Umbraco.Web.UI/umbraco/controls/PasswordChanger.ascx.cs index fbf30a776d..7f32743db9 100644 --- a/src/Umbraco.Web.UI/umbraco/controls/PasswordChanger.ascx.cs +++ b/src/Umbraco.Web.UI/umbraco/controls/PasswordChanger.ascx.cs @@ -21,8 +21,8 @@ namespace Umbraco.Web.UI.Umbraco.Controls //reset the flag always IsChangingPasswordField.Value = "false"; this.DataBind(); - } + } + - } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web.UI/umbraco/controls/PasswordChanger.ascx.designer.cs b/src/Umbraco.Web.UI/umbraco/controls/PasswordChanger.ascx.designer.cs index 71269f4300..777f43b7ec 100644 --- a/src/Umbraco.Web.UI/umbraco/controls/PasswordChanger.ascx.designer.cs +++ b/src/Umbraco.Web.UI/umbraco/controls/PasswordChanger.ascx.designer.cs @@ -3,15 +3,15 @@ // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace Umbraco.Web.UI.Umbraco.Controls { - - + + public partial class PasswordChanger { - + /// /// ResetPlaceHolder control. /// @@ -20,7 +20,7 @@ namespace Umbraco.Web.UI.Umbraco.Controls { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.PlaceHolder ResetPlaceHolder; - + /// /// CurrentPasswordPlaceHolder control. /// @@ -29,7 +29,7 @@ namespace Umbraco.Web.UI.Umbraco.Controls { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.PlaceHolder CurrentPasswordPlaceHolder; - + /// /// CurrentPasswordValidator control. /// @@ -38,7 +38,7 @@ namespace Umbraco.Web.UI.Umbraco.Controls { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.RequiredFieldValidator CurrentPasswordValidator; - + /// /// NewPasswordRequiredValidator control. /// @@ -47,7 +47,7 @@ namespace Umbraco.Web.UI.Umbraco.Controls { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.RequiredFieldValidator NewPasswordRequiredValidator; - + /// /// NewPasswordLengthValidator control. /// @@ -56,7 +56,7 @@ namespace Umbraco.Web.UI.Umbraco.Controls { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.RegularExpressionValidator NewPasswordLengthValidator; - + /// /// Div1 control. /// diff --git a/src/Umbraco.Web.UI/umbraco/create/PartialViewMacro.ascx.cs b/src/Umbraco.Web.UI/umbraco/create/PartialViewMacro.ascx.cs index 2e06e083e3..34ef06d8f5 100644 --- a/src/Umbraco.Web.UI/umbraco/create/PartialViewMacro.ascx.cs +++ b/src/Umbraco.Web.UI/umbraco/create/PartialViewMacro.ascx.cs @@ -76,4 +76,4 @@ namespace Umbraco.Web.UI.Umbraco.Create } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web.UI/umbraco/create/PartialViewMacro.ascx.designer.cs b/src/Umbraco.Web.UI/umbraco/create/PartialViewMacro.ascx.designer.cs index a1ae520234..fb2108daf2 100644 --- a/src/Umbraco.Web.UI/umbraco/create/PartialViewMacro.ascx.designer.cs +++ b/src/Umbraco.Web.UI/umbraco/create/PartialViewMacro.ascx.designer.cs @@ -3,15 +3,15 @@ // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace Umbraco.Web.UI.Umbraco.Create { - - + + public partial class PartialViewMacro { - + /// /// FileName control. /// @@ -20,7 +20,7 @@ namespace Umbraco.Web.UI.Umbraco.Create { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.TextBox FileName; - + /// /// RequiredFieldValidator2 control. /// @@ -29,7 +29,7 @@ namespace Umbraco.Web.UI.Umbraco.Create { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator2; - + /// /// EndsWithValidator control. /// @@ -38,7 +38,7 @@ namespace Umbraco.Web.UI.Umbraco.Create { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.RegularExpressionValidator EndsWithValidator; - + /// /// PartialViewTemplate control. /// @@ -47,7 +47,7 @@ namespace Umbraco.Web.UI.Umbraco.Create { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.ListBox PartialViewTemplate; - + /// /// CreateMacroCheckBox control. /// @@ -56,7 +56,7 @@ namespace Umbraco.Web.UI.Umbraco.Create { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.CheckBox CreateMacroCheckBox; - + /// /// MacroExistsValidator control. /// @@ -65,7 +65,7 @@ namespace Umbraco.Web.UI.Umbraco.Create { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.CustomValidator MacroExistsValidator; - + /// /// Textbox2 control. /// @@ -74,7 +74,7 @@ namespace Umbraco.Web.UI.Umbraco.Create { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.TextBox Textbox2; - + /// /// SubmitButton control. /// diff --git a/src/Umbraco.Web.UI/umbraco/create/User.ascx.cs b/src/Umbraco.Web.UI/umbraco/create/User.ascx.cs index 6364c9af9f..e7119463e4 100644 --- a/src/Umbraco.Web.UI/umbraco/create/User.ascx.cs +++ b/src/Umbraco.Web.UI/umbraco/create/User.ascx.cs @@ -79,4 +79,4 @@ namespace Umbraco.Web.UI.Umbraco.Create args.IsValid = MembershipProviderBase.IsEmailValid(args.Value); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web.UI/umbraco/create/User.ascx.designer.cs b/src/Umbraco.Web.UI/umbraco/create/User.ascx.designer.cs index 1017a1da04..2ddaaf5a7f 100644 --- a/src/Umbraco.Web.UI/umbraco/create/User.ascx.designer.cs +++ b/src/Umbraco.Web.UI/umbraco/create/User.ascx.designer.cs @@ -3,15 +3,15 @@ // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace Umbraco.Web.UI.Umbraco.Create { - - + + public partial class User { - + /// /// validationSummary control. /// @@ -20,7 +20,7 @@ namespace Umbraco.Web.UI.Umbraco.Create { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.ValidationSummary validationSummary; - + /// /// loginRequired control. /// @@ -29,7 +29,7 @@ namespace Umbraco.Web.UI.Umbraco.Create { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.RequiredFieldValidator loginRequired; - + /// /// loginExistsCheck control. /// @@ -38,7 +38,7 @@ namespace Umbraco.Web.UI.Umbraco.Create { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.CustomValidator loginExistsCheck; - + /// /// Login control. /// @@ -47,7 +47,7 @@ namespace Umbraco.Web.UI.Umbraco.Create { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.TextBox Login; - + /// /// emailRequired control. /// @@ -56,7 +56,7 @@ namespace Umbraco.Web.UI.Umbraco.Create { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.RequiredFieldValidator emailRequired; - + /// /// emailExistsCheck control. /// @@ -65,7 +65,7 @@ namespace Umbraco.Web.UI.Umbraco.Create { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.CustomValidator emailExistsCheck; - + /// /// EmailValidator control. /// @@ -74,7 +74,7 @@ namespace Umbraco.Web.UI.Umbraco.Create { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.CustomValidator EmailValidator; - + /// /// Email control. /// @@ -83,7 +83,7 @@ namespace Umbraco.Web.UI.Umbraco.Create { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.TextBox Email; - + /// /// Textbox1 control. /// @@ -92,7 +92,7 @@ namespace Umbraco.Web.UI.Umbraco.Create { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.TextBox Textbox1; - + /// /// sbmt control. /// diff --git a/src/Umbraco.Web.UI/umbraco/create/xslt.ascx.cs b/src/Umbraco.Web.UI/umbraco/create/xslt.ascx.cs index 1eafe2e11c..9f6cd5fce5 100644 --- a/src/Umbraco.Web.UI/umbraco/create/xslt.ascx.cs +++ b/src/Umbraco.Web.UI/umbraco/create/xslt.ascx.cs @@ -8,4 +8,4 @@ namespace Umbraco.Web.UI.Umbraco.Create public partial class Xslt : global::umbraco.presentation.create.xslt { } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web.UI/umbraco/create/xslt.ascx.designer.cs b/src/Umbraco.Web.UI/umbraco/create/xslt.ascx.designer.cs index 0ac63adfbe..b346b8a7bf 100644 --- a/src/Umbraco.Web.UI/umbraco/create/xslt.ascx.designer.cs +++ b/src/Umbraco.Web.UI/umbraco/create/xslt.ascx.designer.cs @@ -3,13 +3,13 @@ // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace Umbraco.Web.UI.Umbraco.Create { - - + + public partial class Xslt { } } diff --git a/src/Umbraco.Web.UI/umbraco/developer/Macros/EditMacro.aspx.cs b/src/Umbraco.Web.UI/umbraco/developer/Macros/EditMacro.aspx.cs index 73aa21647b..d01d9b08e7 100644 --- a/src/Umbraco.Web.UI/umbraco/developer/Macros/EditMacro.aspx.cs +++ b/src/Umbraco.Web.UI/umbraco/developer/Macros/EditMacro.aspx.cs @@ -12,64 +12,64 @@ using Umbraco.Core.Models; namespace Umbraco.Web.UI.Umbraco.Developer.Macros { - public partial class EditMacro : global::umbraco.cms.presentation.developer.editMacro - { + public partial class EditMacro : global::umbraco.cms.presentation.developer.editMacro + { - protected override void OnLoad(EventArgs e) - { - base.OnLoad(e); + protected override void OnLoad(EventArgs e) + { + base.OnLoad(e); - PopulatePartialViewFiles(); - } + PopulatePartialViewFiles(); + } - /// - /// This ensures that the SelectedPartialView txt box value is set correctly when the m_macro object's - /// ScriptingFile property contains a full virtual path beginning with the MacroPartials path - /// - /// - /// - /// - protected override void PopulateFieldsOnLoad(IMacro macro, string macroAssemblyValue, string macroTypeValue) - { - base.PopulateFieldsOnLoad(macro, macroAssemblyValue, macroTypeValue); - //check if the ScriptingFile property contains the MacroPartials path - if (macro.ScriptPath.IsNullOrWhiteSpace() == false && + /// + /// This ensures that the SelectedPartialView txt box value is set correctly when the m_macro object's + /// ScriptingFile property contains a full virtual path beginning with the MacroPartials path + /// + /// + /// + /// + protected override void PopulateFieldsOnLoad(IMacro macro, string macroAssemblyValue, string macroTypeValue) + { + base.PopulateFieldsOnLoad(macro, macroAssemblyValue, macroTypeValue); + //check if the ScriptingFile property contains the MacroPartials path + if (macro.ScriptPath.IsNullOrWhiteSpace() == false && (macro.ScriptPath.StartsWith(SystemDirectories.MvcViews + "/MacroPartials/") || (Regex.IsMatch(macro.ScriptPath, "~/App_Plugins/.+?/Views/MacroPartials", RegexOptions.Compiled)))) - { + { SelectedPartialView.Text = macro.ScriptPath; - } - } + } + } - /// - /// This changes the macro type to a PartialViewMacro if the SelectedPartialView txt box has a value. - /// This then also updates the file path saved for the partial view to be the full virtual path, not just the file name. - /// - /// - /// - /// - /// - protected override void SetMacroValuesFromPostBack(IMacro macro, int macroCachePeriod, string macroAssemblyValue, string macroTypeValue) - { - base.SetMacroValuesFromPostBack(macro, macroCachePeriod, macroAssemblyValue, macroTypeValue); - if (!SelectedPartialView.Text.IsNullOrWhiteSpace()) - { - macro.ScriptPath = SelectedPartialView.Text; - } - } + /// + /// This changes the macro type to a PartialViewMacro if the SelectedPartialView txt box has a value. + /// This then also updates the file path saved for the partial view to be the full virtual path, not just the file name. + /// + /// + /// + /// + /// + protected override void SetMacroValuesFromPostBack(IMacro macro, int macroCachePeriod, string macroAssemblyValue, string macroTypeValue) + { + base.SetMacroValuesFromPostBack(macro, macroCachePeriod, macroAssemblyValue, macroTypeValue); + if (!SelectedPartialView.Text.IsNullOrWhiteSpace()) + { + macro.ScriptPath = SelectedPartialView.Text; + } + } - /// - /// Populate the drop down list for partial view files - /// - private void PopulatePartialViewFiles() - { - var partialsDir = IOHelper.MapPath(SystemDirectories.MvcViews + "/MacroPartials"); - //get all the partials in the normal /MacroPartials folder - var foundMacroPartials = GetPartialViewFiles(partialsDir, partialsDir, SystemDirectories.MvcViews + "/MacroPartials"); - //now try to find all of them int he App_Plugins/[PackageName]/Views/MacroPartials folder - var appPluginsFolder = new DirectoryInfo(IOHelper.MapPath(SystemDirectories.AppPlugins)); - if (appPluginsFolder.Exists) - { + /// + /// Populate the drop down list for partial view files + /// + private void PopulatePartialViewFiles() + { + var partialsDir = IOHelper.MapPath(SystemDirectories.MvcViews + "/MacroPartials"); + //get all the partials in the normal /MacroPartials folder + var foundMacroPartials = GetPartialViewFiles(partialsDir, partialsDir, SystemDirectories.MvcViews + "/MacroPartials"); + //now try to find all of them int he App_Plugins/[PackageName]/Views/MacroPartials folder + var appPluginsFolder = new DirectoryInfo(IOHelper.MapPath(SystemDirectories.AppPlugins)); + if (appPluginsFolder.Exists) + { foreach (var d in appPluginsFolder.GetDirectories()) { var viewsFolder = d.GetDirectories("Views"); @@ -82,50 +82,50 @@ namespace Umbraco.Web.UI.Umbraco.Developer.Macros GetPartialViewFiles(macroPartials.First().FullName, macroPartials.First().FullName, SystemDirectories.AppPlugins + "/" + d.Name + "/Views/MacroPartials")); } } - } - } - - - PartialViewList.DataSource = foundMacroPartials; - PartialViewList.DataBind(); - PartialViewList.Items.Insert(0, new ListItem("Browse partial view files on server...", string.Empty)); - } + } + } - /// - /// Get the list of partial view files in the ~/Views/MacroPartials folder and in all - /// folders of ~/App_Plugins/[PackageName]/Views/MacroPartials - /// - /// - /// - /// - /// - private IEnumerable GetPartialViewFiles(string orgPath, string path, string prefixVirtualPath) - { - var files = new List(); - var dirInfo = new DirectoryInfo(path); - // Populate subdirectories - var dirInfos = dirInfo.GetDirectories(); - foreach (var dir in dirInfos) - { - files.AddRange(GetPartialViewFiles(orgPath, path + "/" + dir.Name, prefixVirtualPath)); - } + PartialViewList.DataSource = foundMacroPartials; + PartialViewList.DataBind(); + PartialViewList.Items.Insert(0, new ListItem("Browse partial view files on server...", string.Empty)); + } - var fileInfo = dirInfo.GetFiles("*.*"); + /// + /// Get the list of partial view files in the ~/Views/MacroPartials folder and in all + /// folders of ~/App_Plugins/[PackageName]/Views/MacroPartials + /// + /// + /// + /// + /// + private IEnumerable GetPartialViewFiles(string orgPath, string path, string prefixVirtualPath) + { + var files = new List(); + var dirInfo = new DirectoryInfo(path); - files.AddRange( - fileInfo.Select(file => - prefixVirtualPath.TrimEnd('/') + "/" + (path.Replace(orgPath, string.Empty).Trim('/') + "/" + file.Name).Trim('/'))); - return files; - } + // Populate subdirectories + var dirInfos = dirInfo.GetDirectories(); + foreach (var dir in dirInfos) + { + files.AddRange(GetPartialViewFiles(orgPath, path + "/" + dir.Name, prefixVirtualPath)); + } + + var fileInfo = dirInfo.GetFiles("*.*"); + + files.AddRange( + fileInfo.Select(file => + prefixVirtualPath.TrimEnd('/') + "/" + (path.Replace(orgPath, string.Empty).Trim('/') + "/" + file.Name).Trim('/'))); + return files; + } /// /// Binds the drop down list but ensures that the macro param type exists if it doesn't the drop down will be left blank /// /// /// - protected void MacroPropertiesOnItemDataBound(object sender, RepeaterItemEventArgs e) - { + protected void MacroPropertiesOnItemDataBound(object sender, RepeaterItemEventArgs e) + { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { var propertyTypes = (DropDownList)e.Item.FindControl("macroPropertyType"); @@ -137,9 +137,9 @@ namespace Umbraco.Web.UI.Umbraco.Developer.Macros if (editors.Any(x => x.Alias == macroProp.EditorAlias)) { propertyTypes.SelectedValue = macroProp.EditorAlias; - } + } } - } - } -} \ No newline at end of file + } + } +} diff --git a/src/Umbraco.Web.UI/umbraco/developer/Macros/EditMacro.aspx.designer.cs b/src/Umbraco.Web.UI/umbraco/developer/Macros/EditMacro.aspx.designer.cs index a1febaa2ba..a64101c102 100644 --- a/src/Umbraco.Web.UI/umbraco/developer/Macros/EditMacro.aspx.designer.cs +++ b/src/Umbraco.Web.UI/umbraco/developer/Macros/EditMacro.aspx.designer.cs @@ -3,15 +3,15 @@ // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace Umbraco.Web.UI.Umbraco.Developer.Macros { - - + + public partial class EditMacro { - + /// /// CssInclude1 control. /// @@ -20,7 +20,7 @@ namespace Umbraco.Web.UI.Umbraco.Developer.Macros { /// To modify move field declaration from designer file to code-behind file. /// protected global::ClientDependency.Core.Controls.CssInclude CssInclude1; - + /// /// SelectedPartialView control. /// @@ -29,7 +29,7 @@ namespace Umbraco.Web.UI.Umbraco.Developer.Macros { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.TextBox SelectedPartialView; - + /// /// PartialViewList control. /// diff --git a/src/Umbraco.Web.UI/umbraco/developer/Packages/DirectoryBrowser.aspx.cs b/src/Umbraco.Web.UI/umbraco/developer/Packages/DirectoryBrowser.aspx.cs index df1ec59321..6be42a0ad9 100644 --- a/src/Umbraco.Web.UI/umbraco/developer/Packages/DirectoryBrowser.aspx.cs +++ b/src/Umbraco.Web.UI/umbraco/developer/Packages/DirectoryBrowser.aspx.cs @@ -31,7 +31,7 @@ namespace Umbraco.Web.UI.Umbraco.Developer.Packages Response.Cache.SetExpires(DateTime.Now.AddSeconds(5)); Response.Cache.SetCacheability(HttpCacheability.Public); - + //we need to clean this string: //http://issues.umbraco.org/issue/U4-2027 var target = Request.QueryString.Get("target"); @@ -42,7 +42,7 @@ namespace Umbraco.Web.UI.Umbraco.Developer.Packages throw new InvalidOperationException("The target query string must be set to a valid html element id"); Target = matched[0].Value; - + try { @@ -137,4 +137,4 @@ namespace Umbraco.Web.UI.Umbraco.Developer.Packages } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web.UI/umbraco/developer/Packages/DirectoryBrowser.aspx.designer.cs b/src/Umbraco.Web.UI/umbraco/developer/Packages/DirectoryBrowser.aspx.designer.cs index 2ab2a2d15e..7badb831a6 100644 --- a/src/Umbraco.Web.UI/umbraco/developer/Packages/DirectoryBrowser.aspx.designer.cs +++ b/src/Umbraco.Web.UI/umbraco/developer/Packages/DirectoryBrowser.aspx.designer.cs @@ -3,15 +3,15 @@ // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace Umbraco.Web.UI.Umbraco.Developer.Packages { - - + + public partial class DirectoryBrowser { - + /// /// CssInclude1 control. /// @@ -20,7 +20,7 @@ namespace Umbraco.Web.UI.Umbraco.Developer.Packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::ClientDependency.Core.Controls.CssInclude CssInclude1; - + /// /// pane control. /// @@ -29,7 +29,7 @@ namespace Umbraco.Web.UI.Umbraco.Developer.Packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.Pane pane; - + /// /// Output control. /// diff --git a/src/Umbraco.Web.UI/umbraco/dialogs/ChangeDocType.aspx.cs b/src/Umbraco.Web.UI/umbraco/dialogs/ChangeDocType.aspx.cs index b4ad0633a9..2435c946c4 100644 --- a/src/Umbraco.Web.UI/umbraco/dialogs/ChangeDocType.aspx.cs +++ b/src/Umbraco.Web.UI/umbraco/dialogs/ChangeDocType.aspx.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -255,7 +255,7 @@ namespace Umbraco.Web.UI.Umbraco.Dialogs // Sync the tree ClientTools.SyncTree(_content.Path, true); - + // Reload the page if the content was already being viewed ClientTools.ReloadLocation(); @@ -341,4 +341,4 @@ namespace Umbraco.Web.UI.Umbraco.Dialogs return mappedPropertyValues; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web.UI/umbraco/dialogs/ChangeDocType.aspx.designer.cs b/src/Umbraco.Web.UI/umbraco/dialogs/ChangeDocType.aspx.designer.cs index 29acc7d2c3..c3b5ca8296 100644 --- a/src/Umbraco.Web.UI/umbraco/dialogs/ChangeDocType.aspx.designer.cs +++ b/src/Umbraco.Web.UI/umbraco/dialogs/ChangeDocType.aspx.designer.cs @@ -1,17 +1,17 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace Umbraco.Web.UI.Umbraco.Dialogs { - - + + public partial class ChangeDocType { - + /// /// ChangeDocTypePane control. /// @@ -20,7 +20,7 @@ namespace Umbraco.Web.UI.Umbraco.Dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.Pane ChangeDocTypePane; - + /// /// ContentNamePropertyPanel control. /// @@ -29,7 +29,7 @@ namespace Umbraco.Web.UI.Umbraco.Dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.PropertyPanel ContentNamePropertyPanel; - + /// /// ContentNameLabel control. /// @@ -38,7 +38,7 @@ namespace Umbraco.Web.UI.Umbraco.Dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Label ContentNameLabel; - + /// /// CurrentTypePropertyPanel control. /// @@ -47,7 +47,7 @@ namespace Umbraco.Web.UI.Umbraco.Dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.PropertyPanel CurrentTypePropertyPanel; - + /// /// CurrentTypeLabel control. /// @@ -56,7 +56,7 @@ namespace Umbraco.Web.UI.Umbraco.Dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Label CurrentTypeLabel; - + /// /// NewTypePropertyPanel control. /// @@ -65,7 +65,7 @@ namespace Umbraco.Web.UI.Umbraco.Dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.PropertyPanel NewTypePropertyPanel; - + /// /// NewDocumentTypeList control. /// @@ -74,7 +74,7 @@ namespace Umbraco.Web.UI.Umbraco.Dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.DropDownList NewDocumentTypeList; - + /// /// NewDocumentTypeValidator control. /// @@ -83,7 +83,7 @@ namespace Umbraco.Web.UI.Umbraco.Dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.RequiredFieldValidator NewDocumentTypeValidator; - + /// /// NewTemplatePropertyPanel control. /// @@ -92,7 +92,7 @@ namespace Umbraco.Web.UI.Umbraco.Dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.PropertyPanel NewTemplatePropertyPanel; - + /// /// NewTemplateList control. /// @@ -101,7 +101,7 @@ namespace Umbraco.Web.UI.Umbraco.Dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.DropDownList NewTemplateList; - + /// /// NotAvailablePlaceholder control. /// @@ -110,7 +110,7 @@ namespace Umbraco.Web.UI.Umbraco.Dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.PlaceHolder NotAvailablePlaceholder; - + /// /// ChangeDocTypePropertyMappingPane control. /// @@ -119,7 +119,7 @@ namespace Umbraco.Web.UI.Umbraco.Dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.Pane ChangeDocTypePropertyMappingPane; - + /// /// PropertyMappingRepeater control. /// @@ -128,7 +128,7 @@ namespace Umbraco.Web.UI.Umbraco.Dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Repeater PropertyMappingRepeater; - + /// /// SuccessPlaceholder control. /// @@ -137,7 +137,7 @@ namespace Umbraco.Web.UI.Umbraco.Dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.PlaceHolder SuccessPlaceholder; - + /// /// SuccessMessage control. /// @@ -146,7 +146,7 @@ namespace Umbraco.Web.UI.Umbraco.Dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Literal SuccessMessage; - + /// /// PropertiesMappedMessage control. /// @@ -155,7 +155,7 @@ namespace Umbraco.Web.UI.Umbraco.Dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Literal PropertiesMappedMessage; - + /// /// ContentPublishedMessage control. /// @@ -164,7 +164,7 @@ namespace Umbraco.Web.UI.Umbraco.Dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Literal ContentPublishedMessage; - + /// /// ValidationPlaceholder control. /// @@ -173,7 +173,7 @@ namespace Umbraco.Web.UI.Umbraco.Dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.PlaceHolder ValidationPlaceholder; - + /// /// ValidationError control. /// @@ -182,7 +182,7 @@ namespace Umbraco.Web.UI.Umbraco.Dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Literal ValidationError; - + /// /// SaveAndCancelPlaceholder control. /// @@ -191,7 +191,7 @@ namespace Umbraco.Web.UI.Umbraco.Dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.PlaceHolder SaveAndCancelPlaceholder; - + /// /// SavePlaceholder control. /// @@ -200,7 +200,7 @@ namespace Umbraco.Web.UI.Umbraco.Dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.PlaceHolder SavePlaceholder; - + /// /// ValidateAndSave control. /// diff --git a/src/Umbraco.Web.UI/umbraco/dialogs/Publish.aspx.cs b/src/Umbraco.Web.UI/umbraco/dialogs/Publish.aspx.cs index 7e09d0b425..c2a9bbb103 100644 --- a/src/Umbraco.Web.UI/umbraco/dialogs/Publish.aspx.cs +++ b/src/Umbraco.Web.UI/umbraco/dialogs/Publish.aspx.cs @@ -8,7 +8,7 @@ namespace Umbraco.Web.UI.Umbraco.Dialogs { public partial class Publish : UmbracoEnsuredPage { - + protected string PageName { get; private set; } protected int DocumentId { get; private set; } protected string DocumentPath { get; private set; } @@ -35,4 +35,4 @@ namespace Umbraco.Web.UI.Umbraco.Dialogs } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web.UI/umbraco/dialogs/Publish.aspx.designer.cs b/src/Umbraco.Web.UI/umbraco/dialogs/Publish.aspx.designer.cs index 8d393f6f1d..26eb7ede75 100644 --- a/src/Umbraco.Web.UI/umbraco/dialogs/Publish.aspx.designer.cs +++ b/src/Umbraco.Web.UI/umbraco/dialogs/Publish.aspx.designer.cs @@ -3,15 +3,15 @@ // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace Umbraco.Web.UI.Umbraco.Dialogs { - - + + public partial class Publish { - + /// /// JsInclude1 control. /// @@ -20,7 +20,7 @@ namespace Umbraco.Web.UI.Umbraco.Dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::ClientDependency.Core.Controls.JsInclude JsInclude1; - + /// /// JsInclude2 control. /// @@ -29,7 +29,7 @@ namespace Umbraco.Web.UI.Umbraco.Dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::ClientDependency.Core.Controls.JsInclude JsInclude2; - + /// /// CssInclude1 control. /// @@ -38,7 +38,7 @@ namespace Umbraco.Web.UI.Umbraco.Dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::ClientDependency.Core.Controls.CssInclude CssInclude1; - + /// /// ProgBar1 control. /// diff --git a/src/Umbraco.Web.UI/umbraco/dialogs/Sort.aspx.cs b/src/Umbraco.Web.UI/umbraco/dialogs/Sort.aspx.cs index 2d3c846be3..d51b9d1e66 100644 --- a/src/Umbraco.Web.UI/umbraco/dialogs/Sort.aspx.cs +++ b/src/Umbraco.Web.UI/umbraco/dialogs/Sort.aspx.cs @@ -8,4 +8,4 @@ namespace Umbraco.Web.UI.Umbraco.Dialogs public partial class Sort : global::umbraco.cms.presentation.sort { } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web.UI/umbraco/dialogs/Sort.aspx.designer.cs b/src/Umbraco.Web.UI/umbraco/dialogs/Sort.aspx.designer.cs index ecfbc638bd..ba59ae38ac 100644 --- a/src/Umbraco.Web.UI/umbraco/dialogs/Sort.aspx.designer.cs +++ b/src/Umbraco.Web.UI/umbraco/dialogs/Sort.aspx.designer.cs @@ -3,15 +3,15 @@ // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace Umbraco.Web.UI.Umbraco.Dialogs { - - + + public partial class Sort { - + /// /// CssInclude1 control. /// @@ -20,7 +20,7 @@ namespace Umbraco.Web.UI.Umbraco.Dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::ClientDependency.Core.Controls.CssInclude CssInclude1; - + /// /// JsInclude3 control. /// diff --git a/src/Umbraco.Web.UI/umbraco/masterpages/Default.Master.cs b/src/Umbraco.Web.UI/umbraco/masterpages/Default.Master.cs index 0c8e1b7907..77b5e8b758 100644 --- a/src/Umbraco.Web.UI/umbraco/masterpages/Default.Master.cs +++ b/src/Umbraco.Web.UI/umbraco/masterpages/Default.Master.cs @@ -8,4 +8,4 @@ namespace Umbraco.Web.UI.Umbraco.Masterpages public partial class Default : global::umbraco.presentation.masterpages._default { } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web.UI/umbraco/masterpages/Default.Master.designer.cs b/src/Umbraco.Web.UI/umbraco/masterpages/Default.Master.designer.cs index 7ae6fe970b..6132427f43 100644 --- a/src/Umbraco.Web.UI/umbraco/masterpages/Default.Master.designer.cs +++ b/src/Umbraco.Web.UI/umbraco/masterpages/Default.Master.designer.cs @@ -3,13 +3,13 @@ // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace Umbraco.Web.UI.Umbraco.Masterpages { - - + + public partial class Default { } } diff --git a/src/Umbraco.Web.UI/umbraco/masterpages/UmbracoDialog.master.cs b/src/Umbraco.Web.UI/umbraco/masterpages/UmbracoDialog.master.cs index 8b3cd6d546..3d28c7c367 100644 --- a/src/Umbraco.Web.UI/umbraco/masterpages/UmbracoDialog.master.cs +++ b/src/Umbraco.Web.UI/umbraco/masterpages/UmbracoDialog.master.cs @@ -5,7 +5,7 @@ using System.Web; namespace Umbraco.Web.UI.Umbraco.Masterpages { - public partial class UmbracoDialog : global::umbraco.presentation.masterpages.umbracoDialog - { - } -} \ No newline at end of file + public partial class UmbracoDialog : global::umbraco.presentation.masterpages.umbracoDialog + { + } +} diff --git a/src/Umbraco.Web.UI/umbraco/masterpages/UmbracoDialog.master.designer.cs b/src/Umbraco.Web.UI/umbraco/masterpages/UmbracoDialog.master.designer.cs index 66f2c928bd..914587e9b8 100644 --- a/src/Umbraco.Web.UI/umbraco/masterpages/UmbracoDialog.master.designer.cs +++ b/src/Umbraco.Web.UI/umbraco/masterpages/UmbracoDialog.master.designer.cs @@ -3,15 +3,15 @@ // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace Umbraco.Web.UI.Umbraco.Masterpages { - - + + public partial class UmbracoDialog { - + /// /// DocType control. /// diff --git a/src/Umbraco.Web.UI/umbraco/masterpages/UmbracoPage.master.cs b/src/Umbraco.Web.UI/umbraco/masterpages/UmbracoPage.master.cs index b2c2597f21..719e458bb3 100644 --- a/src/Umbraco.Web.UI/umbraco/masterpages/UmbracoPage.master.cs +++ b/src/Umbraco.Web.UI/umbraco/masterpages/UmbracoPage.master.cs @@ -5,7 +5,7 @@ using System.Web; namespace Umbraco.Web.UI.Umbraco.Masterpages { - public partial class UmbracoPage : global::umbraco.presentation.masterpages.umbracoPage - { - } -} \ No newline at end of file + public partial class UmbracoPage : global::umbraco.presentation.masterpages.umbracoPage + { + } +} diff --git a/src/Umbraco.Web.UI/umbraco/masterpages/UmbracoPage.master.designer.cs b/src/Umbraco.Web.UI/umbraco/masterpages/UmbracoPage.master.designer.cs index 52f17f5672..6658b833c8 100644 --- a/src/Umbraco.Web.UI/umbraco/masterpages/UmbracoPage.master.designer.cs +++ b/src/Umbraco.Web.UI/umbraco/masterpages/UmbracoPage.master.designer.cs @@ -3,15 +3,15 @@ // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace Umbraco.Web.UI.Umbraco.Masterpages { - - + + public partial class UmbracoPage { - + /// /// DocType control. /// diff --git a/src/Umbraco.Web.UI/umbraco/settings/EditTemplate.aspx.cs b/src/Umbraco.Web.UI/umbraco/settings/EditTemplate.aspx.cs index c219f71a29..4c81917beb 100644 --- a/src/Umbraco.Web.UI/umbraco/settings/EditTemplate.aspx.cs +++ b/src/Umbraco.Web.UI/umbraco/settings/EditTemplate.aspx.cs @@ -5,7 +5,7 @@ using System.Web; namespace Umbraco.Web.UI.Umbraco.Settings { - public partial class EditTemplate : global::umbraco.cms.presentation.settings.editTemplate - { - } -} \ No newline at end of file + public partial class EditTemplate : global::umbraco.cms.presentation.settings.editTemplate + { + } +} diff --git a/src/Umbraco.Web.UI/umbraco/settings/EditTemplate.aspx.designer.cs b/src/Umbraco.Web.UI/umbraco/settings/EditTemplate.aspx.designer.cs index 956466eac9..7345824a88 100644 --- a/src/Umbraco.Web.UI/umbraco/settings/EditTemplate.aspx.designer.cs +++ b/src/Umbraco.Web.UI/umbraco/settings/EditTemplate.aspx.designer.cs @@ -3,15 +3,15 @@ // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace Umbraco.Web.UI.Umbraco.Settings { - - + + public partial class EditTemplate { - + /// /// JsInclude1 control. /// diff --git a/src/Umbraco.Web.UI/umbraco/settings/stylesheet/editstylesheet.aspx.cs b/src/Umbraco.Web.UI/umbraco/settings/stylesheet/editstylesheet.aspx.cs index 6e875be4d8..7cb1d62410 100644 --- a/src/Umbraco.Web.UI/umbraco/settings/stylesheet/editstylesheet.aspx.cs +++ b/src/Umbraco.Web.UI/umbraco/settings/stylesheet/editstylesheet.aspx.cs @@ -8,4 +8,4 @@ namespace Umbraco.Web.UI.Umbraco.Settings.Stylesheet public partial class EditStyleSheet : global::umbraco.cms.presentation.settings.stylesheet.editstylesheet { } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web.UI/umbraco/settings/stylesheet/editstylesheet.aspx.designer.cs b/src/Umbraco.Web.UI/umbraco/settings/stylesheet/editstylesheet.aspx.designer.cs index 1adaec56b9..7788269b14 100644 --- a/src/Umbraco.Web.UI/umbraco/settings/stylesheet/editstylesheet.aspx.designer.cs +++ b/src/Umbraco.Web.UI/umbraco/settings/stylesheet/editstylesheet.aspx.designer.cs @@ -3,13 +3,13 @@ // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace Umbraco.Web.UI.Umbraco.Settings.Stylesheet { - - + + public partial class EditStyleSheet { } } diff --git a/src/Umbraco.Web.UI/umbraco/settings/stylesheet/property/EditStyleSheetProperty.aspx.cs b/src/Umbraco.Web.UI/umbraco/settings/stylesheet/property/EditStyleSheetProperty.aspx.cs index e5d366f7dd..10fbd19bb9 100644 --- a/src/Umbraco.Web.UI/umbraco/settings/stylesheet/property/EditStyleSheetProperty.aspx.cs +++ b/src/Umbraco.Web.UI/umbraco/settings/stylesheet/property/EditStyleSheetProperty.aspx.cs @@ -8,4 +8,4 @@ namespace Umbraco.Web.UI.Umbraco.Settings.Stylesheet.Property public partial class EditStyleSheetProperty : global::umbraco.cms.presentation.settings.stylesheet.EditStyleSheetProperty { } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web.UI/umbraco/settings/stylesheet/property/EditStyleSheetProperty.aspx.designer.cs b/src/Umbraco.Web.UI/umbraco/settings/stylesheet/property/EditStyleSheetProperty.aspx.designer.cs index 41a9e1e887..a91ca8778c 100644 --- a/src/Umbraco.Web.UI/umbraco/settings/stylesheet/property/EditStyleSheetProperty.aspx.designer.cs +++ b/src/Umbraco.Web.UI/umbraco/settings/stylesheet/property/EditStyleSheetProperty.aspx.designer.cs @@ -3,13 +3,13 @@ // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace Umbraco.Web.UI.Umbraco.Settings.Stylesheet.Property { - - + + public partial class EditStyleSheetProperty { } } diff --git a/src/Umbraco.Web.UI/umbraco/settings/views/EditView.aspx.cs b/src/Umbraco.Web.UI/umbraco/settings/views/EditView.aspx.cs index 07b57b768a..68178aeef6 100644 --- a/src/Umbraco.Web.UI/umbraco/settings/views/EditView.aspx.cs +++ b/src/Umbraco.Web.UI/umbraco/settings/views/EditView.aspx.cs @@ -21,38 +21,38 @@ using Umbraco.Core.Services; namespace Umbraco.Web.UI.Umbraco.Settings.Views { - public partial class EditView : UmbracoEnsuredPage - { - private Template _template; - public MenuButton SaveButton; + public partial class EditView : UmbracoEnsuredPage + { + private Template _template; + public MenuButton SaveButton; - public EditView() - { - CurrentApp = Constants.Applications.Settings; - } + public EditView() + { + CurrentApp = Constants.Applications.Settings; + } - /// - /// The type of MVC/Umbraco view the editor is editing - /// - public enum ViewEditorType - { - Template, - PartialView, + /// + /// The type of MVC/Umbraco view the editor is editing + /// + public enum ViewEditorType + { + Template, + PartialView, PartialViewMacro - } + } - /// - /// Returns the type of view being edited - /// - protected ViewEditorType EditorType - { - get - { - if (_template != null) return ViewEditorType.Template; + /// + /// Returns the type of view being edited + /// + protected ViewEditorType EditorType + { + get + { + if (_template != null) return ViewEditorType.Template; if (Request.QueryString["treeType"].IsNullOrWhiteSpace() == false && Request.QueryString["treeType"].InvariantEquals("partialViewMacros")) return ViewEditorType.PartialViewMacro; - return ViewEditorType.PartialView; - } - } + return ViewEditorType.PartialView; + } + } protected string TemplateTreeSyncPath { get; private set; } @@ -60,112 +60,112 @@ namespace Umbraco.Web.UI.Umbraco.Settings.Views /// This view is shared between different trees so we'll look for the query string ///
protected string CurrentTreeType - { - get - { - if (Request.QueryString["treeType"].IsNullOrWhiteSpace()) + { + get + { + if (Request.QueryString["treeType"].IsNullOrWhiteSpace()) { return Constants.Trees.PartialViews; } - return Request.CleanForXss("treeType"); - } - } + return Request.CleanForXss("treeType"); + } + } - /// - /// Returns the original file name that the editor was loaded with - /// - /// - /// this is used for editing a partial view - /// - protected string OriginalFileName { get; private set; } + /// + /// Returns the original file name that the editor was loaded with + /// + /// + /// this is used for editing a partial view + /// + protected string OriginalFileName { get; private set; } - protected override void OnLoad(EventArgs e) - { - base.OnLoad(e); + protected override void OnLoad(EventArgs e) + { + base.OnLoad(e); - if (!IsPostBack) - { + if (!IsPostBack) + { - //configure screen for editing a template - if (_template != null) - { - MasterTemplate.Items.Add(new ListItem(Services.TextService.Localize("none"), "0")); - var selectedTemplate = string.Empty; + //configure screen for editing a template + if (_template != null) + { + MasterTemplate.Items.Add(new ListItem(Services.TextService.Localize("none"), "0")); + var selectedTemplate = string.Empty; - foreach (var t in Template.GetAllAsList()) - { - if (t.Id == _template.Id) continue; + foreach (var t in Template.GetAllAsList()) + { + if (t.Id == _template.Id) continue; - var li = new ListItem(t.Text, t.Id.ToString(CultureInfo.InvariantCulture)); - li.Attributes.Add("id", t.Alias.Replace(" ", "") + ".cshtml"); - MasterTemplate.Items.Add(li); - } + var li = new ListItem(t.Text, t.Id.ToString(CultureInfo.InvariantCulture)); + li.Attributes.Add("id", t.Alias.Replace(" ", "") + ".cshtml"); + MasterTemplate.Items.Add(li); + } - try - { - if (_template.MasterTemplate > 0) - MasterTemplate.SelectedValue = _template.MasterTemplate.ToString(CultureInfo.InvariantCulture); - } - catch (Exception ex) - { + try + { + if (_template.MasterTemplate > 0) + MasterTemplate.SelectedValue = _template.MasterTemplate.ToString(CultureInfo.InvariantCulture); + } + catch (Exception ex) + { Current.Logger.Error("An error occurred setting a master template id", ex); - } + } - MasterTemplate.SelectedValue = selectedTemplate; - NameTxt.Text = _template.GetRawText(); - AliasTxt.Text = _template.Alias; - editorSource.Text = _template.Design; - PathPrefix.Visible = false; - } - else - { - //configure editor for editing a file.... + MasterTemplate.SelectedValue = selectedTemplate; + NameTxt.Text = _template.GetRawText(); + AliasTxt.Text = _template.Alias; + editorSource.Text = _template.Design; + PathPrefix.Visible = false; + } + else + { + //configure editor for editing a file.... - NameTxt.Text = OriginalFileName; - var svce = Current.Services.FileService; + NameTxt.Text = OriginalFileName; + var svce = Current.Services.FileService; var file = EditorType == ViewEditorType.PartialView - ? svce.GetPartialView(OriginalFileName) + ? svce.GetPartialView(OriginalFileName) : svce.GetPartialViewMacro(OriginalFileName); - editorSource.Text = file.Content; + editorSource.Text = file.Content; const string prefixFormat = "{0}"; PathPrefix.Text = string.Format(prefixFormat, EditorType == ViewEditorType.PartialView - ? "Partials/" - : "MacroPartials/"); - } - } + ? "Partials/" + : "MacroPartials/"); + } + } ClientTools .SetActiveTreeType(CurrentTreeType) .SyncTree(TemplateTreeSyncPath, false); - } + } - protected override void OnInit(EventArgs e) - { - base.OnInit(e); + protected override void OnInit(EventArgs e) + { + base.OnInit(e); - //check if a templateId is assigned, meaning we are editing a template - if (!Request.QueryString["templateID"].IsNullOrWhiteSpace()) - { - _template = new Template(int.Parse(Request.QueryString["templateID"])); + //check if a templateId is assigned, meaning we are editing a template + if (!Request.QueryString["templateID"].IsNullOrWhiteSpace()) + { + _template = new Template(int.Parse(Request.QueryString["templateID"])); TemplateTreeSyncPath = "-1,init," + _template.Path.Replace("-1,", ""); - } - else if (!Request.QueryString["file"].IsNullOrWhiteSpace()) - { - //we are editing a view (i.e. partial view) - OriginalFileName = HttpUtility.UrlDecode(Request.QueryString["file"]); + } + else if (!Request.QueryString["file"].IsNullOrWhiteSpace()) + { + //we are editing a view (i.e. partial view) + OriginalFileName = HttpUtility.UrlDecode(Request.QueryString["file"]); //TemplateTreeSyncPath = "-1,init," + Path.GetFileName(OriginalFileName); TemplateTreeSyncPath = BaseTree.GetTreePathFromFilePath(OriginalFileName.TrimStart("MacroPartials/").TrimStart("Partials/")); - } - else - { - throw new InvalidOperationException("Cannot render the editor without a supplied templateId or a file"); - } + } + else + { + throw new InvalidOperationException("Cannot render the editor without a supplied templateId or a file"); + } - Panel1.hasMenu = true; + Panel1.hasMenu = true; var editor = Panel1.NewTabPage(Services.TextService.Localize("template")); editor.Controls.Add(Pane8); @@ -179,36 +179,36 @@ namespace Umbraco.Web.UI.Umbraco.Settings.Views SaveButton.ID = "save"; SaveButton.CssClass = "client-side"; - Panel1.Text = Services.TextService.Localize("edittemplate"); - pp_name.Text = Services.TextService.Localize("name"); - pp_alias.Text = Services.TextService.Localize("alias"); - pp_masterTemplate.Text = Services.TextService.Localize("mastertemplate"); + Panel1.Text = Services.TextService.Localize("edittemplate"); + pp_name.Text = Services.TextService.Localize("name"); + pp_alias.Text = Services.TextService.Localize("alias"); + pp_masterTemplate.Text = Services.TextService.Localize("mastertemplate"); - // Editing buttons + // Editing buttons MenuIconI umbField = editorSource.Menu.NewIcon(); - umbField.ImageURL = SystemDirectories.Umbraco + "/images/editor/insField.gif"; - umbField.OnClickCommand = - ClientTools.Scripts.OpenModalWindow( - IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/dialogs/umbracoField.aspx?objectId=" + - editorSource.ClientID + "&tagName=UMBRACOGETDATA&mvcView=true", Services.TextService.Localize("template/insertPageField"), 640, 550); - umbField.AltText = Services.TextService.Localize("template/insertPageField"); + umbField.ImageURL = SystemDirectories.Umbraco + "/images/editor/insField.gif"; + umbField.OnClickCommand = + ClientTools.Scripts.OpenModalWindow( + IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/dialogs/umbracoField.aspx?objectId=" + + editorSource.ClientID + "&tagName=UMBRACOGETDATA&mvcView=true", Services.TextService.Localize("template/insertPageField"), 640, 550); + umbField.AltText = Services.TextService.Localize("template/insertPageField"); - // TODO: Update icon + // TODO: Update icon MenuIconI umbDictionary = editorSource.Menu.NewIcon(); - umbDictionary.ImageURL = GlobalSettings.Path + "/images/editor/dictionaryItem.gif"; - umbDictionary.OnClickCommand = - ClientTools.Scripts.OpenModalWindow( - IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/dialogs/umbracoField.aspx?objectId=" + + umbDictionary.ImageURL = GlobalSettings.Path + "/images/editor/dictionaryItem.gif"; + umbDictionary.OnClickCommand = + ClientTools.Scripts.OpenModalWindow( + IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/dialogs/umbracoField.aspx?objectId=" + editorSource.ClientID + "&tagName=UMBRACOGETDICTIONARY&mvcView=true", Services.TextService.Localize("template/insertDictionaryItem"), - 640, 550); - umbDictionary.AltText = "Insert umbraco dictionary item"; + 640, 550); + umbDictionary.AltText = "Insert umbraco dictionary item"; - var macroSplitButton = new InsertMacroSplitButton - { - ClientCallbackInsertMacroMarkup = "function(alias) {editViewEditor.insertMacroMarkup(alias);}", - ClientCallbackOpenMacroModel = "function(alias) {editViewEditor.openMacroModal(alias);}" - }; + var macroSplitButton = new InsertMacroSplitButton + { + ClientCallbackInsertMacroMarkup = "function(alias) {editViewEditor.insertMacroMarkup(alias);}", + ClientCallbackOpenMacroModel = "function(alias) {editViewEditor.openMacroModal(alias);}" + }; editorSource.Menu.InsertNewControl(macroSplitButton, 40); MenuIconI umbTemplateQueryBuilder = editorSource.Menu.NewIcon(); @@ -216,39 +216,39 @@ namespace Umbraco.Web.UI.Umbraco.Settings.Views umbTemplateQueryBuilder.OnClickCommand = "editViewEditor.openQueryModal()"; umbTemplateQueryBuilder.AltText = "Open query builder"; - if (_template == null) - { - InitializeEditorForPartialView(); - } - else - { - InitializeEditorForTemplate(); - } + if (_template == null) + { + InitializeEditorForPartialView(); + } + else + { + InitializeEditorForTemplate(); + } - } + } - protected override void OnPreRender(EventArgs e) - { - base.OnPreRender(e); - ScriptManager.GetCurrent(Page).Services.Add(new ServiceReference("../webservices/codeEditorSave.asmx")); - ScriptManager.GetCurrent(Page).Services.Add(new ServiceReference("../webservices/legacyAjaxCalls.asmx")); - } + protected override void OnPreRender(EventArgs e) + { + base.OnPreRender(e); + ScriptManager.GetCurrent(Page).Services.Add(new ServiceReference("../webservices/codeEditorSave.asmx")); + ScriptManager.GetCurrent(Page).Services.Add(new ServiceReference("../webservices/legacyAjaxCalls.asmx")); + } - /// - /// Configure the editor for partial view editing - /// - private void InitializeEditorForPartialView() - { - pp_masterTemplate.Visible = false; - pp_alias.Visible = false; - pp_name.Text = "Filename"; - } + /// + /// Configure the editor for partial view editing + /// + private void InitializeEditorForPartialView() + { + pp_masterTemplate.Visible = false; + pp_alias.Visible = false; + pp_name.Text = "Filename"; + } - /// - /// Configure the editor for editing a template - /// - private void InitializeEditorForTemplate() - { + /// + /// Configure the editor for editing a template + /// + private void InitializeEditorForTemplate() + { //TODO: implement content placeholders, etc... just like we had in v5 @@ -278,4 +278,4 @@ namespace Umbraco.Web.UI.Umbraco.Settings.Views } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web.UI/umbraco/settings/views/EditView.aspx.designer.cs b/src/Umbraco.Web.UI/umbraco/settings/views/EditView.aspx.designer.cs index dd81da023a..6f8dea35aa 100644 --- a/src/Umbraco.Web.UI/umbraco/settings/views/EditView.aspx.designer.cs +++ b/src/Umbraco.Web.UI/umbraco/settings/views/EditView.aspx.designer.cs @@ -3,15 +3,15 @@ // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace Umbraco.Web.UI.Umbraco.Settings.Views { - - + + public partial class EditView { - + /// /// JsInclude1 control. /// @@ -20,7 +20,7 @@ namespace Umbraco.Web.UI.Umbraco.Settings.Views { /// To modify move field declaration from designer file to code-behind file. /// protected global::ClientDependency.Core.Controls.JsInclude JsInclude1; - + /// /// Panel1 control. /// @@ -29,7 +29,7 @@ namespace Umbraco.Web.UI.Umbraco.Settings.Views { /// To modify move field declaration from designer file to code-behind file. /// protected global::umbraco.uicontrols.TabView Panel1; - + /// /// Pane8 control. /// @@ -38,7 +38,7 @@ namespace Umbraco.Web.UI.Umbraco.Settings.Views { /// To modify move field declaration from designer file to code-behind file. /// protected global::umbraco.uicontrols.Pane Pane8; - + /// /// pp_source control. /// @@ -47,7 +47,7 @@ namespace Umbraco.Web.UI.Umbraco.Settings.Views { /// To modify move field declaration from designer file to code-behind file. /// protected global::umbraco.uicontrols.PropertyPanel pp_source; - + /// /// editorSource control. /// @@ -56,7 +56,7 @@ namespace Umbraco.Web.UI.Umbraco.Settings.Views { /// To modify move field declaration from designer file to code-behind file. /// protected global::umbraco.uicontrols.CodeArea editorSource; - + /// /// Pane7 control. /// @@ -65,7 +65,7 @@ namespace Umbraco.Web.UI.Umbraco.Settings.Views { /// To modify move field declaration from designer file to code-behind file. /// protected global::umbraco.uicontrols.Pane Pane7; - + /// /// pp_name control. /// @@ -74,7 +74,7 @@ namespace Umbraco.Web.UI.Umbraco.Settings.Views { /// To modify move field declaration from designer file to code-behind file. /// protected global::umbraco.uicontrols.PropertyPanel pp_name; - + /// /// PathPrefix control. /// @@ -83,7 +83,7 @@ namespace Umbraco.Web.UI.Umbraco.Settings.Views { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Literal PathPrefix; - + /// /// NameTxt control. /// @@ -92,7 +92,7 @@ namespace Umbraco.Web.UI.Umbraco.Settings.Views { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.TextBox NameTxt; - + /// /// pp_alias control. /// @@ -101,7 +101,7 @@ namespace Umbraco.Web.UI.Umbraco.Settings.Views { /// To modify move field declaration from designer file to code-behind file. /// protected global::umbraco.uicontrols.PropertyPanel pp_alias; - + /// /// AliasTxt control. /// @@ -110,7 +110,7 @@ namespace Umbraco.Web.UI.Umbraco.Settings.Views { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.TextBox AliasTxt; - + /// /// pp_masterTemplate control. /// @@ -119,7 +119,7 @@ namespace Umbraco.Web.UI.Umbraco.Settings.Views { /// To modify move field declaration from designer file to code-behind file. /// protected global::umbraco.uicontrols.PropertyPanel pp_masterTemplate; - + /// /// MasterTemplate control. /// diff --git a/src/Umbraco.Web.UI/umbraco/users/EditUser.aspx.cs b/src/Umbraco.Web.UI/umbraco/users/EditUser.aspx.cs index aa8c0c5b57..ce322501ce 100644 --- a/src/Umbraco.Web.UI/umbraco/users/EditUser.aspx.cs +++ b/src/Umbraco.Web.UI/umbraco/users/EditUser.aspx.cs @@ -8,4 +8,4 @@ namespace Umbraco.Web.UI.Umbraco.Users public partial class EditUser : global::umbraco.cms.presentation.user.EditUser { } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web.UI/umbraco/users/EditUser.aspx.designer.cs b/src/Umbraco.Web.UI/umbraco/users/EditUser.aspx.designer.cs index d9ef0b3cc5..f386114ed0 100644 --- a/src/Umbraco.Web.UI/umbraco/users/EditUser.aspx.designer.cs +++ b/src/Umbraco.Web.UI/umbraco/users/EditUser.aspx.designer.cs @@ -3,13 +3,13 @@ // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace Umbraco.Web.UI.Umbraco.Users { - - + + public partial class EditUser { } } diff --git a/src/Umbraco.Web/AreaRegistrationContextExtensions.cs b/src/Umbraco.Web/AreaRegistrationContextExtensions.cs index a3b4c53e36..1321d3722c 100644 --- a/src/Umbraco.Web/AreaRegistrationContextExtensions.cs +++ b/src/Umbraco.Web/AreaRegistrationContextExtensions.cs @@ -1,4 +1,4 @@ -using System.Web.Http; +using System.Web.Http; using System.Web.Mvc; using System.Web.Routing; @@ -25,4 +25,4 @@ namespace Umbraco.Web return apiRoute; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/BatchedDatabaseServerMessenger.cs b/src/Umbraco.Web/BatchedDatabaseServerMessenger.cs index f63441e039..6b57e7f3ea 100644 --- a/src/Umbraco.Web/BatchedDatabaseServerMessenger.cs +++ b/src/Umbraco.Web/BatchedDatabaseServerMessenger.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Web; @@ -99,7 +99,7 @@ namespace Umbraco.Web { WriteInstructions(instructionsBatch); } - + } private void WriteInstructions(IEnumerable instructions) @@ -125,7 +125,7 @@ namespace Umbraco.Web // can get the http context from it var httpContext = (UmbracoContext.Current == null ? null : UmbracoContext.Current.HttpContext) // if this is null, it could be that an async thread is calling this method that we weren't aware of and the UmbracoContext - // wasn't ensured at the beginning of the thread. We can try to see if the HttpContext.Current is available which might be + // wasn't ensured at the beginning of the thread. We can try to see if the HttpContext.Current is available which might be // the case if the asp.net synchronization context has kicked in ?? (HttpContext.Current == null ? null : new HttpContextWrapper(HttpContext.Current)); @@ -165,7 +165,7 @@ namespace Umbraco.Web { batch.Add(new RefreshInstructionEnvelope(servers, refresher, instructions)); } - - } + + } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/BatchedWebServiceServerMessenger.cs b/src/Umbraco.Web/BatchedWebServiceServerMessenger.cs index 766683a1c9..66a850e5c5 100644 --- a/src/Umbraco.Web/BatchedWebServiceServerMessenger.cs +++ b/src/Umbraco.Web/BatchedWebServiceServerMessenger.cs @@ -20,13 +20,13 @@ namespace Umbraco.Web UmbracoModule.EndRequest += UmbracoModule_EndRequest; } - internal BatchedWebServiceServerMessenger(string login, string password) + internal BatchedWebServiceServerMessenger(string login, string password) : base(login, password) { UmbracoModule.EndRequest += UmbracoModule_EndRequest; } - internal BatchedWebServiceServerMessenger(string login, string password, bool useDistributedCalls) + internal BatchedWebServiceServerMessenger(string login, string password, bool useDistributedCalls) : base(login, password, useDistributedCalls) { UmbracoModule.EndRequest += UmbracoModule_EndRequest; @@ -45,7 +45,7 @@ namespace Umbraco.Web // can get the http context from it var httpContext = (UmbracoContext.Current == null ? null : UmbracoContext.Current.HttpContext) //if this is null, it could be that an async thread is calling this method that we weren't aware of and the UmbracoContext - // wasn't ensured at the beginning of the thread. We can try to see if the HttpContext.Current is available which might be + // wasn't ensured at the beginning of the thread. We can try to see if the HttpContext.Current is available which might be // the case if the asp.net synchronization context has kicked in ?? (HttpContext.Current == null ? null : new HttpContextWrapper(HttpContext.Current)); diff --git a/src/Umbraco.Web/Cache/ApplicationCacheRefresher.cs b/src/Umbraco.Web/Cache/ApplicationCacheRefresher.cs index f01a0bc678..b3fc1bc9f6 100644 --- a/src/Umbraco.Web/Cache/ApplicationCacheRefresher.cs +++ b/src/Umbraco.Web/Cache/ApplicationCacheRefresher.cs @@ -43,4 +43,4 @@ namespace Umbraco.Web.Cache #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Cache/ApplicationTreeCacheRefresher.cs b/src/Umbraco.Web/Cache/ApplicationTreeCacheRefresher.cs index f9cbf68b26..0346e6bd3e 100644 --- a/src/Umbraco.Web/Cache/ApplicationTreeCacheRefresher.cs +++ b/src/Umbraco.Web/Cache/ApplicationTreeCacheRefresher.cs @@ -43,4 +43,4 @@ namespace Umbraco.Web.Cache #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Cache/CacheRefresherComponent.cs b/src/Umbraco.Web/Cache/CacheRefresherComponent.cs index bf81bcd4bb..3bd8e5235a 100644 --- a/src/Umbraco.Web/Cache/CacheRefresherComponent.cs +++ b/src/Umbraco.Web/Cache/CacheRefresherComponent.cs @@ -621,7 +621,7 @@ namespace Umbraco.Web.Cache foreach (var e in args.DeletedEntities) dc.RemoveRelationTypeCache(e.Id); } - + #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Cache/ContentTypeCacheRefresher.cs b/src/Umbraco.Web/Cache/ContentTypeCacheRefresher.cs index 7b0335ee0f..4a4c6c4c35 100644 --- a/src/Umbraco.Web/Cache/ContentTypeCacheRefresher.cs +++ b/src/Umbraco.Web/Cache/ContentTypeCacheRefresher.cs @@ -11,7 +11,7 @@ namespace Umbraco.Web.Cache { private readonly IFacadeService _facadeService; - public ContentTypeCacheRefresher(CacheHelper cacheHelper, IFacadeService facadeService) + public ContentTypeCacheRefresher(CacheHelper cacheHelper, IFacadeService facadeService) : base(cacheHelper) { _facadeService = facadeService; @@ -123,7 +123,7 @@ namespace Umbraco.Web.Cache // that cache is disabled because we could not clear it properly //global::umbraco.cms.businesslogic.ContentType.RemoveFromDataTypeCache(contentTypeAlias); } - + #endregion #region Json diff --git a/src/Umbraco.Web/Cache/DataTypeCacheRefresher.cs b/src/Umbraco.Web/Cache/DataTypeCacheRefresher.cs index c76b09b906..8dfb4713b8 100644 --- a/src/Umbraco.Web/Cache/DataTypeCacheRefresher.cs +++ b/src/Umbraco.Web/Cache/DataTypeCacheRefresher.cs @@ -112,4 +112,4 @@ namespace Umbraco.Web.Cache #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Cache/DictionaryCacheRefresher.cs b/src/Umbraco.Web/Cache/DictionaryCacheRefresher.cs index 0e69e4ad70..13e1e35a83 100644 --- a/src/Umbraco.Web/Cache/DictionaryCacheRefresher.cs +++ b/src/Umbraco.Web/Cache/DictionaryCacheRefresher.cs @@ -38,4 +38,4 @@ namespace Umbraco.Web.Cache #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Cache/DistributedCacheExtensions.cs b/src/Umbraco.Web/Cache/DistributedCacheExtensions.cs index 0b6c4ae310..d8ed5d0ad9 100644 --- a/src/Umbraco.Web/Cache/DistributedCacheExtensions.cs +++ b/src/Umbraco.Web/Cache/DistributedCacheExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using Umbraco.Core.Models; using Umbraco.Core.Services.Changes; @@ -340,4 +340,4 @@ namespace Umbraco.Web.Cache #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Cache/DomainCacheRefresher.cs b/src/Umbraco.Web/Cache/DomainCacheRefresher.cs index b873d28d12..2ddf38a29b 100644 --- a/src/Umbraco.Web/Cache/DomainCacheRefresher.cs +++ b/src/Umbraco.Web/Cache/DomainCacheRefresher.cs @@ -86,4 +86,4 @@ namespace Umbraco.Web.Cache #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Cache/LanguageCacheRefresher.cs b/src/Umbraco.Web/Cache/LanguageCacheRefresher.cs index 740488c3ec..2270f6471c 100644 --- a/src/Umbraco.Web/Cache/LanguageCacheRefresher.cs +++ b/src/Umbraco.Web/Cache/LanguageCacheRefresher.cs @@ -40,4 +40,4 @@ namespace Umbraco.Web.Cache #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Cache/MacroCacheRefresher.cs b/src/Umbraco.Web/Cache/MacroCacheRefresher.cs index b039672ad2..633f5c1b76 100644 --- a/src/Umbraco.Web/Cache/MacroCacheRefresher.cs +++ b/src/Umbraco.Web/Cache/MacroCacheRefresher.cs @@ -11,7 +11,7 @@ namespace Umbraco.Web.Cache { public sealed class MacroCacheRefresher : JsonCacheRefresherBase { - public MacroCacheRefresher(CacheHelper cacheHelper) + public MacroCacheRefresher(CacheHelper cacheHelper) : base(cacheHelper) { } @@ -61,7 +61,7 @@ namespace Umbraco.Web.Cache base.Refresh(json); } - + #endregion #region Json @@ -124,4 +124,4 @@ namespace Umbraco.Web.Cache #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Cache/MediaCacheRefresher.cs b/src/Umbraco.Web/Cache/MediaCacheRefresher.cs index 4be360e1e7..93a98bf523 100644 --- a/src/Umbraco.Web/Cache/MediaCacheRefresher.cs +++ b/src/Umbraco.Web/Cache/MediaCacheRefresher.cs @@ -147,4 +147,4 @@ namespace Umbraco.Web.Cache #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Cache/MemberCacheRefresher.cs b/src/Umbraco.Web/Cache/MemberCacheRefresher.cs index fdacda00c2..c701ecea5d 100644 --- a/src/Umbraco.Web/Cache/MemberCacheRefresher.cs +++ b/src/Umbraco.Web/Cache/MemberCacheRefresher.cs @@ -74,4 +74,4 @@ namespace Umbraco.Web.Cache #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Cache/MemberGroupCacheRefresher.cs b/src/Umbraco.Web/Cache/MemberGroupCacheRefresher.cs index c81871797b..009f534615 100644 --- a/src/Umbraco.Web/Cache/MemberGroupCacheRefresher.cs +++ b/src/Umbraco.Web/Cache/MemberGroupCacheRefresher.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using Newtonsoft.Json; using Umbraco.Core; @@ -98,4 +98,4 @@ namespace Umbraco.Web.Cache #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Cache/PublicAccessCacheRefresher.cs b/src/Umbraco.Web/Cache/PublicAccessCacheRefresher.cs index 553ba9b128..7c3af1129f 100644 --- a/src/Umbraco.Web/Cache/PublicAccessCacheRefresher.cs +++ b/src/Umbraco.Web/Cache/PublicAccessCacheRefresher.cs @@ -1,4 +1,4 @@ -using System; +using System; using Umbraco.Core.Cache; using Umbraco.Core.Models; @@ -6,7 +6,7 @@ namespace Umbraco.Web.Cache { public sealed class PublicAccessCacheRefresher : CacheRefresherBase { - public PublicAccessCacheRefresher(CacheHelper cacheHelper) + public PublicAccessCacheRefresher(CacheHelper cacheHelper) : base(cacheHelper) { } @@ -50,4 +50,4 @@ namespace Umbraco.Web.Cache #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Cache/RelationTypeCacheRefresher.cs b/src/Umbraco.Web/Cache/RelationTypeCacheRefresher.cs index f81aaebe64..3f3be57f91 100644 --- a/src/Umbraco.Web/Cache/RelationTypeCacheRefresher.cs +++ b/src/Umbraco.Web/Cache/RelationTypeCacheRefresher.cs @@ -7,7 +7,7 @@ namespace Umbraco.Web.Cache { public sealed class RelationTypeCacheRefresher : CacheRefresherBase { - public RelationTypeCacheRefresher(CacheHelper cacheHelper) + public RelationTypeCacheRefresher(CacheHelper cacheHelper) : base(cacheHelper) { } diff --git a/src/Umbraco.Web/Cache/TemplateCacheRefresher.cs b/src/Umbraco.Web/Cache/TemplateCacheRefresher.cs index 65cb5e2e74..e4d1e4600a 100644 --- a/src/Umbraco.Web/Cache/TemplateCacheRefresher.cs +++ b/src/Umbraco.Web/Cache/TemplateCacheRefresher.cs @@ -6,7 +6,7 @@ namespace Umbraco.Web.Cache { public sealed class TemplateCacheRefresher : CacheRefresherBase { - public TemplateCacheRefresher(CacheHelper cacheHelper) + public TemplateCacheRefresher(CacheHelper cacheHelper) : base(cacheHelper) { } @@ -56,4 +56,4 @@ namespace Umbraco.Web.Cache #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Cache/UserCacheRefresher.cs b/src/Umbraco.Web/Cache/UserCacheRefresher.cs index bcd04132de..a6d50231f4 100644 --- a/src/Umbraco.Web/Cache/UserCacheRefresher.cs +++ b/src/Umbraco.Web/Cache/UserCacheRefresher.cs @@ -55,4 +55,4 @@ namespace Umbraco.Web.Cache #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Cache/UserPermissionsCacheRefresher.cs b/src/Umbraco.Web/Cache/UserPermissionsCacheRefresher.cs index 301a979794..b43a7984d1 100644 --- a/src/Umbraco.Web/Cache/UserPermissionsCacheRefresher.cs +++ b/src/Umbraco.Web/Cache/UserPermissionsCacheRefresher.cs @@ -28,7 +28,7 @@ namespace Umbraco.Web.Cache { var userPermissionCache = CacheHelper.IsolatedRuntimeCache.GetCache(); if (userPermissionCache) - userPermissionCache.Result.ClearCacheByKeySearch(CacheKeys.UserPermissionsCacheKey); + userPermissionCache.Result.ClearCacheByKeySearch(CacheKeys.UserPermissionsCacheKey); base.RefreshAll(); } @@ -48,4 +48,4 @@ namespace Umbraco.Web.Cache #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Cache/UserTypeCacheRefresher.cs b/src/Umbraco.Web/Cache/UserTypeCacheRefresher.cs index e87d975ef8..99edfef6bd 100644 --- a/src/Umbraco.Web/Cache/UserTypeCacheRefresher.cs +++ b/src/Umbraco.Web/Cache/UserTypeCacheRefresher.cs @@ -8,7 +8,7 @@ namespace Umbraco.Web.Cache { public sealed class UserTypeCacheRefresher : CacheRefresherBase { - public UserTypeCacheRefresher(CacheHelper cacheHelper) + public UserTypeCacheRefresher(CacheHelper cacheHelper) : base(cacheHelper) { } @@ -50,4 +50,4 @@ namespace Umbraco.Web.Cache #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/CacheHelperExtensions.cs b/src/Umbraco.Web/CacheHelperExtensions.cs index e10852e9f0..7d3b513e76 100644 --- a/src/Umbraco.Web/CacheHelperExtensions.cs +++ b/src/Umbraco.Web/CacheHelperExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Web; using System.Web.Caching; using System.Web.Mvc; @@ -8,34 +8,34 @@ using Umbraco.Core.Cache; namespace Umbraco.Web { - /// - /// Extension methods for the cache helper - /// - public static class CacheHelperExtensions - { + /// + /// Extension methods for the cache helper + /// + public static class CacheHelperExtensions + { - public const string PartialViewCacheKey = "Umbraco.Web.PartialViewCacheKey"; - - /// - /// Outputs and caches a partial view in MVC - /// - /// - /// - /// - /// - /// - /// used to cache the partial view, this key could change if it is cached by page or by member - /// - /// - public static IHtmlString CachedPartialView( - this CacheHelper cacheHelper, - HtmlHelper htmlHelper, - string partialViewName, - object model, - int cachedSeconds, - string cacheKey, - ViewDataDictionary viewData = null) - { + public const string PartialViewCacheKey = "Umbraco.Web.PartialViewCacheKey"; + + /// + /// Outputs and caches a partial view in MVC + /// + /// + /// + /// + /// + /// + /// used to cache the partial view, this key could change if it is cached by page or by member + /// + /// + public static IHtmlString CachedPartialView( + this CacheHelper cacheHelper, + HtmlHelper htmlHelper, + string partialViewName, + object model, + int cachedSeconds, + string cacheKey, + ViewDataDictionary viewData = null) + { //disable cached partials in debug mode: http://issues.umbraco.org/issue/U4-5940 if (htmlHelper.ViewContext.HttpContext.IsDebuggingEnabled) { @@ -44,19 +44,19 @@ namespace Umbraco.Web } return cacheHelper.RuntimeCache.GetCacheItem( - PartialViewCacheKey + cacheKey, + PartialViewCacheKey + cacheKey, () => htmlHelper.Partial(partialViewName, model, viewData), - priority: CacheItemPriority.NotRemovable, //not removable, the same as macros (apparently issue #27610) - timeout: new TimeSpan(0, 0, 0, cachedSeconds)); - } + priority: CacheItemPriority.NotRemovable, //not removable, the same as macros (apparently issue #27610) + timeout: new TimeSpan(0, 0, 0, cachedSeconds)); + } - /// - /// Clears the cache for partial views - /// - /// - public static void ClearPartialViewCache(this CacheHelper cacheHelper) - { - cacheHelper.RuntimeCache.ClearCacheByKeySearch(PartialViewCacheKey); - } - } + /// + /// Clears the cache for partial views + /// + /// + public static void ClearPartialViewCache(this CacheHelper cacheHelper) + { + cacheHelper.RuntimeCache.ClearCacheByKeySearch(PartialViewCacheKey); + } + } } diff --git a/src/Umbraco.Web/Controllers/UmbLoginController.cs b/src/Umbraco.Web/Controllers/UmbLoginController.cs index c62d9fef7c..2b70f927b7 100644 --- a/src/Umbraco.Web/Controllers/UmbLoginController.cs +++ b/src/Umbraco.Web/Controllers/UmbLoginController.cs @@ -29,8 +29,8 @@ namespace Umbraco.Web.Controllers { // validate the redirect url // if it's not a local url we'll redirect to the root of the current site - return Redirect(Url.IsLocalUrl(model.RedirectUrl) - ? model.RedirectUrl + return Redirect(Url.IsLocalUrl(model.RedirectUrl) + ? model.RedirectUrl : CurrentPage.AncestorOrSelf(1).Url); } diff --git a/src/Umbraco.Web/Controllers/UmbLoginStatusController.cs b/src/Umbraco.Web/Controllers/UmbLoginStatusController.cs index 08cd87eb44..0364359673 100644 --- a/src/Umbraco.Web/Controllers/UmbLoginStatusController.cs +++ b/src/Umbraco.Web/Controllers/UmbLoginStatusController.cs @@ -31,7 +31,7 @@ namespace Umbraco.Web.Controllers } //redirect to current page by default - + return RedirectToCurrentUmbracoPage(); } } diff --git a/src/Umbraco.Web/Controllers/UmbProfileController.cs b/src/Umbraco.Web/Controllers/UmbProfileController.cs index 7ed9220086..27c5c32a02 100644 --- a/src/Umbraco.Web/Controllers/UmbProfileController.cs +++ b/src/Umbraco.Web/Controllers/UmbProfileController.cs @@ -40,7 +40,7 @@ namespace Umbraco.Web.Controllers return Redirect(model.RedirectUrl); } - //redirect to current page by default + //redirect to current page by default return RedirectToCurrentUmbracoPage(); } } diff --git a/src/Umbraco.Web/Controllers/UmbRegisterController.cs b/src/Umbraco.Web/Controllers/UmbRegisterController.cs index df50febbde..0d622b8730 100644 --- a/src/Umbraco.Web/Controllers/UmbRegisterController.cs +++ b/src/Umbraco.Web/Controllers/UmbRegisterController.cs @@ -19,7 +19,7 @@ namespace Umbraco.Web.Controllers MembershipCreateStatus status; var member = Members.RegisterMember(model, out status, model.LoginOnSuccess); - + switch (status) { case MembershipCreateStatus.Success: @@ -32,7 +32,7 @@ namespace Umbraco.Web.Controllers return Redirect(model.RedirectUrl); } //redirect to current page by default - + return RedirectToCurrentUmbracoPage(); case MembershipCreateStatus.InvalidUserName: ModelState.AddModelError((model.UsernameIsEmail || model.Username == null) diff --git a/src/Umbraco.Web/DI/WebMappingProfilesCompositionRoot.cs b/src/Umbraco.Web/DI/WebMappingProfilesCompositionRoot.cs index 2a8daad829..6dd06c17b5 100644 --- a/src/Umbraco.Web/DI/WebMappingProfilesCompositionRoot.cs +++ b/src/Umbraco.Web/DI/WebMappingProfilesCompositionRoot.cs @@ -1,4 +1,4 @@ -using LightInject; +using LightInject; using Umbraco.Web.Models.Mapping; namespace Umbraco.Web.DI @@ -23,4 +23,4 @@ namespace Umbraco.Web.DI container.Register(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/DefaultEventMessagesFactory.cs b/src/Umbraco.Web/DefaultEventMessagesFactory.cs index 36d56a7aa6..39be829a7d 100644 --- a/src/Umbraco.Web/DefaultEventMessagesFactory.cs +++ b/src/Umbraco.Web/DefaultEventMessagesFactory.cs @@ -1,4 +1,4 @@ -using System; +using System; using Umbraco.Core.Events; namespace Umbraco.Web @@ -26,4 +26,4 @@ namespace Umbraco.Web return _eventMessagesAccessor.EventMessages; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Dictionary/UmbracoCultureDictionary.cs b/src/Umbraco.Web/Dictionary/UmbracoCultureDictionary.cs index 5cdb787f73..481be85136 100644 --- a/src/Umbraco.Web/Dictionary/UmbracoCultureDictionary.cs +++ b/src/Umbraco.Web/Dictionary/UmbracoCultureDictionary.cs @@ -15,26 +15,26 @@ namespace Umbraco.Web.Dictionary ///
/// /// TODO: The ICultureDictionary needs to represent the 'fast' way to do dictionary item retrieval - for front-end and back office. - /// The ILocalizationService is the service used for interacting with this data from the database which isn't all that fast + /// The ILocalizationService is the service used for interacting with this data from the database which isn't all that fast /// (even though there is caching involved, if there's lots of dictionary items the caching is not great) /// - public class DefaultCultureDictionary : Core.Dictionary.ICultureDictionary - { - private readonly ILocalizationService _localizationService; + public class DefaultCultureDictionary : Core.Dictionary.ICultureDictionary + { + private readonly ILocalizationService _localizationService; private readonly ICacheProvider _requestCacheProvider; private readonly CultureInfo _specificCulture; - public DefaultCultureDictionary() + public DefaultCultureDictionary() : this(Current.Services.LocalizationService, Current.ApplicationCache.RequestCache) - { - - } + { - public DefaultCultureDictionary(ILocalizationService localizationService, ICacheProvider requestCacheProvider) - { - _localizationService = localizationService ?? throw new ArgumentNullException(nameof(localizationService)); - _requestCacheProvider = requestCacheProvider ?? throw new ArgumentNullException(nameof(requestCacheProvider)); - } + } + + public DefaultCultureDictionary(ILocalizationService localizationService, ICacheProvider requestCacheProvider) + { + _localizationService = localizationService ?? throw new ArgumentNullException(nameof(localizationService)); + _requestCacheProvider = requestCacheProvider ?? throw new ArgumentNullException(nameof(requestCacheProvider)); + } public DefaultCultureDictionary(CultureInfo specificCulture) : this(Current.Services.LocalizationService, Current.ApplicationCache.RequestCache) @@ -49,43 +49,43 @@ namespace Umbraco.Web.Dictionary _specificCulture = specificCulture ?? throw new ArgumentNullException(nameof(specificCulture)); } - /// - /// Returns the dictionary value based on the key supplied - /// - /// - /// - public string this[string key] - { - get - { - var found = _localizationService.GetDictionaryItemByKey(key); - if (found == null) - { - return string.Empty; - } + /// + /// Returns the dictionary value based on the key supplied + /// + /// + /// + public string this[string key] + { + get + { + var found = _localizationService.GetDictionaryItemByKey(key); + if (found == null) + { + return string.Empty; + } - var byLang = found.Translations.FirstOrDefault(x => x.Language.Equals(Language)); - if (byLang == null) - { - return string.Empty; - } + var byLang = found.Translations.FirstOrDefault(x => x.Language.Equals(Language)); + if (byLang == null) + { + return string.Empty; + } - return byLang.Value; - } - } + return byLang.Value; + } + } - /// - /// Returns the current culture - /// - public CultureInfo Culture => _specificCulture ?? System.Threading.Thread.CurrentThread.CurrentUICulture; + /// + /// Returns the current culture + /// + public CultureInfo Culture => _specificCulture ?? System.Threading.Thread.CurrentThread.CurrentUICulture; - /// + /// /// Returns the child dictionary entries for a given key /// /// /// /// - /// NOTE: The result of this is not cached anywhere - the underlying repository does not cache + /// NOTE: The result of this is not cached anywhere - the underlying repository does not cache /// the child lookups because that is done by a query lookup. This method isn't used in our codebase /// so I don't think this is a performance issue but if devs are using this it could be optimized here. /// @@ -118,7 +118,7 @@ namespace Umbraco.Web.Dictionary } private ILanguage Language - { + { get { //ensure it's stored/retrieved from request cache @@ -126,6 +126,6 @@ namespace Umbraco.Web.Dictionary return _requestCacheProvider.GetCacheItem(typeof (DefaultCultureDictionary).Name + "Culture" + Culture.Name, () => _localizationService.GetLanguageByIsoCode(Culture.Name)); } - } - } + } + } } diff --git a/src/Umbraco.Web/Dictionary/UmbracoCultureDictionaryFactory.cs b/src/Umbraco.Web/Dictionary/UmbracoCultureDictionaryFactory.cs index c2662d0616..9c49971014 100644 --- a/src/Umbraco.Web/Dictionary/UmbracoCultureDictionaryFactory.cs +++ b/src/Umbraco.Web/Dictionary/UmbracoCultureDictionaryFactory.cs @@ -1,16 +1,16 @@ -namespace Umbraco.Web.Dictionary +namespace Umbraco.Web.Dictionary { - /// - /// A culture dictionary factory used to create an Umbraco.Core.Dictionary.ICultureDictionary. - /// - /// - /// In the future this will allow use to potentially store dictionary items elsewhere and allows for maximum flexibility. - /// - internal class DefaultCultureDictionaryFactory : Umbraco.Core.Dictionary.ICultureDictionaryFactory - { - public Umbraco.Core.Dictionary.ICultureDictionary CreateDictionary() - { - return new DefaultCultureDictionary(); - } - } -} \ No newline at end of file + /// + /// A culture dictionary factory used to create an Umbraco.Core.Dictionary.ICultureDictionary. + /// + /// + /// In the future this will allow use to potentially store dictionary items elsewhere and allows for maximum flexibility. + /// + internal class DefaultCultureDictionaryFactory : Umbraco.Core.Dictionary.ICultureDictionaryFactory + { + public Umbraco.Core.Dictionary.ICultureDictionary CreateDictionary() + { + return new DefaultCultureDictionary(); + } + } +} diff --git a/src/Umbraco.Web/Editors/AuthenticationController.cs b/src/Umbraco.Web/Editors/AuthenticationController.cs index 6d2661822f..702d1ee3d3 100644 --- a/src/Umbraco.Web/Editors/AuthenticationController.cs +++ b/src/Umbraco.Web/Editors/AuthenticationController.cs @@ -148,7 +148,7 @@ namespace Umbraco.Web.Editors HttpStatusCode.BadRequest, "UserManager does not implement " + typeof(IUmbracoBackOfficeTwoFactorOptions))); } - + var twofactorView = twofactorOptions.GetTwoFactorView( TryGetOwinContext().Result, UmbracoContext, @@ -163,7 +163,7 @@ namespace Umbraco.Web.Editors } var attemptedUser = Security.GetBackOfficeUser(loginModel.Username); - + //create a with information to display a custom two factor send code view var verifyResponse = Request.CreateResponse(HttpStatusCode.PaymentRequired, new { @@ -284,7 +284,7 @@ namespace Umbraco.Web.Editors var user = Security.GetBackOfficeUser(userName); return SetPrincipalAndReturnUserDetail(user); case SignInStatus.LockedOut: - return Request.CreateValidationErrorResponse("User is locked out"); + return Request.CreateValidationErrorResponse("User is locked out"); case SignInStatus.Failure: default: return Request.CreateValidationErrorResponse("Invalid code"); @@ -306,15 +306,15 @@ namespace Umbraco.Web.Editors { Logger.Info( "User {0} is currently locked out, unlocking and resetting AccessFailedCount", - () => model.UserId); + () => model.UserId); //var user = await UserManager.FindByIdAsync(model.UserId); - var unlockResult = await UserManager.SetLockoutEndDateAsync(model.UserId, DateTimeOffset.Now); - if(unlockResult.Succeeded == false) + var unlockResult = await UserManager.SetLockoutEndDateAsync(model.UserId, DateTimeOffset.Now); + if(unlockResult.Succeeded == false) { Logger.Warn("Could not unlock for user {0} - error {1}", - () => model.UserId, () => unlockResult.Errors.First()); - } + () => model.UserId, () => unlockResult.Errors.First()); + } var resetAccessFailedCountResult = await UserManager.ResetAccessFailedCountAsync(model.UserId); if (resetAccessFailedCountResult.Succeeded == false) @@ -390,8 +390,8 @@ namespace Umbraco.Web.Editors var applicationUri = Current.RuntimeState.ApplicationUrl; var callbackUri = new Uri(applicationUri, action); return callbackUri.ToString(); - } - + } + private HttpContextBase EnsureHttpContext() { @@ -401,7 +401,7 @@ namespace Umbraco.Web.Editors return attempt.Result; } - + private void AddModelErrors(IdentityResult result, string prefix = "") { @@ -412,4 +412,4 @@ namespace Umbraco.Web.Editors } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Editors/BackOfficeController.cs b/src/Umbraco.Web/Editors/BackOfficeController.cs index 149638aeca..2ee631d149 100644 --- a/src/Umbraco.Web/Editors/BackOfficeController.cs +++ b/src/Umbraco.Web/Editors/BackOfficeController.cs @@ -401,7 +401,7 @@ namespace Umbraco.Web.Editors { "disallowedUploadFiles", string.Join(",", UmbracoConfig.For.UmbracoSettings().Content.DisallowedUploadFiles) - }, + }, { "allowedUploadFiles", string.Join(",", UmbracoConfig.For.UmbracoSettings().Content.AllowedUploadFiles) diff --git a/src/Umbraco.Web/Editors/BackOfficeNotificationsController.cs b/src/Umbraco.Web/Editors/BackOfficeNotificationsController.cs index 461b71711c..66e7a4734a 100644 --- a/src/Umbraco.Web/Editors/BackOfficeNotificationsController.cs +++ b/src/Umbraco.Web/Editors/BackOfficeNotificationsController.cs @@ -1,4 +1,4 @@ -using Umbraco.Web.WebApi; +using Umbraco.Web.WebApi; using Umbraco.Web.WebApi.Filters; namespace Umbraco.Web.Editors @@ -12,4 +12,4 @@ namespace Umbraco.Web.Editors [PrefixlessBodyModelValidator] public abstract class BackOfficeNotificationsController : UmbracoAuthorizedJsonController { } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Editors/CanvasDesignerController.cs b/src/Umbraco.Web/Editors/CanvasDesignerController.cs index 567c646328..13b270ebb4 100644 --- a/src/Umbraco.Web/Editors/CanvasDesignerController.cs +++ b/src/Umbraco.Web/Editors/CanvasDesignerController.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Net.Http; using System.Web.Http; using Umbraco.Web.WebApi; @@ -107,4 +107,4 @@ namespace Umbraco.Web.Editors } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Editors/CodeFileController.cs b/src/Umbraco.Web/Editors/CodeFileController.cs index c6a5fab852..6cf6d61c44 100644 --- a/src/Umbraco.Web/Editors/CodeFileController.cs +++ b/src/Umbraco.Web/Editors/CodeFileController.cs @@ -249,7 +249,7 @@ namespace Umbraco.Web.Editors codeFileDisplay.Path = Url.GetTreePathFromFilePath(id); } - codeFileDisplay.VirtualPath = codeFileDisplay.VirtualPath.TrimStart("~"); + codeFileDisplay.VirtualPath = codeFileDisplay.VirtualPath.TrimStart("~"); codeFileDisplay.FileType = type; return codeFileDisplay; } @@ -266,7 +266,7 @@ namespace Umbraco.Web.Editors { if (string.IsNullOrWhiteSpace(type)) throw new ArgumentException("Value cannot be null or whitespace.", "type"); if (string.IsNullOrWhiteSpace(virtualPath)) throw new ArgumentException("Value cannot be null or whitespace.", "virtualPath"); - + virtualPath = System.Web.HttpUtility.UrlDecode(virtualPath); switch (type) @@ -376,7 +376,7 @@ namespace Umbraco.Web.Editors break; - + default: throw new HttpResponseException(HttpStatusCode.NotFound); @@ -409,7 +409,7 @@ namespace Umbraco.Web.Editors relPath = relPath.IsNullOrWhiteSpace() ? relPath + display.Name : relPath.EnsureEndsWith('/') + display.Name; - } + } var script = Services.FileService.GetScriptByName(relPath); if (script != null) @@ -435,13 +435,13 @@ namespace Umbraco.Web.Editors private Attempt CreateOrUpdatePartialView(CodeFileDisplay display) { return CreateOrUpdatePartialView(display, SystemDirectories.PartialViews, - Services.FileService.GetPartialView, Services.FileService.SavePartialView, Services.FileService.CreatePartialView); + Services.FileService.GetPartialView, Services.FileService.SavePartialView, Services.FileService.CreatePartialView); } - + private Attempt CreateOrUpdatePartialViewMacro(CodeFileDisplay display) { return CreateOrUpdatePartialView(display, SystemDirectories.MacroPartials, - Services.FileService.GetPartialViewMacro, Services.FileService.SavePartialViewMacro, Services.FileService.CreatePartialViewMacro); + Services.FileService.GetPartialViewMacro, Services.FileService.SavePartialViewMacro, Services.FileService.CreatePartialViewMacro); } /// diff --git a/src/Umbraco.Web/Editors/ContentController.cs b/src/Umbraco.Web/Editors/ContentController.cs index 9416129547..b8d03985d1 100644 --- a/src/Umbraco.Web/Editors/ContentController.cs +++ b/src/Umbraco.Web/Editors/ContentController.cs @@ -191,7 +191,7 @@ namespace Umbraco.Web.Editors { return GetNiceUrl(guidUdi.Guid); } - throw new HttpResponseException(HttpStatusCode.NotFound); + throw new HttpResponseException(HttpStatusCode.NotFound); } /// @@ -827,4 +827,4 @@ namespace Umbraco.Web.Editors } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Editors/ContentControllerBase.cs b/src/Umbraco.Web/Editors/ContentControllerBase.cs index 7921e85029..a298efb0fb 100644 --- a/src/Umbraco.Web/Editors/ContentControllerBase.cs +++ b/src/Umbraco.Web/Editors/ContentControllerBase.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Net; @@ -82,7 +82,7 @@ namespace Umbraco.Web.Editors var files = contentItem.UploadedFiles.Where(x => x.PropertyAlias == property.Alias).ToArray(); if (files.Length > 0) { - dictionary.Add("files", files); + dictionary.Add("files", files); } foreach (var file in files) file.FileName = file.FileName.ToSafeFileName(); diff --git a/src/Umbraco.Web/Editors/ContentPostValidateAttribute.cs b/src/Umbraco.Web/Editors/ContentPostValidateAttribute.cs index 12a1c6a304..b1fc989cd2 100644 --- a/src/Umbraco.Web/Editors/ContentPostValidateAttribute.cs +++ b/src/Umbraco.Web/Editors/ContentPostValidateAttribute.cs @@ -150,4 +150,4 @@ namespace Umbraco.Web.Editors } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Editors/ContentTypeController.cs b/src/Umbraco.Web/Editors/ContentTypeController.cs index 1a849ace93..6fdafddc87 100644 --- a/src/Umbraco.Web/Editors/ContentTypeController.cs +++ b/src/Umbraco.Web/Editors/ContentTypeController.cs @@ -310,4 +310,4 @@ namespace Umbraco.Web.Editors doCopy: (type, i) => Services.ContentTypeService.Copy(type, i)); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Editors/ContentTypeControllerBase.cs b/src/Umbraco.Web/Editors/ContentTypeControllerBase.cs index 3eedfc2c44..dbbe626af6 100644 --- a/src/Umbraco.Web/Editors/ContentTypeControllerBase.cs +++ b/src/Umbraco.Web/Editors/ContentTypeControllerBase.cs @@ -449,4 +449,4 @@ namespace Umbraco.Web.Editors private ICultureDictionary CultureDictionary => _cultureDictionary ?? (_cultureDictionary = Current.CultureDictionaryFactory.CreateDictionary()); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Editors/DashboardController.cs b/src/Umbraco.Web/Editors/DashboardController.cs index f6df1ac317..0842ae7800 100644 --- a/src/Umbraco.Web/Editors/DashboardController.cs +++ b/src/Umbraco.Web/Editors/DashboardController.cs @@ -120,7 +120,7 @@ namespace Umbraco.Web.Editors Content = new StringContent(result, Encoding.UTF8, "text/css") }; } - + [ValidateAngularAntiForgeryToken] public IEnumerable> GetDashboard(string section) { diff --git a/src/Umbraco.Web/Editors/DashboardSecurity.cs b/src/Umbraco.Web/Editors/DashboardSecurity.cs index a8f5e44ef2..0f5f715296 100644 --- a/src/Umbraco.Web/Editors/DashboardSecurity.cs +++ b/src/Umbraco.Web/Editors/DashboardSecurity.cs @@ -106,4 +106,4 @@ namespace Umbraco.Web.Editors return allowedSoFar; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Editors/DataTypeController.cs b/src/Umbraco.Web/Editors/DataTypeController.cs index be016d1808..f969b97ec5 100644 --- a/src/Umbraco.Web/Editors/DataTypeController.cs +++ b/src/Umbraco.Web/Editors/DataTypeController.cs @@ -364,4 +364,4 @@ namespace Umbraco.Web.Editors } #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Editors/DataTypeValidateAttribute.cs b/src/Umbraco.Web/Editors/DataTypeValidateAttribute.cs index bb9aebbadd..8dad002285 100644 --- a/src/Umbraco.Web/Editors/DataTypeValidateAttribute.cs +++ b/src/Umbraco.Web/Editors/DataTypeValidateAttribute.cs @@ -124,4 +124,4 @@ namespace Umbraco.Web.Editors } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Editors/EditorModelEventManager.cs b/src/Umbraco.Web/Editors/EditorModelEventManager.cs index 44454ca6c3..0dea726142 100644 --- a/src/Umbraco.Web/Editors/EditorModelEventManager.cs +++ b/src/Umbraco.Web/Editors/EditorModelEventManager.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Web.Http.Filters; using Umbraco.Core.Events; using Umbraco.Web.Models.ContentEditing; @@ -86,6 +86,6 @@ namespace Umbraco.Web.Editors OnSendingMemberModel(sender, new EditorModelEventArgs(e)); } } - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Editors/EditorValidator.cs b/src/Umbraco.Web/Editors/EditorValidator.cs index d123838f52..d2b86116b8 100644 --- a/src/Umbraco.Web/Editors/EditorValidator.cs +++ b/src/Umbraco.Web/Editors/EditorValidator.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -18,4 +18,4 @@ namespace Umbraco.Web.Editors return PerformValidate((T) model); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Editors/EditorValidatorCollection.cs b/src/Umbraco.Web/Editors/EditorValidatorCollection.cs index 89dccc5425..535d1133a6 100644 --- a/src/Umbraco.Web/Editors/EditorValidatorCollection.cs +++ b/src/Umbraco.Web/Editors/EditorValidatorCollection.cs @@ -8,7 +8,7 @@ namespace Umbraco.Web.Editors { internal class EditorValidatorCollection : BuilderCollectionBase { - public EditorValidatorCollection(IEnumerable items) + public EditorValidatorCollection(IEnumerable items) : base(items) { } diff --git a/src/Umbraco.Web/Editors/EntityController.cs b/src/Umbraco.Web/Editors/EntityController.cs index 220548083c..5fb656cf29 100644 --- a/src/Umbraco.Web/Editors/EntityController.cs +++ b/src/Umbraco.Web/Editors/EntityController.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; @@ -45,7 +45,7 @@ namespace Umbraco.Web.Editors { controllerSettings.Services.Replace(typeof(IHttpActionSelector), new ParameterSwapControllerActionSelector( - //This is a special case, we'll accept a String here so that we can get page members when the special "all-members" + //This is a special case, we'll accept a String here so that we can get page members when the special "all-members" //id is passed in eventually we'll probably want to support GUID + Udi too new ParameterSwapControllerActionSelector.ParameterSwapInfo("GetPagedChildren", "id", typeof(int), typeof(string)), new ParameterSwapControllerActionSelector.ParameterSwapInfo("GetPath", "id", typeof(int), typeof(Guid), typeof(Udi)), @@ -182,7 +182,7 @@ namespace Umbraco.Web.Editors { return GetPath(guidUdi.Guid, type); } - throw new HttpResponseException(HttpStatusCode.NotFound); + throw new HttpResponseException(HttpStatusCode.NotFound); } /// @@ -206,7 +206,7 @@ namespace Umbraco.Web.Editors { Content = new StringContent(returnUrl) }; - } + } } var ancestors = GetAncestors(id, type); @@ -223,7 +223,7 @@ namespace Umbraco.Web.Editors Content = new StringContent(returnUrl) }; } - + [Obsolete("Use GetyById instead")] [EditorBrowsable(EditorBrowsableState.Never)] public EntityBasic GetByKey(Guid id, UmbracoEntityTypes type) @@ -308,7 +308,7 @@ namespace Umbraco.Web.Editors return GetResultForKey(guidUdi.Guid, type); } throw new HttpResponseException(HttpStatusCode.NotFound); - } + } #endregion #region GetByIds @@ -387,7 +387,7 @@ namespace Umbraco.Web.Editors } throw new HttpResponseException(HttpStatusCode.NotFound); - } + } #endregion [Obsolete("Use GetyByIds instead")] @@ -456,7 +456,7 @@ namespace Umbraco.Web.Editors return GetPagedChildren(intId, type, pageNumber, pageSize, orderBy, orderDirection, filter); } - //the EntityService cannot search members of a certain type, this is currently not supported and would require + //the EntityService cannot search members of a certain type, this is currently not supported and would require //quite a bit of plumbing to do in the Services/Repository, we'll revert to a paged search int total; @@ -465,7 +465,7 @@ namespace Umbraco.Web.Editors return new PagedResult(total, pageNumber, pageSize) { Items = searchResult - }; + }; } /// @@ -482,7 +482,7 @@ namespace Umbraco.Web.Editors public PagedResult GetPagedChildren( int id, UmbracoEntityTypes type, - int pageNumber, + int pageNumber, int pageSize, string orderBy = "SortOrder", Direction orderDirection = Direction.Ascending, @@ -492,7 +492,7 @@ namespace Umbraco.Web.Editors throw new HttpResponseException(HttpStatusCode.NotFound); if (pageSize <= 0) throw new HttpResponseException(HttpStatusCode.NotFound); - + var objectType = ConvertToObjectType(type); if (objectType.HasValue) { @@ -773,26 +773,26 @@ namespace Umbraco.Web.Editors //must match index type sb.Append("+__IndexType:"); sb.Append(type); - + var raw = internalSearcher.CreateSearchCriteria().RawQuery(sb.ToString()); - + // fixme - ISearcher has not been updated in Examine for v8? throw new NotImplementedException(); //var result = internalSearcher // //only return the number of items specified to read up to the amount of records to fill from 0 -> the number of items on the page requested - // .Search(raw, pageSize * (pageIndex + 1)); + // .Search(raw, pageSize * (pageIndex + 1)); var result = new SR(); totalFound = result.TotalItemCount; var pagedResult = result.Skip(pageIndex); - + switch (entityType) { case UmbracoEntityTypes.Member: return MemberFromSearchResults(pagedResult.ToArray()); case UmbracoEntityTypes.Media: - return MediaFromSearchResults(pagedResult); + return MediaFromSearchResults(pagedResult); case UmbracoEntityTypes.Document: return ContentFromSearchResults(pagedResult); default: diff --git a/src/Umbraco.Web/Editors/EntityControllerConfigurationAttribute.cs b/src/Umbraco.Web/Editors/EntityControllerConfigurationAttribute.cs index 571b29ed01..cae0759141 100644 --- a/src/Umbraco.Web/Editors/EntityControllerConfigurationAttribute.cs +++ b/src/Umbraco.Web/Editors/EntityControllerConfigurationAttribute.cs @@ -1,8 +1,8 @@ -using System; +using System; using System.Web.Http.Controllers; using Umbraco.Web.WebApi; namespace Umbraco.Web.Editors { - -} \ No newline at end of file + +} diff --git a/src/Umbraco.Web/Editors/FromJsonPathAttribute.cs b/src/Umbraco.Web/Editors/FromJsonPathAttribute.cs index bb275f8fa2..b0a1c6ebaf 100644 --- a/src/Umbraco.Web/Editors/FromJsonPathAttribute.cs +++ b/src/Umbraco.Web/Editors/FromJsonPathAttribute.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Net.Http; using System.Web.Http; using System.Web.Http.Controllers; @@ -16,12 +16,12 @@ namespace Umbraco.Web.Editors /// /// An example would be if you had json like: /// { ids: [1,2,3,4] } - /// + /// /// And you had an action like: GetByIds(int[] ids, UmbracoEntityTypes type) - /// - /// The ids array will not bind because the object being sent up is an object and not an array so the - /// normal json formatter will not figure this out. - /// + /// + /// The ids array will not bind because the object being sent up is an object and not an array so the + /// normal json formatter will not figure this out. + /// /// This would also let you bind sub levels of the JSON being sent up too if you wanted with any jsonpath /// internal class FromJsonPathAttribute : ModelBinderAttribute @@ -81,7 +81,7 @@ namespace Umbraco.Web.Editors } var json = JsonConvert.DeserializeObject(strJson); - + //if no explicit json path then use the model name var match = json.SelectToken(_jsonPath ?? bindingContext.ModelName); @@ -95,7 +95,7 @@ namespace Umbraco.Web.Editors return true; } } - - + + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Editors/IEditorValidator.cs b/src/Umbraco.Web/Editors/IEditorValidator.cs index 2ee2b25bd6..bf6aa3c643 100644 --- a/src/Umbraco.Web/Editors/IEditorValidator.cs +++ b/src/Umbraco.Web/Editors/IEditorValidator.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using Umbraco.Core.Composing; @@ -10,4 +10,4 @@ namespace Umbraco.Web.Editors Type ModelType { get; } IEnumerable Validate(object model); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Editors/ImagesController.cs b/src/Umbraco.Web/Editors/ImagesController.cs index e906cbe24a..861a157cd8 100644 --- a/src/Umbraco.Web/Editors/ImagesController.cs +++ b/src/Umbraco.Web/Editors/ImagesController.cs @@ -35,7 +35,7 @@ namespace Umbraco.Web.Editors var media = Services.MediaService.GetById(mediaId); if (media == null) return Request.CreateResponse(HttpStatusCode.NotFound); - + var imageProp = media.Properties[Constants.Conventions.Media.File]; if (imageProp == null) return Request.CreateResponse(HttpStatusCode.NotFound); @@ -54,8 +54,8 @@ namespace Umbraco.Web.Editors /// public HttpResponseMessage GetBigThumbnail(string originalImagePath) { - return string.IsNullOrWhiteSpace(originalImagePath) - ? Request.CreateResponse(HttpStatusCode.OK) + return string.IsNullOrWhiteSpace(originalImagePath) + ? Request.CreateResponse(HttpStatusCode.OK) : GetResized(originalImagePath, 500, "big-thumb"); } @@ -73,7 +73,7 @@ namespace Umbraco.Web.Editors var media = Services.MediaService.GetById(mediaId); if (media == null) return new HttpResponseMessage(HttpStatusCode.NotFound); - + var imageProp = media.Properties[Constants.Conventions.Media.File]; if (imageProp == null) return new HttpResponseMessage(HttpStatusCode.NotFound); @@ -118,4 +118,4 @@ namespace Umbraco.Web.Editors return response; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Editors/LegacyController.cs b/src/Umbraco.Web/Editors/LegacyController.cs index a55fca7678..3e8b6f54e0 100644 --- a/src/Umbraco.Web/Editors/LegacyController.cs +++ b/src/Umbraco.Web/Editors/LegacyController.cs @@ -56,4 +56,4 @@ namespace Umbraco.Web.Editors } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Editors/MacroController.cs b/src/Umbraco.Web/Editors/MacroController.cs index 76d110fb38..dc4d42a48c 100644 --- a/src/Umbraco.Web/Editors/MacroController.cs +++ b/src/Umbraco.Web/Editors/MacroController.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Net; @@ -156,4 +156,4 @@ namespace Umbraco.Web.Editors public string VirtualPath { get; set; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Editors/MediaController.cs b/src/Umbraco.Web/Editors/MediaController.cs index f3129f0e7d..7394a2d34b 100644 --- a/src/Umbraco.Web/Editors/MediaController.cs +++ b/src/Umbraco.Web/Editors/MediaController.cs @@ -34,7 +34,7 @@ using Umbraco.Core.Persistence.Querying; using Umbraco.Web.UI; using Notification = Umbraco.Web.Models.ContentEditing.Notification; using Umbraco.Core.Persistence; -using Umbraco.Core.Configuration.UmbracoSettings; +using Umbraco.Core.Configuration.UmbracoSettings; namespace Umbraco.Web.Editors { diff --git a/src/Umbraco.Web/Editors/MediaPostValidateAttribute.cs b/src/Umbraco.Web/Editors/MediaPostValidateAttribute.cs index 8701f7fcf0..b6b94d694d 100644 --- a/src/Umbraco.Web/Editors/MediaPostValidateAttribute.cs +++ b/src/Umbraco.Web/Editors/MediaPostValidateAttribute.cs @@ -43,7 +43,7 @@ namespace Umbraco.Web.Editors { get { return _security ?? UmbracoContext.Current.Security; } } - + public override void OnActionExecuting(HttpActionContext actionContext) { var mediaItem = (MediaItemSave)actionContext.ActionArguments["contentItem"]; @@ -57,7 +57,7 @@ namespace Umbraco.Web.Editors case ContentSaveAction.Save: contentToCheck = mediaItem.PersistedContent; contentIdToCheck = contentToCheck.Id; - break; + break; case ContentSaveAction.SaveNew: contentToCheck = MediaService.GetById(mediaItem.ParentId); @@ -89,4 +89,4 @@ namespace Umbraco.Web.Editors } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Editors/MediaTypeController.cs b/src/Umbraco.Web/Editors/MediaTypeController.cs index 049e143a57..3907944154 100644 --- a/src/Umbraco.Web/Editors/MediaTypeController.cs +++ b/src/Umbraco.Web/Editors/MediaTypeController.cs @@ -268,7 +268,7 @@ namespace Umbraco.Web.Editors } throw new HttpResponseException(HttpStatusCode.NotFound); - } + } #endregion /// @@ -297,4 +297,4 @@ namespace Umbraco.Web.Editors doCopy: (type, i) => Services.MediaTypeService.Copy(type, i)); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Editors/MemberGroupController.cs b/src/Umbraco.Web/Editors/MemberGroupController.cs index 0c5e77eef0..4ea823b25a 100644 --- a/src/Umbraco.Web/Editors/MemberGroupController.cs +++ b/src/Umbraco.Web/Editors/MemberGroupController.cs @@ -86,4 +86,4 @@ namespace Umbraco.Web.Editors return display; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Editors/MemberTypeController.cs b/src/Umbraco.Web/Editors/MemberTypeController.cs index 46370ff1a3..88a529d3e5 100644 --- a/src/Umbraco.Web/Editors/MemberTypeController.cs +++ b/src/Umbraco.Web/Editors/MemberTypeController.cs @@ -122,4 +122,4 @@ namespace Umbraco.Web.Editors return display; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Editors/PackageInstallController.cs b/src/Umbraco.Web/Editors/PackageInstallController.cs index f6c639e17b..3e08852bfb 100644 --- a/src/Umbraco.Web/Editors/PackageInstallController.cs +++ b/src/Umbraco.Web/Editors/PackageInstallController.cs @@ -229,7 +229,7 @@ namespace Umbraco.Web.Editors if (File.Exists(filePath)) File.Delete(filePath); - + } pack.Data.Files.Remove(file); } diff --git a/src/Umbraco.Web/Editors/ParameterSwapControllerActionSelector.cs b/src/Umbraco.Web/Editors/ParameterSwapControllerActionSelector.cs index 53e25c146a..03e982c7cd 100644 --- a/src/Umbraco.Web/Editors/ParameterSwapControllerActionSelector.cs +++ b/src/Umbraco.Web/Editors/ParameterSwapControllerActionSelector.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.Linq; using System.Net.Http; @@ -20,7 +20,7 @@ namespace Umbraco.Web.Editors /// /// As an example, lets say we have 2 methods: GetChildren(int id) and GetChildren(Guid id), by default Web Api won't allow this since /// it won't know what to select, but if this Tuple is passed in new Tuple{string, string}("GetChildren", "id") - /// + /// /// This supports POST values too however only for JSON values /// internal class ParameterSwapControllerActionSelector : ApiControllerActionSelector @@ -110,7 +110,7 @@ namespace Umbraco.Web.Editors } if (requestParam != null) - { + { foreach (var paramType in paramTypes) { //check if this is IEnumerable and if so this will get it's type @@ -160,4 +160,4 @@ namespace Umbraco.Web.Editors } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Editors/RedirectUrlManagementController.cs b/src/Umbraco.Web/Editors/RedirectUrlManagementController.cs index 5ee0759198..bd5ddb5062 100644 --- a/src/Umbraco.Web/Editors/RedirectUrlManagementController.cs +++ b/src/Umbraco.Web/Editors/RedirectUrlManagementController.cs @@ -45,7 +45,7 @@ namespace Umbraco.Web.Editors var redirectUrlService = Services.RedirectUrlService; long resultCount; - var redirects = string.IsNullOrWhiteSpace(searchTerm) + var redirects = string.IsNullOrWhiteSpace(searchTerm) ? redirectUrlService.GetAllRedirectUrls(page, pageSize, out resultCount) : redirectUrlService.SearchRedirectUrls(searchTerm, page, pageSize, out resultCount); @@ -59,7 +59,7 @@ namespace Umbraco.Web.Editors searchResult.TotalCount = resultCount; searchResult.CurrentPage = page; searchResult.PageCount = ((int)resultCount + pageSize - 1) / pageSize; - + return searchResult; } @@ -106,4 +106,4 @@ namespace Umbraco.Web.Editors return Ok($"URL tracker is now {action}d."); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Editors/RelationController.cs b/src/Umbraco.Web/Editors/RelationController.cs index 39eeb87b7e..c287e8a429 100644 --- a/src/Umbraco.Web/Editors/RelationController.cs +++ b/src/Umbraco.Web/Editors/RelationController.cs @@ -13,49 +13,49 @@ using Relation = Umbraco.Web.Models.ContentEditing.Relation; namespace Umbraco.Web.Editors { - [PluginController("UmbracoApi")] - [UmbracoApplicationAuthorizeAttribute(Constants.Applications.Content)] + [PluginController("UmbracoApi")] + [UmbracoApplicationAuthorizeAttribute(Constants.Applications.Content)] public class RelationController : UmbracoAuthorizedJsonController - { + { public Relation GetById(int id) - { - return Mapper.Map(Services.RelationService.GetById(id)); - } + { + return Mapper.Map(Services.RelationService.GetById(id)); + } //[EnsureUserPermissionForContent("childId")] public IEnumerable GetByChildId(int childId, string relationTypeAlias = "") - { - var relations = Services.RelationService.GetByChildId(childId).ToArray(); + { + var relations = Services.RelationService.GetByChildId(childId).ToArray(); - if (relations.Any() == false) - { - return Enumerable.Empty(); - } + if (relations.Any() == false) + { + return Enumerable.Empty(); + } - if (string.IsNullOrWhiteSpace(relationTypeAlias) == false) - { - return - Mapper.Map, IEnumerable>( - relations.Where(x => x.RelationType.Alias.InvariantEquals(relationTypeAlias))); - } + if (string.IsNullOrWhiteSpace(relationTypeAlias) == false) + { + return + Mapper.Map, IEnumerable>( + relations.Where(x => x.RelationType.Alias.InvariantEquals(relationTypeAlias))); + } - return Mapper.Map, IEnumerable>(relations); - } + return Mapper.Map, IEnumerable>(relations); + } - [HttpDelete] - [HttpPost] - public HttpResponseMessage DeleteById(int id) - { - var foundRelation = Services.RelationService.GetById(id); + [HttpDelete] + [HttpPost] + public HttpResponseMessage DeleteById(int id) + { + var foundRelation = Services.RelationService.GetById(id); - if (foundRelation == null) - { - return Request.CreateErrorResponse(HttpStatusCode.NotFound, "No relation found with the specified id"); - } + if (foundRelation == null) + { + return Request.CreateErrorResponse(HttpStatusCode.NotFound, "No relation found with the specified id"); + } - Services.RelationService.Delete(foundRelation); + Services.RelationService.Delete(foundRelation); - return Request.CreateResponse(HttpStatusCode.OK); - } - } -} \ No newline at end of file + return Request.CreateResponse(HttpStatusCode.OK); + } + } +} diff --git a/src/Umbraco.Web/Editors/SectionController.cs b/src/Umbraco.Web/Editors/SectionController.cs index c74d5e7430..c414b41fdf 100644 --- a/src/Umbraco.Web/Editors/SectionController.cs +++ b/src/Umbraco.Web/Editors/SectionController.cs @@ -18,4 +18,4 @@ namespace Umbraco.Web.Editors return sections.Select(Mapper.Map); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Editors/TemplateController.cs b/src/Umbraco.Web/Editors/TemplateController.cs index 78855c95c2..d1db42c8fb 100644 --- a/src/Umbraco.Web/Editors/TemplateController.cs +++ b/src/Umbraco.Web/Editors/TemplateController.cs @@ -49,7 +49,7 @@ namespace Umbraco.Web.Editors var template = Services.FileService.GetTemplate(id); if (template == null) throw new HttpResponseException(HttpStatusCode.NotFound); - + return Mapper.Map(template); } @@ -87,7 +87,7 @@ namespace Umbraco.Web.Editors var content = ViewHelper.GetDefaultFileContent( layoutPageAlias: dt.MasterTemplateAlias ); var scaffold = Mapper.Map(dt); - + scaffold.Content = content + "\r\n\r\n@* the fun starts here *@\r\n\r\n"; return scaffold; } @@ -105,7 +105,7 @@ namespace Umbraco.Web.Editors { throw new HttpResponseException(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState)); } - + if (display.Id > 0) { // update @@ -138,11 +138,11 @@ namespace Umbraco.Web.Editors { //template ID to find var templateIdInPath = "," + display.Id + ","; - + if (string.IsNullOrEmpty(childTemplate.Path)) { continue; - } + } //Find position in current comma seperate string path (so we get the correct children path) var positionInPath = childTemplate.Path.IndexOf(templateIdInPath) + templateIdInPath.Length; diff --git a/src/Umbraco.Web/Editors/TemplateQueryController.cs b/src/Umbraco.Web/Editors/TemplateQueryController.cs index 33739bd6ae..d51a00b3a2 100644 --- a/src/Umbraco.Web/Editors/TemplateQueryController.cs +++ b/src/Umbraco.Web/Editors/TemplateQueryController.cs @@ -67,7 +67,7 @@ namespace Umbraco.Web.Editors var indention = Environment.NewLine + "\t\t\t\t\t\t"; sb.Append("Model.Content.Site()"); - + var timer = new Stopwatch(); timer.Start(); @@ -159,7 +159,7 @@ namespace Umbraco.Web.Editors timer.Start(); //trial-run the tokenized clause to time the execution - //for review - this uses a tonized query rather then the normal linq query. + //for review - this uses a tonized query rather then the normal linq query. // fixme - that cannot work anymore now that we have killed dynamic support //contents = contents.AsQueryable().Where(clause, model.Filters.Select(this.GetConstraintValue).ToArray()); throw new NotImplementedException(); @@ -317,4 +317,4 @@ namespace Umbraco.Web.Editors return Terms; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Editors/UmbracoAuthorizedJsonController.cs b/src/Umbraco.Web/Editors/UmbracoAuthorizedJsonController.cs index 25d5905954..184511cbf0 100644 --- a/src/Umbraco.Web/Editors/UmbracoAuthorizedJsonController.cs +++ b/src/Umbraco.Web/Editors/UmbracoAuthorizedJsonController.cs @@ -14,4 +14,4 @@ namespace Umbraco.Web.Editors [AngularJsonOnlyConfiguration] public abstract class UmbracoAuthorizedJsonController : UmbracoAuthorizedApiController { } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Editors/UserController.cs b/src/Umbraco.Web/Editors/UserController.cs index 6dd70bfddc..4454709227 100644 --- a/src/Umbraco.Web/Editors/UserController.cs +++ b/src/Umbraco.Web/Editors/UserController.cs @@ -1,4 +1,4 @@ -using System.Net; +using System.Net; using System.Web.Http; using Umbraco.Web.Mvc; using Umbraco.Web.WebApi.Filters; @@ -26,4 +26,4 @@ namespace Umbraco.Web.Editors return true; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Editors/ValidationHelper.cs b/src/Umbraco.Web/Editors/ValidationHelper.cs index 525e6ab9da..09140d1ee1 100644 --- a/src/Umbraco.Web/Editors/ValidationHelper.cs +++ b/src/Umbraco.Web/Editors/ValidationHelper.cs @@ -26,7 +26,7 @@ namespace Umbraco.Web.Editors } /// - /// This will check if any properties of the model are attributed with the RequiredForPersistenceAttribute attribute and if they are it will + /// This will check if any properties of the model are attributed with the RequiredForPersistenceAttribute attribute and if they are it will /// check if that property validates, if it doesn't it means that the current model cannot be persisted because it doesn't have the necessary information /// to be saved. /// @@ -34,7 +34,7 @@ namespace Umbraco.Web.Editors /// /// /// This is normally used for things like content creating when the name is empty since we cannot actually create a content item when the name is empty. - /// This is similar but different from the standard Required validator since we still allow content to be saved when validation fails but there are some + /// This is similar but different from the standard Required validator since we still allow content to be saved when validation fails but there are some /// content fields that are absolutely mandatory for creating/saving. /// internal static bool ModelHasRequiredForPersistenceErrors(object model) @@ -46,4 +46,4 @@ namespace Umbraco.Web.Editors return requiredForPersistenceProperties.Any(p => !validator.IsValid(p.GetValue(model))); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/ExamineExtensions.cs b/src/Umbraco.Web/ExamineExtensions.cs index ececba1cf2..97d29bf520 100644 --- a/src/Umbraco.Web/ExamineExtensions.cs +++ b/src/Umbraco.Web/ExamineExtensions.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using Examine; using Umbraco.Core.Models.PublishedContent; @@ -6,22 +6,22 @@ using Umbraco.Web.PublishedCache; namespace Umbraco.Web { - /// - /// Extension methods for Examine - /// - public static class ExamineExtensions - { + /// + /// Extension methods for Examine + /// + public static class ExamineExtensions + { public static IEnumerable ConvertSearchResultToPublishedContent(this IEnumerable results, IPublishedCache cache) - { + { // no need to think about creating the IPublishedContent from the Examine result // content cache is fast and optimized - use it! - var list = new List(); + var list = new List(); - foreach (var result in results.OrderByDescending(x => x.Score)) - { - var content = cache.GetById(result.Id); - if (content == null) continue; // skip if this doesn't exist in the cache + foreach (var result in results.OrderByDescending(x => x.Score)) + { + var content = cache.GetById(result.Id); + if (content == null) continue; // skip if this doesn't exist in the cache // need to extend the content as we're going to add a property to it, // and we should not ever do it to the content we get from the cache, @@ -31,17 +31,17 @@ namespace Umbraco.Web // returned by the cache, in case the cache can create real types. // so we have to ask it to please extend itself. - var extend = PublishedContentExtended.Extend(content); + var extend = PublishedContentExtended.Extend(content); list.Add(extend.CreateModel()); // take care, must create the model! var property = new PropertyResult("examineScore", result.Score, - PropertyResultType.CustomProperty); + PropertyResultType.CustomProperty); extend.AddProperty(property); - } + } return list; - } - } -} \ No newline at end of file + } + } +} diff --git a/src/Umbraco.Web/FormDataCollectionExtensions.cs b/src/Umbraco.Web/FormDataCollectionExtensions.cs index 632569abef..46fa4378ad 100644 --- a/src/Umbraco.Web/FormDataCollectionExtensions.cs +++ b/src/Umbraco.Web/FormDataCollectionExtensions.cs @@ -7,7 +7,7 @@ using Umbraco.Core; namespace Umbraco.Web { - + public static class FormDataCollectionExtensions { /// @@ -77,8 +77,8 @@ namespace Umbraco.Web if (string.IsNullOrEmpty(val)) return default(T); var converted = val.TryConvertTo(); - return converted.Success - ? converted.Result + return converted.Success + ? converted.Result : default(T); } } diff --git a/src/Umbraco.Web/FormlessPage.cs b/src/Umbraco.Web/FormlessPage.cs index 6c7a309a9b..c1f78cddae 100644 --- a/src/Umbraco.Web/FormlessPage.cs +++ b/src/Umbraco.Web/FormlessPage.cs @@ -1,20 +1,20 @@ -using System.Web.UI; +using System.Web.UI; namespace Umbraco.Web { - /// - /// A formless page for use with the rendering a control in a page via Server.Execute. - /// This ignores the check to check for a form control on the page. - /// - /// - /// UmbracoHelper currently uses this for rendering macros but could be used anywhere we want when rendering - /// a page with Server.Execute. - /// SD: I have a custom MVC engine that uses this in my own internal libs if we want to pull it out which is called ViewManager - /// and works really well for things like this. - /// - internal class FormlessPage : Page - { - public override void VerifyRenderingInServerForm(Control control) { } + /// + /// A formless page for use with the rendering a control in a page via Server.Execute. + /// This ignores the check to check for a form control on the page. + /// + /// + /// UmbracoHelper currently uses this for rendering macros but could be used anywhere we want when rendering + /// a page with Server.Execute. + /// SD: I have a custom MVC engine that uses this in my own internal libs if we want to pull it out which is called ViewManager + /// and works really well for things like this. + /// + internal class FormlessPage : Page + { + public override void VerifyRenderingInServerForm(Control control) { } - } -} \ No newline at end of file + } +} diff --git a/src/Umbraco.Web/GridTemplateExtensions.cs b/src/Umbraco.Web/GridTemplateExtensions.cs index 069aa6c483..6f37baa6ac 100644 --- a/src/Umbraco.Web/GridTemplateExtensions.cs +++ b/src/Umbraco.Web/GridTemplateExtensions.cs @@ -16,7 +16,7 @@ using Umbraco.Web.Mvc; namespace Umbraco.Web { - + public static class GridTemplateExtensions { public static MvcHtmlString GetGridHtml(this HtmlHelper html, IPublishedProperty property, string framework = "bootstrap3") @@ -110,7 +110,7 @@ namespace Umbraco.Web { if (string.IsNullOrWhiteSpace(propertyAlias)) throw new ArgumentNullOrEmptyException(nameof(propertyAlias)); - return GetGridHtml(contentItem, propertyAlias, "bootstrap3"); + return GetGridHtml(contentItem, propertyAlias, "bootstrap3"); } [Obsolete("This should not be used, GetGridHtml methods accepting HtmlHelper as a parameter or GetGridHtml extensions on HtmlHelper should be used instead")] @@ -144,7 +144,7 @@ namespace Umbraco.Web private class FakeView : IView { public void Render(ViewContext viewContext, TextWriter writer) - { + { } } } diff --git a/src/Umbraco.Web/HealthCheck/Checks/Config/AbstractConfigCheck.cs b/src/Umbraco.Web/HealthCheck/Checks/Config/AbstractConfigCheck.cs index 05d735d066..92ac0c6be5 100644 --- a/src/Umbraco.Web/HealthCheck/Checks/Config/AbstractConfigCheck.cs +++ b/src/Umbraco.Web/HealthCheck/Checks/Config/AbstractConfigCheck.cs @@ -208,4 +208,4 @@ namespace Umbraco.Web.HealthCheck.Checks.Config : Rectify(action.ProvidedValue); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/HealthCheck/Checks/Config/AcceptableConfiguration.cs b/src/Umbraco.Web/HealthCheck/Checks/Config/AcceptableConfiguration.cs index e7c3036991..b71bba1d14 100644 --- a/src/Umbraco.Web/HealthCheck/Checks/Config/AcceptableConfiguration.cs +++ b/src/Umbraco.Web/HealthCheck/Checks/Config/AcceptableConfiguration.cs @@ -1,8 +1,8 @@ -namespace Umbraco.Web.HealthCheck.Checks.Config +namespace Umbraco.Web.HealthCheck.Checks.Config { public class AcceptableConfiguration { public string Value { get; set; } public bool IsRecommended { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/HealthCheck/Checks/Config/CompilationDebugCheck.cs b/src/Umbraco.Web/HealthCheck/Checks/Config/CompilationDebugCheck.cs index c8ee3534c5..5b33e14491 100644 --- a/src/Umbraco.Web/HealthCheck/Checks/Config/CompilationDebugCheck.cs +++ b/src/Umbraco.Web/HealthCheck/Checks/Config/CompilationDebugCheck.cs @@ -29,4 +29,4 @@ namespace Umbraco.Web.HealthCheck.Checks.Config public override string RectifySuccessMessage => TextService.Localize("healthcheck/compilationDebugCheckRectifySuccessMessage"); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/HealthCheck/Checks/Config/ConfigurationService.cs b/src/Umbraco.Web/HealthCheck/Checks/Config/ConfigurationService.cs index 65a1ea828e..e1f96a2a38 100644 --- a/src/Umbraco.Web/HealthCheck/Checks/Config/ConfigurationService.cs +++ b/src/Umbraco.Web/HealthCheck/Checks/Config/ConfigurationService.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.IO; using System.Xml; using Umbraco.Core.Logging; @@ -26,7 +26,7 @@ namespace Umbraco.Web.HealthCheck.Checks.Config } /// - /// Gets a value from a given configuration file with the given XPath + /// Gets a value from a given configuration file with the given XPath /// public ConfigurationServiceResult GetConfigurationValue() { @@ -68,7 +68,7 @@ namespace Umbraco.Web.HealthCheck.Checks.Config } /// - /// Updates a value in a given configuration file with the given XPath + /// Updates a value in a given configuration file with the given XPath /// /// /// @@ -113,4 +113,4 @@ namespace Umbraco.Web.HealthCheck.Checks.Config } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/HealthCheck/Checks/Config/ConfigurationServiceResult.cs b/src/Umbraco.Web/HealthCheck/Checks/Config/ConfigurationServiceResult.cs index e88492d6b2..3b1400da5b 100644 --- a/src/Umbraco.Web/HealthCheck/Checks/Config/ConfigurationServiceResult.cs +++ b/src/Umbraco.Web/HealthCheck/Checks/Config/ConfigurationServiceResult.cs @@ -1,8 +1,8 @@ -namespace Umbraco.Web.HealthCheck.Checks.Config +namespace Umbraco.Web.HealthCheck.Checks.Config { public class ConfigurationServiceResult { public bool Success { get; set; } public string Result { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/HealthCheck/Checks/Config/CustomErrorsCheck.cs b/src/Umbraco.Web/HealthCheck/Checks/Config/CustomErrorsCheck.cs index 1bb91ba075..6948326d06 100644 --- a/src/Umbraco.Web/HealthCheck/Checks/Config/CustomErrorsCheck.cs +++ b/src/Umbraco.Web/HealthCheck/Checks/Config/CustomErrorsCheck.cs @@ -53,4 +53,4 @@ namespace Umbraco.Web.HealthCheck.Checks.Config } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/HealthCheck/Checks/Config/MacroErrorsCheck.cs b/src/Umbraco.Web/HealthCheck/Checks/Config/MacroErrorsCheck.cs index 68a2c5ce42..09c041998e 100644 --- a/src/Umbraco.Web/HealthCheck/Checks/Config/MacroErrorsCheck.cs +++ b/src/Umbraco.Web/HealthCheck/Checks/Config/MacroErrorsCheck.cs @@ -68,4 +68,4 @@ namespace Umbraco.Web.HealthCheck.Checks.Config } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/HealthCheck/Checks/Config/NotificationEmailCheck.cs b/src/Umbraco.Web/HealthCheck/Checks/Config/NotificationEmailCheck.cs index 4c5f005f14..8c52a5686b 100644 --- a/src/Umbraco.Web/HealthCheck/Checks/Config/NotificationEmailCheck.cs +++ b/src/Umbraco.Web/HealthCheck/Checks/Config/NotificationEmailCheck.cs @@ -29,4 +29,4 @@ namespace Umbraco.Web.HealthCheck.Checks.Config public override string CheckErrorMessage => TextService.Localize("healthcheck/notificationEmailsCheckErrorMessage", new[] { DefaultFromEmail }); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/HealthCheck/Checks/Config/TraceCheck.cs b/src/Umbraco.Web/HealthCheck/Checks/Config/TraceCheck.cs index 6a1256af5e..b8e4e51eb9 100644 --- a/src/Umbraco.Web/HealthCheck/Checks/Config/TraceCheck.cs +++ b/src/Umbraco.Web/HealthCheck/Checks/Config/TraceCheck.cs @@ -30,4 +30,4 @@ namespace Umbraco.Web.HealthCheck.Checks.Config public override string RectifySuccessMessage => TextService.Localize("healthcheck/traceModeCheckRectifySuccessMessage"); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/HealthCheck/Checks/Config/TrySkipIisCustomErrorsCheck.cs b/src/Umbraco.Web/HealthCheck/Checks/Config/TrySkipIisCustomErrorsCheck.cs index 4ebf700ace..4a467d7120 100644 --- a/src/Umbraco.Web/HealthCheck/Checks/Config/TrySkipIisCustomErrorsCheck.cs +++ b/src/Umbraco.Web/HealthCheck/Checks/Config/TrySkipIisCustomErrorsCheck.cs @@ -62,4 +62,4 @@ namespace Umbraco.Web.HealthCheck.Checks.Config } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/HealthCheck/Checks/Config/ValueComparisonType.cs b/src/Umbraco.Web/HealthCheck/Checks/Config/ValueComparisonType.cs index 88c8a94a09..8df40da9f9 100644 --- a/src/Umbraco.Web/HealthCheck/Checks/Config/ValueComparisonType.cs +++ b/src/Umbraco.Web/HealthCheck/Checks/Config/ValueComparisonType.cs @@ -5,4 +5,4 @@ ShouldEqual, ShouldNotEqual, } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/HealthCheck/Checks/DataIntegrity/XmlDataIntegrityHealthCheck.cs b/src/Umbraco.Web/HealthCheck/Checks/DataIntegrity/XmlDataIntegrityHealthCheck.cs index e0117acd7b..a14d5c10bd 100644 --- a/src/Umbraco.Web/HealthCheck/Checks/DataIntegrity/XmlDataIntegrityHealthCheck.cs +++ b/src/Umbraco.Web/HealthCheck/Checks/DataIntegrity/XmlDataIntegrityHealthCheck.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using Umbraco.Core.Composing; using Umbraco.Core.Services; @@ -94,4 +94,4 @@ namespace Umbraco.Web.HealthCheck.Checks.DataIntegrity }; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/HealthCheck/Checks/Permissions/FolderAndFilePermissionsCheck.cs b/src/Umbraco.Web/HealthCheck/Checks/Permissions/FolderAndFilePermissionsCheck.cs index cd45d9cd8a..ae3db90660 100644 --- a/src/Umbraco.Web/HealthCheck/Checks/Permissions/FolderAndFilePermissionsCheck.cs +++ b/src/Umbraco.Web/HealthCheck/Checks/Permissions/FolderAndFilePermissionsCheck.cs @@ -161,4 +161,4 @@ namespace Umbraco.Web.HealthCheck.Checks.Permissions return filePath.Replace(rootFolder, string.Empty); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/HealthCheck/Checks/Security/ClickJackingCheck.cs b/src/Umbraco.Web/HealthCheck/Checks/Security/ClickJackingCheck.cs index fa94be4fc1..dc668d75ff 100644 --- a/src/Umbraco.Web/HealthCheck/Checks/Security/ClickJackingCheck.cs +++ b/src/Umbraco.Web/HealthCheck/Checks/Security/ClickJackingCheck.cs @@ -219,4 +219,4 @@ namespace Umbraco.Web.HealthCheck.Checks.Security } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/HealthCheck/Checks/Security/ExcessiveHeadersCheck.cs b/src/Umbraco.Web/HealthCheck/Checks/Security/ExcessiveHeadersCheck.cs index a540dde6aa..e794a41426 100644 --- a/src/Umbraco.Web/HealthCheck/Checks/Security/ExcessiveHeadersCheck.cs +++ b/src/Umbraco.Web/HealthCheck/Checks/Security/ExcessiveHeadersCheck.cs @@ -86,4 +86,4 @@ namespace Umbraco.Web.HealthCheck.Checks.Security }; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/HealthCheck/Checks/Security/HttpsCheck.cs b/src/Umbraco.Web/HealthCheck/Checks/Security/HttpsCheck.cs index 92fffc8588..1fb9005036 100644 --- a/src/Umbraco.Web/HealthCheck/Checks/Security/HttpsCheck.cs +++ b/src/Umbraco.Web/HealthCheck/Checks/Security/HttpsCheck.cs @@ -171,4 +171,4 @@ namespace Umbraco.Web.HealthCheck.Checks.Security }; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/HealthCheck/Checks/Services/SmtpCheck.cs b/src/Umbraco.Web/HealthCheck/Checks/Services/SmtpCheck.cs index 4c0652632c..8e3447c79f 100644 --- a/src/Umbraco.Web/HealthCheck/Checks/Services/SmtpCheck.cs +++ b/src/Umbraco.Web/HealthCheck/Checks/Services/SmtpCheck.cs @@ -111,4 +111,4 @@ namespace Umbraco.Web.HealthCheck.Checks.Services } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/HealthCheck/HealthCheck.cs b/src/Umbraco.Web/HealthCheck/HealthCheck.cs index 5907fd0d07..2c8b0c3c84 100644 --- a/src/Umbraco.Web/HealthCheck/HealthCheck.cs +++ b/src/Umbraco.Web/HealthCheck/HealthCheck.cs @@ -52,4 +52,4 @@ namespace Umbraco.Web.HealthCheck //TODO: What else? } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/HealthCheck/HealthCheckAction.cs b/src/Umbraco.Web/HealthCheck/HealthCheckAction.cs index 756bc4fbbe..f5549221a1 100644 --- a/src/Umbraco.Web/HealthCheck/HealthCheckAction.cs +++ b/src/Umbraco.Web/HealthCheck/HealthCheckAction.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Runtime.Serialization; using Umbraco.Core.Services; @@ -77,4 +77,4 @@ namespace Umbraco.Web.HealthCheck [DataMember(Name = "providedValue")] public string ProvidedValue { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/HealthCheck/HealthCheckAttribute.cs b/src/Umbraco.Web/HealthCheck/HealthCheckAttribute.cs index 885af8b3ba..35a8e022fb 100644 --- a/src/Umbraco.Web/HealthCheck/HealthCheckAttribute.cs +++ b/src/Umbraco.Web/HealthCheck/HealthCheckAttribute.cs @@ -1,4 +1,4 @@ -using System; +using System; namespace Umbraco.Web.HealthCheck { @@ -7,7 +7,7 @@ namespace Umbraco.Web.HealthCheck /// [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] public sealed class HealthCheckAttribute : Attribute - { + { public HealthCheckAttribute(string id, string name) { Id = new Guid(id); @@ -23,4 +23,4 @@ namespace Umbraco.Web.HealthCheck //TODO: Do we need more metadata? } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/HealthCheck/HealthCheckCollection.cs b/src/Umbraco.Web/HealthCheck/HealthCheckCollection.cs index 71777e37ee..6de442b765 100644 --- a/src/Umbraco.Web/HealthCheck/HealthCheckCollection.cs +++ b/src/Umbraco.Web/HealthCheck/HealthCheckCollection.cs @@ -5,7 +5,7 @@ namespace Umbraco.Web.HealthCheck { public class HealthCheckCollection : BuilderCollectionBase { - public HealthCheckCollection(IEnumerable items) + public HealthCheckCollection(IEnumerable items) : base(items) { } } diff --git a/src/Umbraco.Web/HealthCheck/HealthCheckController.cs b/src/Umbraco.Web/HealthCheck/HealthCheckController.cs index 409b344514..ab3a434e36 100644 --- a/src/Umbraco.Web/HealthCheck/HealthCheckController.cs +++ b/src/Umbraco.Web/HealthCheck/HealthCheckController.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Web.Http; @@ -73,4 +73,4 @@ namespace Umbraco.Web.HealthCheck return check.ExecuteAction(action); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/HealthCheck/HealthCheckStatus.cs b/src/Umbraco.Web/HealthCheck/HealthCheckStatus.cs index c966cadfa7..445582788a 100644 --- a/src/Umbraco.Web/HealthCheck/HealthCheckStatus.cs +++ b/src/Umbraco.Web/HealthCheck/HealthCheckStatus.cs @@ -51,4 +51,4 @@ namespace Umbraco.Web.HealthCheck //TODO: What else? } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/HealthCheck/StatusResultType.cs b/src/Umbraco.Web/HealthCheck/StatusResultType.cs index 8e5fbb4cc9..c6bd50f247 100644 --- a/src/Umbraco.Web/HealthCheck/StatusResultType.cs +++ b/src/Umbraco.Web/HealthCheck/StatusResultType.cs @@ -7,4 +7,4 @@ Error, Info } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/HtmlHelperBackOfficeExtensions.cs b/src/Umbraco.Web/HtmlHelperBackOfficeExtensions.cs index d5147a2990..fe463e36a6 100644 --- a/src/Umbraco.Web/HtmlHelperBackOfficeExtensions.cs +++ b/src/Umbraco.Web/HtmlHelperBackOfficeExtensions.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using System.Text; using System.Web; @@ -56,11 +56,11 @@ namespace Umbraco.Web ""cdf"": """ + ClientDependencySettings.Instance.Version + @""" }, ""isDebuggingEnabled"" : " + html.ViewContext.HttpContext.IsDebuggingEnabled.ToString().ToLowerInvariant() + @" - }; + }; "; return html.Raw(str); - } + } /// /// Used to render the script that will pass in the angular "externalLoginInfo" service/value on page load @@ -126,7 +126,7 @@ namespace Umbraco.Web sb.AppendLine(@"app.value(""resetPasswordCodeInfo"", {"); - sb.AppendLine(@"errors: errors,"); + sb.AppendLine(@"errors: errors,"); sb.Append(@"resetCodeModel: "); sb.AppendLine(JsonConvert.SerializeObject(resetCodeModel)); sb.AppendLine(@"});"); @@ -134,4 +134,4 @@ namespace Umbraco.Web return html.Raw(sb.ToString()); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/HtmlHelperRenderExtensions.cs b/src/Umbraco.Web/HtmlHelperRenderExtensions.cs index 5c6c1f93eb..938bc0bb27 100644 --- a/src/Umbraco.Web/HtmlHelperRenderExtensions.cs +++ b/src/Umbraco.Web/HtmlHelperRenderExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; @@ -21,10 +21,10 @@ using Constants = Umbraco.Core.Constants; namespace Umbraco.Web { /// - /// HtmlHelper extensions for use in templates - /// - public static class HtmlHelperRenderExtensions - { + /// HtmlHelper extensions for use in templates + /// + public static class HtmlHelperRenderExtensions + { /// /// Renders the markup for the profiler /// @@ -53,7 +53,7 @@ namespace Umbraco.Web return result; } - /// + /// /// Will render the preview badge when in preview mode which is not required ever unless the MVC page you are /// using does not inherit from UmbracoTemplatePage /// @@ -77,85 +77,85 @@ namespace Umbraco.Web } - public static IHtmlString CachedPartial( - this HtmlHelper htmlHelper, - string partialViewName, - object model, - int cachedSeconds, - bool cacheByPage = false, - bool cacheByMember = false, - ViewDataDictionary viewData = null, - Func contextualKeyBuilder = null) - { - var cacheKey = new StringBuilder(partialViewName); - if (cacheByPage) - { - if (UmbracoContext.Current == null) - { - throw new InvalidOperationException("Cannot cache by page if the UmbracoContext has not been initialized, this parameter can only be used in the context of an Umbraco request"); - } - cacheKey.AppendFormat("{0}-", UmbracoContext.Current.PageId); - } - if (cacheByMember) - { + public static IHtmlString CachedPartial( + this HtmlHelper htmlHelper, + string partialViewName, + object model, + int cachedSeconds, + bool cacheByPage = false, + bool cacheByMember = false, + ViewDataDictionary viewData = null, + Func contextualKeyBuilder = null) + { + var cacheKey = new StringBuilder(partialViewName); + if (cacheByPage) + { + if (UmbracoContext.Current == null) + { + throw new InvalidOperationException("Cannot cache by page if the UmbracoContext has not been initialized, this parameter can only be used in the context of an Umbraco request"); + } + cacheKey.AppendFormat("{0}-", UmbracoContext.Current.PageId); + } + if (cacheByMember) + { var helper = new MembershipHelper(Current.UmbracoContext); - var currentMember = helper.GetCurrentMember(); - cacheKey.AppendFormat("m{0}-", currentMember == null ? 0 : currentMember.Id); - } - if (contextualKeyBuilder != null) - { - var contextualKey = contextualKeyBuilder(model, viewData); + var currentMember = helper.GetCurrentMember(); + cacheKey.AppendFormat("m{0}-", currentMember == null ? 0 : currentMember.Id); + } + if (contextualKeyBuilder != null) + { + var contextualKey = contextualKeyBuilder(model, viewData); cacheKey.AppendFormat("c{0}-", contextualKey); - } - return Current.ApplicationCache.CachedPartialView(htmlHelper, partialViewName, model, cachedSeconds, cacheKey.ToString(), viewData); - } + } + return Current.ApplicationCache.CachedPartialView(htmlHelper, partialViewName, model, cachedSeconds, cacheKey.ToString(), viewData); + } - public static MvcHtmlString EditorFor(this HtmlHelper htmlHelper, string templateName = "", string htmlFieldName = "", object additionalViewData = null) - where T : new() - { - var model = new T(); - var typedHelper = new HtmlHelper( - htmlHelper.ViewContext.CopyWithModel(model), - htmlHelper.ViewDataContainer.CopyWithModel(model)); + public static MvcHtmlString EditorFor(this HtmlHelper htmlHelper, string templateName = "", string htmlFieldName = "", object additionalViewData = null) + where T : new() + { + var model = new T(); + var typedHelper = new HtmlHelper( + htmlHelper.ViewContext.CopyWithModel(model), + htmlHelper.ViewDataContainer.CopyWithModel(model)); - return typedHelper.EditorFor(x => model, templateName, htmlFieldName, additionalViewData); - } + return typedHelper.EditorFor(x => model, templateName, htmlFieldName, additionalViewData); + } - /// - /// A validation summary that lets you pass in a prefix so that the summary only displays for elements - /// containing the prefix. This allows you to have more than on validation summary on a page. - /// - /// - /// - /// - /// - /// - /// - public static MvcHtmlString ValidationSummary(this HtmlHelper htmlHelper, - string prefix = "", - bool excludePropertyErrors = false, - string message = "", - IDictionary htmlAttributes = null) - { - if (prefix.IsNullOrWhiteSpace()) - { - return htmlHelper.ValidationSummary(excludePropertyErrors, message, htmlAttributes); - } + /// + /// A validation summary that lets you pass in a prefix so that the summary only displays for elements + /// containing the prefix. This allows you to have more than on validation summary on a page. + /// + /// + /// + /// + /// + /// + /// + public static MvcHtmlString ValidationSummary(this HtmlHelper htmlHelper, + string prefix = "", + bool excludePropertyErrors = false, + string message = "", + IDictionary htmlAttributes = null) + { + if (prefix.IsNullOrWhiteSpace()) + { + return htmlHelper.ValidationSummary(excludePropertyErrors, message, htmlAttributes); + } - //if there's a prefix applied, we need to create a new html helper with a filtered ModelState collection so that it only looks for - //specific model state with the prefix. - var filteredHtmlHelper = new HtmlHelper(htmlHelper.ViewContext, htmlHelper.ViewDataContainer.FilterContainer(prefix)); - return filteredHtmlHelper.ValidationSummary(excludePropertyErrors, message, htmlAttributes); - } + //if there's a prefix applied, we need to create a new html helper with a filtered ModelState collection so that it only looks for + //specific model state with the prefix. + var filteredHtmlHelper = new HtmlHelper(htmlHelper.ViewContext, htmlHelper.ViewDataContainer.FilterContainer(prefix)); + return filteredHtmlHelper.ValidationSummary(excludePropertyErrors, message, htmlAttributes); + } - /// - /// Returns the result of a child action of a strongly typed SurfaceController - /// - /// - /// - /// - /// - public static IHtmlString Action(this HtmlHelper htmlHelper, string actionName) + /// + /// Returns the result of a child action of a strongly typed SurfaceController + /// + /// + /// + /// + /// + public static IHtmlString Action(this HtmlHelper htmlHelper, string actionName) where T : SurfaceController { return htmlHelper.Action(actionName, typeof(T)); @@ -268,47 +268,47 @@ namespace Umbraco.Web /// Used for rendering out the Form for BeginUmbracoForm /// internal class UmbracoForm : MvcForm - { - /// - /// Creates an UmbracoForm - /// - /// - /// - /// - /// - /// - /// - public UmbracoForm( - ViewContext viewContext, - string controllerName, - string controllerAction, - string area, + { + /// + /// Creates an UmbracoForm + /// + /// + /// + /// + /// + /// + /// + public UmbracoForm( + ViewContext viewContext, + string controllerName, + string controllerAction, + string area, FormMethod method, - object additionalRouteVals = null) - : base(viewContext) - { - _viewContext = viewContext; - _method = method; + object additionalRouteVals = null) + : base(viewContext) + { + _viewContext = viewContext; + _method = method; _encryptedString = UmbracoHelper.CreateEncryptedRouteString(controllerName, controllerAction, area, additionalRouteVals); - } + } - private readonly ViewContext _viewContext; - private readonly FormMethod _method; - private bool _disposed; - private readonly string _encryptedString; + private readonly ViewContext _viewContext; + private readonly FormMethod _method; + private bool _disposed; + private readonly string _encryptedString; - protected override void Dispose(bool disposing) - { - if (this._disposed) - return; - this._disposed = true; + protected override void Dispose(bool disposing) + { + if (this._disposed) + return; + this._disposed = true; //write out the hidden surface form routes _viewContext.Writer.Write(""); - base.Dispose(disposing); - } - } + base.Dispose(disposing); + } + } /// /// Helper method to create a new form to execute in the Umbraco request pipeline against a locally declared controller @@ -323,17 +323,17 @@ namespace Umbraco.Web return html.BeginUmbracoForm(action, controllerName, null, new Dictionary(), method); } - /// - /// Helper method to create a new form to execute in the Umbraco request pipeline against a locally declared controller - /// - /// - /// - /// - /// - public static MvcForm BeginUmbracoForm(this HtmlHelper html, string action, string controllerName) - { - return html.BeginUmbracoForm(action, controllerName, null, new Dictionary()); - } + /// + /// Helper method to create a new form to execute in the Umbraco request pipeline against a locally declared controller + /// + /// + /// + /// + /// + public static MvcForm BeginUmbracoForm(this HtmlHelper html, string action, string controllerName) + { + return html.BeginUmbracoForm(action, controllerName, null, new Dictionary()); + } /// /// Helper method to create a new form to execute in the Umbraco request pipeline against a locally declared controller @@ -349,18 +349,18 @@ namespace Umbraco.Web return html.BeginUmbracoForm(action, controllerName, additionalRouteVals, new Dictionary(), method); } - /// - /// Helper method to create a new form to execute in the Umbraco request pipeline against a locally declared controller - /// - /// - /// - /// - /// - /// - public static MvcForm BeginUmbracoForm(this HtmlHelper html, string action, string controllerName, object additionalRouteVals) - { - return html.BeginUmbracoForm(action, controllerName, additionalRouteVals, new Dictionary()); - } + /// + /// Helper method to create a new form to execute in the Umbraco request pipeline against a locally declared controller + /// + /// + /// + /// + /// + /// + public static MvcForm BeginUmbracoForm(this HtmlHelper html, string action, string controllerName, object additionalRouteVals) + { + return html.BeginUmbracoForm(action, controllerName, additionalRouteVals, new Dictionary()); + } /// /// Helper method to create a new form to execute in the Umbraco request pipeline against a locally declared controller @@ -381,20 +381,20 @@ namespace Umbraco.Web } /// - /// Helper method to create a new form to execute in the Umbraco request pipeline against a locally declared controller - /// - /// - /// - /// - /// - /// - /// - public static MvcForm BeginUmbracoForm(this HtmlHelper html, string action, string controllerName, - object additionalRouteVals, - object htmlAttributes) - { + /// Helper method to create a new form to execute in the Umbraco request pipeline against a locally declared controller + /// + /// + /// + /// + /// + /// + /// + public static MvcForm BeginUmbracoForm(this HtmlHelper html, string action, string controllerName, + object additionalRouteVals, + object htmlAttributes) + { return html.BeginUmbracoForm(action, controllerName, additionalRouteVals, HtmlHelper.AnonymousObjectToHtmlAttributes(htmlAttributes)); - } + } /// /// Helper method to create a new form to execute in the Umbraco request pipeline against a locally declared controller @@ -418,23 +418,23 @@ namespace Umbraco.Web } /// - /// Helper method to create a new form to execute in the Umbraco request pipeline against a locally declared controller - /// - /// - /// - /// - /// - /// - /// - public static MvcForm BeginUmbracoForm(this HtmlHelper html, string action, string controllerName, - object additionalRouteVals, - IDictionary htmlAttributes) - { - if (string.IsNullOrWhiteSpace(action)) throw new ArgumentNullOrEmptyException(nameof(action)); - if (string.IsNullOrWhiteSpace(controllerName)) throw new ArgumentNullOrEmptyException(nameof(controllerName)); + /// Helper method to create a new form to execute in the Umbraco request pipeline against a locally declared controller + /// + /// + /// + /// + /// + /// + /// + public static MvcForm BeginUmbracoForm(this HtmlHelper html, string action, string controllerName, + object additionalRouteVals, + IDictionary htmlAttributes) + { + if (string.IsNullOrWhiteSpace(action)) throw new ArgumentNullOrEmptyException(nameof(action)); + if (string.IsNullOrWhiteSpace(controllerName)) throw new ArgumentNullOrEmptyException(nameof(controllerName)); return html.BeginUmbracoForm(action, controllerName, "", additionalRouteVals, htmlAttributes); - } + } /// /// Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin @@ -449,17 +449,17 @@ namespace Umbraco.Web return html.BeginUmbracoForm(action, surfaceType, null, new Dictionary(), method); } - /// - /// Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin - /// - /// - /// - /// The surface controller to route to - /// - public static MvcForm BeginUmbracoForm(this HtmlHelper html, string action, Type surfaceType) - { - return html.BeginUmbracoForm(action, surfaceType, null, new Dictionary()); - } + /// + /// Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin + /// + /// + /// + /// The surface controller to route to + /// + public static MvcForm BeginUmbracoForm(this HtmlHelper html, string action, Type surfaceType) + { + return html.BeginUmbracoForm(action, surfaceType, null, new Dictionary()); + } /// /// Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin @@ -475,18 +475,18 @@ namespace Umbraco.Web return html.BeginUmbracoForm(action, typeof(T), method); } - /// - /// Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin - /// - /// - /// - /// - /// - public static MvcForm BeginUmbracoForm(this HtmlHelper html, string action) - where T : SurfaceController - { - return html.BeginUmbracoForm(action, typeof(T)); - } + /// + /// Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin + /// + /// + /// + /// + /// + public static MvcForm BeginUmbracoForm(this HtmlHelper html, string action) + where T : SurfaceController + { + return html.BeginUmbracoForm(action, typeof(T)); + } /// /// Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin @@ -503,19 +503,19 @@ namespace Umbraco.Web return html.BeginUmbracoForm(action, surfaceType, additionalRouteVals, new Dictionary(), method); } - /// - /// Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin - /// - /// - /// - /// The surface controller to route to - /// - /// - public static MvcForm BeginUmbracoForm(this HtmlHelper html, string action, Type surfaceType, - object additionalRouteVals) - { - return html.BeginUmbracoForm(action, surfaceType, additionalRouteVals, new Dictionary()); - } + /// + /// Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin + /// + /// + /// + /// The surface controller to route to + /// + /// + public static MvcForm BeginUmbracoForm(this HtmlHelper html, string action, Type surfaceType, + object additionalRouteVals) + { + return html.BeginUmbracoForm(action, surfaceType, additionalRouteVals, new Dictionary()); + } /// /// Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin @@ -532,19 +532,19 @@ namespace Umbraco.Web return html.BeginUmbracoForm(action, typeof(T), additionalRouteVals, method); } - /// - /// Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin - /// - /// - /// - /// - /// - /// - public static MvcForm BeginUmbracoForm(this HtmlHelper html, string action, object additionalRouteVals) - where T : SurfaceController - { - return html.BeginUmbracoForm(action, typeof(T), additionalRouteVals); - } + /// + /// Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin + /// + /// + /// + /// + /// + /// + public static MvcForm BeginUmbracoForm(this HtmlHelper html, string action, object additionalRouteVals) + where T : SurfaceController + { + return html.BeginUmbracoForm(action, typeof(T), additionalRouteVals); + } /// /// Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin @@ -565,20 +565,20 @@ namespace Umbraco.Web } /// - /// Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin - /// - /// - /// - /// The surface controller to route to - /// - /// - /// - public static MvcForm BeginUmbracoForm(this HtmlHelper html, string action, Type surfaceType, - object additionalRouteVals, - object htmlAttributes) - { + /// Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin + /// + /// + /// + /// The surface controller to route to + /// + /// + /// + public static MvcForm BeginUmbracoForm(this HtmlHelper html, string action, Type surfaceType, + object additionalRouteVals, + object htmlAttributes) + { return html.BeginUmbracoForm(action, surfaceType, additionalRouteVals, HtmlHelper.AnonymousObjectToHtmlAttributes(htmlAttributes)); - } + } /// /// Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin @@ -600,21 +600,21 @@ namespace Umbraco.Web } /// - /// Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin - /// - /// - /// - /// - /// - /// - /// - public static MvcForm BeginUmbracoForm(this HtmlHelper html, string action, - object additionalRouteVals, - object htmlAttributes) - where T : SurfaceController - { - return html.BeginUmbracoForm(action, typeof(T), additionalRouteVals, htmlAttributes); - } + /// Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin + /// + /// + /// + /// + /// + /// + /// + public static MvcForm BeginUmbracoForm(this HtmlHelper html, string action, + object additionalRouteVals, + object htmlAttributes) + where T : SurfaceController + { + return html.BeginUmbracoForm(action, typeof(T), additionalRouteVals, htmlAttributes); + } /// /// Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin @@ -649,17 +649,17 @@ namespace Umbraco.Web } /// - /// Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin - /// - /// - /// - /// The surface controller to route to - /// - /// - /// - public static MvcForm BeginUmbracoForm(this HtmlHelper html, string action, Type surfaceType, - object additionalRouteVals, - IDictionary htmlAttributes) + /// Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin + /// + /// + /// + /// The surface controller to route to + /// + /// + /// + public static MvcForm BeginUmbracoForm(this HtmlHelper html, string action, Type surfaceType, + object additionalRouteVals, + IDictionary htmlAttributes) { return html.BeginUmbracoForm(action, surfaceType, additionalRouteVals, htmlAttributes, FormMethod.Post); } @@ -684,21 +684,21 @@ namespace Umbraco.Web } /// - /// Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin - /// - /// - /// - /// - /// - /// - /// - public static MvcForm BeginUmbracoForm(this HtmlHelper html, string action, - object additionalRouteVals, - IDictionary htmlAttributes) - where T : SurfaceController - { - return html.BeginUmbracoForm(action, typeof(T), additionalRouteVals, htmlAttributes); - } + /// Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin + /// + /// + /// + /// + /// + /// + /// + public static MvcForm BeginUmbracoForm(this HtmlHelper html, string action, + object additionalRouteVals, + IDictionary htmlAttributes) + where T : SurfaceController + { + return html.BeginUmbracoForm(action, typeof(T), additionalRouteVals, htmlAttributes); + } /// /// Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin @@ -714,18 +714,18 @@ namespace Umbraco.Web return html.BeginUmbracoForm(action, controllerName, area, null, new Dictionary(), method); } - /// - /// Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin - /// - /// - /// - /// - /// - /// - public static MvcForm BeginUmbracoForm(this HtmlHelper html, string action, string controllerName, string area) - { - return html.BeginUmbracoForm(action, controllerName, area, null, new Dictionary()); - } + /// + /// Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin + /// + /// + /// + /// + /// + /// + public static MvcForm BeginUmbracoForm(this HtmlHelper html, string action, string controllerName, string area) + { + return html.BeginUmbracoForm(action, controllerName, area, null, new Dictionary()); + } /// /// Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin @@ -751,139 +751,139 @@ namespace Umbraco.Web } /// - /// Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin - /// - /// - /// - /// - /// - /// - /// - /// - public static MvcForm BeginUmbracoForm(this HtmlHelper html, string action, string controllerName, string area, - object additionalRouteVals, - IDictionary htmlAttributes) + /// Helper method to create a new form to execute in the Umbraco request pipeline to a surface controller plugin + /// + /// + /// + /// + /// + /// + /// + /// + public static MvcForm BeginUmbracoForm(this HtmlHelper html, string action, string controllerName, string area, + object additionalRouteVals, + IDictionary htmlAttributes) { return html.BeginUmbracoForm(action, controllerName, area, additionalRouteVals, htmlAttributes, FormMethod.Post); } - /// - /// This renders out the form for us - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// This code is pretty much the same as the underlying MVC code that writes out the form - /// - private static MvcForm RenderForm(this HtmlHelper htmlHelper, - string formAction, - FormMethod method, - IDictionary htmlAttributes, - string surfaceController, - string surfaceAction, - string area, - object additionalRouteVals = null) - { + /// + /// This renders out the form for us + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// This code is pretty much the same as the underlying MVC code that writes out the form + /// + private static MvcForm RenderForm(this HtmlHelper htmlHelper, + string formAction, + FormMethod method, + IDictionary htmlAttributes, + string surfaceController, + string surfaceAction, + string area, + object additionalRouteVals = null) + { - //ensure that the multipart/form-data is added to the html attributes - if (htmlAttributes.ContainsKey("enctype") == false) - { - htmlAttributes.Add("enctype", "multipart/form-data"); - } + //ensure that the multipart/form-data is added to the html attributes + if (htmlAttributes.ContainsKey("enctype") == false) + { + htmlAttributes.Add("enctype", "multipart/form-data"); + } - var tagBuilder = new TagBuilder("form"); - tagBuilder.MergeAttributes(htmlAttributes); - // action is implicitly generated, so htmlAttributes take precedence. - tagBuilder.MergeAttribute("action", formAction); - // method is an explicit parameter, so it takes precedence over the htmlAttributes. - tagBuilder.MergeAttribute("method", HtmlHelper.GetFormMethodString(method), true); - var traditionalJavascriptEnabled = htmlHelper.ViewContext.ClientValidationEnabled && htmlHelper.ViewContext.UnobtrusiveJavaScriptEnabled == false; - if (traditionalJavascriptEnabled) - { - // forms must have an ID for client validation - tagBuilder.GenerateId("form" + Guid.NewGuid().ToString("N")); - } - htmlHelper.ViewContext.Writer.Write(tagBuilder.ToString(TagRenderMode.StartTag)); + var tagBuilder = new TagBuilder("form"); + tagBuilder.MergeAttributes(htmlAttributes); + // action is implicitly generated, so htmlAttributes take precedence. + tagBuilder.MergeAttribute("action", formAction); + // method is an explicit parameter, so it takes precedence over the htmlAttributes. + tagBuilder.MergeAttribute("method", HtmlHelper.GetFormMethodString(method), true); + var traditionalJavascriptEnabled = htmlHelper.ViewContext.ClientValidationEnabled && htmlHelper.ViewContext.UnobtrusiveJavaScriptEnabled == false; + if (traditionalJavascriptEnabled) + { + // forms must have an ID for client validation + tagBuilder.GenerateId("form" + Guid.NewGuid().ToString("N")); + } + htmlHelper.ViewContext.Writer.Write(tagBuilder.ToString(TagRenderMode.StartTag)); - //new UmbracoForm: - var theForm = new UmbracoForm(htmlHelper.ViewContext, surfaceController, surfaceAction, area, method, additionalRouteVals); + //new UmbracoForm: + var theForm = new UmbracoForm(htmlHelper.ViewContext, surfaceController, surfaceAction, area, method, additionalRouteVals); - if (traditionalJavascriptEnabled) - { - htmlHelper.ViewContext.FormContext.FormId = tagBuilder.Attributes["id"]; - } - return theForm; - } + if (traditionalJavascriptEnabled) + { + htmlHelper.ViewContext.FormContext.FormId = tagBuilder.Attributes["id"]; + } + return theForm; + } - #endregion + #endregion - #region Wrap + #region Wrap - public static HtmlTagWrapper Wrap(this HtmlHelper html, string tag, string innerText, params IHtmlTagWrapper[] children) - { - var item = html.Wrap(tag, innerText, (object)null); - foreach (var child in children) - { - item.AddChild(child); - } - return item; - } + public static HtmlTagWrapper Wrap(this HtmlHelper html, string tag, string innerText, params IHtmlTagWrapper[] children) + { + var item = html.Wrap(tag, innerText, (object)null); + foreach (var child in children) + { + item.AddChild(child); + } + return item; + } - public static HtmlTagWrapper Wrap(this HtmlHelper html, string tag, object inner, object anonymousAttributes, params IHtmlTagWrapper[] children) - { - string innerText = null; - if (inner != null) - { - innerText = string.Format("{0}", inner); - } - var item = html.Wrap(tag, innerText, anonymousAttributes); - foreach (var child in children) - { - item.AddChild(child); - } - return item; - } - public static HtmlTagWrapper Wrap(this HtmlHelper html, string tag, object inner) - { - string innerText = null; - if (inner != null) - { - innerText = string.Format("{0}", inner); - } - return html.Wrap(tag, innerText, (object)null); - } + public static HtmlTagWrapper Wrap(this HtmlHelper html, string tag, object inner, object anonymousAttributes, params IHtmlTagWrapper[] children) + { + string innerText = null; + if (inner != null) + { + innerText = string.Format("{0}", inner); + } + var item = html.Wrap(tag, innerText, anonymousAttributes); + foreach (var child in children) + { + item.AddChild(child); + } + return item; + } + public static HtmlTagWrapper Wrap(this HtmlHelper html, string tag, object inner) + { + string innerText = null; + if (inner != null) + { + innerText = string.Format("{0}", inner); + } + return html.Wrap(tag, innerText, (object)null); + } - public static HtmlTagWrapper Wrap(this HtmlHelper html, string tag, string innerText, object anonymousAttributes, params IHtmlTagWrapper[] children) - { - var wrap = new HtmlTagWrapper(tag); - if (anonymousAttributes != null) - { - wrap.ReflectAttributesFromAnonymousType(anonymousAttributes); - } - if (!string.IsNullOrWhiteSpace(innerText)) - { - wrap.AddChild(new HtmlTagWrapperTextNode(innerText)); - } - foreach (var child in children) - { - wrap.AddChild(child); - } - return wrap; - } + public static HtmlTagWrapper Wrap(this HtmlHelper html, string tag, string innerText, object anonymousAttributes, params IHtmlTagWrapper[] children) + { + var wrap = new HtmlTagWrapper(tag); + if (anonymousAttributes != null) + { + wrap.ReflectAttributesFromAnonymousType(anonymousAttributes); + } + if (!string.IsNullOrWhiteSpace(innerText)) + { + wrap.AddChild(new HtmlTagWrapperTextNode(innerText)); + } + foreach (var child in children) + { + wrap.AddChild(child); + } + return wrap; + } - public static HtmlTagWrapper Wrap(this HtmlHelper html, bool visible, string tag, string innerText, object anonymousAttributes, params IHtmlTagWrapper[] children) - { - var item = html.Wrap(tag, innerText, anonymousAttributes, children); - item.Visible = visible; - return item; - } + public static HtmlTagWrapper Wrap(this HtmlHelper html, bool visible, string tag, string innerText, object anonymousAttributes, params IHtmlTagWrapper[] children) + { + var item = html.Wrap(tag, innerText, anonymousAttributes, children); + item.Visible = visible; + return item; + } #endregion diff --git a/src/Umbraco.Web/HtmlStringUtilities.cs b/src/Umbraco.Web/HtmlStringUtilities.cs index 30429173c1..4ecf7c61ca 100644 --- a/src/Umbraco.Web/HtmlStringUtilities.cs +++ b/src/Umbraco.Web/HtmlStringUtilities.cs @@ -245,4 +245,4 @@ namespace Umbraco.Web } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/HttpCookieExtensions.cs b/src/Umbraco.Web/HttpCookieExtensions.cs index 41cbcf5149..9206a3c3ad 100644 --- a/src/Umbraco.Web/HttpCookieExtensions.cs +++ b/src/Umbraco.Web/HttpCookieExtensions.cs @@ -13,7 +13,7 @@ namespace Umbraco.Web /// /// /// This should 100% supercede the StateManager.Cookies - /// + /// internal static class HttpCookieExtensions { /// @@ -179,4 +179,4 @@ namespace Umbraco.Web return new HttpRequestWrapper(request).HasCookieValue(key); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/HttpRequestExtensions.cs b/src/Umbraco.Web/HttpRequestExtensions.cs index d7f9e409c8..677e85b2b2 100644 --- a/src/Umbraco.Web/HttpRequestExtensions.cs +++ b/src/Umbraco.Web/HttpRequestExtensions.cs @@ -7,77 +7,77 @@ using Umbraco.Core; namespace Umbraco.Web { /// - /// Extension methods for the HttpRequest and HttpRequestBase objects - /// - public static class HttpRequestExtensions - { + /// Extension methods for the HttpRequest and HttpRequestBase objects + /// + public static class HttpRequestExtensions + { /// /// Extracts the value from the query string and cleans it to prevent xss attacks. /// /// /// - /// + /// public static string CleanForXss(this HttpRequest request, string key) { var item = request.GetItemAsString(key); return item.CleanForXss(); } - /// - /// Safely get a request item as string, if the item does not exist, an empty string is returned. - /// - /// - /// - /// The value to return if the key is not found in the collection - /// - public static string GetItemAsString(this HttpRequest request, string key, string valueIfNotFound = "") - { - return new HttpRequestWrapper(request).GetItemAsString(key, valueIfNotFound); - } + /// + /// Safely get a request item as string, if the item does not exist, an empty string is returned. + /// + /// + /// + /// The value to return if the key is not found in the collection + /// + public static string GetItemAsString(this HttpRequest request, string key, string valueIfNotFound = "") + { + return new HttpRequestWrapper(request).GetItemAsString(key, valueIfNotFound); + } - /// - /// Safely get a request item as string, if the item does not exist, an empty string is returned. - /// - /// - /// - /// The value to return if the key is not found in the collection - /// - public static string GetItemAsString(this HttpRequestBase request, string key, string valueIfNotFound = "") - { - var val = request[key]; - return !val.IsNullOrWhiteSpace() ? val : valueIfNotFound; - } + /// + /// Safely get a request item as string, if the item does not exist, an empty string is returned. + /// + /// + /// + /// The value to return if the key is not found in the collection + /// + public static string GetItemAsString(this HttpRequestBase request, string key, string valueIfNotFound = "") + { + var val = request[key]; + return !val.IsNullOrWhiteSpace() ? val : valueIfNotFound; + } - /// - /// Safely get the item from the query string and convert it to type 'T', otherwise will return default(T). - /// - /// - /// - /// - /// - public static T GetItemAs(this HttpRequestBase request, string key) - { - var val = request[key]; - var whitespaceCheck = !val.IsNullOrWhiteSpace() ? val : string.Empty; - if (whitespaceCheck.IsNullOrWhiteSpace()) - return (T) typeof (T).GetDefaultValue(); - var attempt = val.TryConvertTo(); - if (attempt.Success) - return attempt.Result; - return (T)typeof(T).GetDefaultValue(); - } + /// + /// Safely get the item from the query string and convert it to type 'T', otherwise will return default(T). + /// + /// + /// + /// + /// + public static T GetItemAs(this HttpRequestBase request, string key) + { + var val = request[key]; + var whitespaceCheck = !val.IsNullOrWhiteSpace() ? val : string.Empty; + if (whitespaceCheck.IsNullOrWhiteSpace()) + return (T) typeof (T).GetDefaultValue(); + var attempt = val.TryConvertTo(); + if (attempt.Success) + return attempt.Result; + return (T)typeof(T).GetDefaultValue(); + } - /// - /// Safely get the item from the query string and convert it to type 'T', otherwise will return default(T). - /// - /// - /// - /// - /// - public static T GetItemAs(this HttpRequest request, string key) - { - return new HttpRequestWrapper(request).GetItemAs(key); - } + /// + /// Safely get the item from the query string and convert it to type 'T', otherwise will return default(T). + /// + /// + /// + /// + /// + public static T GetItemAs(this HttpRequest request, string key) + { + return new HttpRequestWrapper(request).GetItemAs(key); + } - } + } } diff --git a/src/Umbraco.Web/HttpUrlHelperExtensions.cs b/src/Umbraco.Web/HttpUrlHelperExtensions.cs index 436f987541..113d7b3351 100644 --- a/src/Umbraco.Web/HttpUrlHelperExtensions.cs +++ b/src/Umbraco.Web/HttpUrlHelperExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using System.Linq.Expressions; using System.Web.Http.Routing; @@ -38,7 +38,7 @@ namespace Umbraco.Web if (methodParams.Any() == false) { - return url.GetUmbracoApiService(method.Name); + return url.GetUmbracoApiService(method.Name); } return url.GetUmbracoApiService(method.Name, methodParams.Values.First()); } @@ -149,4 +149,4 @@ namespace Umbraco.Web return url.GetUmbracoApiService(method.Name).TrimEnd(method.Name); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/HybridAccessorBase.cs b/src/Umbraco.Web/HybridAccessorBase.cs index a14caa60a2..669b929fd6 100644 --- a/src/Umbraco.Web/HybridAccessorBase.cs +++ b/src/Umbraco.Web/HybridAccessorBase.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Runtime.Remoting.Messaging; using Umbraco.Core; @@ -90,4 +90,4 @@ namespace Umbraco.Web } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/IHttpContextAccessor.cs b/src/Umbraco.Web/IHttpContextAccessor.cs index 9e2e7fe6d5..a00632803d 100644 --- a/src/Umbraco.Web/IHttpContextAccessor.cs +++ b/src/Umbraco.Web/IHttpContextAccessor.cs @@ -1,4 +1,4 @@ -using System.Web; +using System.Web; namespace Umbraco.Web { @@ -6,4 +6,4 @@ namespace Umbraco.Web { HttpContext HttpContext { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/IPublishedContentQuery.cs b/src/Umbraco.Web/IPublishedContentQuery.cs index ef7b355d90..0ba3da6c4f 100644 --- a/src/Umbraco.Web/IPublishedContentQuery.cs +++ b/src/Umbraco.Web/IPublishedContentQuery.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Xml.XPath; using Umbraco.Core.Models.PublishedContent; @@ -43,4 +43,4 @@ namespace Umbraco.Web /// IEnumerable Search(Examine.SearchCriteria.ISearchCriteria criteria, Examine.Providers.BaseSearchProvider searchProvider = null); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/ITagQuery.cs b/src/Umbraco.Web/ITagQuery.cs index 2f118f6276..3d0757a695 100644 --- a/src/Umbraco.Web/ITagQuery.cs +++ b/src/Umbraco.Web/ITagQuery.cs @@ -80,4 +80,4 @@ namespace Umbraco.Web /// IEnumerable GetTagsForEntity(int contentId, string tagGroup = null); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/IUmbracoComponentRenderer.cs b/src/Umbraco.Web/IUmbracoComponentRenderer.cs index 0c6c1a775e..dc91cacdc0 100644 --- a/src/Umbraco.Web/IUmbracoComponentRenderer.cs +++ b/src/Umbraco.Web/IUmbracoComponentRenderer.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Web; using Umbraco.Core.Models.PublishedContent; @@ -40,4 +40,4 @@ namespace Umbraco.Web /// IHtmlString RenderMacro(string alias, IDictionary parameters); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/IUmbracoComponentRendererWithField.cs b/src/Umbraco.Web/IUmbracoComponentRendererWithField.cs index 103e5b5b50..30754e28a3 100644 --- a/src/Umbraco.Web/IUmbracoComponentRendererWithField.cs +++ b/src/Umbraco.Web/IUmbracoComponentRendererWithField.cs @@ -1,4 +1,4 @@ -using System.Web; +using System.Web; using Umbraco.Core.Models.PublishedContent; namespace Umbraco.Web @@ -27,13 +27,13 @@ namespace Umbraco.Web /// //// /// - IHtmlString Field(IPublishedContent currentPage, string fieldAlias, + IHtmlString Field(IPublishedContent currentPage, string fieldAlias, string altFieldAlias = "", string altText = "", string insertBefore = "", string insertAfter = "", bool recursive = false, bool convertLineBreaks = false, bool removeParagraphTags = false, RenderFieldCaseType casing = RenderFieldCaseType.Unchanged, - RenderFieldEncodingType encoding = RenderFieldEncodingType.Unchanged, + RenderFieldEncodingType encoding = RenderFieldEncodingType.Unchanged, bool formatAsDate = false, bool formatAsDateWithTime = false, string formatAsDateWithTimeSeparator = ""); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/IUmbracoContextAccessor.cs b/src/Umbraco.Web/IUmbracoContextAccessor.cs index 72309d5efc..74df940865 100644 --- a/src/Umbraco.Web/IUmbracoContextAccessor.cs +++ b/src/Umbraco.Web/IUmbracoContextAccessor.cs @@ -1,4 +1,4 @@ -namespace Umbraco.Web +namespace Umbraco.Web { /// /// Provides access to UmbracoContext. @@ -7,4 +7,4 @@ namespace Umbraco.Web { UmbracoContext UmbracoContext { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/ImageCropperTemplateExtensions.cs b/src/Umbraco.Web/ImageCropperTemplateExtensions.cs index f2ef3ad77c..77081ccace 100644 --- a/src/Umbraco.Web/ImageCropperTemplateExtensions.cs +++ b/src/Umbraco.Web/ImageCropperTemplateExtensions.cs @@ -100,7 +100,7 @@ namespace Umbraco.Web /// /// /// If the image should be upscaled to requested dimensions - /// + /// /// /// The . /// @@ -115,7 +115,7 @@ namespace Umbraco.Web ImageCropAnchor? imageCropAnchor = null, bool preferFocalPoint = false, bool useCropDimensions = false, - bool cacheBuster = true, + bool cacheBuster = true, string furtherOptions = null, ImageCropRatioMode? ratioMode = null, bool upScale = true) @@ -126,7 +126,7 @@ namespace Umbraco.Web if (mediaItem.HasProperty(propertyAlias) == false || mediaItem.HasValue(propertyAlias) == false) return string.Empty; - + //get the default obj from the value converter var cropperValue = mediaItem.Value(propertyAlias); @@ -208,7 +208,7 @@ namespace Umbraco.Web /// /// /// If the image should be upscaled to requested dimensions - /// + /// /// /// The . /// @@ -223,7 +223,7 @@ namespace Umbraco.Web ImageCropAnchor? imageCropAnchor = null, bool preferFocalPoint = false, bool useCropDimensions = false, - string cacheBusterValue = null, + string cacheBusterValue = null, string furtherOptions = null, ImageCropRatioMode? ratioMode = null, bool upScale = true) @@ -233,7 +233,7 @@ namespace Umbraco.Web ImageCropDataSet cropDataSet = null; if (string.IsNullOrEmpty(imageCropperValue) == false && imageCropperValue.DetectIsJson() && (imageCropMode == ImageCropMode.Crop || imageCropMode == null)) { - cropDataSet = imageCropperValue.SerializeToCropDataSet(); + cropDataSet = imageCropperValue.SerializeToCropDataSet(); } return GetCropUrl( imageUrl, cropDataSet, width, height, cropAlias, quality, imageCropMode, @@ -287,7 +287,7 @@ namespace Umbraco.Web /// /// /// If the image should be upscaled to requested dimensions - /// + /// /// /// The . /// @@ -366,7 +366,7 @@ namespace Umbraco.Web var hasFormat = furtherOptions != null && furtherOptions.InvariantContains("&format="); - //Only put quality here, if we don't have a format specified. + //Only put quality here, if we don't have a format specified. //Otherwise we need to put quality at the end to avoid it being overridden by the format. if (quality != null && hasFormat == false) { diff --git a/src/Umbraco.Web/Install/Controllers/InstallController.cs b/src/Umbraco.Web/Install/Controllers/InstallController.cs index 3a34e4d461..acdb8d98b1 100644 --- a/src/Umbraco.Web/Install/Controllers/InstallController.cs +++ b/src/Umbraco.Web/Install/Controllers/InstallController.cs @@ -22,12 +22,12 @@ namespace Umbraco.Web.Install.Controllers private readonly ILogger _logger; public InstallController(UmbracoContext umbracoContext, DatabaseBuilder databaseBuilder, IRuntimeState runtime, ILogger logger) - { - _umbracoContext = umbracoContext; + { + _umbracoContext = umbracoContext; _databaseBuilder = databaseBuilder; _runtime = runtime; - _logger = logger; - } + _logger = logger; + } [HttpGet] public ActionResult Index() diff --git a/src/Umbraco.Web/Install/Controllers/InstallPackageController.cs b/src/Umbraco.Web/Install/Controllers/InstallPackageController.cs index a9f858cddd..bb2d6869c6 100644 --- a/src/Umbraco.Web/Install/Controllers/InstallPackageController.cs +++ b/src/Umbraco.Web/Install/Controllers/InstallPackageController.cs @@ -17,31 +17,31 @@ using Umbraco.Web.WebApi; namespace Umbraco.Web.Install.Controllers { /// - /// A controller for the installation process regarding packages - /// - /// - /// Currently this is used for web services however we should/could eventually migrate the whole installer to MVC as it - /// is a bit of a mess currently. - /// - [HttpInstallAuthorize] + /// A controller for the installation process regarding packages + /// + /// + /// Currently this is used for web services however we should/could eventually migrate the whole installer to MVC as it + /// is a bit of a mess currently. + /// + [HttpInstallAuthorize] [AngularJsonOnlyConfiguration] [Obsolete("This is only used for the legacy way of installing starter kits in the back office")] public class InstallPackageController : ApiController - { - public InstallPackageController() - { } + { + public InstallPackageController() + { } - private const string RepoGuid = "65194810-1f85-11dd-bd0b-0800200c9a66"; + private const string RepoGuid = "65194810-1f85-11dd-bd0b-0800200c9a66"; - /// - /// Empty action, useful for retrieving the base url for this controller - /// - /// - [HttpGet] + /// + /// Empty action, useful for retrieving the base url for this controller + /// + /// + [HttpGet] public HttpResponseMessage Index() - { - throw new NotImplementedException(); - } + { + throw new NotImplementedException(); + } /// /// Connects to the repo, downloads the package and creates the manifest @@ -59,102 +59,102 @@ namespace Umbraco.Web.Install.Controllers var installer = new global::umbraco.cms.businesslogic.packager.Installer(UmbracoContext.Current.Security.CurrentUser.Id); var tempFile = installer.Import(packageFile); - installer.LoadConfig(tempFile); + installer.LoadConfig(tempFile); var pId = installer.CreateManifest(tempFile, model.KitGuid.ToString(), RepoGuid); - return Json(new - { - success = true, - manifestId = pId, - packageFile = tempFile, - percentage = 10, - message = "Downloading starter kit files..." - }, HttpStatusCode.OK); - } + return Json(new + { + success = true, + manifestId = pId, + packageFile = tempFile, + percentage = 10, + message = "Downloading starter kit files..." + }, HttpStatusCode.OK); + } - /// - /// Installs the files in the package - /// - /// - [HttpPost] + /// + /// Installs the files in the package + /// + /// + [HttpPost] public HttpResponseMessage InstallPackageFiles(InstallPackageModel model) - { + { model.PackageFile = HttpUtility.UrlDecode(model.PackageFile); var installer = new global::umbraco.cms.businesslogic.packager.Installer(UmbracoContext.Current.Security.CurrentUser.Id); installer.LoadConfig(model.PackageFile); installer.InstallFiles(model.ManifestId, model.PackageFile); - return Json(new - { - success = true, + return Json(new + { + success = true, model.ManifestId, model.PackageFile, - percentage = 20, - message = "Installing starter kit files" - }, HttpStatusCode.OK); - } + percentage = 20, + message = "Installing starter kit files" + }, HttpStatusCode.OK); + } - /// - /// Ensures the app pool is restarted - /// - /// - [HttpPost] + /// + /// Ensures the app pool is restarted + /// + /// + [HttpPost] public HttpResponseMessage RestartAppPool() - { - Current.RestartAppPool(Request.TryGetHttpContext().Result); - return Json(new - { - success = true, - percentage = 25, - message = "Installing starter kit files" - }, HttpStatusCode.OK); - } - - /// - /// Checks if the app pool has completed restarted - /// - /// - [HttpPost] - public HttpResponseMessage CheckAppPoolRestart() - { - if (Request.TryGetHttpContext().Result.Application.AllKeys.Contains("AppPoolRestarting")) - { - return Request.CreateResponse(HttpStatusCode.BadRequest); - } - - return Json(new - { - percentage = 30, + { + Current.RestartAppPool(Request.TryGetHttpContext().Result); + return Json(new + { success = true, - }, HttpStatusCode.OK); - } + percentage = 25, + message = "Installing starter kit files" + }, HttpStatusCode.OK); + } - /// - /// Installs the business logic portion of the package after app restart - /// - /// - [HttpPost] + /// + /// Checks if the app pool has completed restarted + /// + /// + [HttpPost] + public HttpResponseMessage CheckAppPoolRestart() + { + if (Request.TryGetHttpContext().Result.Application.AllKeys.Contains("AppPoolRestarting")) + { + return Request.CreateResponse(HttpStatusCode.BadRequest); + } + + return Json(new + { + percentage = 30, + success = true, + }, HttpStatusCode.OK); + } + + /// + /// Installs the business logic portion of the package after app restart + /// + /// + [HttpPost] public HttpResponseMessage InstallBusinessLogic(InstallPackageModel model) - { + { model.PackageFile = HttpUtility.UrlDecode(model.PackageFile); var installer = new global::umbraco.cms.businesslogic.packager.Installer(UmbracoContext.Current.Security.CurrentUser.Id); installer.LoadConfig(model.PackageFile); installer.InstallBusinessLogic(model.ManifestId, model.PackageFile); - return Json(new - { - success = true, + return Json(new + { + success = true, model.ManifestId, model.PackageFile, - percentage = 70, - message = "Installing starter kit files" - }, HttpStatusCode.OK); - } + percentage = 70, + message = "Installing starter kit files" + }, HttpStatusCode.OK); + } - /// - /// Cleans up the package installation - /// - /// - [HttpPost] + /// + /// Cleans up the package installation + /// + /// + [HttpPost] public HttpResponseMessage CleanupInstallation(InstallPackageModel model) - { + { model.PackageFile = HttpUtility.UrlDecode(model.PackageFile); var installer = new global::umbraco.cms.businesslogic.packager.Installer(UmbracoContext.Current.Security.CurrentUser.Id); installer.LoadConfig(model.PackageFile); @@ -164,15 +164,15 @@ namespace Umbraco.Web.Install.Controllers // but it should be managed automatically by services and caches! //DistributedCache.Instance.RefreshAllFacade(); - return Json(new - { - success = true, + return Json(new + { + success = true, model.ManifestId, model.PackageFile, - percentage = 100, - message = "Starter kit has been installed" - }, HttpStatusCode.OK); - } + percentage = 100, + message = "Starter kit has been installed" + }, HttpStatusCode.OK); + } private HttpResponseMessage Json(object jsonObject, HttpStatusCode status) { @@ -181,6 +181,6 @@ namespace Umbraco.Web.Install.Controllers response.Content = new StringContent(json.ToString(), Encoding.UTF8, "application/json"); return response; } - } + } } diff --git a/src/Umbraco.Web/Install/FilePermissionHelper.cs b/src/Umbraco.Web/Install/FilePermissionHelper.cs index 099dee5ddb..5b160f482b 100644 --- a/src/Umbraco.Web/Install/FilePermissionHelper.cs +++ b/src/Umbraco.Web/Install/FilePermissionHelper.cs @@ -193,4 +193,4 @@ namespace Umbraco.Web.Install return "umbraco-test." + Guid.NewGuid().ToString("N").Substring(0, 8); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Install/HttpInstallAuthorizeAttribute.cs b/src/Umbraco.Web/Install/HttpInstallAuthorizeAttribute.cs index 2ed4a9d903..68acdd6cc8 100644 --- a/src/Umbraco.Web/Install/HttpInstallAuthorizeAttribute.cs +++ b/src/Umbraco.Web/Install/HttpInstallAuthorizeAttribute.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Web.Http; using System.Web.Http.Controllers; using Umbraco.Core; @@ -7,12 +7,12 @@ using Umbraco.Web.Composing; namespace Umbraco.Web.Install { - /// - /// Ensures authorization occurs for the installer if it has already completed. - /// If install has not yet occured then the authorization is successful. - /// - internal class HttpInstallAuthorizeAttribute : AuthorizeAttribute - { + /// + /// Ensures authorization occurs for the installer if it has already completed. + /// If install has not yet occured then the authorization is successful. + /// + internal class HttpInstallAuthorizeAttribute : AuthorizeAttribute + { // todo - cannot inject UmbracoContext nor RuntimeState in the attribute, read: // http://stackoverflow.com/questions/30096903/dependency-injection-inside-a-filterattribute-in-asp-net-mvc-6 // https://www.cuttingedge.it/blogs/steven/pivot/entry.php?id=98 - don't do it! @@ -23,18 +23,18 @@ namespace Umbraco.Web.Install // the second solution is nicer BUT for the time being, let's use the first (simpler). private readonly UmbracoContext _umbracoContext; - private readonly IRuntimeState _runtimeState; + private readonly IRuntimeState _runtimeState; - private IRuntimeState RuntimeState => _runtimeState ?? Current.RuntimeState; + private IRuntimeState RuntimeState => _runtimeState ?? Current.RuntimeState; - private UmbracoContext UmbracoContext => _umbracoContext ?? Current.UmbracoContext; + private UmbracoContext UmbracoContext => _umbracoContext ?? Current.UmbracoContext; - /// - /// THIS SHOULD BE ONLY USED FOR UNIT TESTS - /// - /// - /// - public HttpInstallAuthorizeAttribute(UmbracoContext umbracoContext, IRuntimeState runtimeState) + /// + /// THIS SHOULD BE ONLY USED FOR UNIT TESTS + /// + /// + /// + public HttpInstallAuthorizeAttribute(UmbracoContext umbracoContext, IRuntimeState runtimeState) { if (umbracoContext == null) throw new ArgumentNullException(nameof(umbracoContext)); if (runtimeState == null) throw new ArgumentNullException(nameof(runtimeState)); @@ -43,10 +43,10 @@ namespace Umbraco.Web.Install } public HttpInstallAuthorizeAttribute() - { } + { } - protected override bool IsAuthorized(HttpActionContext actionContext) - { + protected override bool IsAuthorized(HttpActionContext actionContext) + { try { // if not configured (install or upgrade) then we can continue @@ -60,6 +60,6 @@ namespace Umbraco.Web.Install Current.Logger.Error("An error occurred determining authorization", ex); return false; } - } - } -} \ No newline at end of file + } + } +} diff --git a/src/Umbraco.Web/Install/InstallAuthorizeAttribute.cs b/src/Umbraco.Web/Install/InstallAuthorizeAttribute.cs index 722c74c40f..238bb7c6eb 100644 --- a/src/Umbraco.Web/Install/InstallAuthorizeAttribute.cs +++ b/src/Umbraco.Web/Install/InstallAuthorizeAttribute.cs @@ -69,4 +69,4 @@ namespace Umbraco.Web.Install filterContext.Result = new RedirectResult(SystemDirectories.Umbraco.EnsureEndsWith('/')); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Install/InstallHelper.cs b/src/Umbraco.Web/Install/InstallHelper.cs index 048f54fa74..a94cc96466 100644 --- a/src/Umbraco.Web/Install/InstallHelper.cs +++ b/src/Umbraco.Web/Install/InstallHelper.cs @@ -214,4 +214,4 @@ namespace Umbraco.Web.Install return packages; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Install/InstallStatusTracker.cs b/src/Umbraco.Web/Install/InstallStatusTracker.cs index b8bdec9c2c..7944100648 100644 --- a/src/Umbraco.Web/Install/InstallStatusTracker.cs +++ b/src/Umbraco.Web/Install/InstallStatusTracker.cs @@ -38,7 +38,7 @@ namespace Umbraco.Web.Install } public static void ClearFiles() - { + { var dir = IOHelper.MapPath("~/App_Data/TEMP/Install/"); if (Directory.Exists(dir)) { @@ -131,7 +131,7 @@ namespace Umbraco.Web.Install trackingItem.AdditionalData = additionalData; } trackingItem.IsComplete = true; - + //save the file var file = GetFile(installId); var serialized = JsonConvert.SerializeObject(new List(_steps)); @@ -141,6 +141,6 @@ namespace Umbraco.Web.Install public static IEnumerable GetStatus() { return new List(_steps).OrderBy(x => x.ServerOrder); - } + } } } diff --git a/src/Umbraco.Web/Install/InstallSteps/DatabaseInstallStep.cs b/src/Umbraco.Web/Install/InstallSteps/DatabaseInstallStep.cs index f7fa2d1102..c4ecf16f5b 100644 --- a/src/Umbraco.Web/Install/InstallSteps/DatabaseInstallStep.cs +++ b/src/Umbraco.Web/Install/InstallSteps/DatabaseInstallStep.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Configuration; using Umbraco.Core; @@ -68,4 +68,4 @@ namespace Umbraco.Web.Install.InstallSteps return true; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Install/InstallSteps/DatabaseUpgradeStep.cs b/src/Umbraco.Web/Install/InstallSteps/DatabaseUpgradeStep.cs index ae323d6e3d..025bd38489 100644 --- a/src/Umbraco.Web/Install/InstallSteps/DatabaseUpgradeStep.cs +++ b/src/Umbraco.Web/Install/InstallSteps/DatabaseUpgradeStep.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Configuration; using System.Linq; @@ -32,7 +32,7 @@ namespace Umbraco.Web.Install.InstallSteps public override InstallSetupResult Execute(object model) { - var installSteps = InstallStatusTracker.GetStatus().ToArray(); + var installSteps = InstallStatusTracker.GetStatus().ToArray(); var previousStep = installSteps.Single(x => x.Name == "DatabaseInstall"); var upgrade = previousStep.AdditionalData.ContainsKey("upgrade"); @@ -65,7 +65,7 @@ namespace Umbraco.Web.Install.InstallSteps { return false; } - + var databaseSettings = ConfigurationManager.ConnectionStrings[Constants.System.UmbracoConnectionName]; if (_databaseBuilder.IsConnectionStringConfigured(databaseSettings)) @@ -88,4 +88,4 @@ namespace Umbraco.Web.Install.InstallSteps return false; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Install/InstallSteps/FilePermissionsStep.cs b/src/Umbraco.Web/Install/InstallSteps/FilePermissionsStep.cs index 8c9dec9f6e..6d07190b4f 100644 --- a/src/Umbraco.Web/Install/InstallSteps/FilePermissionsStep.cs +++ b/src/Umbraco.Web/Install/InstallSteps/FilePermissionsStep.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.IO; using umbraco; @@ -30,4 +30,4 @@ namespace Umbraco.Web.Install.InstallSteps return true; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Install/InstallSteps/MajorVersion7UpgradeReport.cs b/src/Umbraco.Web/Install/InstallSteps/MajorVersion7UpgradeReport.cs index 90ad55e51c..fefbfce9c1 100644 --- a/src/Umbraco.Web/Install/InstallSteps/MajorVersion7UpgradeReport.cs +++ b/src/Umbraco.Web/Install/InstallSteps/MajorVersion7UpgradeReport.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using NPoco; @@ -40,7 +40,7 @@ namespace Umbraco.Web.Install.InstallSteps var result = _databaseBuilder.ValidateDatabaseSchema(); var determinedVersion = result.DetermineInstalledVersion(); - return new InstallSetupResult("version7upgradereport", + return new InstallSetupResult("version7upgradereport", new { currentVersion = determinedVersion.ToString(), @@ -129,4 +129,4 @@ namespace Umbraco.Web.Install.InstallSteps return errorReport; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Install/InstallSteps/NewInstallStep.cs b/src/Umbraco.Web/Install/InstallSteps/NewInstallStep.cs index dd438ef2ba..0d45a14581 100644 --- a/src/Umbraco.Web/Install/InstallSteps/NewInstallStep.cs +++ b/src/Umbraco.Web/Install/InstallSteps/NewInstallStep.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Configuration; @@ -16,8 +16,8 @@ namespace Umbraco.Web.Install.InstallSteps /// This is the first UI step for a brand new install /// /// - /// By default this will show the user view which is the most basic information to configure a new install, but if an install get's interupted because of an - /// error, etc... and the end-user refreshes the installer then we cannot show the user screen because they've already entered that information so instead we'll + /// By default this will show the user view which is the most basic information to configure a new install, but if an install get's interupted because of an + /// error, etc... and the end-user refreshes the installer then we cannot show the user screen because they've already entered that information so instead we'll /// display a simple continue installation view. /// [InstallSetupStep(InstallationType.NewInstall, @@ -113,24 +113,24 @@ namespace Umbraco.Web.Install.InstallSteps { get { return RequiresExecution(null) //the user UI - ? "user" + ? "user" //the continue install UI : "continueinstall"; } } - + public override bool RequiresExecution(UserModel model) { //now we have to check if this is really a new install, the db might be configured and might contain data var databaseSettings = ConfigurationManager.ConnectionStrings[Constants.System.UmbracoConnectionName]; - //if there's already a version then there should def be a user but in some cases someone may have + //if there's already a version then there should def be a user but in some cases someone may have // left a version number in there but cleared out their db conn string, in that case, it's really a new install. if (GlobalSettings.ConfigurationStatus.IsNullOrWhiteSpace() == false && databaseSettings != null) return false; if (_databaseBuilder.IsConnectionStringConfigured(databaseSettings) && _databaseBuilder.IsDatabaseConfigured) return _databaseBuilder.HasSomeNonDefaultUser() == false; - // In this one case when it's a brand new install and nothing has been configured, make sure the + // In this one case when it's a brand new install and nothing has been configured, make sure the // back office cookie is cleared so there's no old cookies lying around causing problems _http.ExpireCookie(UmbracoConfig.For.UmbracoSettings().Security.AuthCookieName); diff --git a/src/Umbraco.Web/Install/InstallSteps/SetUmbracoVersionStep.cs b/src/Umbraco.Web/Install/InstallSteps/SetUmbracoVersionStep.cs index ec34fcce51..53440e1798 100644 --- a/src/Umbraco.Web/Install/InstallSteps/SetUmbracoVersionStep.cs +++ b/src/Umbraco.Web/Install/InstallSteps/SetUmbracoVersionStep.cs @@ -1,4 +1,4 @@ -using System.Web; +using System.Web; using Umbraco.Core; using Umbraco.Core.Configuration; using Umbraco.Core.Logging; @@ -59,4 +59,4 @@ namespace Umbraco.Web.Install.InstallSteps return true; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Install/InstallSteps/StarterKitCleanupStep.cs b/src/Umbraco.Web/Install/InstallSteps/StarterKitCleanupStep.cs index 73944fe718..b9fe860c00 100644 --- a/src/Umbraco.Web/Install/InstallSteps/StarterKitCleanupStep.cs +++ b/src/Umbraco.Web/Install/InstallSteps/StarterKitCleanupStep.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using System.Web; using umbraco.cms.businesslogic.packager; @@ -6,7 +6,7 @@ using Umbraco.Web.Install.Models; namespace Umbraco.Web.Install.InstallSteps { - [InstallSetupStep(InstallationType.NewInstall, + [InstallSetupStep(InstallationType.NewInstall, "StarterKitCleanup", 32, "Almost done")] internal class StarterKitCleanupStep : InstallSetupStep { @@ -18,7 +18,7 @@ namespace Umbraco.Web.Install.InstallSteps var packageFile = (string)previousStep.AdditionalData["packageFile"]; CleanupInstallation(manifestId, packageFile); - + return null; } @@ -46,4 +46,4 @@ namespace Umbraco.Web.Install.InstallSteps return true; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Install/InstallSteps/StarterKitDownloadStep.cs b/src/Umbraco.Web/Install/InstallSteps/StarterKitDownloadStep.cs index 5537f39dc9..3161dba04a 100644 --- a/src/Umbraco.Web/Install/InstallSteps/StarterKitDownloadStep.cs +++ b/src/Umbraco.Web/Install/InstallSteps/StarterKitDownloadStep.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Web; @@ -56,7 +56,7 @@ namespace Umbraco.Web.Install.InstallSteps } private Tuple DownloadPackageFiles(Guid kitGuid) - { + { var installer = new Installer(); //Go get the package file from the package repo @@ -102,4 +102,4 @@ namespace Umbraco.Web.Install.InstallSteps return true; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Install/InstallSteps/StarterKitInstallStep.cs b/src/Umbraco.Web/Install/InstallSteps/StarterKitInstallStep.cs index b3ca1519d4..844a27a576 100644 --- a/src/Umbraco.Web/Install/InstallSteps/StarterKitInstallStep.cs +++ b/src/Umbraco.Web/Install/InstallSteps/StarterKitInstallStep.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using System.Web; using umbraco.cms.businesslogic.packager; @@ -54,4 +54,4 @@ namespace Umbraco.Web.Install.InstallSteps return true; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Install/InstallSteps/UpgradeStep.cs b/src/Umbraco.Web/Install/InstallSteps/UpgradeStep.cs index d0474d3773..aa95dac3f1 100644 --- a/src/Umbraco.Web/Install/InstallSteps/UpgradeStep.cs +++ b/src/Umbraco.Web/Install/InstallSteps/UpgradeStep.cs @@ -1,4 +1,4 @@ -using System; +using System; using Semver; using Umbraco.Core; using Umbraco.Core.Configuration; @@ -92,4 +92,4 @@ namespace Umbraco.Web.Install.InstallSteps return version; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Install/InstallSteps/Version73FileCleanup.cs b/src/Umbraco.Web/Install/InstallSteps/Version73FileCleanup.cs index f15463dc5f..289fdda078 100644 --- a/src/Umbraco.Web/Install/InstallSteps/Version73FileCleanup.cs +++ b/src/Umbraco.Web/Install/InstallSteps/Version73FileCleanup.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.IO; using System.Text; using System.Text.RegularExpressions; @@ -11,8 +11,8 @@ using Umbraco.Web.Install.Models; namespace Umbraco.Web.Install.InstallSteps { [InstallSetupStep(InstallationType.Upgrade, - "Version73FileCleanup", 2, - "Performing some housecleaning...", + "Version73FileCleanup", 2, + "Performing some housecleaning...", PerformsAppRestart = true)] internal class Version73FileCleanup : InstallSetupStep { @@ -36,8 +36,8 @@ namespace Umbraco.Web.Install.InstallSteps var root = new DirectoryInfo(_httpContext.Server.MapPath("~/")); ProcessWebConfigs(root); - - //now remove the dll + + //now remove the dll var bin = root.GetDirectories("bin", SearchOption.TopDirectoryOnly); if (bin.Length == 1) @@ -87,4 +87,4 @@ namespace Umbraco.Web.Install.InstallSteps private readonly Regex _webPagesRazorVersion = new Regex(@"(System\.Web\.WebPages\.Razor,\s*?Version)(=2\.0\.0\.0)", RegexOptions.Compiled); private readonly Regex _mvcVersion = new Regex(@"(System\.Web\.Mvc,\s*?Version)(=4\.0\.0\.0)", RegexOptions.Compiled); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Install/Models/DatabaseModel.cs b/src/Umbraco.Web/Install/Models/DatabaseModel.cs index 74bf2935e5..4b09534f39 100644 --- a/src/Umbraco.Web/Install/Models/DatabaseModel.cs +++ b/src/Umbraco.Web/Install/Models/DatabaseModel.cs @@ -1,4 +1,4 @@ -using System.Runtime.Serialization; +using System.Runtime.Serialization; namespace Umbraco.Web.Install.Models { @@ -32,4 +32,4 @@ namespace Umbraco.Web.Install.Models [DataMember(Name = "connectionString")] public string ConnectionString { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Install/Models/DatabaseType.cs b/src/Umbraco.Web/Install/Models/DatabaseType.cs index b66de5496b..3f7379eca5 100644 --- a/src/Umbraco.Web/Install/Models/DatabaseType.cs +++ b/src/Umbraco.Web/Install/Models/DatabaseType.cs @@ -1,4 +1,4 @@ -namespace Umbraco.Web.Install.Models +namespace Umbraco.Web.Install.Models { public enum DatabaseType { @@ -8,4 +8,4 @@ namespace Umbraco.Web.Install.Models SqlAzure, Custom } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Install/Models/InstallInstructions.cs b/src/Umbraco.Web/Install/Models/InstallInstructions.cs index f0a8907cdc..da4dfb1671 100644 --- a/src/Umbraco.Web/Install/Models/InstallInstructions.cs +++ b/src/Umbraco.Web/Install/Models/InstallInstructions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Runtime.Serialization; using Newtonsoft.Json.Linq; @@ -14,4 +14,4 @@ namespace Umbraco.Web.Install.Models [DataMember(Name = "installId")] public Guid InstallId { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Install/Models/InstallProgressResultModel.cs b/src/Umbraco.Web/Install/Models/InstallProgressResultModel.cs index 6ebffd4ffe..7ea3b3375b 100644 --- a/src/Umbraco.Web/Install/Models/InstallProgressResultModel.cs +++ b/src/Umbraco.Web/Install/Models/InstallProgressResultModel.cs @@ -1,4 +1,4 @@ -using System.Runtime.Serialization; +using System.Runtime.Serialization; namespace Umbraco.Web.Install.Models { @@ -39,4 +39,4 @@ namespace Umbraco.Web.Install.Models [DataMember(Name = "model")] public object ViewModel { get; private set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Install/Models/InstallSetup.cs b/src/Umbraco.Web/Install/Models/InstallSetup.cs index 55f66f13d6..f61e301a09 100644 --- a/src/Umbraco.Web/Install/Models/InstallSetup.cs +++ b/src/Umbraco.Web/Install/Models/InstallSetup.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Runtime.Serialization; @@ -18,9 +18,9 @@ namespace Umbraco.Web.Install.Models [DataMember(Name = "installId")] public Guid InstallId { get; private set; } - + [DataMember(Name = "steps")] - public IEnumerable Steps { get; set; } + public IEnumerable Steps { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Install/Models/InstallSetupResult.cs b/src/Umbraco.Web/Install/Models/InstallSetupResult.cs index e04f3c166a..4ef4b70f51 100644 --- a/src/Umbraco.Web/Install/Models/InstallSetupResult.cs +++ b/src/Umbraco.Web/Install/Models/InstallSetupResult.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; namespace Umbraco.Web.Install.Models { @@ -8,7 +8,7 @@ namespace Umbraco.Web.Install.Models public class InstallSetupResult { public InstallSetupResult() - { + { } public InstallSetupResult(IDictionary savedStepData, string view, object viewModel = null) @@ -44,4 +44,4 @@ namespace Umbraco.Web.Install.Models /// public object ViewModel { get; private set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Install/Models/InstallSetupStep.cs b/src/Umbraco.Web/Install/Models/InstallSetupStep.cs index 3cfa2659e2..36cf838a82 100644 --- a/src/Umbraco.Web/Install/Models/InstallSetupStep.cs +++ b/src/Umbraco.Web/Install/Models/InstallSetupStep.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Runtime.Serialization; using Umbraco.Core; @@ -71,9 +71,9 @@ namespace Umbraco.Web.Install.Models [IgnoreDataMember] public bool PerformsAppRestart { get; private set; } - + /// - /// Defines what order this step needs to execute on the server side since the + /// Defines what order this step needs to execute on the server side since the /// steps might be shown out of order on the front-end /// [DataMember(Name = "serverOrder")] @@ -84,7 +84,7 @@ namespace Umbraco.Web.Install.Models /// [IgnoreDataMember] public abstract Type StepType { get; } - + [IgnoreDataMember] public bool HasUIElement { @@ -92,4 +92,4 @@ namespace Umbraco.Web.Install.Models } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Install/Models/InstallSetupStepAttribute.cs b/src/Umbraco.Web/Install/Models/InstallSetupStepAttribute.cs index 3fb99a21bb..9cecdacf99 100644 --- a/src/Umbraco.Web/Install/Models/InstallSetupStepAttribute.cs +++ b/src/Umbraco.Web/Install/Models/InstallSetupStepAttribute.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Text.RegularExpressions; namespace Umbraco.Web.Install.Models @@ -42,4 +42,4 @@ namespace Umbraco.Web.Install.Models /// public bool PerformsAppRestart { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Install/Models/InstallTrackingItem.cs b/src/Umbraco.Web/Install/Models/InstallTrackingItem.cs index 360f58e0e7..1b1985dd1e 100644 --- a/src/Umbraco.Web/Install/Models/InstallTrackingItem.cs +++ b/src/Umbraco.Web/Install/Models/InstallTrackingItem.cs @@ -35,4 +35,4 @@ namespace Umbraco.Web.Install.Models return Name.GetHashCode(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Install/Models/InstallationType.cs b/src/Umbraco.Web/Install/Models/InstallationType.cs index cfedb8b850..b0202a4c3a 100644 --- a/src/Umbraco.Web/Install/Models/InstallationType.cs +++ b/src/Umbraco.Web/Install/Models/InstallationType.cs @@ -1,4 +1,4 @@ -using System; +using System; namespace Umbraco.Web.Install.Models { @@ -8,4 +8,4 @@ namespace Umbraco.Web.Install.Models NewInstall = 1 << 0, // 1 Upgrade = 1 << 1, // 2 } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Install/Models/UserModel.cs b/src/Umbraco.Web/Install/Models/UserModel.cs index 82baf9ba56..aed397a7d9 100644 --- a/src/Umbraco.Web/Install/Models/UserModel.cs +++ b/src/Umbraco.Web/Install/Models/UserModel.cs @@ -1,4 +1,4 @@ -using System.Runtime.Serialization; +using System.Runtime.Serialization; namespace Umbraco.Web.Install.Models { @@ -7,14 +7,14 @@ namespace Umbraco.Web.Install.Models { [DataMember(Name = "name")] public string Name { get; set; } - + [DataMember(Name = "email")] public string Email { get; set; } - + [DataMember(Name = "password")] public string Password { get; set; } [DataMember(Name = "subscribeToNewsLetter")] public bool SubscribeToNewsLetter { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Install/UmbracoInstallArea.cs b/src/Umbraco.Web/Install/UmbracoInstallArea.cs index 789fe854f4..2b44abd4ab 100644 --- a/src/Umbraco.Web/Install/UmbracoInstallArea.cs +++ b/src/Umbraco.Web/Install/UmbracoInstallArea.cs @@ -21,7 +21,7 @@ namespace Umbraco.Web.Install /// /// /// - /// By using the context to register the routes it means that the area is already applied to them all + /// By using the context to register the routes it means that the area is already applied to them all /// and that the namespaces searched for the controllers are ONLY the ones specified. /// public override void RegisterArea(AreaRegistrationContext context) @@ -52,4 +52,4 @@ namespace Umbraco.Web.Install get { return "UmbracoInstall"; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Macros/MacroPropertyModel.cs b/src/Umbraco.Web/Macros/MacroPropertyModel.cs index 7e14f4f064..0621155be7 100644 --- a/src/Umbraco.Web/Macros/MacroPropertyModel.cs +++ b/src/Umbraco.Web/Macros/MacroPropertyModel.cs @@ -1,27 +1,27 @@ -namespace Umbraco.Web.Macros +namespace Umbraco.Web.Macros { - public class MacroPropertyModel - { - public string Key { get; set; } + public class MacroPropertyModel + { + public string Key { get; set; } - public string Value { get; set; } + public string Value { get; set; } - public string Type { get; set; } - - public MacroPropertyModel() - { } + public string Type { get; set; } - public MacroPropertyModel(string key, string value) - { - Key = key; - Value = value; - } + public MacroPropertyModel() + { } - public MacroPropertyModel(string key, string value, string type) - { - Key = key; - Value = value; - Type = type; - } - } -} \ No newline at end of file + public MacroPropertyModel(string key, string value) + { + Key = key; + Value = value; + } + + public MacroPropertyModel(string key, string value, string type) + { + Key = key; + Value = value; + Type = type; + } + } +} diff --git a/src/Umbraco.Web/Macros/PartialViewMacroController.cs b/src/Umbraco.Web/Macros/PartialViewMacroController.cs index 3eeedd05f7..cf31de3bac 100644 --- a/src/Umbraco.Web/Macros/PartialViewMacroController.cs +++ b/src/Umbraco.Web/Macros/PartialViewMacroController.cs @@ -1,4 +1,4 @@ -using System.Web.Mvc; +using System.Web.Mvc; using Umbraco.Web.Models; using Umbraco.Web.Mvc; using System.Linq; @@ -37,4 +37,4 @@ namespace Umbraco.Web.Macros return PartialView(_macro.ScriptName, model); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Macros/PartialViewMacroEngine.cs b/src/Umbraco.Web/Macros/PartialViewMacroEngine.cs index 992581df47..4488dee2ec 100644 --- a/src/Umbraco.Web/Macros/PartialViewMacroEngine.cs +++ b/src/Umbraco.Web/Macros/PartialViewMacroEngine.cs @@ -65,7 +65,7 @@ namespace Umbraco.Web.Macros { if (macro == null) throw new ArgumentNullException(nameof(macro)); if (content == null) throw new ArgumentNullException(nameof(content)); - if (macro.ScriptName.IsNullOrWhiteSpace()) throw new ArgumentException("The ScriptName property of the macro object cannot be null or empty"); + if (macro.ScriptName.IsNullOrWhiteSpace()) throw new ArgumentException("The ScriptName property of the macro object cannot be null or empty"); var http = _getHttpContext(); var umbCtx = _getUmbracoContext(); @@ -74,8 +74,8 @@ namespace Umbraco.Web.Macros routeVals.Values.Add("action", "Index"); routeVals.DataTokens.Add(Core.Constants.Web.UmbracoContextDataToken, umbCtx); //required for UmbracoViewPage - //lets render this controller as a child action - var viewContext = new ViewContext { ViewData = new ViewDataDictionary() }; + //lets render this controller as a child action + var viewContext = new ViewContext { ViewData = new ViewDataDictionary() }; //try and extract the current view context from the route values, this would be set in the UmbracoViewPage or in // the UmbracoPageResult if POSTing to an MVC controller but rendering in Webforms if (http.Request.RequestContext.RouteData.DataTokens.ContainsKey(Mvc.Constants.DataTokenCurrentViewContext)) @@ -90,11 +90,11 @@ namespace Umbraco.Web.Macros { controller.ViewData = viewContext.ViewData; - controller.ControllerContext = new ControllerContext(request, controller); + controller.ControllerContext = new ControllerContext(request, controller); //call the action to render var result = controller.Index(); - output = controller.RenderViewResultAsString(result); + output = controller.RenderViewResultAsString(result); } return new MacroContent { Text = output }; diff --git a/src/Umbraco.Web/Macros/PartialViewMacroPage.cs b/src/Umbraco.Web/Macros/PartialViewMacroPage.cs index 0c6bdfc32e..a50fcc3149 100644 --- a/src/Umbraco.Web/Macros/PartialViewMacroPage.cs +++ b/src/Umbraco.Web/Macros/PartialViewMacroPage.cs @@ -1,4 +1,4 @@ -using System.Web.Mvc; +using System.Web.Mvc; using Umbraco.Core.Models; using Umbraco.Web.Models; using Umbraco.Web.Mvc; @@ -10,4 +10,4 @@ namespace Umbraco.Web.Macros /// public abstract class PartialViewMacroPage : UmbracoViewPage { } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Media/EmbedProviders/AbstractOEmbedProvider.cs b/src/Umbraco.Web/Media/EmbedProviders/AbstractOEmbedProvider.cs index 2f8ec85075..933dc1a204 100644 --- a/src/Umbraco.Web/Media/EmbedProviders/AbstractOEmbedProvider.cs +++ b/src/Umbraco.Web/Media/EmbedProviders/AbstractOEmbedProvider.cs @@ -79,4 +79,4 @@ namespace Umbraco.Web.Media.EmbedProviders } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Media/EmbedProviders/AbstractProvider.cs b/src/Umbraco.Web/Media/EmbedProviders/AbstractProvider.cs index 20c94c06d1..62f08b48f0 100644 --- a/src/Umbraco.Web/Media/EmbedProviders/AbstractProvider.cs +++ b/src/Umbraco.Web/Media/EmbedProviders/AbstractProvider.cs @@ -11,4 +11,4 @@ namespace Umbraco.Web.Media.EmbedProviders public abstract string GetMarkup(string url, int maxWidth, int maxHeight); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Media/EmbedProviders/Flickr.cs b/src/Umbraco.Web/Media/EmbedProviders/Flickr.cs index 944513ee4f..7d6c887d4a 100644 --- a/src/Umbraco.Web/Media/EmbedProviders/Flickr.cs +++ b/src/Umbraco.Web/Media/EmbedProviders/Flickr.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.ComponentModel; using System.Web; @@ -22,4 +22,4 @@ namespace Umbraco.Web.Media.EmbedProviders imageUrl, imageWidth, imageHeight, HttpUtility.HtmlEncode(imageTitle)); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Media/EmbedProviders/OEmbedPhoto.cs b/src/Umbraco.Web/Media/EmbedProviders/OEmbedPhoto.cs index acc75cb876..26dbf38d31 100644 --- a/src/Umbraco.Web/Media/EmbedProviders/OEmbedPhoto.cs +++ b/src/Umbraco.Web/Media/EmbedProviders/OEmbedPhoto.cs @@ -19,4 +19,4 @@ namespace Umbraco.Web.Media.EmbedProviders imageUrl, imageWidth, imageHeight, HttpUtility.HtmlEncode(imageTitle)); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Media/EmbedProviders/OEmbedRich.cs b/src/Umbraco.Web/Media/EmbedProviders/OEmbedRich.cs index f93a4d799b..70ee29ed19 100644 --- a/src/Umbraco.Web/Media/EmbedProviders/OEmbedRich.cs +++ b/src/Umbraco.Web/Media/EmbedProviders/OEmbedRich.cs @@ -3,4 +3,4 @@ public class OEmbedRich : OEmbedVideo { } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Media/EmbedProviders/OEmbedVideo.cs b/src/Umbraco.Web/Media/EmbedProviders/OEmbedVideo.cs index 3fb0b3d1e0..a4350e8681 100644 --- a/src/Umbraco.Web/Media/EmbedProviders/OEmbedVideo.cs +++ b/src/Umbraco.Web/Media/EmbedProviders/OEmbedVideo.cs @@ -12,4 +12,4 @@ namespace Umbraco.Web.Media.EmbedProviders return GetXmlProperty(doc, "/oembed/html"); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Media/EmbedProviders/Settings/Dictionary.cs b/src/Umbraco.Web/Media/EmbedProviders/Settings/Dictionary.cs index 7d40d9c866..c259b4997a 100644 --- a/src/Umbraco.Web/Media/EmbedProviders/Settings/Dictionary.cs +++ b/src/Umbraco.Web/Media/EmbedProviders/Settings/Dictionary.cs @@ -11,4 +11,4 @@ namespace Umbraco.Web.Media.EmbedProviders.Settings return settingNode.ChildNodes.Cast().ToDictionary(item => item.Attributes != null ? item.Attributes["name"].Value : null, item => item.InnerText); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Media/EmbedProviders/Settings/String.cs b/src/Umbraco.Web/Media/EmbedProviders/Settings/String.cs index 9b6c162cc9..6dd501eb66 100644 --- a/src/Umbraco.Web/Media/EmbedProviders/Settings/String.cs +++ b/src/Umbraco.Web/Media/EmbedProviders/Settings/String.cs @@ -10,4 +10,4 @@ namespace Umbraco.Web.Media.EmbedProviders.Settings return settingNode.InnerText; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Media/EmbedProviders/Twitgoo.cs b/src/Umbraco.Web/Media/EmbedProviders/Twitgoo.cs index a28dd97809..efd8d9712f 100644 --- a/src/Umbraco.Web/Media/EmbedProviders/Twitgoo.cs +++ b/src/Umbraco.Web/Media/EmbedProviders/Twitgoo.cs @@ -20,4 +20,4 @@ namespace Umbraco.Web.Media.EmbedProviders img.Value); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Media/ImageUrl.cs b/src/Umbraco.Web/Media/ImageUrl.cs index 06db716914..3606af5eda 100644 --- a/src/Umbraco.Web/Media/ImageUrl.cs +++ b/src/Umbraco.Web/Media/ImageUrl.cs @@ -94,4 +94,4 @@ namespace Umbraco.Web.Media return content; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Media/ImageUrlProviderCollection.cs b/src/Umbraco.Web/Media/ImageUrlProviderCollection.cs index 38205462c1..5d20fbda4f 100644 --- a/src/Umbraco.Web/Media/ImageUrlProviderCollection.cs +++ b/src/Umbraco.Web/Media/ImageUrlProviderCollection.cs @@ -11,7 +11,7 @@ namespace Umbraco.Web.Media // fixme - kill entirely we should not use this anymore internal class ImageUrlProviderCollection : BuilderCollectionBase { - public ImageUrlProviderCollection(IEnumerable items) + public ImageUrlProviderCollection(IEnumerable items) : base(items) { } diff --git a/src/Umbraco.Web/Media/ImageUrlProviders/ImageUrlProvider.cs b/src/Umbraco.Web/Media/ImageUrlProviders/ImageUrlProvider.cs index c69b3ce443..fa2209b278 100644 --- a/src/Umbraco.Web/Media/ImageUrlProviders/ImageUrlProvider.cs +++ b/src/Umbraco.Web/Media/ImageUrlProviders/ImageUrlProvider.cs @@ -66,7 +66,7 @@ namespace Umbraco.Web.Media.ImageUrlProviders { var lastIndexOf = filename.LastIndexOf('.'); var name = filename.Substring(0, lastIndexOf); - + //var extension = filename.Substring(lastIndexOf, filename.Length - lastIndexOf); //Built in cropper currently always uses jpg as an extension @@ -90,4 +90,4 @@ namespace Umbraco.Web.Media.ImageUrlProviders return file; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Media/ThumbnailProviders/FileExtensionIconThumbnailProvider.cs b/src/Umbraco.Web/Media/ThumbnailProviders/FileExtensionIconThumbnailProvider.cs index 3a623ac3e1..ea3a13a3c2 100644 --- a/src/Umbraco.Web/Media/ThumbnailProviders/FileExtensionIconThumbnailProvider.cs +++ b/src/Umbraco.Web/Media/ThumbnailProviders/FileExtensionIconThumbnailProvider.cs @@ -8,7 +8,7 @@ using Umbraco.Core.IO; namespace Umbraco.Web.Media.ThumbnailProviders { - [Weight(2000)] + [Weight(2000)] public class FileExtensionIconThumbnailProvider : AbstractThumbnailProvider { protected override IEnumerable SupportedExtensions diff --git a/src/Umbraco.Web/Media/ThumbnailProviders/ImageThumbnailProvider.cs b/src/Umbraco.Web/Media/ThumbnailProviders/ImageThumbnailProvider.cs index b09e411d32..4fea0a6b5f 100644 --- a/src/Umbraco.Web/Media/ThumbnailProviders/ImageThumbnailProvider.cs +++ b/src/Umbraco.Web/Media/ThumbnailProviders/ImageThumbnailProvider.cs @@ -9,17 +9,17 @@ using Umbraco.Core.IO; namespace Umbraco.Web.Media.ThumbnailProviders { - [Weight(1000)] + [Weight(1000)] public class ImageThumbnailProvider : AbstractThumbnailProvider { - private readonly MediaFileSystem _mediaFileSystem; + private readonly MediaFileSystem _mediaFileSystem; - public ImageThumbnailProvider(MediaFileSystem mediaFileSystem) - { - _mediaFileSystem = mediaFileSystem; - } + public ImageThumbnailProvider(MediaFileSystem mediaFileSystem) + { + _mediaFileSystem = mediaFileSystem; + } - protected override IEnumerable SupportedExtensions + protected override IEnumerable SupportedExtensions { get { return new List { ".jpeg", ".jpg", ".gif", ".bmp", ".png", ".tiff", ".tif" }; } } diff --git a/src/Umbraco.Web/Media/ThumbnailProviders/MediaTypeIconThumbnailProvider.cs b/src/Umbraco.Web/Media/ThumbnailProviders/MediaTypeIconThumbnailProvider.cs index 769a73bee6..0ecaaf8ff3 100644 --- a/src/Umbraco.Web/Media/ThumbnailProviders/MediaTypeIconThumbnailProvider.cs +++ b/src/Umbraco.Web/Media/ThumbnailProviders/MediaTypeIconThumbnailProvider.cs @@ -8,10 +8,10 @@ using Umbraco.Core.IO; namespace Umbraco.Web.Media.ThumbnailProviders { - [Weight(3000)] + [Weight(3000)] public class MediaTypeIconThumbnailProvider : AbstractThumbnailProvider { - + protected override IEnumerable SupportedExtensions { get { return new List { "*" }; } diff --git a/src/Umbraco.Web/MembershipProviderExtensions.cs b/src/Umbraco.Web/MembershipProviderExtensions.cs index 2a32384732..cb26930b30 100644 --- a/src/Umbraco.Web/MembershipProviderExtensions.cs +++ b/src/Umbraco.Web/MembershipProviderExtensions.cs @@ -20,7 +20,7 @@ namespace Umbraco.Web { var baseProvider = membershipProvider as MembershipProviderBase; - var canReset = membershipProvider.CanResetPassword(userService); + var canReset = membershipProvider.CanResetPassword(userService); return new Dictionary { @@ -31,7 +31,7 @@ namespace Umbraco.Web {"allowManuallyChangingPassword", baseProvider != null && baseProvider.AllowManuallyChangingPassword} //TODO: Inject the other parameters in here to change the behavior of this control - based on the membership provider settings. }; - } + } } } diff --git a/src/Umbraco.Web/ModelStateExtensions.cs b/src/Umbraco.Web/ModelStateExtensions.cs index 5df479ce76..2db24938ad 100644 --- a/src/Umbraco.Web/ModelStateExtensions.cs +++ b/src/Umbraco.Web/ModelStateExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; @@ -6,50 +6,50 @@ using System.Web.Mvc; namespace Umbraco.Web { - internal static class ModelStateExtensions - { + internal static class ModelStateExtensions + { - /// - /// Merges ModelState that has names matching the prefix - /// - /// - /// - /// - public static void Merge(this ModelStateDictionary state, ModelStateDictionary dictionary, string prefix) - { - if (dictionary == null) - return; - foreach (var keyValuePair in dictionary + /// + /// Merges ModelState that has names matching the prefix + /// + /// + /// + /// + public static void Merge(this ModelStateDictionary state, ModelStateDictionary dictionary, string prefix) + { + if (dictionary == null) + return; + foreach (var keyValuePair in dictionary //It can either equal the prefix exactly (model level errors) or start with the prefix. (property level errors) .Where(keyValuePair => keyValuePair.Key == prefix || keyValuePair.Key.StartsWith(prefix + "."))) - { - state[keyValuePair.Key] = keyValuePair.Value; - } - } + { + state[keyValuePair.Key] = keyValuePair.Value; + } + } - /// - /// Checks if there are any model errors on any fields containing the prefix - /// - /// - /// - /// - public static bool IsValid(this ModelStateDictionary state, string prefix) - { - return state.Where(v => v.Key.StartsWith(prefix + ".")).All(v => !v.Value.Errors.Any()); - } + /// + /// Checks if there are any model errors on any fields containing the prefix + /// + /// + /// + /// + public static bool IsValid(this ModelStateDictionary state, string prefix) + { + return state.Where(v => v.Key.StartsWith(prefix + ".")).All(v => !v.Value.Errors.Any()); + } - //NOTE: we used this alot in v5 when we had editors in MVC, this was really handy for knockout editors using JS + //NOTE: we used this alot in v5 when we had editors in MVC, this was really handy for knockout editors using JS - ///// - ///// Adds an error to the model state that has to do with data validation, this is generally used for JSON responses - ///// - ///// - ///// - //public static void AddDataValidationError(this ModelStateDictionary state, string errorMessage) - //{ - // state.AddModelError("DataValidation", errorMessage); - //} + ///// + ///// Adds an error to the model state that has to do with data validation, this is generally used for JSON responses + ///// + ///// + ///// + //public static void AddDataValidationError(this ModelStateDictionary state, string errorMessage) + //{ + // state.AddModelError("DataValidation", errorMessage); + //} /// /// Adds the error to model state correctly for a property so we can use it on the client side. @@ -92,31 +92,31 @@ namespace Umbraco.Web return modelStateError; } - /// - /// Serializes the ModelState to JSON for JavaScript to interrogate the errors - /// - /// - /// - public static JsonResult ToJsonErrors(this ModelStateDictionary state) - { - return new JsonResult - { - Data = new - { - success = state.IsValid.ToString().ToLower(), - failureType = "ValidationError", - validationErrors = from e in state - where e.Value.Errors.Count > 0 - select new - { - name = e.Key, - errors = e.Value.Errors.Select(x => x.ErrorMessage) - .Concat( - e.Value.Errors.Where(x => x.Exception != null).Select(x => x.Exception.Message)) - } - } - }; - } + /// + /// Serializes the ModelState to JSON for JavaScript to interrogate the errors + /// + /// + /// + public static JsonResult ToJsonErrors(this ModelStateDictionary state) + { + return new JsonResult + { + Data = new + { + success = state.IsValid.ToString().ToLower(), + failureType = "ValidationError", + validationErrors = from e in state + where e.Value.Errors.Count > 0 + select new + { + name = e.Key, + errors = e.Value.Errors.Select(x => x.ErrorMessage) + .Concat( + e.Value.Errors.Where(x => x.Exception != null).Select(x => x.Exception.Message)) + } + } + }; + } - } -} \ No newline at end of file + } +} diff --git a/src/Umbraco.Web/Models/ChangingPasswordModel.cs b/src/Umbraco.Web/Models/ChangingPasswordModel.cs index bc11a53316..6778b8c4eb 100644 --- a/src/Umbraco.Web/Models/ChangingPasswordModel.cs +++ b/src/Umbraco.Web/Models/ChangingPasswordModel.cs @@ -14,7 +14,7 @@ namespace Umbraco.Web.Models public string NewPassword { get; set; } /// - /// The old password - used to change a password when: EnablePasswordRetrieval = false + /// The old password - used to change a password when: EnablePasswordRetrieval = false /// [DataMember(Name = "oldPassword")] public string OldPassword { get; set; } @@ -26,7 +26,7 @@ namespace Umbraco.Web.Models public bool? Reset { get; set; } /// - /// The password answer - required for reset when: RequiresQuestionAndAnswer = true + /// The password answer - required for reset when: RequiresQuestionAndAnswer = true /// [DataMember(Name = "answer")] public string Answer { get; set; } diff --git a/src/Umbraco.Web/Models/ContentEditing/AuditLog.cs b/src/Umbraco.Web/Models/ContentEditing/AuditLog.cs index 7fdf279cc9..236ddec941 100644 --- a/src/Umbraco.Web/Models/ContentEditing/AuditLog.cs +++ b/src/Umbraco.Web/Models/ContentEditing/AuditLog.cs @@ -21,4 +21,4 @@ namespace Umbraco.Web.Models.ContentEditing [DataMember(Name = "comment", IsRequired = true)] public string Comment { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/CodeFileDisplay.cs b/src/Umbraco.Web/Models/ContentEditing/CodeFileDisplay.cs index 34ad507836..2e66b270c9 100644 --- a/src/Umbraco.Web/Models/ContentEditing/CodeFileDisplay.cs +++ b/src/Umbraco.Web/Models/ContentEditing/CodeFileDisplay.cs @@ -29,8 +29,8 @@ namespace Umbraco.Web.Models.ContentEditing /// Path represents the path used by the backoffice tree /// For files stored on disk, this is a urlencoded, comma seperated /// path to the file, always starting with -1. - /// - /// -1,Partials,Parials%2FFolder,Partials%2FFolder%2FFile.cshtml + /// + /// -1,Partials,Parials%2FFolder,Partials%2FFolder%2FFile.cshtml /// [DataMember(Name = "path")] [ReadOnly(true)] @@ -66,7 +66,7 @@ namespace Umbraco.Web.Models.ContentEditing if (Name.ContainsAny(illegalChars)) { yield return new ValidationResult( - "The file name cannot contain illegal characters", + "The file name cannot contain illegal characters", new[] { "Name" }); } else if (System.IO.Path.GetFileNameWithoutExtension(Name).IsNullOrWhiteSpace()) diff --git a/src/Umbraco.Web/Models/ContentEditing/ContentBaseItemSave.cs b/src/Umbraco.Web/Models/ContentEditing/ContentBaseItemSave.cs index 0a0aaf204b..4e5077859b 100644 --- a/src/Umbraco.Web/Models/ContentEditing/ContentBaseItemSave.cs +++ b/src/Umbraco.Web/Models/ContentEditing/ContentBaseItemSave.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using Umbraco.Core.Models; @@ -9,8 +9,8 @@ namespace Umbraco.Web.Models.ContentEditing /// A model representing a content base item to be saved /// [DataContract(Name = "content", Namespace = "")] - public abstract class ContentBaseItemSave : ContentItemBasic, IHaveUploadedFiles - where TPersisted : IContentBase + public abstract class ContentBaseItemSave : ContentItemBasic, IHaveUploadedFiles + where TPersisted : IContentBase { protected ContentBaseItemSave() { @@ -27,4 +27,4 @@ namespace Umbraco.Web.Models.ContentEditing [IgnoreDataMember] public List UploadedFiles { get; private set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/ContentItemBasic.cs b/src/Umbraco.Web/Models/ContentEditing/ContentItemBasic.cs index 74c6a3ea7e..d097065c88 100644 --- a/src/Umbraco.Web/Models/ContentEditing/ContentItemBasic.cs +++ b/src/Umbraco.Web/Models/ContentEditing/ContentItemBasic.cs @@ -14,7 +14,7 @@ namespace Umbraco.Web.Models.ContentEditing /// [DataContract(Name = "content", Namespace = "")] public class ContentItemBasic : EntityBasic - { + { [DataMember(Name = "updateDate")] public DateTime UpdateDate { get; set; } @@ -40,7 +40,7 @@ namespace Umbraco.Web.Models.ContentEditing [DataMember(Name = "sortOrder")] public int SortOrder { get; set; } - + protected bool Equals(ContentItemBasic other) { return Id == other.Id; @@ -105,4 +105,4 @@ namespace Umbraco.Web.Models.ContentEditing } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/ContentItemDisplay.cs b/src/Umbraco.Web/Models/ContentEditing/ContentItemDisplay.cs index 2615c8774d..6aaed3fa64 100644 --- a/src/Umbraco.Web/Models/ContentEditing/ContentItemDisplay.cs +++ b/src/Umbraco.Web/Models/ContentEditing/ContentItemDisplay.cs @@ -13,10 +13,10 @@ using Umbraco.Web.Trees; namespace Umbraco.Web.Models.ContentEditing { - + /// /// A model representing a content item to be displayed in the back office - /// + /// [DataContract(Name = "content", Namespace = "")] public class ContentItemDisplay : ListViewAwareContentItemDisplayBase { @@ -59,4 +59,4 @@ namespace Umbraco.Web.Models.ContentEditing public IEnumerable AllowedActions { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/ContentItemDisplayBase.cs b/src/Umbraco.Web/Models/ContentEditing/ContentItemDisplayBase.cs index 87de7b435c..04a1e37f95 100644 --- a/src/Umbraco.Web/Models/ContentEditing/ContentItemDisplayBase.cs +++ b/src/Umbraco.Web/Models/ContentEditing/ContentItemDisplayBase.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.ComponentModel; using System.Runtime.Serialization; using Umbraco.Core.Models; @@ -6,7 +6,7 @@ using Umbraco.Core.Models; namespace Umbraco.Web.Models.ContentEditing { public abstract class ContentItemDisplayBase : TabbedContentItem, INotificationModel, IErrorModel - where T : ContentPropertyBasic + where T : ContentPropertyBasic where TPersisted : IContentBase { protected ContentItemDisplayBase() @@ -41,7 +41,7 @@ namespace Umbraco.Web.Models.ContentEditing /// A content item can be invalid but still be saved. This occurs when there's property validation errors, we will /// still save the item but it cannot be published. So we need a way of returning validation errors as well as the /// updated model. - /// + /// /// NOTE: The ProperCase is important because when we return ModeState normally it will always be proper case. /// [DataMember(Name = "ModelState")] diff --git a/src/Umbraco.Web/Models/ContentEditing/ContentItemDto.cs b/src/Umbraco.Web/Models/ContentEditing/ContentItemDto.cs index 2bd7f60660..a94eb5883d 100644 --- a/src/Umbraco.Web/Models/ContentEditing/ContentItemDto.cs +++ b/src/Umbraco.Web/Models/ContentEditing/ContentItemDto.cs @@ -6,9 +6,9 @@ namespace Umbraco.Web.Models.ContentEditing /// /// Represents a content item from the database including all of the required data that we need to work with such as data type data /// - internal class ContentItemDto : ContentItemBasic + internal class ContentItemDto : ContentItemBasic where TPersisted : IContentBase { - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/ContentItemFile.cs b/src/Umbraco.Web/Models/ContentEditing/ContentItemFile.cs index 2800d410f4..517d288102 100644 --- a/src/Umbraco.Web/Models/ContentEditing/ContentItemFile.cs +++ b/src/Umbraco.Web/Models/ContentEditing/ContentItemFile.cs @@ -20,4 +20,4 @@ /// public string TempFilePath { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/ContentItemSave.cs b/src/Umbraco.Web/Models/ContentEditing/ContentItemSave.cs index 6c4eab8a31..c05f7e9dba 100644 --- a/src/Umbraco.Web/Models/ContentEditing/ContentItemSave.cs +++ b/src/Umbraco.Web/Models/ContentEditing/ContentItemSave.cs @@ -9,7 +9,7 @@ namespace Umbraco.Web.Models.ContentEditing /// A model representing a content item to be saved /// [DataContract(Name = "content", Namespace = "")] - public class ContentItemSave : ContentBaseItemSave + public class ContentItemSave : ContentBaseItemSave { /// /// The template alias to save @@ -24,4 +24,4 @@ namespace Umbraco.Web.Models.ContentEditing public DateTime? ExpireDate { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/ContentPropertyBasic.cs b/src/Umbraco.Web/Models/ContentEditing/ContentPropertyBasic.cs index f317771333..aca51262f8 100644 --- a/src/Umbraco.Web/Models/ContentEditing/ContentPropertyBasic.cs +++ b/src/Umbraco.Web/Models/ContentEditing/ContentPropertyBasic.cs @@ -38,4 +38,4 @@ namespace Umbraco.Web.Models.ContentEditing internal PropertyEditor PropertyEditor { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/ContentPropertyDisplay.cs b/src/Umbraco.Web/Models/ContentEditing/ContentPropertyDisplay.cs index 343b018000..f7268b6c27 100644 --- a/src/Umbraco.Web/Models/ContentEditing/ContentPropertyDisplay.cs +++ b/src/Umbraco.Web/Models/ContentEditing/ContentPropertyDisplay.cs @@ -34,6 +34,6 @@ namespace Umbraco.Web.Models.ContentEditing public bool HideLabel { get; set; } [DataMember(Name = "validation")] - public PropertyTypeValidation Validation { get; set; } + public PropertyTypeValidation Validation { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/ContentPropertyDto.cs b/src/Umbraco.Web/Models/ContentEditing/ContentPropertyDto.cs index 6d2a7e6993..29b75b618e 100644 --- a/src/Umbraco.Web/Models/ContentEditing/ContentPropertyDto.cs +++ b/src/Umbraco.Web/Models/ContentEditing/ContentPropertyDto.cs @@ -22,4 +22,4 @@ namespace Umbraco.Web.Models.ContentEditing [JsonIgnore] internal PreValueCollection PreValues { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/ContentRedirectUrl.cs b/src/Umbraco.Web/Models/ContentEditing/ContentRedirectUrl.cs index 38fdb265b8..805a6d60be 100644 --- a/src/Umbraco.Web/Models/ContentEditing/ContentRedirectUrl.cs +++ b/src/Umbraco.Web/Models/ContentEditing/ContentRedirectUrl.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Runtime.Serialization; namespace Umbraco.Web.Models.ContentEditing @@ -21,4 +21,4 @@ namespace Umbraco.Web.Models.ContentEditing [DataMember(Name = "contentId")] public int ContentId { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/ContentSaveAction.cs b/src/Umbraco.Web/Models/ContentEditing/ContentSaveAction.cs index ed54588ccc..17cd82bd01 100644 --- a/src/Umbraco.Web/Models/ContentEditing/ContentSaveAction.cs +++ b/src/Umbraco.Web/Models/ContentEditing/ContentSaveAction.cs @@ -35,4 +35,4 @@ /// SendPublishNew = 5 } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/ContentSortOrder.cs b/src/Umbraco.Web/Models/ContentEditing/ContentSortOrder.cs index 41df1abe27..d869f4eea2 100644 --- a/src/Umbraco.Web/Models/ContentEditing/ContentSortOrder.cs +++ b/src/Umbraco.Web/Models/ContentEditing/ContentSortOrder.cs @@ -31,5 +31,5 @@ namespace Umbraco.Web.Models.ContentEditing public int[] IdSortOrder { get; set; } } - + } diff --git a/src/Umbraco.Web/Models/ContentEditing/ContentTypeBasic.cs b/src/Umbraco.Web/Models/ContentEditing/ContentTypeBasic.cs index 8dde1f1f97..a6a0caf67a 100644 --- a/src/Umbraco.Web/Models/ContentEditing/ContentTypeBasic.cs +++ b/src/Umbraco.Web/Models/ContentEditing/ContentTypeBasic.cs @@ -14,16 +14,16 @@ namespace Umbraco.Web.Models.ContentEditing /// /// /// Generally used to return the minimal amount of data about a content type - /// + /// [DataContract(Name = "contentType", Namespace = "")] public class ContentTypeBasic : EntityBasic { /// /// Overridden to apply our own validation attributes since this is not always required for other classes - /// - [Required] - [RegularExpression(@"^([a-zA-Z]\w.*)$", ErrorMessage = "Invalid alias")] - [DataMember(Name = "alias")] + /// + [Required] + [RegularExpression(@"^([a-zA-Z]\w.*)$", ErrorMessage = "Invalid alias")] + [DataMember(Name = "alias")] public override string Alias { get; set; } [DataMember(Name = "updateDate")] diff --git a/src/Umbraco.Web/Models/ContentEditing/ContentTypeCompositionDisplay.cs b/src/Umbraco.Web/Models/ContentEditing/ContentTypeCompositionDisplay.cs index fb50fdec5c..f80cd12516 100644 --- a/src/Umbraco.Web/Models/ContentEditing/ContentTypeCompositionDisplay.cs +++ b/src/Umbraco.Web/Models/ContentEditing/ContentTypeCompositionDisplay.cs @@ -1,23 +1,23 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Runtime.Serialization; -using System.Text; -using System.Threading.Tasks; -using Umbraco.Core.Models.Validation; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +using System.Threading.Tasks; +using Umbraco.Core.Models.Validation; -namespace Umbraco.Web.Models.ContentEditing -{ - public abstract class ContentTypeCompositionDisplay : ContentTypeBasic, INotificationModel - { - protected ContentTypeCompositionDisplay() - { - //initialize collections so at least their never null +namespace Umbraco.Web.Models.ContentEditing +{ + public abstract class ContentTypeCompositionDisplay : ContentTypeBasic, INotificationModel + { + protected ContentTypeCompositionDisplay() + { + //initialize collections so at least their never null AllowedContentTypes = new List(); - CompositeContentTypes = new List(); - Notifications = new List(); + CompositeContentTypes = new List(); + Notifications = new List(); } //name, alias, icon, thumb, desc, inherited from basic @@ -28,7 +28,7 @@ namespace Umbraco.Web.Models.ContentEditing [DataMember(Name = "listViewEditorName")] [ReadOnly(true)] - public string ListViewEditorName { get; set; } + public string ListViewEditorName { get; set; } //Allowed child types [DataMember(Name = "allowedContentTypes")] @@ -43,14 +43,14 @@ namespace Umbraco.Web.Models.ContentEditing public IEnumerable LockedCompositeContentTypes { get; set; } [DataMember(Name = "allowAsRoot")] - public bool AllowAsRoot { get; set; } + public bool AllowAsRoot { get; set; } /// /// This is used to add custom localized messages/strings to the response for the app to use for localized UI purposes. /// [DataMember(Name = "notifications")] [ReadOnly(true)] - public List Notifications { get; private set; } + public List Notifications { get; private set; } /// /// This is used for validation of a content item. @@ -59,27 +59,27 @@ namespace Umbraco.Web.Models.ContentEditing /// A content item can be invalid but still be saved. This occurs when there's property validation errors, we will /// still save the item but it cannot be published. So we need a way of returning validation errors as well as the /// updated model. - /// + /// /// NOTE: The ProperCase is important because when we return ModeState normally it will always be proper case. /// [DataMember(Name = "ModelState")] [ReadOnly(true)] - public IDictionary Errors { get; set; } - } + public IDictionary Errors { get; set; } + } - [DataContract(Name = "contentType", Namespace = "")] - public abstract class ContentTypeCompositionDisplay : ContentTypeCompositionDisplay - where TPropertyTypeDisplay : PropertyTypeDisplay - { - protected ContentTypeCompositionDisplay() - { - //initialize collections so at least their never null - Groups = new List>(); + [DataContract(Name = "contentType", Namespace = "")] + public abstract class ContentTypeCompositionDisplay : ContentTypeCompositionDisplay + where TPropertyTypeDisplay : PropertyTypeDisplay + { + protected ContentTypeCompositionDisplay() + { + //initialize collections so at least their never null + Groups = new List>(); } - - //Tabs - [DataMember(Name = "groups")] + + //Tabs + [DataMember(Name = "groups")] public IEnumerable> Groups { get; set; } - - } -} + + } +} diff --git a/src/Umbraco.Web/Models/ContentEditing/ContentTypeSave.cs b/src/Umbraco.Web/Models/ContentEditing/ContentTypeSave.cs index 62e1979076..3f3efa15d8 100644 --- a/src/Umbraco.Web/Models/ContentEditing/ContentTypeSave.cs +++ b/src/Umbraco.Web/Models/ContentEditing/ContentTypeSave.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Runtime.Serialization; @@ -56,7 +56,7 @@ namespace Umbraco.Web.Models.ContentEditing { Groups = new List>(); } - + //Tabs [DataMember(Name = "groups")] public IEnumerable> Groups { get; set; } @@ -89,7 +89,7 @@ namespace Umbraco.Web.Models.ContentEditing { //we need to return the field name with an index so it's wired up correctly var lastProperty = duplicateProperties.Last().Last(); - var propertyGroup = Groups.Single(x => x.Properties.Contains(lastProperty)); + var propertyGroup = Groups.Single(x => x.Properties.Contains(lastProperty)); yield return new ValidationResult("Duplicate property aliases not allowed: " + lastProperty.Alias, new[] { @@ -99,4 +99,4 @@ namespace Umbraco.Web.Models.ContentEditing } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/DataTypeBasic.cs b/src/Umbraco.Web/Models/ContentEditing/DataTypeBasic.cs index 1165ec8fd6..3834129ed0 100644 --- a/src/Umbraco.Web/Models/ContentEditing/DataTypeBasic.cs +++ b/src/Umbraco.Web/Models/ContentEditing/DataTypeBasic.cs @@ -1,27 +1,27 @@ -using System.ComponentModel; -using System.Runtime.Serialization; +using System.ComponentModel; +using System.Runtime.Serialization; -namespace Umbraco.Web.Models.ContentEditing -{ - /// - /// The basic data type information - /// - [DataContract(Name = "dataType", Namespace = "")] - public class DataTypeBasic : EntityBasic - { - /// - /// Whether or not this is a system data type, in which case it cannot be deleted - /// - [DataMember(Name = "isSystem")] - [ReadOnly(true)] - public bool IsSystemDataType { get; set; } +namespace Umbraco.Web.Models.ContentEditing +{ + /// + /// The basic data type information + /// + [DataContract(Name = "dataType", Namespace = "")] + public class DataTypeBasic : EntityBasic + { + /// + /// Whether or not this is a system data type, in which case it cannot be deleted + /// + [DataMember(Name = "isSystem")] + [ReadOnly(true)] + public bool IsSystemDataType { get; set; } - [DataMember(Name = "group")] - [ReadOnly(true)] + [DataMember(Name = "group")] + [ReadOnly(true)] public string Group { get; set; } [DataMember(Name = "hasPrevalues")] [ReadOnly(true)] - public bool HasPrevalues { get; set; } - } -} \ No newline at end of file + public bool HasPrevalues { get; set; } + } +} diff --git a/src/Umbraco.Web/Models/ContentEditing/DataTypeDisplay.cs b/src/Umbraco.Web/Models/ContentEditing/DataTypeDisplay.cs index 795d334e71..c61e02d37f 100644 --- a/src/Umbraco.Web/Models/ContentEditing/DataTypeDisplay.cs +++ b/src/Umbraco.Web/Models/ContentEditing/DataTypeDisplay.cs @@ -34,6 +34,6 @@ namespace Umbraco.Web.Models.ContentEditing /// [DataMember(Name = "notifications")] public List Notifications { get; private set; } - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/DataTypeSave.cs b/src/Umbraco.Web/Models/ContentEditing/DataTypeSave.cs index 16c7cade0b..7e003175ab 100644 --- a/src/Umbraco.Web/Models/ContentEditing/DataTypeSave.cs +++ b/src/Umbraco.Web/Models/ContentEditing/DataTypeSave.cs @@ -41,4 +41,4 @@ namespace Umbraco.Web.Models.ContentEditing internal PropertyEditor PropertyEditor { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/DocumentTypeDisplay.cs b/src/Umbraco.Web/Models/ContentEditing/DocumentTypeDisplay.cs index 65641e7f63..7965b90ae0 100644 --- a/src/Umbraco.Web/Models/ContentEditing/DocumentTypeDisplay.cs +++ b/src/Umbraco.Web/Models/ContentEditing/DocumentTypeDisplay.cs @@ -9,17 +9,17 @@ namespace Umbraco.Web.Models.ContentEditing public DocumentTypeDisplay() { //initialize collections so at least their never null - AllowedTemplates = new List(); + AllowedTemplates = new List(); } //name, alias, icon, thumb, desc, inherited from the content type // Templates [DataMember(Name = "allowedTemplates")] - public IEnumerable AllowedTemplates { get; set; } + public IEnumerable AllowedTemplates { get; set; } [DataMember(Name = "defaultTemplate")] public EntityBasic DefaultTemplate { get; set; } - + } } diff --git a/src/Umbraco.Web/Models/ContentEditing/DocumentTypeSave.cs b/src/Umbraco.Web/Models/ContentEditing/DocumentTypeSave.cs index cdf20dba8d..3f163f860f 100644 --- a/src/Umbraco.Web/Models/ContentEditing/DocumentTypeSave.cs +++ b/src/Umbraco.Web/Models/ContentEditing/DocumentTypeSave.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Runtime.Serialization; @@ -11,13 +11,13 @@ namespace Umbraco.Web.Models.ContentEditing /// [DataContract(Name = "contentType", Namespace = "")] public class DocumentTypeSave : ContentTypeSave - { + { /// /// The list of allowed templates to assign (template alias) /// [DataMember(Name = "allowedTemplates")] public IEnumerable AllowedTemplates { get; set; } - + /// /// The default template to assign (template alias) /// @@ -40,4 +40,4 @@ namespace Umbraco.Web.Models.ContentEditing } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/EntityBasic.cs b/src/Umbraco.Web/Models/ContentEditing/EntityBasic.cs index 9f6e5b28da..471b81ea58 100644 --- a/src/Umbraco.Web/Models/ContentEditing/EntityBasic.cs +++ b/src/Umbraco.Web/Models/ContentEditing/EntityBasic.cs @@ -65,12 +65,12 @@ namespace Umbraco.Web.Models.ContentEditing /// [DataMember(Name = "path")] public string Path { get; set; } - + /// /// A collection of extra data that is available for this specific entity/entity type /// [DataMember(Name = "metaData")] [ReadOnly(true)] - public IDictionary AdditionalData { get; private set; } + public IDictionary AdditionalData { get; private set; } } } diff --git a/src/Umbraco.Web/Models/ContentEditing/EntityTypeSearchResult.cs b/src/Umbraco.Web/Models/ContentEditing/EntityTypeSearchResult.cs index 47dd5005a6..27ddb18406 100644 --- a/src/Umbraco.Web/Models/ContentEditing/EntityTypeSearchResult.cs +++ b/src/Umbraco.Web/Models/ContentEditing/EntityTypeSearchResult.cs @@ -16,4 +16,4 @@ namespace Umbraco.Web.Models.ContentEditing [DataMember(Name = "results")] public IEnumerable Results { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/GetAvailableCompositionsFilter.cs b/src/Umbraco.Web/Models/ContentEditing/GetAvailableCompositionsFilter.cs index 61d61f2108..38442f6da5 100644 --- a/src/Umbraco.Web/Models/ContentEditing/GetAvailableCompositionsFilter.cs +++ b/src/Umbraco.Web/Models/ContentEditing/GetAvailableCompositionsFilter.cs @@ -1,4 +1,4 @@ -namespace Umbraco.Web.Models.ContentEditing +namespace Umbraco.Web.Models.ContentEditing { public class GetAvailableCompositionsFilter { @@ -17,4 +17,4 @@ namespace Umbraco.Web.Models.ContentEditing /// public string[] FilterContentTypes { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/IErrorModel.cs b/src/Umbraco.Web/Models/ContentEditing/IErrorModel.cs index 9e267aac33..1388b4dd05 100644 --- a/src/Umbraco.Web/Models/ContentEditing/IErrorModel.cs +++ b/src/Umbraco.Web/Models/ContentEditing/IErrorModel.cs @@ -14,4 +14,4 @@ namespace Umbraco.Web.Models.ContentEditing /// IDictionary Errors { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/IHaveUploadedFiles.cs b/src/Umbraco.Web/Models/ContentEditing/IHaveUploadedFiles.cs index 8366c9b8c6..a6a3bd625e 100644 --- a/src/Umbraco.Web/Models/ContentEditing/IHaveUploadedFiles.cs +++ b/src/Umbraco.Web/Models/ContentEditing/IHaveUploadedFiles.cs @@ -6,4 +6,4 @@ namespace Umbraco.Web.Models.ContentEditing { List UploadedFiles { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/INotificationModel.cs b/src/Umbraco.Web/Models/ContentEditing/INotificationModel.cs index 401ced3c91..20b5c0c4e6 100644 --- a/src/Umbraco.Web/Models/ContentEditing/INotificationModel.cs +++ b/src/Umbraco.Web/Models/ContentEditing/INotificationModel.cs @@ -11,4 +11,4 @@ namespace Umbraco.Web.Models.ContentEditing [DataMember(Name = "notifications")] List Notifications { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/InstalledPackageModel.cs b/src/Umbraco.Web/Models/ContentEditing/InstalledPackageModel.cs index 3b1bf69faf..9161f972bd 100644 --- a/src/Umbraco.Web/Models/ContentEditing/InstalledPackageModel.cs +++ b/src/Umbraco.Web/Models/ContentEditing/InstalledPackageModel.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Runtime.Serialization; namespace Umbraco.Web.Models.ContentEditing @@ -33,4 +33,4 @@ namespace Umbraco.Web.Models.ContentEditing [DataMember(Name = "iconUrl")] public string IconUrl { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/ListViewAwareContentItemDisplayBase.cs b/src/Umbraco.Web/Models/ContentEditing/ListViewAwareContentItemDisplayBase.cs index f0cb59cbba..0982389a4c 100644 --- a/src/Umbraco.Web/Models/ContentEditing/ListViewAwareContentItemDisplayBase.cs +++ b/src/Umbraco.Web/Models/ContentEditing/ListViewAwareContentItemDisplayBase.cs @@ -1,4 +1,4 @@ -using System.Runtime.Serialization; +using System.Runtime.Serialization; using Umbraco.Core.Models; namespace Umbraco.Web.Models.ContentEditing @@ -22,10 +22,10 @@ namespace Umbraco.Web.Models.ContentEditing /// Property for the entity's individual tree node URL /// /// - /// This is required if the item is a child of a list view since the tree won't actually be loaded, + /// This is required if the item is a child of a list view since the tree won't actually be loaded, /// so the app will need to go fetch the individual tree node in order to be able to load it's action list (menu) /// [DataMember(Name = "treeNodeUrl")] public string TreeNodeUrl { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/MacroParameter.cs b/src/Umbraco.Web/Models/ContentEditing/MacroParameter.cs index 2ca9d0fa90..96ece40a0f 100644 --- a/src/Umbraco.Web/Models/ContentEditing/MacroParameter.cs +++ b/src/Umbraco.Web/Models/ContentEditing/MacroParameter.cs @@ -23,7 +23,7 @@ namespace Umbraco.Web.Models.ContentEditing [DataMember(Name = "sortOrder")] public int SortOrder { get; set; } - + /// /// The editor view to render for this parameter /// diff --git a/src/Umbraco.Web/Models/ContentEditing/MediaItemDisplay.cs b/src/Umbraco.Web/Models/ContentEditing/MediaItemDisplay.cs index 5505ff7904..7d314c0392 100644 --- a/src/Umbraco.Web/Models/ContentEditing/MediaItemDisplay.cs +++ b/src/Umbraco.Web/Models/ContentEditing/MediaItemDisplay.cs @@ -6,10 +6,10 @@ namespace Umbraco.Web.Models.ContentEditing { /// /// A model representing a content item to be displayed in the back office - /// + /// [DataContract(Name = "content", Namespace = "")] public class MediaItemDisplay : ListViewAwareContentItemDisplayBase { - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/MediaItemSave.cs b/src/Umbraco.Web/Models/ContentEditing/MediaItemSave.cs index 1a14b4b0fa..334c0d1ddd 100644 --- a/src/Umbraco.Web/Models/ContentEditing/MediaItemSave.cs +++ b/src/Umbraco.Web/Models/ContentEditing/MediaItemSave.cs @@ -1,4 +1,4 @@ -using System.Runtime.Serialization; +using System.Runtime.Serialization; using Umbraco.Core.Models; namespace Umbraco.Web.Models.ContentEditing @@ -11,4 +11,4 @@ namespace Umbraco.Web.Models.ContentEditing { } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/MediaTypeDisplay.cs b/src/Umbraco.Web/Models/ContentEditing/MediaTypeDisplay.cs index 7063613d66..40227184db 100644 --- a/src/Umbraco.Web/Models/ContentEditing/MediaTypeDisplay.cs +++ b/src/Umbraco.Web/Models/ContentEditing/MediaTypeDisplay.cs @@ -1,4 +1,4 @@ -using System.Runtime.Serialization; +using System.Runtime.Serialization; namespace Umbraco.Web.Models.ContentEditing { @@ -7,4 +7,4 @@ namespace Umbraco.Web.Models.ContentEditing { } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/MediaTypeSave.cs b/src/Umbraco.Web/Models/ContentEditing/MediaTypeSave.cs index e20eb23125..3e3a64740b 100644 --- a/src/Umbraco.Web/Models/ContentEditing/MediaTypeSave.cs +++ b/src/Umbraco.Web/Models/ContentEditing/MediaTypeSave.cs @@ -1,4 +1,4 @@ -using System.Runtime.Serialization; +using System.Runtime.Serialization; namespace Umbraco.Web.Models.ContentEditing { @@ -9,4 +9,4 @@ namespace Umbraco.Web.Models.ContentEditing public class MediaTypeSave : ContentTypeSave { } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/MemberBasic.cs b/src/Umbraco.Web/Models/ContentEditing/MemberBasic.cs index a85aa8c89f..ceb16ed748 100644 --- a/src/Umbraco.Web/Models/ContentEditing/MemberBasic.cs +++ b/src/Umbraco.Web/Models/ContentEditing/MemberBasic.cs @@ -14,4 +14,4 @@ namespace Umbraco.Web.Models.ContentEditing [DataMember(Name = "email")] public string Email { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/MemberDisplay.cs b/src/Umbraco.Web/Models/ContentEditing/MemberDisplay.cs index 77eec943fc..729b1b119c 100644 --- a/src/Umbraco.Web/Models/ContentEditing/MemberDisplay.cs +++ b/src/Umbraco.Web/Models/ContentEditing/MemberDisplay.cs @@ -28,11 +28,11 @@ namespace Umbraco.Web.Models.ContentEditing /// /// This is used to indicate how to map the membership provider properties to the save model, this mapping - /// will change if a developer has opted to have custom member property aliases specified in their membership provider config, + /// will change if a developer has opted to have custom member property aliases specified in their membership provider config, /// or if we are editing a member that is not an Umbraco member (custom provider) /// [DataMember(Name = "fieldConfig")] public IDictionary MemberProviderFieldMapping { get; set; } - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/MemberGroupDisplay.cs b/src/Umbraco.Web/Models/ContentEditing/MemberGroupDisplay.cs index f2e8cc6277..6453fdb7a4 100644 --- a/src/Umbraco.Web/Models/ContentEditing/MemberGroupDisplay.cs +++ b/src/Umbraco.Web/Models/ContentEditing/MemberGroupDisplay.cs @@ -1,4 +1,4 @@ -using System.Runtime.Serialization; +using System.Runtime.Serialization; namespace Umbraco.Web.Models.ContentEditing { @@ -18,4 +18,4 @@ namespace Umbraco.Web.Models.ContentEditing [DataMember(Name = "notifications")] public List Notifications { get; private set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/MemberGroupSave.cs b/src/Umbraco.Web/Models/ContentEditing/MemberGroupSave.cs index 26e1665451..ed5c8de40f 100644 --- a/src/Umbraco.Web/Models/ContentEditing/MemberGroupSave.cs +++ b/src/Umbraco.Web/Models/ContentEditing/MemberGroupSave.cs @@ -1,4 +1,4 @@ -using System.Runtime.Serialization; +using System.Runtime.Serialization; namespace Umbraco.Web.Models.ContentEditing { @@ -6,4 +6,4 @@ namespace Umbraco.Web.Models.ContentEditing public class MemberGroupSave : EntityBasic { } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/MemberListDisplay.cs b/src/Umbraco.Web/Models/ContentEditing/MemberListDisplay.cs index 749035d1d4..c46d5d71fb 100644 --- a/src/Umbraco.Web/Models/ContentEditing/MemberListDisplay.cs +++ b/src/Umbraco.Web/Models/ContentEditing/MemberListDisplay.cs @@ -1,4 +1,4 @@ -using System.Runtime.Serialization; +using System.Runtime.Serialization; using Umbraco.Core.Models; namespace Umbraco.Web.Models.ContentEditing @@ -10,4 +10,4 @@ namespace Umbraco.Web.Models.ContentEditing public class MemberListDisplay : ContentItemDisplayBase { } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/MemberPropertyTypeBasic.cs b/src/Umbraco.Web/Models/ContentEditing/MemberPropertyTypeBasic.cs index dfe98461dd..6927cb44a0 100644 --- a/src/Umbraco.Web/Models/ContentEditing/MemberPropertyTypeBasic.cs +++ b/src/Umbraco.Web/Models/ContentEditing/MemberPropertyTypeBasic.cs @@ -1,4 +1,4 @@ -using System.Runtime.Serialization; +using System.Runtime.Serialization; namespace Umbraco.Web.Models.ContentEditing { @@ -14,4 +14,4 @@ namespace Umbraco.Web.Models.ContentEditing [DataMember(Name = "memberCanEdit")] public bool MemberCanEditProperty { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/MemberPropertyTypeDisplay.cs b/src/Umbraco.Web/Models/ContentEditing/MemberPropertyTypeDisplay.cs index 8f7d4be310..0c045afbdd 100644 --- a/src/Umbraco.Web/Models/ContentEditing/MemberPropertyTypeDisplay.cs +++ b/src/Umbraco.Web/Models/ContentEditing/MemberPropertyTypeDisplay.cs @@ -1,4 +1,4 @@ -using System.Runtime.Serialization; +using System.Runtime.Serialization; namespace Umbraco.Web.Models.ContentEditing { @@ -11,4 +11,4 @@ namespace Umbraco.Web.Models.ContentEditing [DataMember(Name = "memberCanEdit")] public bool MemberCanEditProperty { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/MemberSave.cs b/src/Umbraco.Web/Models/ContentEditing/MemberSave.cs index fac73e802d..3b1f3cc048 100644 --- a/src/Umbraco.Web/Models/ContentEditing/MemberSave.cs +++ b/src/Umbraco.Web/Models/ContentEditing/MemberSave.cs @@ -12,7 +12,7 @@ namespace Umbraco.Web.Models.ContentEditing /// public class MemberSave : ContentBaseItemSave { - + [DataMember(Name = "username", IsRequired = true)] [RequiredForPersistence(AllowEmptyStrings = false, ErrorMessage = "Required")] public string Username { get; set; } @@ -20,13 +20,13 @@ namespace Umbraco.Web.Models.ContentEditing [DataMember(Name = "email", IsRequired = true)] [RequiredForPersistence(AllowEmptyStrings = false, ErrorMessage = "Required")] public string Email { get; set; } - + [DataMember(Name = "password")] public ChangingPasswordModel Password { get; set; } - + [DataMember(Name = "memberGroups")] public IEnumerable Groups { get; set; } - + [DataMember(Name = "comments")] public string Comments { get; set; } @@ -36,6 +36,6 @@ namespace Umbraco.Web.Models.ContentEditing [DataMember(Name = "isApproved")] public bool IsApproved { get; set; } - //TODO: Need to add question / answer support + //TODO: Need to add question / answer support } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/MemberTypeDisplay.cs b/src/Umbraco.Web/Models/ContentEditing/MemberTypeDisplay.cs index e6092a10f4..26d06c5d1c 100644 --- a/src/Umbraco.Web/Models/ContentEditing/MemberTypeDisplay.cs +++ b/src/Umbraco.Web/Models/ContentEditing/MemberTypeDisplay.cs @@ -1,4 +1,4 @@ -using System.Runtime.Serialization; +using System.Runtime.Serialization; namespace Umbraco.Web.Models.ContentEditing { @@ -7,4 +7,4 @@ namespace Umbraco.Web.Models.ContentEditing { } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/MemberTypeSave.cs b/src/Umbraco.Web/Models/ContentEditing/MemberTypeSave.cs index 98bfbf0fce..be3d294714 100644 --- a/src/Umbraco.Web/Models/ContentEditing/MemberTypeSave.cs +++ b/src/Umbraco.Web/Models/ContentEditing/MemberTypeSave.cs @@ -1,10 +1,10 @@ -namespace Umbraco.Web.Models.ContentEditing +namespace Umbraco.Web.Models.ContentEditing { /// /// Model used to save a member type /// public class MemberTypeSave : ContentTypeSave { - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/MessagesExtensions.cs b/src/Umbraco.Web/Models/ContentEditing/MessagesExtensions.cs index d981ee58dc..14163d73f0 100644 --- a/src/Umbraco.Web/Models/ContentEditing/MessagesExtensions.cs +++ b/src/Umbraco.Web/Models/ContentEditing/MessagesExtensions.cs @@ -54,4 +54,4 @@ namespace Umbraco.Web.Models.ContentEditing }); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/ModelWithNotifications.cs b/src/Umbraco.Web/Models/ContentEditing/ModelWithNotifications.cs index 4d34962f20..20bfb4947d 100644 --- a/src/Umbraco.Web/Models/ContentEditing/ModelWithNotifications.cs +++ b/src/Umbraco.Web/Models/ContentEditing/ModelWithNotifications.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Runtime.Serialization; namespace Umbraco.Web.Models.ContentEditing @@ -28,4 +28,4 @@ namespace Umbraco.Web.Models.ContentEditing [DataMember(Name = "notifications")] public List Notifications { get; private set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/Notification.cs b/src/Umbraco.Web/Models/ContentEditing/Notification.cs index 0f042b6cbc..0305348c7c 100644 --- a/src/Umbraco.Web/Models/ContentEditing/Notification.cs +++ b/src/Umbraco.Web/Models/ContentEditing/Notification.cs @@ -8,9 +8,9 @@ namespace Umbraco.Web.Models.ContentEditing { public Notification() { - + } - + public Notification(string header, string message, SpeechBubbleIcon notificationType) { Header = header; @@ -25,4 +25,4 @@ namespace Umbraco.Web.Models.ContentEditing [DataMember(Name = "type")] public SpeechBubbleIcon NotificationType { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/PostedFiles.cs b/src/Umbraco.Web/Models/ContentEditing/PostedFiles.cs index 7793787670..7f21a58ce3 100644 --- a/src/Umbraco.Web/Models/ContentEditing/PostedFiles.cs +++ b/src/Umbraco.Web/Models/ContentEditing/PostedFiles.cs @@ -1,10 +1,10 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Runtime.Serialization; namespace Umbraco.Web.Models.ContentEditing { /// - /// This is used for the response of PostAddFile so that we can analyze the response in a filter and remove the + /// This is used for the response of PostAddFile so that we can analyze the response in a filter and remove the /// temporary files that were created. /// [DataContract] @@ -20,4 +20,4 @@ namespace Umbraco.Web.Models.ContentEditing [DataMember(Name = "notifications")] public List Notifications { get; private set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/PreValueFieldDisplay.cs b/src/Umbraco.Web/Models/ContentEditing/PreValueFieldDisplay.cs index 6879701bde..1276d72a1f 100644 --- a/src/Umbraco.Web/Models/ContentEditing/PreValueFieldDisplay.cs +++ b/src/Umbraco.Web/Models/ContentEditing/PreValueFieldDisplay.cs @@ -36,9 +36,9 @@ namespace Umbraco.Web.Models.ContentEditing /// /// This allows for custom configuration to be injected into the pre-value editor - /// + /// [DataMember(Name = "config")] public IDictionary Config { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/PreValueFieldSave.cs b/src/Umbraco.Web/Models/ContentEditing/PreValueFieldSave.cs index 3f3c018ef6..34bcb75e04 100644 --- a/src/Umbraco.Web/Models/ContentEditing/PreValueFieldSave.cs +++ b/src/Umbraco.Web/Models/ContentEditing/PreValueFieldSave.cs @@ -20,4 +20,4 @@ namespace Umbraco.Web.Models.ContentEditing [DataMember(Name = "value", IsRequired = true)] public object Value { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/PropertyEditorBasic.cs b/src/Umbraco.Web/Models/ContentEditing/PropertyEditorBasic.cs index 50b8641b19..a369eadf34 100644 --- a/src/Umbraco.Web/Models/ContentEditing/PropertyEditorBasic.cs +++ b/src/Umbraco.Web/Models/ContentEditing/PropertyEditorBasic.cs @@ -18,4 +18,4 @@ namespace Umbraco.Web.Models.ContentEditing [DataMember(Name = "icon")] public string Icon { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/PropertyGroupBasic.cs b/src/Umbraco.Web/Models/ContentEditing/PropertyGroupBasic.cs index 6bfe1dc76e..92a0904b63 100644 --- a/src/Umbraco.Web/Models/ContentEditing/PropertyGroupBasic.cs +++ b/src/Umbraco.Web/Models/ContentEditing/PropertyGroupBasic.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; @@ -49,11 +49,11 @@ namespace Umbraco.Web.Models.ContentEditing Properties = new List(); } - + [DataMember(Name = "properties")] public IEnumerable Properties { get; set; } - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/PropertyGroupDisplay.cs b/src/Umbraco.Web/Models/ContentEditing/PropertyGroupDisplay.cs index c31c93b206..1523daacda 100644 --- a/src/Umbraco.Web/Models/ContentEditing/PropertyGroupDisplay.cs +++ b/src/Umbraco.Web/Models/ContentEditing/PropertyGroupDisplay.cs @@ -5,7 +5,7 @@ using System.Runtime.Serialization; namespace Umbraco.Web.Models.ContentEditing { [DataContract(Name = "propertyGroup", Namespace = "")] - public class PropertyGroupDisplay : PropertyGroupBasic + public class PropertyGroupDisplay : PropertyGroupBasic where TPropertyTypeDisplay : PropertyTypeDisplay { public PropertyGroupDisplay() diff --git a/src/Umbraco.Web/Models/ContentEditing/PropertyTypeBasic.cs b/src/Umbraco.Web/Models/ContentEditing/PropertyTypeBasic.cs index 107ae287fa..b6f678068e 100644 --- a/src/Umbraco.Web/Models/ContentEditing/PropertyTypeBasic.cs +++ b/src/Umbraco.Web/Models/ContentEditing/PropertyTypeBasic.cs @@ -47,4 +47,4 @@ namespace Umbraco.Web.Models.ContentEditing [DataMember(Name = "groupId")] public int GroupId { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/PropertyTypeDisplay.cs b/src/Umbraco.Web/Models/ContentEditing/PropertyTypeDisplay.cs index 4ee7c3eced..d3878bfeba 100644 --- a/src/Umbraco.Web/Models/ContentEditing/PropertyTypeDisplay.cs +++ b/src/Umbraco.Web/Models/ContentEditing/PropertyTypeDisplay.cs @@ -10,7 +10,7 @@ namespace Umbraco.Web.Models.ContentEditing [DataMember(Name = "editor")] [ReadOnly(true)] public string Editor { get; set; } - + [DataMember(Name = "view")] [ReadOnly(true)] public string View { get; set; } @@ -18,7 +18,7 @@ namespace Umbraco.Web.Models.ContentEditing [DataMember(Name = "config")] [ReadOnly(true)] public IDictionary Config { get; set; } - + /// /// Gets a value indicating whether this property should be locked when editing. /// @@ -29,9 +29,9 @@ namespace Umbraco.Web.Models.ContentEditing public bool Locked { get; set; } /// - /// This is required for the UI editor to know if this particular property belongs to + /// This is required for the UI editor to know if this particular property belongs to /// an inherited item or the current item. - /// + /// [DataMember(Name = "contentTypeId")] [ReadOnly(true)] public int ContentTypeId { get; set; } diff --git a/src/Umbraco.Web/Models/ContentEditing/PropertyTypeValidation.cs b/src/Umbraco.Web/Models/ContentEditing/PropertyTypeValidation.cs index 31f1c4de84..929c7ce324 100644 --- a/src/Umbraco.Web/Models/ContentEditing/PropertyTypeValidation.cs +++ b/src/Umbraco.Web/Models/ContentEditing/PropertyTypeValidation.cs @@ -14,4 +14,4 @@ namespace Umbraco.Web.Models.ContentEditing [DataMember(Name = "pattern")] public string Pattern { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/RedirectUrlSearchResults.cs b/src/Umbraco.Web/Models/ContentEditing/RedirectUrlSearchResults.cs index 6a64b0dbc4..8833bfdbf6 100644 --- a/src/Umbraco.Web/Models/ContentEditing/RedirectUrlSearchResults.cs +++ b/src/Umbraco.Web/Models/ContentEditing/RedirectUrlSearchResults.cs @@ -9,7 +9,7 @@ namespace Umbraco.Web.Models.ContentEditing { [DataMember(Name = "searchResults")] public IEnumerable SearchResults { get; set; } - + [DataMember(Name = "totalCount")] public long TotalCount { get; set; } @@ -17,6 +17,6 @@ namespace Umbraco.Web.Models.ContentEditing public int PageCount { get; set; } [DataMember(Name = "currentPage")] - public int CurrentPage { get; set; } + public int CurrentPage { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/RelationType.cs b/src/Umbraco.Web/Models/ContentEditing/RelationType.cs index 8c29343319..129376da5c 100644 --- a/src/Umbraco.Web/Models/ContentEditing/RelationType.cs +++ b/src/Umbraco.Web/Models/ContentEditing/RelationType.cs @@ -39,4 +39,4 @@ namespace Umbraco.Web.Models.ContentEditing [DataMember(Name = "childObjectType", IsRequired = true)] public Guid ChildObjectType { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/RichTextEditorCommand.cs b/src/Umbraco.Web/Models/ContentEditing/RichTextEditorCommand.cs index fb2a95c2a4..1780d00bba 100644 --- a/src/Umbraco.Web/Models/ContentEditing/RichTextEditorCommand.cs +++ b/src/Umbraco.Web/Models/ContentEditing/RichTextEditorCommand.cs @@ -18,22 +18,22 @@ namespace Umbraco.Web.Models.ContentEditing [DataMember(Name = "command")] public string Command { get; set; } - + [DataMember(Name = "alias")] public string Alias { get; set; } - + [DataMember(Name = "userInterface")] public string UserInterface { get; set; } - + [DataMember(Name = "frontEndCommand")] public string FrontEndCommand { get; set; } - + [DataMember(Name = "value")] public string Value { get; set; } - + [DataMember(Name = "priority")] public int Priority { get; set; } - + [DataMember(Name = "isStylePicker")] public bool IsStylePicker { get; set; } } diff --git a/src/Umbraco.Web/Models/ContentEditing/SearchResultItem.cs b/src/Umbraco.Web/Models/ContentEditing/SearchResultItem.cs index b846812e88..d55e80b1f9 100644 --- a/src/Umbraco.Web/Models/ContentEditing/SearchResultItem.cs +++ b/src/Umbraco.Web/Models/ContentEditing/SearchResultItem.cs @@ -1,7 +1,7 @@ namespace Umbraco.Web.Models.ContentEditing { public class SearchResultItem - { + { /// /// The string representation of the ID, used for Web responses /// @@ -22,4 +22,4 @@ /// public string Description { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/SimpleNotificationModel.cs b/src/Umbraco.Web/Models/ContentEditing/SimpleNotificationModel.cs index 83b00662c4..5394636bbf 100644 --- a/src/Umbraco.Web/Models/ContentEditing/SimpleNotificationModel.cs +++ b/src/Umbraco.Web/Models/ContentEditing/SimpleNotificationModel.cs @@ -23,9 +23,9 @@ namespace Umbraco.Web.Models.ContentEditing public List Notifications { get; private set; } /// - /// A default msg + /// A default msg /// [DataMember(Name = "message")] public string Message { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/StyleSheet.cs b/src/Umbraco.Web/Models/ContentEditing/StyleSheet.cs index 6162aebfd7..809aa7185f 100644 --- a/src/Umbraco.Web/Models/ContentEditing/StyleSheet.cs +++ b/src/Umbraco.Web/Models/ContentEditing/StyleSheet.cs @@ -11,7 +11,7 @@ namespace Umbraco.Web.Models.ContentEditing { [DataMember(Name="name")] public string Name { get; set; } - + [DataMember(Name = "path")] public string Path { get; set; } } diff --git a/src/Umbraco.Web/Models/ContentEditing/Tab.cs b/src/Umbraco.Web/Models/ContentEditing/Tab.cs index dd1c73b418..536fe31182 100644 --- a/src/Umbraco.Web/Models/ContentEditing/Tab.cs +++ b/src/Umbraco.Web/Models/ContentEditing/Tab.cs @@ -24,4 +24,4 @@ namespace Umbraco.Web.Models.ContentEditing [DataMember(Name = "properties")] public IEnumerable Properties { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/TabbedContentItem.cs b/src/Umbraco.Web/Models/ContentEditing/TabbedContentItem.cs index b18118d8c2..c4575a78ca 100644 --- a/src/Umbraco.Web/Models/ContentEditing/TabbedContentItem.cs +++ b/src/Umbraco.Web/Models/ContentEditing/TabbedContentItem.cs @@ -7,15 +7,15 @@ using Umbraco.Core.Models; namespace Umbraco.Web.Models.ContentEditing { - public abstract class TabbedContentItem : ContentItemBasic - where T : ContentPropertyBasic + public abstract class TabbedContentItem : ContentItemBasic + where T : ContentPropertyBasic where TPersisted : IContentBase { protected TabbedContentItem() { Tabs = new List>(); - } - + } + /// /// Defines the tabs containing display properties /// @@ -36,4 +36,4 @@ namespace Umbraco.Web.Models.ContentEditing set { throw new NotImplementedException(); } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/UmbracoEntityTypes.cs b/src/Umbraco.Web/Models/ContentEditing/UmbracoEntityTypes.cs index c68ee3c655..5f4414d919 100644 --- a/src/Umbraco.Web/Models/ContentEditing/UmbracoEntityTypes.cs +++ b/src/Umbraco.Web/Models/ContentEditing/UmbracoEntityTypes.cs @@ -7,7 +7,7 @@ namespace Umbraco.Web.Models.ContentEditing /// Represents the type's of Umbraco entities that can be resolved from the EntityController /// public enum UmbracoEntityTypes - { + { /// /// Domain /// @@ -69,10 +69,10 @@ namespace Umbraco.Web.Models.ContentEditing /// Document Type /// DocumentType, - + /// /// Stylesheet - /// + /// Stylesheet, /// @@ -95,4 +95,4 @@ namespace Umbraco.Web.Models.ContentEditing /// PropertyGroup } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/UserBasic.cs b/src/Umbraco.Web/Models/ContentEditing/UserBasic.cs index c1cf3ed5c6..19da210840 100644 --- a/src/Umbraco.Web/Models/ContentEditing/UserBasic.cs +++ b/src/Umbraco.Web/Models/ContentEditing/UserBasic.cs @@ -13,7 +13,7 @@ namespace Umbraco.Web.Models.ContentEditing [DataMember(Name = "id", IsRequired = true)] [Required] public int UserId { get; set; } - + [DataMember(Name = "name", IsRequired = true)] [Required] public string Name { get; set; } @@ -24,4 +24,4 @@ namespace Umbraco.Web.Models.ContentEditing return Name.CompareTo(((UserBasic)obj).Name); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentEditing/UserDetail.cs b/src/Umbraco.Web/Models/ContentEditing/UserDetail.cs index d27736576f..56f54832d6 100644 --- a/src/Umbraco.Web/Models/ContentEditing/UserDetail.cs +++ b/src/Umbraco.Web/Models/ContentEditing/UserDetail.cs @@ -43,6 +43,6 @@ namespace Umbraco.Web.Models.ContentEditing [DataMember(Name = "allowedSections")] public IEnumerable AllowedSections { get; set; } - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ContentModel.cs b/src/Umbraco.Web/Models/ContentModel.cs index b644efd806..9e4a9a3024 100644 --- a/src/Umbraco.Web/Models/ContentModel.cs +++ b/src/Umbraco.Web/Models/ContentModel.cs @@ -1,26 +1,26 @@ -using System; +using System; using Umbraco.Core.Models.PublishedContent; namespace Umbraco.Web.Models { - /// - /// Represents the model for the current Umbraco view. - /// - public class ContentModel : IContentModel - { - /// - /// Initializes a new instance of the class with a content. - /// - /// - public ContentModel(IPublishedContent content) - { + /// + /// Represents the model for the current Umbraco view. + /// + public class ContentModel : IContentModel + { + /// + /// Initializes a new instance of the class with a content. + /// + /// + public ContentModel(IPublishedContent content) + { if (content == null) throw new ArgumentNullException(nameof(content)); - Content = content; - } + Content = content; + } - /// - /// Gets the content. - /// - public IPublishedContent Content { get; } - } -} \ No newline at end of file + /// + /// Gets the content. + /// + public IPublishedContent Content { get; } + } +} diff --git a/src/Umbraco.Web/Models/ImageCropAnchor.cs b/src/Umbraco.Web/Models/ImageCropAnchor.cs index 94e666e5ea..a24b4df6fa 100644 --- a/src/Umbraco.Web/Models/ImageCropAnchor.cs +++ b/src/Umbraco.Web/Models/ImageCropAnchor.cs @@ -12,4 +12,4 @@ BottomLeft, BottomRight } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ImageCropCoordinates.cs b/src/Umbraco.Web/Models/ImageCropCoordinates.cs index e501bf4426..e28902285f 100644 --- a/src/Umbraco.Web/Models/ImageCropCoordinates.cs +++ b/src/Umbraco.Web/Models/ImageCropCoordinates.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Runtime.Serialization; namespace Umbraco.Web.Models @@ -48,7 +48,7 @@ namespace Umbraco.Web.Models } /// - /// Serves as the default hash function. + /// Serves as the default hash function. /// /// /// A hash code for the current object. @@ -75,4 +75,4 @@ namespace Umbraco.Web.Models return Equals(left, right) == false; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ImageCropData.cs b/src/Umbraco.Web/Models/ImageCropData.cs index 7cef207bac..b724a3de95 100644 --- a/src/Umbraco.Web/Models/ImageCropData.cs +++ b/src/Umbraco.Web/Models/ImageCropData.cs @@ -8,7 +8,7 @@ namespace Umbraco.Web.Models { [DataMember(Name = "alias")] public string Alias { get; set; } - + [DataMember(Name = "width")] public int Width { get; set; } @@ -48,7 +48,7 @@ namespace Umbraco.Web.Models } /// - /// Serves as the default hash function. + /// Serves as the default hash function. /// /// /// A hash code for the current object. diff --git a/src/Umbraco.Web/Models/ImageCropDataSet.cs b/src/Umbraco.Web/Models/ImageCropDataSet.cs index 2bca349f85..fc53704aae 100644 --- a/src/Umbraco.Web/Models/ImageCropDataSet.cs +++ b/src/Umbraco.Web/Models/ImageCropDataSet.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; @@ -15,7 +15,7 @@ namespace Umbraco.Web.Models [TypeConverter(typeof(ImageCropDataSetTypeConverter))] [DataContract(Name="imageCropDataSet")] public class ImageCropDataSet : IHtmlString, IEquatable - { + { [DataMember(Name="src")] public string Src { get; set;} @@ -89,7 +89,7 @@ namespace Umbraco.Web.Models { return Crops.Any() ? JsonConvert.SerializeObject(this) : Src; } - + /// /// Indicates whether the current object is equal to another object of the same type. @@ -102,7 +102,7 @@ namespace Umbraco.Web.Models { if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return string.Equals(Src, other.Src) && Equals(FocalPoint, other.FocalPoint) + return string.Equals(Src, other.Src) && Equals(FocalPoint, other.FocalPoint) && Crops.SequenceEqual(other.Crops); } @@ -122,7 +122,7 @@ namespace Umbraco.Web.Models } /// - /// Serves as the default hash function. + /// Serves as the default hash function. /// /// /// A hash code for the current object. @@ -148,4 +148,4 @@ namespace Umbraco.Web.Models return Equals(left, right) == false; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ImageCropFocalPoint.cs b/src/Umbraco.Web/Models/ImageCropFocalPoint.cs index 11d5c05488..0511ead03f 100644 --- a/src/Umbraco.Web/Models/ImageCropFocalPoint.cs +++ b/src/Umbraco.Web/Models/ImageCropFocalPoint.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Runtime.Serialization; namespace Umbraco.Web.Models @@ -42,7 +42,7 @@ namespace Umbraco.Web.Models } /// - /// Serves as the default hash function. + /// Serves as the default hash function. /// /// /// A hash code for the current object. @@ -65,4 +65,4 @@ namespace Umbraco.Web.Models return Equals(left, right) == false; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/LocalPackageInstallModel.cs b/src/Umbraco.Web/Models/LocalPackageInstallModel.cs index a107ac2428..6b94f97050 100644 --- a/src/Umbraco.Web/Models/LocalPackageInstallModel.cs +++ b/src/Umbraco.Web/Models/LocalPackageInstallModel.cs @@ -15,9 +15,9 @@ namespace Umbraco.Web.Models UploadedFiles = new List(); Notifications = new List(); } - + public List UploadedFiles { get; } - + [DataMember(Name = "notifications")] public List Notifications { get; } @@ -84,4 +84,4 @@ namespace Umbraco.Web.Models [DataMember(Name = "iconUrl")] public string IconUrl { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/LoginStatusModel.cs b/src/Umbraco.Web/Models/LoginStatusModel.cs index ffc04f4021..c6294e8881 100644 --- a/src/Umbraco.Web/Models/LoginStatusModel.cs +++ b/src/Umbraco.Web/Models/LoginStatusModel.cs @@ -66,4 +66,4 @@ namespace Umbraco.Web.Models /// public bool IsLoggedIn { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/Mapping/ActionButtonsResolver.cs b/src/Umbraco.Web/Models/Mapping/ActionButtonsResolver.cs index 3d970b3406..b9857abee2 100644 --- a/src/Umbraco.Web/Models/Mapping/ActionButtonsResolver.cs +++ b/src/Umbraco.Web/Models/Mapping/ActionButtonsResolver.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using Umbraco.Core.Models; @@ -43,4 +43,4 @@ namespace Umbraco.Web.Models.Mapping : permissions.AssignedPermissions.Where(x => x.Length == 1).Select(x => x.ToUpperInvariant()[0]); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/Mapping/AvailablePropertyEditorsResolver.cs b/src/Umbraco.Web/Models/Mapping/AvailablePropertyEditorsResolver.cs index bbd772c62c..e7c18790b8 100644 --- a/src/Umbraco.Web/Models/Mapping/AvailablePropertyEditorsResolver.cs +++ b/src/Umbraco.Web/Models/Mapping/AvailablePropertyEditorsResolver.cs @@ -21,7 +21,7 @@ namespace Umbraco.Web.Models.Mapping { return Current.PropertyEditors .Where(x => - { + { // fixme should we support deprecating? //if (_contentSection.ShowDeprecatedPropertyEditors) // return true; @@ -31,4 +31,4 @@ namespace Umbraco.Web.Models.Mapping .Select(Mapper.Map); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/Mapping/ContentProfile.cs b/src/Umbraco.Web/Models/Mapping/ContentProfile.cs index a1b8888d2b..645718ab94 100644 --- a/src/Umbraco.Web/Models/Mapping/ContentProfile.cs +++ b/src/Umbraco.Web/Models/Mapping/ContentProfile.cs @@ -174,8 +174,8 @@ namespace Umbraco.Web.Models.Mapping genericProperties => { //TODO: This would be much nicer with the IUmbracoContextAccessor so we don't use singletons - //If this is a web request and there's a user signed in and the - // user has access to the settings section, we will + //If this is a web request and there's a user signed in and the + // user has access to the settings section, we will if (HttpContext.Current != null && UmbracoContext.Current != null && UmbracoContext.Current.Security.CurrentUser != null && UmbracoContext.Current.Security.CurrentUser.AllowedSections.Any(x => x.Equals(Constants.Applications.Settings))) { @@ -213,4 +213,4 @@ namespace Umbraco.Web.Models.Mapping }); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/Mapping/ContentPropertyBasicConverter.cs b/src/Umbraco.Web/Models/Mapping/ContentPropertyBasicConverter.cs index bcd420e16c..5f99d19406 100644 --- a/src/Umbraco.Web/Models/Mapping/ContentPropertyBasicConverter.cs +++ b/src/Umbraco.Web/Models/Mapping/ContentPropertyBasicConverter.cs @@ -50,4 +50,4 @@ namespace Umbraco.Web.Models.Mapping return result; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/Mapping/ContentPropertyDisplayConverter.cs b/src/Umbraco.Web/Models/Mapping/ContentPropertyDisplayConverter.cs index 72be760ce6..f2c55cf71d 100644 --- a/src/Umbraco.Web/Models/Mapping/ContentPropertyDisplayConverter.cs +++ b/src/Umbraco.Web/Models/Mapping/ContentPropertyDisplayConverter.cs @@ -34,11 +34,11 @@ namespace Umbraco.Web.Models.Mapping display.Description = originalProp.PropertyType.Description; display.Label = originalProp.PropertyType.Name; display.HideLabel = valEditor.HideLabel; - + //add the validation information display.Validation.Mandatory = originalProp.PropertyType.Mandatory; display.Validation.Pattern = originalProp.PropertyType.ValidationRegExp; - + if (display.PropertyEditor == null) { //display.Config = PreValueCollection.AsDictionary(preVals); @@ -56,4 +56,4 @@ namespace Umbraco.Web.Models.Mapping return display; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/Mapping/ContentPropertyDtoConverter.cs b/src/Umbraco.Web/Models/Mapping/ContentPropertyDtoConverter.cs index 23fa60c551..8192bd1a37 100644 --- a/src/Umbraco.Web/Models/Mapping/ContentPropertyDtoConverter.cs +++ b/src/Umbraco.Web/Models/Mapping/ContentPropertyDtoConverter.cs @@ -25,7 +25,7 @@ namespace Umbraco.Web.Models.Mapping propertyDto.ValidationRegExp = originalProperty.PropertyType.ValidationRegExp; propertyDto.Description = originalProperty.PropertyType.Description; propertyDto.Label = originalProperty.PropertyType.Name; - + //TODO: We should be able to look both of these up at the same time! propertyDto.DataType = dataTypeService.GetDataTypeDefinitionById(originalProperty.PropertyType.DataTypeDefinitionId); propertyDto.PreValues = dataTypeService.GetPreValuesCollectionByDataTypeId(originalProperty.PropertyType.DataTypeDefinitionId); @@ -33,4 +33,4 @@ namespace Umbraco.Web.Models.Mapping return propertyDto; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/Mapping/ContentPropertyProfile.cs b/src/Umbraco.Web/Models/Mapping/ContentPropertyProfile.cs index 926025d838..4ba961aeee 100644 --- a/src/Umbraco.Web/Models/Mapping/ContentPropertyProfile.cs +++ b/src/Umbraco.Web/Models/Mapping/ContentPropertyProfile.cs @@ -7,7 +7,7 @@ using Umbraco.Web.Models.ContentEditing; namespace Umbraco.Web.Models.Mapping { /// - /// A mapper which declares how to map content properties. These mappings are shared among media (and probably members) which is + /// A mapper which declares how to map content properties. These mappings are shared among media (and probably members) which is /// why they are in their own mapper /// internal class ContentPropertyProfile : Profile @@ -40,4 +40,4 @@ namespace Umbraco.Web.Models.Mapping .ConvertUsing(new ContentPropertyDisplayConverter(lazyDataTypeService)); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/Mapping/ContentTypeModelMapperExtensions.cs b/src/Umbraco.Web/Models/Mapping/ContentTypeModelMapperExtensions.cs index c33e1f00f1..e845f680f7 100644 --- a/src/Umbraco.Web/Models/Mapping/ContentTypeModelMapperExtensions.cs +++ b/src/Umbraco.Web/Models/Mapping/ContentTypeModelMapperExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using AutoMapper; @@ -22,7 +22,7 @@ namespace Umbraco.Web.Models.Mapping { public static IMappingExpression MapPropertyGroupBasicToPropertyGroupPersistence( this IMappingExpression mapping) - where TSource : PropertyGroupBasic + where TSource : PropertyGroupBasic where TPropertyTypeBasic : PropertyTypeBasic { return mapping @@ -38,7 +38,7 @@ namespace Umbraco.Web.Models.Mapping public static IMappingExpression> MapPropertyGroupBasicToPropertyGroupDisplay( this IMappingExpression> mapping) where TSource : PropertyGroupBasic - where TPropertyTypeBasic : PropertyTypeBasic + where TPropertyTypeBasic : PropertyTypeBasic where TPropertyTypeDisplay : PropertyTypeDisplay { return mapping @@ -102,8 +102,8 @@ namespace Umbraco.Web.Models.Mapping public static IMappingExpression MapBaseContentTypeSaveToDisplay( this IMappingExpression mapping) where TSource : ContentTypeSave - where TDestination : ContentTypeCompositionDisplay - where TPropertyTypeDestination : PropertyTypeDisplay + where TDestination : ContentTypeCompositionDisplay + where TPropertyTypeDestination : PropertyTypeDisplay where TPropertyTypeSource : PropertyTypeBasic { var propertyGroupDisplayResolver = new PropertyGroupDisplayResolver(); @@ -138,7 +138,7 @@ namespace Umbraco.Web.Models.Mapping //Ignore because this is not actually used for content types .ForMember(dest => dest.Trashed, opt => opt.Ignore()) - .ForMember(dest => dest.AllowedContentTypes, opt => opt.MapFrom(src => src.AllowedContentTypes.Select(x => x.Id.Value))) + .ForMember(dest => dest.AllowedContentTypes, opt => opt.MapFrom(src => src.AllowedContentTypes.Select(x => x.Id.Value))) .ForMember(dest => dest.CompositeContentTypes, opt => opt.MapFrom(src => src.ContentTypeComposition)) .ForMember(dest => dest.LockedCompositeContentTypes, opt => opt.ResolveUsing(src => lockedCompositionsResolver.Resolve(src))) .ForMember(dest => dest.Groups, opt => opt.ResolveUsing(src => propertyTypeGroupResolver.Resolve(src))); @@ -151,12 +151,12 @@ namespace Umbraco.Web.Models.Mapping /// /// /// - /// + /// public static IMappingExpression MapBaseContentTypeSaveToEntity( this IMappingExpression mapping) //where TSource : ContentTypeCompositionDisplay where TSource : ContentTypeSave - where TDestination : IContentTypeComposition + where TDestination : IContentTypeComposition where TSourcePropertyType : PropertyTypeBasic { return mapping @@ -178,7 +178,7 @@ namespace Umbraco.Web.Models.Mapping .ForMember(dest => dest.NoGroupPropertyTypes, opt => opt.Ignore()) // ignore, composition is managed in AfterMapContentTypeSaveToEntity .ForMember(dest => dest.ContentTypeComposition, opt => opt.Ignore()) - + .ForMember( dest => dest.AllowedContentTypes, opt => opt.MapFrom(src => src.AllowedContentTypes.Select((t, i) => new ContentTypeSort(t, i)))) @@ -299,7 +299,7 @@ namespace Umbraco.Web.Models.Mapping sourceProperty.Id = 0; } - // insert a new property, or update an existing property that has + // insert a new property, or update an existing property that has // been deletedin the meantime and we need to re-create // map/create destProperty = Mapper.Map(sourceProperty); @@ -328,4 +328,4 @@ namespace Umbraco.Web.Models.Mapping throw new InvalidOperationException("Cannot map groups due to name conflict."); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/Mapping/ContentTypeProfile.cs b/src/Umbraco.Web/Models/Mapping/ContentTypeProfile.cs index 444dd7c546..f3d1d9fed3 100644 --- a/src/Umbraco.Web/Models/Mapping/ContentTypeProfile.cs +++ b/src/Umbraco.Web/Models/Mapping/ContentTypeProfile.cs @@ -27,7 +27,7 @@ namespace Umbraco.Web.Models.Mapping _fileService = fileService; _contentTypeService = contentTypeService; _mediaTypeService = mediaTypeService; - + // v7 creates this map twice which makes no sense, and AutoMapper 6 detects it // assuming the second map took over, and removing the first one for now /* @@ -182,7 +182,7 @@ namespace Umbraco.Web.Models.Mapping .ForMember(dest => dest.Id, expression => expression.Condition(source => source.Id > 0)) .ForMember(dto => dto.CreateDate, expression => expression.Ignore()) .ForMember(dto => dto.UpdateDate, expression => expression.Ignore()) - //only map if it is actually set, if it's not set, it needs to be handled differently and will be taken care of in the + //only map if it is actually set, if it's not set, it needs to be handled differently and will be taken care of in the // IContentType.AddPropertyType .ForMember(dest => dest.PropertyGroupId, expression => expression.Condition(source => source.GroupId > 0)) .ForMember(type => type.PropertyGroupId, expression => expression.MapFrom(display => new Lazy(() => display.GroupId, false))) @@ -205,7 +205,7 @@ namespace Umbraco.Web.Models.Mapping CreateMap() .MapBaseContentTypeSaveToDisplay(); - + CreateMap() .MapBaseContentTypeSaveToDisplay() .ForMember(dto => dto.AllowedTemplates, expression => expression.Ignore()) @@ -280,4 +280,4 @@ namespace Umbraco.Web.Models.Mapping } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/Mapping/ContentTypeUdiResolver.cs b/src/Umbraco.Web/Models/Mapping/ContentTypeUdiResolver.cs index dd57c9c317..b819a38064 100644 --- a/src/Umbraco.Web/Models/Mapping/ContentTypeUdiResolver.cs +++ b/src/Umbraco.Web/Models/Mapping/ContentTypeUdiResolver.cs @@ -1,4 +1,4 @@ -using Umbraco.Core; +using Umbraco.Core; using Umbraco.Core.Models; namespace Umbraco.Web.Models.Mapping @@ -19,4 +19,4 @@ namespace Umbraco.Web.Models.Mapping ? Constants.UdiEntityType.MediaType : Constants.UdiEntityType.DocumentType, source.Key); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/Mapping/CreatorResolver.cs b/src/Umbraco.Web/Models/Mapping/CreatorResolver.cs index fc5291bca6..781b93cc2a 100644 --- a/src/Umbraco.Web/Models/Mapping/CreatorResolver.cs +++ b/src/Umbraco.Web/Models/Mapping/CreatorResolver.cs @@ -23,4 +23,4 @@ namespace Umbraco.Web.Models.Mapping return Mapper.Map(source.GetWriterProfile(_userService)); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/Mapping/DashboardProfile.cs b/src/Umbraco.Web/Models/Mapping/DashboardProfile.cs index f23e6def40..4d5156f2a6 100644 --- a/src/Umbraco.Web/Models/Mapping/DashboardProfile.cs +++ b/src/Umbraco.Web/Models/Mapping/DashboardProfile.cs @@ -17,4 +17,4 @@ namespace Umbraco.Web.Models.Mapping .ForMember(x => x.RedirectId, expression => expression.MapFrom(item => item.Key)); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/Mapping/DataTypeProfile.cs b/src/Umbraco.Web/Models/Mapping/DataTypeProfile.cs index 35e45b32d0..c46498ecdd 100644 --- a/src/Umbraco.Web/Models/Mapping/DataTypeProfile.cs +++ b/src/Umbraco.Web/Models/Mapping/DataTypeProfile.cs @@ -124,4 +124,4 @@ namespace Umbraco.Web.Models.Mapping }); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/Mapping/DatabaseTypeResolver.cs b/src/Umbraco.Web/Models/Mapping/DatabaseTypeResolver.cs index d456067655..d7ab7a912b 100644 --- a/src/Umbraco.Web/Models/Mapping/DatabaseTypeResolver.cs +++ b/src/Umbraco.Web/Models/Mapping/DatabaseTypeResolver.cs @@ -20,4 +20,4 @@ namespace Umbraco.Web.Models.Mapping return propertyEditor.ValueEditor.GetDatabaseType(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/Mapping/EntityProfile.cs b/src/Umbraco.Web/Models/Mapping/EntityProfile.cs index 422cfd225d..01579a223c 100644 --- a/src/Umbraco.Web/Models/Mapping/EntityProfile.cs +++ b/src/Umbraco.Web/Models/Mapping/EntityProfile.cs @@ -21,7 +21,7 @@ namespace Umbraco.Web.Models.Mapping var contentTypeUdiResolver = new ContentTypeUdiResolver(); CreateMap() - .ForMember(dest => dest.Udi, opt => opt.MapFrom(src => Udi.Create(UmbracoObjectTypesExtensions.GetUdiType(src.NodeObjectTypeId), src.Key))) + .ForMember(dest => dest.Udi, opt => opt.MapFrom(src => Udi.Create(UmbracoObjectTypesExtensions.GetUdiType(src.NodeObjectTypeId), src.Key))) .ForMember(dest => dest.Icon, opt => opt.MapFrom(src => src.ContentTypeIcon)) .ForMember(dest => dest.Trashed, opt => opt.Ignore()) .ForMember(dest => dest.Alias, opt => opt.Ignore()) @@ -105,10 +105,10 @@ namespace Umbraco.Web.Models.Mapping .ForMember(dest => dest.Trashed, opt => opt.Ignore()) .ForMember(dest => dest.AdditionalData, opt => opt.Ignore()) .AfterMap((src, dest) => - { + { //get the icon if there is one - dest.Icon = src.Fields.ContainsKey(BaseUmbracoIndexer.IconFieldName) - ? src.Fields[BaseUmbracoIndexer.IconFieldName] + dest.Icon = src.Fields.ContainsKey(BaseUmbracoIndexer.IconFieldName) + ? src.Fields[BaseUmbracoIndexer.IconFieldName] : "icon-document"; dest.Name = src.Fields.ContainsKey("nodeName") ? src.Fields["nodeName"] : "[no name]"; @@ -151,7 +151,7 @@ namespace Umbraco.Web.Models.Mapping } } dest.Path = src.Fields.ContainsKey(UmbracoContentIndexer.IndexPathFieldName) ? src.Fields[UmbracoContentIndexer.IndexPathFieldName] : ""; - + if (src.Fields.ContainsKey(LuceneIndexer.NodeTypeAliasFieldName)) { dest.AdditionalData.Add("contentType", src.Fields[LuceneIndexer.NodeTypeAliasFieldName]); @@ -165,4 +165,4 @@ namespace Umbraco.Web.Models.Mapping .ConvertUsing(results => results.Select(Mapper.Map).ToList()); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/Mapping/MacroProfile.cs b/src/Umbraco.Web/Models/Mapping/MacroProfile.cs index 66baacdd21..5179307b74 100644 --- a/src/Umbraco.Web/Models/Mapping/MacroProfile.cs +++ b/src/Umbraco.Web/Models/Mapping/MacroProfile.cs @@ -50,4 +50,4 @@ namespace Umbraco.Web.Models.Mapping }); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/Mapping/MemberDtoPropertiesResolver.cs b/src/Umbraco.Web/Models/Mapping/MemberDtoPropertiesResolver.cs index 3c3d6860b0..0d6478d737 100644 --- a/src/Umbraco.Web/Models/Mapping/MemberDtoPropertiesResolver.cs +++ b/src/Umbraco.Web/Models/Mapping/MemberDtoPropertiesResolver.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using AutoMapper; using Umbraco.Core; @@ -27,4 +27,4 @@ namespace Umbraco.Web.Models.Mapping .Select(Mapper.Map); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/Mapping/MemberProfile.cs b/src/Umbraco.Web/Models/Mapping/MemberProfile.cs index f9093d4bc9..46587590a8 100644 --- a/src/Umbraco.Web/Models/Mapping/MemberProfile.cs +++ b/src/Umbraco.Web/Models/Mapping/MemberProfile.cs @@ -62,7 +62,7 @@ namespace Umbraco.Web.Models.Mapping .ForMember(dest => dest.FailedPasswordAttempts, opt => opt.Ignore()) .ForMember(dest => dest.DeletedDate, opt => opt.Ignore()) //TODO: Support these eventually - .ForMember(dest => dest.PasswordQuestion, opt => opt.Ignore()) + .ForMember(dest => dest.PasswordQuestion, opt => opt.Ignore()) .ForMember(dest => dest.RawPasswordAnswerValue, opt => opt.Ignore()); //FROM IMember TO MediaItemDisplay @@ -103,7 +103,7 @@ namespace Umbraco.Web.Models.Mapping .ForMember(dest => dest.HasPublishedVersion, opt => opt.Ignore()); //FROM MembershipUser TO MemberBasic - CreateMap() + CreateMap() //we're giving this entity an ID of 0 - we cannot really map it but it needs an id so the system knows it's not a new entity .ForMember(dest => dest.Id, opt => opt.MapFrom(src => int.MaxValue)) .ForMember(dest => dest.Udi, opt => opt.Ignore()) @@ -315,4 +315,4 @@ namespace Umbraco.Web.Models.Mapping return result; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/Mapping/MemberProviderFieldResolver.cs b/src/Umbraco.Web/Models/Mapping/MemberProviderFieldResolver.cs index 587b29c6d8..4325ebd566 100644 --- a/src/Umbraco.Web/Models/Mapping/MemberProviderFieldResolver.cs +++ b/src/Umbraco.Web/Models/Mapping/MemberProviderFieldResolver.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using Umbraco.Core; using Umbraco.Core.Models; using Umbraco.Core.Security; @@ -36,4 +36,4 @@ namespace Umbraco.Web.Models.Mapping } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/Mapping/MemberTabsAndPropertiesResolver.cs b/src/Umbraco.Web/Models/Mapping/MemberTabsAndPropertiesResolver.cs index 222ac46154..b4bfead5e7 100644 --- a/src/Umbraco.Web/Models/Mapping/MemberTabsAndPropertiesResolver.cs +++ b/src/Umbraco.Web/Models/Mapping/MemberTabsAndPropertiesResolver.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using Umbraco.Core; using Umbraco.Core.Models; @@ -73,4 +73,4 @@ namespace Umbraco.Web.Models.Mapping } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/Mapping/MembershipScenarioResolver.cs b/src/Umbraco.Web/Models/Mapping/MembershipScenarioResolver.cs index 508aa3cd6d..98ff68c578 100644 --- a/src/Umbraco.Web/Models/Mapping/MembershipScenarioResolver.cs +++ b/src/Umbraco.Web/Models/Mapping/MembershipScenarioResolver.cs @@ -1,4 +1,4 @@ -using System; +using System; using Umbraco.Core; using Umbraco.Core.Models; using Umbraco.Core.Models.Membership; @@ -30,4 +30,4 @@ namespace Umbraco.Web.Models.Mapping : MembershipScenario.StandaloneCustomProvider; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/Mapping/OwnerResolver.cs b/src/Umbraco.Web/Models/Mapping/OwnerResolver.cs index dd87942dc1..facaa91377 100644 --- a/src/Umbraco.Web/Models/Mapping/OwnerResolver.cs +++ b/src/Umbraco.Web/Models/Mapping/OwnerResolver.cs @@ -25,4 +25,4 @@ namespace Umbraco.Web.Models.Mapping return Mapper.Map(source.GetCreatorProfile(_userService)); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/Mapping/PreValueDisplayResolver.cs b/src/Umbraco.Web/Models/Mapping/PreValueDisplayResolver.cs index 18b1c477f4..fb7da2b7a4 100644 --- a/src/Umbraco.Web/Models/Mapping/PreValueDisplayResolver.cs +++ b/src/Umbraco.Web/Models/Mapping/PreValueDisplayResolver.cs @@ -25,12 +25,12 @@ namespace Umbraco.Web.Models.Mapping /// Maps pre-values in the dictionary to the values for the fields /// /// - /// + /// internal static void MapPreValueValuesToPreValueFields(PreValueFieldDisplay[] fields, IDictionary preValues) { if (fields == null) throw new ArgumentNullException("fields"); if (preValues == null) throw new ArgumentNullException("preValues"); - //now we need to wire up the pre-values values with the actual fields defined + //now we need to wire up the pre-values values with the actual fields defined foreach (var field in fields) { var found = preValues.Any(x => x.Key.InvariantEquals(field.Key)); @@ -73,4 +73,4 @@ namespace Umbraco.Web.Models.Mapping return result; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/Mapping/PropertyGroupDisplayResolver.cs b/src/Umbraco.Web/Models/Mapping/PropertyGroupDisplayResolver.cs index 799b576fd9..ba165f44b4 100644 --- a/src/Umbraco.Web/Models/Mapping/PropertyGroupDisplayResolver.cs +++ b/src/Umbraco.Web/Models/Mapping/PropertyGroupDisplayResolver.cs @@ -7,7 +7,7 @@ namespace Umbraco.Web.Models.Mapping { internal class PropertyGroupDisplayResolver where TSource : ContentTypeSave - where TPropertyTypeDestination : PropertyTypeDisplay + where TPropertyTypeDestination : PropertyTypeDisplay where TPropertyTypeSource : PropertyTypeBasic { public IEnumerable> Resolve(TSource source) @@ -15,4 +15,4 @@ namespace Umbraco.Web.Models.Mapping return source.Groups.Select(Mapper.Map>); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/Mapping/PropertyTypeGroupResolver.cs b/src/Umbraco.Web/Models/Mapping/PropertyTypeGroupResolver.cs index 5255b239b7..47bc936293 100644 --- a/src/Umbraco.Web/Models/Mapping/PropertyTypeGroupResolver.cs +++ b/src/Umbraco.Web/Models/Mapping/PropertyTypeGroupResolver.cs @@ -81,7 +81,7 @@ namespace Umbraco.Web.Models.Mapping group.Properties = MapProperties(tab.PropertyTypes, source, tab.Id, false); groups.Add(group); - } + } // add groups inherited through composition var localGroupIds = groups.Select(x => x.Id).ToArray(); @@ -92,7 +92,7 @@ namespace Umbraco.Web.Models.Mapping // get the content type that defines this group var definingContentType = GetContentTypeForPropertyGroup(source, tab.Id); - if (definingContentType == null) + if (definingContentType == null) throw new Exception("PropertyGroup with id=" + tab.Id + " was not found on any of the content type's compositions."); var group = new PropertyGroupDisplay @@ -135,11 +135,11 @@ namespace Umbraco.Web.Models.Mapping { var genericTab = new PropertyGroupDisplay { - Id = PropertyGroupBasic.GenericPropertiesGroupId, + Id = PropertyGroupBasic.GenericPropertiesGroupId, Name = "Generic properties", - ContentTypeId = source.Id, + ContentTypeId = source.Id, SortOrder = 999, - Inherited = false, + Inherited = false, Properties = genericProperties }; groups.Add(genericTab); @@ -201,7 +201,7 @@ namespace Umbraco.Web.Models.Mapping var propertyEditor = _propertyEditors[p.PropertyEditorAlias]; var preValues = _dataTypeService.GetPreValuesCollectionByDataTypeId(p.DataTypeDefinitionId); - if (propertyEditor == null) + if (propertyEditor == null) throw new InvalidOperationException("No property editor could be resolved with the alias: " + p.PropertyEditorAlias + ", ensure all packages are installed correctly."); mappedProperties.Add(new TPropertyType diff --git a/src/Umbraco.Web/Models/Mapping/RelationProfile.cs b/src/Umbraco.Web/Models/Mapping/RelationProfile.cs index 629ee17751..9047d99aea 100644 --- a/src/Umbraco.Web/Models/Mapping/RelationProfile.cs +++ b/src/Umbraco.Web/Models/Mapping/RelationProfile.cs @@ -1,4 +1,4 @@ -using AutoMapper; +using AutoMapper; using Umbraco.Core.Models; using Relation = Umbraco.Web.Models.ContentEditing.Relation; using RelationType = Umbraco.Web.Models.ContentEditing.RelationType; @@ -16,4 +16,4 @@ namespace Umbraco.Web.Models.Mapping CreateMap(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/Mapping/SectionProfile.cs b/src/Umbraco.Web/Models/Mapping/SectionProfile.cs index c7ee644235..78d5e40675 100644 --- a/src/Umbraco.Web/Models/Mapping/SectionProfile.cs +++ b/src/Umbraco.Web/Models/Mapping/SectionProfile.cs @@ -20,4 +20,4 @@ namespace Umbraco.Web.Models.Mapping .ReverseMap(); //backwards too! } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/Mapping/TabProfile.cs b/src/Umbraco.Web/Models/Mapping/TabProfile.cs index b6c36764c2..6e05d775f1 100644 --- a/src/Umbraco.Web/Models/Mapping/TabProfile.cs +++ b/src/Umbraco.Web/Models/Mapping/TabProfile.cs @@ -10,4 +10,4 @@ namespace Umbraco.Web.Models.Mapping CreateMap(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/Mapping/UserProfile.cs b/src/Umbraco.Web/Models/Mapping/UserProfile.cs index bdfe82bfd7..d0b1dd6d87 100644 --- a/src/Umbraco.Web/Models/Mapping/UserProfile.cs +++ b/src/Umbraco.Web/Models/Mapping/UserProfile.cs @@ -55,9 +55,9 @@ namespace Umbraco.Web.Models.Mapping .ForMember(detail => detail.Username, opt => opt.MapFrom(user => user.Username)) .ForMember(detail => detail.Culture, opt => opt.MapFrom(user => user.GetUserCulture(_textService))) .ForMember(detail => detail.SessionId, opt => opt.MapFrom(user => user.SecurityStamp.IsNullOrWhiteSpace() ? Guid.NewGuid().ToString("N") : user.SecurityStamp)); - - } - + + } + private static int GetIntId(object id) { var result = id.TryConvertTo(); @@ -67,7 +67,7 @@ namespace Umbraco.Web.Models.Mapping "Cannot convert the profile to a " + typeof(UserDetail).Name + " object since the id is not an integer"); } return result.Result; - } - + } + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/PackageInstallModel.cs b/src/Umbraco.Web/Models/PackageInstallModel.cs index f903fc1880..729610e6bb 100644 --- a/src/Umbraco.Web/Models/PackageInstallModel.cs +++ b/src/Umbraco.Web/Models/PackageInstallModel.cs @@ -24,6 +24,6 @@ namespace Umbraco.Web.Models [DataMember(Name = "zipFilePath")] public string ZipFilePath { get; set; } - + } } diff --git a/src/Umbraco.Web/Models/PackageInstallResult.cs b/src/Umbraco.Web/Models/PackageInstallResult.cs index bb76bc663b..91b19cda14 100644 --- a/src/Umbraco.Web/Models/PackageInstallResult.cs +++ b/src/Umbraco.Web/Models/PackageInstallResult.cs @@ -11,4 +11,4 @@ namespace Umbraco.Web.Models [DataMember(Name = "postInstallationPath")] public string PostInstallationPath { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/PartialViewMacroModel.cs b/src/Umbraco.Web/Models/PartialViewMacroModel.cs index 36ecb7ef6c..14a1b8ee9c 100644 --- a/src/Umbraco.Web/Models/PartialViewMacroModel.cs +++ b/src/Umbraco.Web/Models/PartialViewMacroModel.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel; using Umbraco.Core.Models; @@ -33,12 +33,12 @@ namespace Umbraco.Web.Models MacroParameters = macroParams; } - [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete("Use the Content property instead")] - public IPublishedContent CurrentPage - { - get { return Content; } - } + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Use the Content property instead")] + public IPublishedContent CurrentPage + { + get { return Content; } + } public IPublishedContent Content { get; private set; } public string MacroName { get; private set; } @@ -47,4 +47,4 @@ namespace Umbraco.Web.Models public IDictionary MacroParameters { get; private set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/PartialViewMacroModelExtensions.cs b/src/Umbraco.Web/Models/PartialViewMacroModelExtensions.cs index 71c3462bf8..9a74a1db31 100644 --- a/src/Umbraco.Web/Models/PartialViewMacroModelExtensions.cs +++ b/src/Umbraco.Web/Models/PartialViewMacroModelExtensions.cs @@ -13,10 +13,10 @@ namespace Umbraco.Web.Models /// /// /// - /// Parameter value if available, the default value that was passed otherwise. + /// Parameter value if available, the default value that was passed otherwise. public static T GetParameterValue(this PartialViewMacroModel partialViewMacroModel, string parameterAlias, T defaultValue) { - if (partialViewMacroModel.MacroParameters.ContainsKey(parameterAlias) == false || string.IsNullOrEmpty(partialViewMacroModel.MacroParameters[parameterAlias].ToString())) + if (partialViewMacroModel.MacroParameters.ContainsKey(parameterAlias) == false || string.IsNullOrEmpty(partialViewMacroModel.MacroParameters[parameterAlias].ToString())) return defaultValue; var attempt = partialViewMacroModel.MacroParameters[parameterAlias].TryConvertTo(typeof(T)); @@ -24,12 +24,12 @@ namespace Umbraco.Web.Models return attempt.Success ? (T) attempt.Result : defaultValue; } - /// + /// /// Attempt to get a Macro parameter from a PartialViewMacroModel /// /// /// - /// Parameter value if available, the default value for the type otherwise. + /// Parameter value if available, the default value for the type otherwise. public static T GetParameterValue(this PartialViewMacroModel partialViewMacroModel, string parameterAlias) { return partialViewMacroModel.GetParameterValue(parameterAlias, default(T)); diff --git a/src/Umbraco.Web/Models/PasswordChangedModel.cs b/src/Umbraco.Web/Models/PasswordChangedModel.cs index c81cdffb46..64fd1e7351 100644 --- a/src/Umbraco.Web/Models/PasswordChangedModel.cs +++ b/src/Umbraco.Web/Models/PasswordChangedModel.cs @@ -17,4 +17,4 @@ namespace Umbraco.Web.Models /// public string ResetPassword { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/PostRedirectModel.cs b/src/Umbraco.Web/Models/PostRedirectModel.cs index ed8176cc5f..e04584704d 100644 --- a/src/Umbraco.Web/Models/PostRedirectModel.cs +++ b/src/Umbraco.Web/Models/PostRedirectModel.cs @@ -1,7 +1,7 @@ namespace Umbraco.Web.Models { /// - /// A base model containing a value to indicate to Umbraco where to redirect to after Posting if + /// A base model containing a value to indicate to Umbraco where to redirect to after Posting if /// a developer doesn't want the controller to redirect to the current Umbraco page - which is the default. /// public class PostRedirectModel @@ -12,4 +12,4 @@ /// public string RedirectUrl { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/PublishedContentBase.cs b/src/Umbraco.Web/Models/PublishedContentBase.cs index ba54203685..1dac635a0a 100644 --- a/src/Umbraco.Web/Models/PublishedContentBase.cs +++ b/src/Umbraco.Web/Models/PublishedContentBase.cs @@ -12,8 +12,8 @@ namespace Umbraco.Web.Models { /// /// Provide an abstract base class for IPublishedContent implementations. - /// - /// This base class does which (a) consitently resolves and caches the Url, (b) provides an implementation + /// + /// This base class does which (a) consitently resolves and caches the Url, (b) provides an implementation /// for this[alias], and (c) provides basic content set management. [DebuggerDisplay("Content Id: {Id}, Name: {Name}")] public abstract class PublishedContentBase : IPublishedContent @@ -22,96 +22,96 @@ namespace Umbraco.Web.Models private string _url; - /// - /// Gets the url of the content. - /// - /// - /// If this content is Content, the url that is returned is the one computed by the NiceUrlProvider, otherwise if - /// this content is Media, the url returned is the value found in the 'umbracoFile' property. - /// - public virtual string Url - { - get - { - // should be thread-safe although it won't prevent url from being resolved more than once - if (_url != null) - return _url; + /// + /// Gets the url of the content. + /// + /// + /// If this content is Content, the url that is returned is the one computed by the NiceUrlProvider, otherwise if + /// this content is Media, the url returned is the value found in the 'umbracoFile' property. + /// + public virtual string Url + { + get + { + // should be thread-safe although it won't prevent url from being resolved more than once + if (_url != null) + return _url; - switch (ItemType) - { - case PublishedItemType.Content: - if (UmbracoContext.Current == null) - throw new InvalidOperationException( - "Cannot resolve a Url for a content item when UmbracoContext.Current is null."); - if (UmbracoContext.Current.UrlProvider == null) - throw new InvalidOperationException( - "Cannot resolve a Url for a content item when UmbracoContext.Current.UrlProvider is null."); - _url = UmbracoContext.Current.UrlProvider.GetUrl(Id); - break; - case PublishedItemType.Media: - var prop = GetProperty(Constants.Conventions.Media.File); - if (prop == null || prop.Value == null) - { - _url = string.Empty; - return _url; - } + switch (ItemType) + { + case PublishedItemType.Content: + if (UmbracoContext.Current == null) + throw new InvalidOperationException( + "Cannot resolve a Url for a content item when UmbracoContext.Current is null."); + if (UmbracoContext.Current.UrlProvider == null) + throw new InvalidOperationException( + "Cannot resolve a Url for a content item when UmbracoContext.Current.UrlProvider is null."); + _url = UmbracoContext.Current.UrlProvider.GetUrl(Id); + break; + case PublishedItemType.Media: + var prop = GetProperty(Constants.Conventions.Media.File); + if (prop == null || prop.Value == null) + { + _url = string.Empty; + return _url; + } - var propType = ContentType.GetPropertyType(Constants.Conventions.Media.File); + var propType = ContentType.GetPropertyType(Constants.Conventions.Media.File); - //This is a hack - since we now have 2 properties that support a URL: upload and cropper, we need to detect this since we always - // want to return the normal URL and the cropper stores data as json - switch (propType.PropertyEditorAlias) - { - case Constants.PropertyEditors.UploadFieldAlias: - _url = prop.Value.ToString(); - break; - case Constants.PropertyEditors.ImageCropperAlias: - //get the url from the json format + //This is a hack - since we now have 2 properties that support a URL: upload and cropper, we need to detect this since we always + // want to return the normal URL and the cropper stores data as json + switch (propType.PropertyEditorAlias) + { + case Constants.PropertyEditors.UploadFieldAlias: + _url = prop.Value.ToString(); + break; + case Constants.PropertyEditors.ImageCropperAlias: + //get the url from the json format - var stronglyTyped = prop.Value as ImageCropDataSet; - if (stronglyTyped != null) - { + var stronglyTyped = prop.Value as ImageCropDataSet; + if (stronglyTyped != null) + { _url = stronglyTyped.Src; break; } var json = prop.Value as JObject; - if (json != null) - { + if (json != null) + { _url = json.ToObject(new JsonSerializer { Culture = CultureInfo.InvariantCulture, FloatParseHandling = FloatParseHandling.Decimal }).Src; - break; - } + break; + } - _url = prop.Value.ToString(); - break; - } - break; - default: - throw new NotSupportedException(); - } + _url = prop.Value.ToString(); + break; + } + break; + default: + throw new NotSupportedException(); + } - return _url; - } - } + return _url; + } + } - public abstract PublishedItemType ItemType { get; } - public abstract int Id { get; } + public abstract PublishedItemType ItemType { get; } + public abstract int Id { get; } public abstract Guid Key { get; } public abstract int TemplateId { get; } - public abstract int SortOrder { get; } - public abstract string Name { get; } - public abstract string UrlName { get; } - public abstract string DocumentTypeAlias { get; } - public abstract int DocumentTypeId { get; } - public abstract string WriterName { get; } - public abstract string CreatorName { get; } - public abstract int WriterId { get; } - public abstract int CreatorId { get; } - public abstract string Path { get; } - public abstract DateTime CreateDate { get; } - public abstract DateTime UpdateDate { get; } - public abstract Guid Version { get; } - public abstract int Level { get; } + public abstract int SortOrder { get; } + public abstract string Name { get; } + public abstract string UrlName { get; } + public abstract string DocumentTypeAlias { get; } + public abstract int DocumentTypeId { get; } + public abstract string WriterName { get; } + public abstract string CreatorName { get; } + public abstract int WriterId { get; } + public abstract int CreatorId { get; } + public abstract string Path { get; } + public abstract DateTime CreateDate { get; } + public abstract DateTime UpdateDate { get; } + public abstract Guid Version { get; } + public abstract int Level { get; } public abstract bool IsDraft { get; } diff --git a/src/Umbraco.Web/Models/RelatedLink.cs b/src/Umbraco.Web/Models/RelatedLink.cs index 884bdebeef..82c95f2987 100644 --- a/src/Umbraco.Web/Models/RelatedLink.cs +++ b/src/Umbraco.Web/Models/RelatedLink.cs @@ -1,8 +1,8 @@ namespace Umbraco.Web.Models { - public class RelatedLink : RelatedLinkBase - { - public int? Id { get; internal set; } - internal bool IsDeleted { get; set; } - } + public class RelatedLink : RelatedLinkBase + { + public int? Id { get; internal set; } + internal bool IsDeleted { get; set; } + } } diff --git a/src/Umbraco.Web/Models/RelatedLinks.cs b/src/Umbraco.Web/Models/RelatedLinks.cs index afccdfb31f..22cdcd11b6 100644 --- a/src/Umbraco.Web/Models/RelatedLinks.cs +++ b/src/Umbraco.Web/Models/RelatedLinks.cs @@ -27,7 +27,7 @@ namespace Umbraco.Web.Models { return this._propertyData; } - } + } public IEnumerator GetEnumerator() { diff --git a/src/Umbraco.Web/Models/SendCodeViewModel.cs b/src/Umbraco.Web/Models/SendCodeViewModel.cs index 31c6644089..750c55a207 100644 --- a/src/Umbraco.Web/Models/SendCodeViewModel.cs +++ b/src/Umbraco.Web/Models/SendCodeViewModel.cs @@ -19,4 +19,4 @@ namespace Umbraco.Web.Models [DataMember(Name = "provider", IsRequired = true)] public string Provider { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/SetPasswordModel.cs b/src/Umbraco.Web/Models/SetPasswordModel.cs index 02d0e4f901..d3f8cfef6f 100644 --- a/src/Umbraco.Web/Models/SetPasswordModel.cs +++ b/src/Umbraco.Web/Models/SetPasswordModel.cs @@ -13,7 +13,7 @@ namespace Umbraco.Web.Models [Required] [DataMember(Name = "password", IsRequired = true)] public string Password { get; set; } - + [Required] [DataMember(Name = "resetCode", IsRequired = true)] public string ResetCode { get; set; } diff --git a/src/Umbraco.Web/Models/TemplateQuery/Operathor.cs b/src/Umbraco.Web/Models/TemplateQuery/Operathor.cs index 0bfb990b84..561caec362 100644 --- a/src/Umbraco.Web/Models/TemplateQuery/Operathor.cs +++ b/src/Umbraco.Web/Models/TemplateQuery/Operathor.cs @@ -11,4 +11,4 @@ GreaterThan = 7, GreaterThanEqualTo = 8 } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/TemplateQuery/OperathorTerm.cs b/src/Umbraco.Web/Models/TemplateQuery/OperathorTerm.cs index 8f9b4ec4b3..c14e1854aa 100644 --- a/src/Umbraco.Web/Models/TemplateQuery/OperathorTerm.cs +++ b/src/Umbraco.Web/Models/TemplateQuery/OperathorTerm.cs @@ -22,4 +22,4 @@ namespace Umbraco.Web.Models.TemplateQuery public Operathor Operathor { get; set; } public IEnumerable AppliesTo { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/TemplateQuery/QueryCondition.cs b/src/Umbraco.Web/Models/TemplateQuery/QueryCondition.cs index 36593736d3..39caf15775 100644 --- a/src/Umbraco.Web/Models/TemplateQuery/QueryCondition.cs +++ b/src/Umbraco.Web/Models/TemplateQuery/QueryCondition.cs @@ -2,7 +2,7 @@ { public class QueryCondition { - + public PropertyModel Property { get; set; } public OperathorTerm Term { get; set; } public string ConstraintValue { get; set; } @@ -11,7 +11,7 @@ internal static class QueryConditionExtensions { - + public static string BuildTokenizedCondition(this QueryCondition condition, int token) { return condition.BuildConditionString(string.Empty, token); @@ -24,7 +24,7 @@ private static string BuildConditionString(this QueryCondition condition, string prefix, int token = -1) { - + var operand = string.Empty; @@ -88,11 +88,11 @@ if (string.IsNullOrEmpty(value) == false) return value; - + return string.Format("{0}{1}{2}{3}", prefix, condition.Property.Alias, operand, constraintValue); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/TemplateQuery/QueryModel.cs b/src/Umbraco.Web/Models/TemplateQuery/QueryModel.cs index 0b7e27f991..90ee4c2452 100644 --- a/src/Umbraco.Web/Models/TemplateQuery/QueryModel.cs +++ b/src/Umbraco.Web/Models/TemplateQuery/QueryModel.cs @@ -10,4 +10,4 @@ namespace Umbraco.Web.Models.TemplateQuery public SortExpression Sort { get; set; } public int Take { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/TemplateQuery/QueryResultModel.cs b/src/Umbraco.Web/Models/TemplateQuery/QueryResultModel.cs index 13421e1199..a1bda3c4ae 100644 --- a/src/Umbraco.Web/Models/TemplateQuery/QueryResultModel.cs +++ b/src/Umbraco.Web/Models/TemplateQuery/QueryResultModel.cs @@ -2,14 +2,14 @@ namespace Umbraco.Web.Models.TemplateQuery { - + public class QueryResultModel { - + public string QueryExpression { get; set; } public IEnumerable SampleResults { get; set; } public int ResultCount { get; set; } public double ExecutionTime { get; set; } public int Take { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/TemplateQuery/SortExpression.cs b/src/Umbraco.Web/Models/TemplateQuery/SortExpression.cs index 76f42b8a69..46f3afa308 100644 --- a/src/Umbraco.Web/Models/TemplateQuery/SortExpression.cs +++ b/src/Umbraco.Web/Models/TemplateQuery/SortExpression.cs @@ -6,4 +6,4 @@ public string Direction { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/TemplateQuery/SourceModel.cs b/src/Umbraco.Web/Models/TemplateQuery/SourceModel.cs index 828de22759..b26912f113 100644 --- a/src/Umbraco.Web/Models/TemplateQuery/SourceModel.cs +++ b/src/Umbraco.Web/Models/TemplateQuery/SourceModel.cs @@ -5,4 +5,4 @@ public int Id { get; set; } public string Name { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/TemplateQuery/TemplateQueryResult.cs b/src/Umbraco.Web/Models/TemplateQuery/TemplateQueryResult.cs index 376caca7df..a59b0dc2d8 100644 --- a/src/Umbraco.Web/Models/TemplateQuery/TemplateQueryResult.cs +++ b/src/Umbraco.Web/Models/TemplateQuery/TemplateQueryResult.cs @@ -6,4 +6,4 @@ public string Name { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/Trees/ActionMenuItem.cs b/src/Umbraco.Web/Models/Trees/ActionMenuItem.cs index ba6172ba81..77ad9f004b 100644 --- a/src/Umbraco.Web/Models/Trees/ActionMenuItem.cs +++ b/src/Umbraco.Web/Models/Trees/ActionMenuItem.cs @@ -9,10 +9,10 @@ namespace Umbraco.Web.Models.Trees /// /// These types of menu items are rare but they do exist. Things like refresh node simply execute /// JS and don't launch a dialog. - /// + /// /// Each action menu item describes what angular service that it's method exists in and what the method name is. - /// - /// An action menu item must describe the angular service name for which it's method exists. It may also define what the + /// + /// An action menu item must describe the angular service name for which it's method exists. It may also define what the /// method name is that will be called in this service but if one is not specified then we will assume the method name is the /// same as the Type name of the current action menu class. /// @@ -35,8 +35,8 @@ namespace Umbraco.Web.Models.Trees } else { - AdditionalData.Add("jsAction", string.Format("{0}.{1}", attribute.ServiceName, attribute.MethodName)); + AdditionalData.Add("jsAction", string.Format("{0}.{1}", attribute.ServiceName, attribute.MethodName)); } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/Trees/ActionMenuItemAttribute.cs b/src/Umbraco.Web/Models/Trees/ActionMenuItemAttribute.cs index 1bc9d68051..04c4e02452 100644 --- a/src/Umbraco.Web/Models/Trees/ActionMenuItemAttribute.cs +++ b/src/Umbraco.Web/Models/Trees/ActionMenuItemAttribute.cs @@ -36,4 +36,4 @@ namespace Umbraco.Web.Models.Trees public string MethodName { get; } public string ServiceName { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/Trees/ApplicationAttribute.cs b/src/Umbraco.Web/Models/Trees/ApplicationAttribute.cs index 9eba9b31fd..221346cd23 100644 --- a/src/Umbraco.Web/Models/Trees/ApplicationAttribute.cs +++ b/src/Umbraco.Web/Models/Trees/ApplicationAttribute.cs @@ -31,4 +31,4 @@ namespace Umbraco.Web.Models.Trees public string Icon { get; private set; } public int SortOrder { get; private set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/Trees/CreateChildEntity.cs b/src/Umbraco.Web/Models/Trees/CreateChildEntity.cs index bbcfe588ef..6d3856d6c2 100644 --- a/src/Umbraco.Web/Models/Trees/CreateChildEntity.cs +++ b/src/Umbraco.Web/Models/Trees/CreateChildEntity.cs @@ -7,4 +7,4 @@ public sealed class CreateChildEntity : ActionMenuItem { } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/Trees/DisableUser.cs b/src/Umbraco.Web/Models/Trees/DisableUser.cs index b28b2043ab..3602897ac2 100644 --- a/src/Umbraco.Web/Models/Trees/DisableUser.cs +++ b/src/Umbraco.Web/Models/Trees/DisableUser.cs @@ -12,4 +12,4 @@ Icon = "remove"; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/Trees/IApplication.cs b/src/Umbraco.Web/Models/Trees/IApplication.cs index f246960c20..4e9cae43fd 100644 --- a/src/Umbraco.Web/Models/Trees/IApplication.cs +++ b/src/Umbraco.Web/Models/Trees/IApplication.cs @@ -7,4 +7,4 @@ namespace Umbraco.Web.Models.Trees /// public interface IApplication : IDiscoverable { } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/Trees/MenuItem.cs b/src/Umbraco.Web/Models/Trees/MenuItem.cs index 6c7a886eb4..8be1b21f8f 100644 --- a/src/Umbraco.Web/Models/Trees/MenuItem.cs +++ b/src/Umbraco.Web/Models/Trees/MenuItem.cs @@ -38,14 +38,14 @@ namespace Umbraco.Web.Models.Trees SeperatorBefore = false; Icon = legacyMenu.Icon; Action = legacyMenu; - } + } #endregion #region Properties internal IAction Action { get; set; } /// - /// A dictionary to support any additional meta data that should be rendered for the node which is + /// A dictionary to support any additional meta data that should be rendered for the node which is /// useful for custom action commands such as 'create', 'copy', etc... /// /// @@ -70,7 +70,7 @@ namespace Umbraco.Web.Models.Trees public bool SeperatorBefore { get; set; } [DataMember(Name = "cssclass")] - public string Icon { get; set; } + public string Icon { get; set; } #endregion #region Constants @@ -86,8 +86,8 @@ namespace Umbraco.Web.Models.Trees internal const string ActionUrlKey = "actionUrl"; //TODO: some action's want to launch a new window like live editing, we support this in the menu item's metadata with - // a key called: "actionUrlMethod" which can be set to either: Dialog, BlankWindow. Normally this is always set to Dialog - // if a URL is specified in the "actionUrl" metadata. For now I'm not going to implement launching in a blank window, + // a key called: "actionUrlMethod" which can be set to either: Dialog, BlankWindow. Normally this is always set to Dialog + // if a URL is specified in the "actionUrl" metadata. For now I'm not going to implement launching in a blank window, // though would be v-easy, just not sure we want to ever support that? internal const string ActionUrlMethodKey = "actionUrlMethod"; @@ -97,14 +97,14 @@ namespace Umbraco.Web.Models.Trees internal const string ActionViewKey = "actionView"; /// - /// Used to specify the js method to execute for the menu item + /// Used to specify the js method to execute for the menu item /// internal const string JsActionKey = "jsAction"; /// /// Used to specify an angular route to go to for the menu item /// - internal const string ActionRouteKey = "actionRoute"; + internal const string ActionRouteKey = "actionRoute"; #endregion @@ -230,4 +230,4 @@ namespace Umbraco.Web.Models.Trees #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/Trees/MenuItemCollection.cs b/src/Umbraco.Web/Models/Trees/MenuItemCollection.cs index 9130ebc67c..b9d7ede7cb 100644 --- a/src/Umbraco.Web/Models/Trees/MenuItemCollection.cs +++ b/src/Umbraco.Web/Models/Trees/MenuItemCollection.cs @@ -7,19 +7,19 @@ namespace Umbraco.Web.Models.Trees /// A menu item collection for a given tree node /// [DataContract(Name = "menuItems", Namespace = "")] - public class MenuItemCollection + public class MenuItemCollection { private readonly MenuItemList _menuItems = new MenuItemList(); public MenuItemCollection() - { + { } public MenuItemCollection(IEnumerable items) { _menuItems = new MenuItemList(items); } - + /// /// Sets the default menu item alias to be shown when the menu is launched - this is optional and if not set then the menu will just be shown normally. /// @@ -38,7 +38,7 @@ namespace Umbraco.Web.Models.Trees get { return _menuItems; } } - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/Trees/MenuItemList.cs b/src/Umbraco.Web/Models/Trees/MenuItemList.cs index 1f76f297e6..26fb0d2796 100644 --- a/src/Umbraco.Web/Models/Trees/MenuItemList.cs +++ b/src/Umbraco.Web/Models/Trees/MenuItemList.cs @@ -15,12 +15,12 @@ namespace Umbraco.Web.Models.Trees public class MenuItemList : List { public MenuItemList() - { + { } public MenuItemList(IEnumerable items) : base(items) - { + { } /// @@ -113,7 +113,7 @@ namespace Umbraco.Web.Models.Trees } /// - /// + /// /// /// /// @@ -153,7 +153,7 @@ namespace Umbraco.Web.Models.Trees } /// - /// Checks if the IAction type passed in is attributed with LegacyActionMenuItemAttribute and if so + /// Checks if the IAction type passed in is attributed with LegacyActionMenuItemAttribute and if so /// ensures that the correct action metadata is added. /// /// @@ -178,4 +178,4 @@ namespace Umbraco.Web.Models.Trees } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/Trees/RefreshNode.cs b/src/Umbraco.Web/Models/Trees/RefreshNode.cs index eadd0b2a4d..0414a5997a 100644 --- a/src/Umbraco.Web/Models/Trees/RefreshNode.cs +++ b/src/Umbraco.Web/Models/Trees/RefreshNode.cs @@ -5,6 +5,6 @@ /// [ActionMenuItem("umbracoMenuActions")] public sealed class RefreshNode : ActionMenuItem - { + { } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/Trees/SectionRootNode.cs b/src/Umbraco.Web/Models/Trees/SectionRootNode.cs index b89a632368..931cb729fc 100644 --- a/src/Umbraco.Web/Models/Trees/SectionRootNode.cs +++ b/src/Umbraco.Web/Models/Trees/SectionRootNode.cs @@ -10,7 +10,7 @@ namespace Umbraco.Web.Models.Trees /// /// This is required to return the tree data for a given section. Some sections may only contain one tree which means it's section /// root should also display a menu, whereas other sections have multiple trees and the section root shouldn't display a menu. - /// + /// /// The section root also contains an explicit collection of children. /// [DataContract(Name = "node", Namespace = "")] @@ -45,11 +45,11 @@ namespace Umbraco.Web.Models.Trees //default to false IsContainer = false; } - + [DataMember(Name = "isContainer")] public bool IsContainer { get; private set; } [DataMember(Name = "children")] public TreeNodeCollection Children { get; private set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/Trees/TreeNode.cs b/src/Umbraco.Web/Models/Trees/TreeNode.cs index 70c193665b..f17c97f17a 100644 --- a/src/Umbraco.Web/Models/Trees/TreeNode.cs +++ b/src/Umbraco.Web/Models/Trees/TreeNode.cs @@ -27,7 +27,7 @@ namespace Umbraco.Web.Models.Trees internal TreeNode(string nodeId, string parentId, string getChildNodesUrl, string menuUrl) { if (string.IsNullOrWhiteSpace(nodeId)) throw new ArgumentNullOrEmptyException(nameof(nodeId)); - + Id = nodeId; ParentId = parentId; ChildNodesUrl = getChildNodesUrl; @@ -36,8 +36,8 @@ namespace Umbraco.Web.Models.Trees //default Icon = "icon-folder-close"; } - - [DataMember(Name = "parentId", IsRequired = true)] + + [DataMember(Name = "parentId", IsRequired = true)] public new object ParentId { get; set; } /// @@ -45,13 +45,13 @@ namespace Umbraco.Web.Models.Trees /// [DataMember(Name = "hasChildren")] public bool HasChildren { get; set; } - + /// /// The tree nodetype which refers to the type of node rendered in the tree /// [DataMember(Name = "nodeType")] public string NodeType { get; set; } - + /// /// Optional: The Route path for the editor for this node /// @@ -111,7 +111,7 @@ namespace Umbraco.Web.Models.Trees return IOHelper.ResolveUrl("~" + Icon.TrimStart('~')); //legacy icon path - return string.Format("{0}images/umbraco/{1}", GlobalSettings.Path.EnsureEndsWith("/"), Icon); + return string.Format("{0}images/umbraco/{1}", GlobalSettings.Path.EnsureEndsWith("/"), Icon); } } diff --git a/src/Umbraco.Web/Models/Trees/TreeNodeCollection.cs b/src/Umbraco.Web/Models/Trees/TreeNodeCollection.cs index f4a4b048d6..1d43f9a743 100644 --- a/src/Umbraco.Web/Models/Trees/TreeNodeCollection.cs +++ b/src/Umbraco.Web/Models/Trees/TreeNodeCollection.cs @@ -7,4 +7,4 @@ namespace Umbraco.Web.Models.Trees public sealed class TreeNodeCollection : List { } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/Trees/TreeNodeExtensions.cs b/src/Umbraco.Web/Models/Trees/TreeNodeExtensions.cs index ec95098f7b..c29c947b7f 100644 --- a/src/Umbraco.Web/Models/Trees/TreeNodeExtensions.cs +++ b/src/Umbraco.Web/Models/Trees/TreeNodeExtensions.cs @@ -75,4 +75,4 @@ } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/UmbracoProperty.cs b/src/Umbraco.Web/Models/UmbracoProperty.cs index db3c17fcb7..ffef9f431f 100644 --- a/src/Umbraco.Web/Models/UmbracoProperty.cs +++ b/src/Umbraco.Web/Models/UmbracoProperty.cs @@ -18,7 +18,7 @@ namespace Umbraco.Web.Models // If we want to have this as an 'object' with a true type on it, we have to create a custom model binder // for an UmbracoProperty and then bind with the correct type based on the property type for this alias. This // would be a bit long winded and perhaps unnecessary. The reason is because it is always posted as a string anyways - // and when we set this value on the property object that gets sent to the database we do a TryConvertTo to the + // and when we set this value on the property object that gets sent to the database we do a TryConvertTo to the // real type anyways. [DataType(DataType.Text)] @@ -30,7 +30,7 @@ namespace Umbraco.Web.Models //TODO: Perhaps one day we'll ship with our own EditorTempates but for now developers can just render their own inside the view ///// - ///// This can dynamically be set to a custom template name to change + ///// This can dynamically be set to a custom template name to change ///// the editor type for this property ///// //[ReadOnly(true)] diff --git a/src/Umbraco.Web/Models/UnLinkLoginModel.cs b/src/Umbraco.Web/Models/UnLinkLoginModel.cs index 776baf03fc..824fadaf90 100644 --- a/src/Umbraco.Web/Models/UnLinkLoginModel.cs +++ b/src/Umbraco.Web/Models/UnLinkLoginModel.cs @@ -13,4 +13,4 @@ namespace Umbraco.Web.Models [DataMember(Name = "providerKey", IsRequired = true)] public string ProviderKey { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Models/ValidatePasswordResetCodeModel.cs b/src/Umbraco.Web/Models/ValidatePasswordResetCodeModel.cs index 7e30e0881b..152d7460fd 100644 --- a/src/Umbraco.Web/Models/ValidatePasswordResetCodeModel.cs +++ b/src/Umbraco.Web/Models/ValidatePasswordResetCodeModel.cs @@ -11,7 +11,7 @@ namespace Umbraco.Web.Models [Required] [DataMember(Name = "userId", IsRequired = true)] public int UserId { get; set; } - + [Required] [DataMember(Name = "resetCode", IsRequired = true)] public string ResetCode { get; set; } diff --git a/src/Umbraco.Web/Mvc/ActionExecutedEventArgs.cs b/src/Umbraco.Web/Mvc/ActionExecutedEventArgs.cs index aabe7133fe..1c596ff80c 100644 --- a/src/Umbraco.Web/Mvc/ActionExecutedEventArgs.cs +++ b/src/Umbraco.Web/Mvc/ActionExecutedEventArgs.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Web.Mvc; namespace Umbraco.Web.Mvc @@ -11,7 +11,7 @@ namespace Umbraco.Web.Mvc public ActionExecutedEventArgs(Controller controller, object model) { Controller = controller; - Model = model; + Model = model; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Mvc/AdminTokenAuthorizeAttribute.cs b/src/Umbraco.Web/Mvc/AdminTokenAuthorizeAttribute.cs index f21b996037..17b09625ff 100644 --- a/src/Umbraco.Web/Mvc/AdminTokenAuthorizeAttribute.cs +++ b/src/Umbraco.Web/Mvc/AdminTokenAuthorizeAttribute.cs @@ -124,4 +124,4 @@ namespace Umbraco.Web.Mvc } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Mvc/AreaRegistrationExtensions.cs b/src/Umbraco.Web/Mvc/AreaRegistrationExtensions.cs index 4f6d928c23..1ebb593502 100644 --- a/src/Umbraco.Web/Mvc/AreaRegistrationExtensions.cs +++ b/src/Umbraco.Web/Mvc/AreaRegistrationExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Web.Http; using System.Web.Mvc; @@ -55,8 +55,8 @@ namespace Umbraco.Web.Mvc var umbracoArea = GlobalSettings.UmbracoMvcArea; //routes are explicitly named with controller names and IDs - var url = umbracoArea + "/" + - (areaPathPrefix.IsNullOrWhiteSpace() ? "" : areaPathPrefix + "/") + + var url = umbracoArea + "/" + + (areaPathPrefix.IsNullOrWhiteSpace() ? "" : areaPathPrefix + "/") + area.AreaName + "/" + controllerName + "/" + routeTokens; Route controllerPluginRoute; @@ -108,7 +108,7 @@ namespace Umbraco.Web.Mvc //Don't look anywhere else except this namespace! controllerPluginRoute.DataTokens.Add("UseNamespaceFallback", false); - //constraints: only match controllers ending with 'controllerSuffixName' and only match this controller's ID for this route + //constraints: only match controllers ending with 'controllerSuffixName' and only match this controller's ID for this route if (controllerSuffixName.IsNullOrWhiteSpace() == false) { controllerPluginRoute.Constraints = new RouteValueDictionary( @@ -125,4 +125,4 @@ namespace Umbraco.Web.Mvc return controllerPluginRoute; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Mvc/BackOfficeArea.cs b/src/Umbraco.Web/Mvc/BackOfficeArea.cs index 68afc3fc39..fe4a9d6c2b 100644 --- a/src/Umbraco.Web/Mvc/BackOfficeArea.cs +++ b/src/Umbraco.Web/Mvc/BackOfficeArea.cs @@ -19,7 +19,7 @@ namespace Umbraco.Web.Mvc /// /// /// - /// By using the context to register the routes it means that the area is already applied to them all + /// By using the context to register the routes it means that the area is already applied to them all /// and that the namespaces searched for the controllers are ONLY the ones specified. /// public override void RegisterArea(AreaRegistrationContext context) @@ -28,15 +28,15 @@ namespace Umbraco.Web.Mvc "Umbraco_back_office", GlobalSettings.UmbracoMvcArea + "/{action}/{id}", new {controller = "BackOffice", action = "Default", id = UrlParameter.Optional}, - //limit the action/id to only allow characters - this is so this route doesn't hog all other + //limit the action/id to only allow characters - this is so this route doesn't hog all other // routes like: /umbraco/channels/word.aspx, etc... new { - action = @"[a-zA-Z]*", + action = @"[a-zA-Z]*", id = @"[a-zA-Z]*" }, new[] {typeof (BackOfficeController).Namespace}); - + //Create the REST/web/script service routes context.MapRoute( "Umbraco_web_services", @@ -51,4 +51,4 @@ namespace Umbraco.Web.Mvc get { return GlobalSettings.UmbracoMvcArea; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Mvc/Constants.cs b/src/Umbraco.Web/Mvc/Constants.cs index e175ef2ea8..69a22c1545 100644 --- a/src/Umbraco.Web/Mvc/Constants.cs +++ b/src/Umbraco.Web/Mvc/Constants.cs @@ -1,12 +1,12 @@ -namespace Umbraco.Web.Mvc +namespace Umbraco.Web.Mvc { - /// - /// constants - /// + /// + /// constants + /// internal static class Constants { - internal const string ViewLocation = "~/Views"; + internal const string ViewLocation = "~/Views"; - internal const string DataTokenCurrentViewContext = "umbraco-current-view-context"; + internal const string DataTokenCurrentViewContext = "umbraco-current-view-context"; } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Mvc/ContentModelBinder.cs b/src/Umbraco.Web/Mvc/ContentModelBinder.cs index cf55797050..33ea5f84f8 100644 --- a/src/Umbraco.Web/Mvc/ContentModelBinder.cs +++ b/src/Umbraco.Web/Mvc/ContentModelBinder.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Globalization; using System.Linq; using System.Text; @@ -14,17 +14,17 @@ namespace Umbraco.Web.Mvc /// /// Maps view models, supporting mapping to and from any IPublishedContent or IContentModel. /// - public class ContentModelBinder : DefaultModelBinder, IModelBinderProvider + public class ContentModelBinder : DefaultModelBinder, IModelBinderProvider { - /// - /// Binds the model to a value by using the specified controller context and binding context. - /// - /// - /// The bound value. - /// - /// The controller context.The binding context. - public override object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext) - { + /// + /// Binds the model to a value by using the specified controller context and binding context. + /// + /// + /// The bound value. + /// + /// The controller context.The binding context. + public override object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext) + { object model; if (controllerContext.RouteData.DataTokens.TryGetValue(Core.Constants.Web.UmbracoDataToken, out model) == false) return null; @@ -42,10 +42,10 @@ namespace Umbraco.Web.Mvc //if for any reason the model is not either IContentModel or IPublishedContent, then we return since those are the only // types this binder is dealing with. - if ((model is IContentModel) == false && (model is IPublishedContent) == false) return null; + if ((model is IContentModel) == false && (model is IPublishedContent) == false) return null; - return BindModel(model, bindingContext.ModelType); - } + return BindModel(model, bindingContext.ModelType); + } // source is the model that we have // modelType is the type of the model that we need to bind to @@ -115,34 +115,34 @@ namespace Umbraco.Web.Mvc return null; } - private static void ThrowModelBindingException(bool sourceContent, bool modelContent, Type sourceType, Type modelType) - { - var msg = new StringBuilder(); + private static void ThrowModelBindingException(bool sourceContent, bool modelContent, Type sourceType, Type modelType) + { + var msg = new StringBuilder(); - msg.Append("Cannot bind source"); - if (sourceContent) msg.Append(" content"); - msg.Append(" type "); - msg.Append(sourceType.FullName); - msg.Append(" to model"); - if (modelContent) msg.Append(" content"); - msg.Append(" type "); + msg.Append("Cannot bind source"); + if (sourceContent) msg.Append(" content"); + msg.Append(" type "); + msg.Append(sourceType.FullName); + msg.Append(" to model"); + if (modelContent) msg.Append(" content"); + msg.Append(" type "); msg.Append(modelType.FullName); msg.Append("."); // compare FullName for the time being because when upgrading ModelsBuilder, // Umbraco does not know about the new attribute type - later on, can compare // on type directly (ie after v7.4.2). - var sourceAttr = sourceType.Assembly.CustomAttributes.FirstOrDefault(x => + var sourceAttr = sourceType.Assembly.CustomAttributes.FirstOrDefault(x => x.AttributeType.FullName == "Umbraco.ModelsBuilder.PureLiveAssemblyAttribute"); - var modelAttr = modelType.Assembly.CustomAttributes.FirstOrDefault(x => + var modelAttr = modelType.Assembly.CustomAttributes.FirstOrDefault(x => x.AttributeType.FullName == "Umbraco.ModelsBuilder.PureLiveAssemblyAttribute"); // bah.. names are App_Web_all.generated.cs.8f9494c4.jjuvxz55 so they ARE different, fuck! // we cannot compare purely on type.FullName 'cos we might be trying to map Sub to Main = fails! if (sourceAttr != null && modelAttr != null && sourceType.Assembly.GetName().Version.Revision != modelType.Assembly.GetName().Version.Revision) - { - msg.Append(" Types come from two PureLive assemblies with different versions,"); + { + msg.Append(" Types come from two PureLive assemblies with different versions,"); msg.Append(" this usually indicates that the application is in an unstable state."); msg.Append(" The application is restarting now, reload the page and it should work."); var context = HttpContext.Current; @@ -152,8 +152,8 @@ namespace Umbraco.Web.Mvc Current.RestartAppPool(new HttpContextWrapper(context)); } - throw new ModelBindingException(msg.ToString()); - } + throw new ModelBindingException(msg.ToString()); + } public IModelBinder GetBinder(Type modelType) { @@ -168,4 +168,4 @@ namespace Umbraco.Web.Mvc return null; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Mvc/ControllerContextExtensions.cs b/src/Umbraco.Web/Mvc/ControllerContextExtensions.cs index 3dc78a15e2..393b6882c9 100644 --- a/src/Umbraco.Web/Mvc/ControllerContextExtensions.cs +++ b/src/Umbraco.Web/Mvc/ControllerContextExtensions.cs @@ -1,4 +1,4 @@ -using System.Web.Mvc; +using System.Web.Mvc; using Umbraco.Web.Composing; namespace Umbraco.Web.Mvc @@ -35,4 +35,4 @@ namespace Umbraco.Web.Mvc return null; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Mvc/ControllerExtensions.cs b/src/Umbraco.Web/Mvc/ControllerExtensions.cs index 734e60e8f5..b23a9a18d7 100644 --- a/src/Umbraco.Web/Mvc/ControllerExtensions.cs +++ b/src/Umbraco.Web/Mvc/ControllerExtensions.cs @@ -12,7 +12,7 @@ namespace Umbraco.Web.Mvc /// /// /// - internal static string GetControllerName(Type controllerType) + internal static string GetControllerName(Type controllerType) { if (!controllerType.Name.EndsWith("Controller")) { @@ -26,90 +26,90 @@ namespace Umbraco.Web.Mvc /// /// /// - internal static string GetControllerName(this IController controllerInstance) - { - return GetControllerName(controllerInstance.GetType()); - } + internal static string GetControllerName(this IController controllerInstance) + { + return GetControllerName(controllerInstance.GetType()); + } - /// + /// /// Return the controller name from the controller type /// /// /// /// - internal static string GetControllerName() + internal static string GetControllerName() { return GetControllerName(typeof(T)); } - /// - /// This is generally used for proxying to a ChildAction which requires a ViewContext to be setup - /// but since the View isn't actually rendered the IView object is null, however the rest of the - /// properties are filled in. - /// - /// - /// - internal static ViewContext CreateEmptyViewContext(this ControllerBase controller) - { - return new ViewContext - { - Controller = controller, - HttpContext = controller.ControllerContext.HttpContext, - RequestContext = controller.ControllerContext.RequestContext, - RouteData = controller.ControllerContext.RouteData, - TempData = controller.TempData, - ViewData = controller.ViewData - }; - } + /// + /// This is generally used for proxying to a ChildAction which requires a ViewContext to be setup + /// but since the View isn't actually rendered the IView object is null, however the rest of the + /// properties are filled in. + /// + /// + /// + internal static ViewContext CreateEmptyViewContext(this ControllerBase controller) + { + return new ViewContext + { + Controller = controller, + HttpContext = controller.ControllerContext.HttpContext, + RequestContext = controller.ControllerContext.RequestContext, + RouteData = controller.ControllerContext.RouteData, + TempData = controller.TempData, + ViewData = controller.ViewData + }; + } - /// - /// Returns the string output from a ViewResultBase object - /// - /// - /// - /// - internal static string RenderViewResultAsString(this ControllerBase controller, ViewResultBase viewResult) - { - using (var sw = new StringWriter()) - { - controller.EnsureViewObjectDataOnResult(viewResult); + /// + /// Returns the string output from a ViewResultBase object + /// + /// + /// + /// + internal static string RenderViewResultAsString(this ControllerBase controller, ViewResultBase viewResult) + { + using (var sw = new StringWriter()) + { + controller.EnsureViewObjectDataOnResult(viewResult); - var viewContext = new ViewContext(controller.ControllerContext, viewResult.View, viewResult.ViewData, viewResult.TempData, sw); - viewResult.View.Render(viewContext, sw); - foreach (var v in viewResult.ViewEngineCollection) - { - v.ReleaseView(controller.ControllerContext, viewResult.View); - } - return sw.ToString().Trim(); - } - } - - /// - /// Renders the partial view to string. - /// - /// The controller context. - /// Name of the view. - /// The model. - /// true if it is a Partial view, otherwise false for a normal view - /// - internal static string RenderViewToString(this ControllerBase controller, string viewName, object model, bool isPartial = false) - { - if (controller.ControllerContext == null) - throw new ArgumentException("The controller must have an assigned ControllerContext to execute this method."); + var viewContext = new ViewContext(controller.ControllerContext, viewResult.View, viewResult.ViewData, viewResult.TempData, sw); + viewResult.View.Render(viewContext, sw); + foreach (var v in viewResult.ViewEngineCollection) + { + v.ReleaseView(controller.ControllerContext, viewResult.View); + } + return sw.ToString().Trim(); + } + } - controller.ViewData.Model = model; + /// + /// Renders the partial view to string. + /// + /// The controller context. + /// Name of the view. + /// The model. + /// true if it is a Partial view, otherwise false for a normal view + /// + internal static string RenderViewToString(this ControllerBase controller, string viewName, object model, bool isPartial = false) + { + if (controller.ControllerContext == null) + throw new ArgumentException("The controller must have an assigned ControllerContext to execute this method."); - using (var sw = new StringWriter()) - { - var viewResult = !isPartial - ? ViewEngines.Engines.FindView(controller.ControllerContext, viewName, null) - : ViewEngines.Engines.FindPartialView(controller.ControllerContext, viewName); - var viewContext = new ViewContext(controller.ControllerContext, viewResult.View, controller.ViewData, controller.TempData, sw); - viewResult.View.Render(viewContext, sw); - viewResult.ViewEngine.ReleaseView(controller.ControllerContext, viewResult.View); - return sw.GetStringBuilder().ToString(); - } - } + controller.ViewData.Model = model; + + using (var sw = new StringWriter()) + { + var viewResult = !isPartial + ? ViewEngines.Engines.FindView(controller.ControllerContext, viewName, null) + : ViewEngines.Engines.FindPartialView(controller.ControllerContext, viewName); + var viewContext = new ViewContext(controller.ControllerContext, viewResult.View, controller.ViewData, controller.TempData, sw); + viewResult.View.Render(viewContext, sw); + viewResult.ViewEngine.ReleaseView(controller.ControllerContext, viewResult.View); + return sw.GetStringBuilder().ToString(); + } + } /// /// Normally in MVC the way that the View object gets assigned to the result is to Execute the ViewResult, this however @@ -120,7 +120,7 @@ namespace Umbraco.Web.Mvc /// /// private static void EnsureViewObjectDataOnResult(this ControllerBase controller, ViewResultBase result) - { + { if (result.View != null) return; if (string.IsNullOrEmpty(result.ViewName)) diff --git a/src/Umbraco.Web/Mvc/ControllerFactoryExtensions.cs b/src/Umbraco.Web/Mvc/ControllerFactoryExtensions.cs index 86f24ac452..862736287c 100644 --- a/src/Umbraco.Web/Mvc/ControllerFactoryExtensions.cs +++ b/src/Umbraco.Web/Mvc/ControllerFactoryExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Web.Mvc; using System.Web.Routing; @@ -23,16 +23,16 @@ namespace Umbraco.Web.Mvc var controllerFactory = factory as MasterControllerFactory; if (controllerFactory != null) { - return controllerFactory.GetControllerTypeInternal(requestContext, controllerName); + return controllerFactory.GetControllerTypeInternal(requestContext, controllerName); } //we have no choice but to instantiate the controller var instance = factory.CreateController(requestContext, controllerName); if (instance != null) { - return instance.GetType(); + return instance.GetType(); } return null; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Mvc/DisableBrowserCacheAttribute.cs b/src/Umbraco.Web/Mvc/DisableBrowserCacheAttribute.cs index c1c2186171..bcf7b34b4f 100644 --- a/src/Umbraco.Web/Mvc/DisableBrowserCacheAttribute.cs +++ b/src/Umbraco.Web/Mvc/DisableBrowserCacheAttribute.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Web; using System.Web.Mvc; @@ -20,12 +20,12 @@ namespace Umbraco.Web.Mvc return; } - filterContext.HttpContext.Response.Cache.SetCacheability(HttpCacheability.NoCache); - filterContext.HttpContext.Response.Cache.SetMaxAge(TimeSpan.Zero); + filterContext.HttpContext.Response.Cache.SetCacheability(HttpCacheability.NoCache); + filterContext.HttpContext.Response.Cache.SetMaxAge(TimeSpan.Zero); filterContext.HttpContext.Response.Cache.SetRevalidation(HttpCacheRevalidation.AllCaches); filterContext.HttpContext.Response.Cache.SetNoStore(); filterContext.HttpContext.Response.AddHeader("Pragma", "no-cache"); filterContext.HttpContext.Response.Cache.SetExpires(new DateTime(1990, 1, 1, 0, 0, 0)); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Mvc/DisableClientCacheAttribute.cs b/src/Umbraco.Web/Mvc/DisableClientCacheAttribute.cs index c266b1ed5e..a874d93d7a 100644 --- a/src/Umbraco.Web/Mvc/DisableClientCacheAttribute.cs +++ b/src/Umbraco.Web/Mvc/DisableClientCacheAttribute.cs @@ -6,7 +6,7 @@ namespace Umbraco.Web.Mvc { /// /// Will ensure that client-side cache does not occur by sending the correct response headers - /// + /// public class DisableClientCacheAttribute : ActionFilterAttribute { public override void OnResultExecuting(ResultExecutingContext filterContext) @@ -23,4 +23,4 @@ namespace Umbraco.Web.Mvc base.OnResultExecuting(filterContext); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Mvc/EnsurePartialViewMacroViewContextFilterAttribute.cs b/src/Umbraco.Web/Mvc/EnsurePartialViewMacroViewContextFilterAttribute.cs index 625b67b2b2..34b857dfb4 100644 --- a/src/Umbraco.Web/Mvc/EnsurePartialViewMacroViewContextFilterAttribute.cs +++ b/src/Umbraco.Web/Mvc/EnsurePartialViewMacroViewContextFilterAttribute.cs @@ -1,19 +1,19 @@ -using System.IO; +using System.IO; using System.Web.Mvc; namespace Umbraco.Web.Mvc { /// - /// This is a special filter which is required for the RTE to be able to render Partial View Macros that + /// This is a special filter which is required for the RTE to be able to render Partial View Macros that /// contain forms when the RTE value is resolved outside of an MVC view being rendered /// /// /// The entire way that we support partial view macros that contain forms isn't really great, these forms /// need to be executed as ChildActions so that the ModelState,ViewData,TempData get merged into that action /// so the form can show errors, viewdata, etc... - /// Under normal circumstances, macros will be rendered after a ViewContext is created but in some cases + /// Under normal circumstances, macros will be rendered after a ViewContext is created but in some cases /// developers will resolve the RTE value in the controller, in this case the Form won't be rendered correctly - /// with merged ModelState from the controller because the special DataToken hasn't been set yet (which is + /// with merged ModelState from the controller because the special DataToken hasn't been set yet (which is /// normally done in the UmbracoViewPageOfModel when a real ViewContext is available. /// So we need to detect if the currently rendering controller is IRenderController and if so we'll ensure that /// this DataToken exists before the action executes in case the developer resolves an RTE value that contains @@ -38,7 +38,7 @@ namespace Umbraco.Web.Mvc /// /// Ensures that the custom ViewContext datatoken is set after the RenderController action is invoked, - /// this ensures that any custom ModelState that may have been added in the RenderController itself is + /// this ensures that any custom ModelState that may have been added in the RenderController itself is /// passed onwards in case it is required when rendering a PartialViewMacro with a form /// /// The filter context. @@ -70,4 +70,4 @@ namespace Umbraco.Web.Mvc } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Mvc/EnsurePublishedContentRequestAttribute.cs b/src/Umbraco.Web/Mvc/EnsurePublishedContentRequestAttribute.cs index 3d1c731818..63aa87db53 100644 --- a/src/Umbraco.Web/Mvc/EnsurePublishedContentRequestAttribute.cs +++ b/src/Umbraco.Web/Mvc/EnsurePublishedContentRequestAttribute.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Web.Mvc; using Umbraco.Web.Routing; using Umbraco.Core; @@ -15,7 +15,7 @@ namespace Umbraco.Web.Mvc /// /// This is inspired from this discussion: /// http://our.umbraco.org/forum/developers/extending-umbraco/41367-Umbraco-6-MVC-Custom-MVC-Route?p=3 - /// + /// /// which is based on custom routing found here: /// http://shazwazza.com/post/Custom-MVC-routing-in-Umbraco /// @@ -79,7 +79,7 @@ namespace Umbraco.Web.Mvc /// /// Exposes an UmbracoHelper /// - protected UmbracoHelper Umbraco => _helper + protected UmbracoHelper Umbraco => _helper ?? (_helper = new UmbracoHelper(Current.UmbracoContext, Current.Services, Current.ApplicationCache)); public override void OnActionExecuted(ActionExecutedContext filterContext) @@ -97,7 +97,7 @@ namespace Umbraco.Web.Mvc } /// - /// This assigns the published content to the request, developers can override this to specify + /// This assigns the published content to the request, developers can override this to specify /// any other custom attributes required. /// /// @@ -130,4 +130,4 @@ namespace Umbraco.Web.Mvc FacadeRouter.PrepareRequest(request); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Mvc/FilteredControllerFactoryCollection.cs b/src/Umbraco.Web/Mvc/FilteredControllerFactoryCollection.cs index 62c7ec7cd0..1c2d140379 100644 --- a/src/Umbraco.Web/Mvc/FilteredControllerFactoryCollection.cs +++ b/src/Umbraco.Web/Mvc/FilteredControllerFactoryCollection.cs @@ -5,7 +5,7 @@ namespace Umbraco.Web.Mvc { public class FilteredControllerFactoryCollection : BuilderCollectionBase { - public FilteredControllerFactoryCollection(IEnumerable items) + public FilteredControllerFactoryCollection(IEnumerable items) : base(items) { } } diff --git a/src/Umbraco.Web/Mvc/FilteredControllerFactoryCollectionBuilder.cs b/src/Umbraco.Web/Mvc/FilteredControllerFactoryCollectionBuilder.cs index 47d4d5ee51..930b5a1eb2 100644 --- a/src/Umbraco.Web/Mvc/FilteredControllerFactoryCollectionBuilder.cs +++ b/src/Umbraco.Web/Mvc/FilteredControllerFactoryCollectionBuilder.cs @@ -5,7 +5,7 @@ namespace Umbraco.Web.Mvc { public class FilteredControllerFactoryCollectionBuilder : OrderedCollectionBuilderBase { - public FilteredControllerFactoryCollectionBuilder(IServiceContainer container) + public FilteredControllerFactoryCollectionBuilder(IServiceContainer container) : base(container) { } diff --git a/src/Umbraco.Web/Mvc/HtmlTagWrapper.cs b/src/Umbraco.Web/Mvc/HtmlTagWrapper.cs index 7a187afb57..fd8586ff48 100644 --- a/src/Umbraco.Web/Mvc/HtmlTagWrapper.cs +++ b/src/Umbraco.Web/Mvc/HtmlTagWrapper.cs @@ -10,20 +10,20 @@ namespace Umbraco.Web.Mvc public class HtmlTagWrapper : IHtmlTagWrapper, IHtmlString { public HtmlTagWrapper Parent; - - private readonly List _children; - public IEnumerable Children - { - get { return _children; } - } - private List> _attributes; - public IEnumerable> Attributes - { - get { return _attributes; } - } + private readonly List _children; + public IEnumerable Children + { + get { return _children; } + } - public void ReflectAttributesFromAnonymousType(List> newAttributes) + private List> _attributes; + public IEnumerable> Attributes + { + get { return _attributes; } + } + + public void ReflectAttributesFromAnonymousType(List> newAttributes) { List> mergedAttributes = newAttributes @@ -32,7 +32,7 @@ namespace Umbraco.Web.Mvc .Select(g => new KeyValuePair(g.Key, string.Join(" ", g.ToArray()))) .ToList(); - _attributes = mergedAttributes; + _attributes = mergedAttributes; } public void ReflectAttributesFromAnonymousType(object anonymousAttributes) { @@ -59,9 +59,9 @@ namespace Umbraco.Web.Mvc public HtmlTagWrapper(string tag) { this.Tag = tag; - this._children = new List(); + this._children = new List(); this.CssClasses = new List(); - this._attributes = new List>(); + this._attributes = new List>(); this.Visible = true; } public HtmlString Write() @@ -150,44 +150,44 @@ namespace Umbraco.Web.Mvc if (!string.IsNullOrWhiteSpace(value)) { var newAttributes = new List> {new KeyValuePair(name, value)}; - this.ReflectAttributesFromAnonymousType(newAttributes); + this.ReflectAttributesFromAnonymousType(newAttributes); } else { var existingKey = this._attributes.Find(item => item.Key == name); - _attributes.Remove(existingKey); + _attributes.Remove(existingKey); } return this; } public HtmlTagWrapper AddChild(IHtmlTagWrapper newChild) { - _children.Add(newChild); + _children.Add(newChild); return this; } public HtmlTagWrapper AddChildren(params IHtmlTagWrapper[] collection) { - _children.AddRange(collection); + _children.AddRange(collection); return this; } public HtmlTagWrapper AddChild(string text) { - _children.Add(new HtmlTagWrapperTextNode(text)); + _children.Add(new HtmlTagWrapperTextNode(text)); return this; } public HtmlTagWrapper AddChildAt(int index, IHtmlTagWrapper newChild) { - _children.Insert(index, newChild); + _children.Insert(index, newChild); return this; } public HtmlTagWrapper AddChildAt(int index, string text) { - _children.Insert(index, new HtmlTagWrapperTextNode(text)); + _children.Insert(index, new HtmlTagWrapperTextNode(text)); return this; } public HtmlTagWrapper AddChildrenAt(int index, params IHtmlTagWrapper[] collection) { - _children.InsertRange(index, collection); + _children.InsertRange(index, collection); return this; } public HtmlTagWrapper RemoveChildAt(int index) diff --git a/src/Umbraco.Web/Mvc/HtmlTagWrapperTextNode.cs b/src/Umbraco.Web/Mvc/HtmlTagWrapperTextNode.cs index d6d82512d0..c5ee99b1b4 100644 --- a/src/Umbraco.Web/Mvc/HtmlTagWrapperTextNode.cs +++ b/src/Umbraco.Web/Mvc/HtmlTagWrapperTextNode.cs @@ -4,7 +4,7 @@ namespace Umbraco.Web.Mvc { public class HtmlTagWrapperTextNode : IHtmlTagWrapper { - public string Content { get; private set; } + public string Content { get; private set; } public HtmlTagWrapperTextNode(string content) { this.Content = content; diff --git a/src/Umbraco.Web/Mvc/IFilteredControllerFactory.cs b/src/Umbraco.Web/Mvc/IFilteredControllerFactory.cs index 214532b6e4..82b16443c8 100644 --- a/src/Umbraco.Web/Mvc/IFilteredControllerFactory.cs +++ b/src/Umbraco.Web/Mvc/IFilteredControllerFactory.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using System.Web.Mvc; using System.Web.Routing; @@ -6,15 +6,15 @@ using System.Web.Routing; namespace Umbraco.Web.Mvc { - public interface IFilteredControllerFactory : IControllerFactory - { - /// - /// Determines whether this instance can handle the specified request. - /// - /// The request. - /// true if this instance can handle the specified request; otherwise, false. - /// - bool CanHandle(RequestContext request); + public interface IFilteredControllerFactory : IControllerFactory + { + /// + /// Determines whether this instance can handle the specified request. + /// + /// The request. + /// true if this instance can handle the specified request; otherwise, false. + /// + bool CanHandle(RequestContext request); - } -} \ No newline at end of file + } +} diff --git a/src/Umbraco.Web/Mvc/IHtmlTagWrapper.cs b/src/Umbraco.Web/Mvc/IHtmlTagWrapper.cs index 2535b78d90..b37cf96d97 100644 --- a/src/Umbraco.Web/Mvc/IHtmlTagWrapper.cs +++ b/src/Umbraco.Web/Mvc/IHtmlTagWrapper.cs @@ -2,8 +2,8 @@ namespace Umbraco.Web.Mvc { - public interface IHtmlTagWrapper - { - void WriteToHtmlTextWriter(HtmlTextWriter html); - } + public interface IHtmlTagWrapper + { + void WriteToHtmlTextWriter(HtmlTextWriter html); + } } diff --git a/src/Umbraco.Web/Mvc/IRenderController.cs b/src/Umbraco.Web/Mvc/IRenderController.cs index e4303e06e5..103a484869 100644 --- a/src/Umbraco.Web/Mvc/IRenderController.cs +++ b/src/Umbraco.Web/Mvc/IRenderController.cs @@ -1,4 +1,4 @@ -using System.Web.Mvc; +using System.Web.Mvc; namespace Umbraco.Web.Mvc { @@ -7,6 +7,6 @@ namespace Umbraco.Web.Mvc /// public interface IRenderController : IController { - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Mvc/IRenderMvcController.cs b/src/Umbraco.Web/Mvc/IRenderMvcController.cs index 9393e38504..450ebbb9f8 100644 --- a/src/Umbraco.Web/Mvc/IRenderMvcController.cs +++ b/src/Umbraco.Web/Mvc/IRenderMvcController.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Web.Http.Filters; using System.Web.Mvc; using System.Web.Routing; @@ -19,4 +19,4 @@ namespace Umbraco.Web.Mvc /// ActionResult Index(ContentModel model); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Mvc/MasterControllerFactory.cs b/src/Umbraco.Web/Mvc/MasterControllerFactory.cs index 16455560f7..3ed178624f 100644 --- a/src/Umbraco.Web/Mvc/MasterControllerFactory.cs +++ b/src/Umbraco.Web/Mvc/MasterControllerFactory.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using System.Web.Mvc; using System.Web.Routing; @@ -6,13 +6,13 @@ using System.Web.Routing; namespace Umbraco.Web.Mvc { /// - /// A controller factory which uses an internal list of in order to invoke - /// different controller factories dependent upon their implementation of for the current - /// request. Allows circumvention of MVC3's singly registered IControllerFactory. - /// - /// - internal class MasterControllerFactory : DefaultControllerFactory - { + /// A controller factory which uses an internal list of in order to invoke + /// different controller factories dependent upon their implementation of for the current + /// request. Allows circumvention of MVC3's singly registered IControllerFactory. + /// + /// + internal class MasterControllerFactory : DefaultControllerFactory + { private readonly Func _factoriesAccessor; private FilteredControllerFactoryCollection _factories; @@ -21,16 +21,16 @@ namespace Umbraco.Web.Mvc /// /// The factories accessor. public MasterControllerFactory(Func factoriesAccessor) - { + { // note - // because the MasterControllerFactory needs to be ctored to be assigned to + // because the MasterControllerFactory needs to be ctored to be assigned to // ControllerBuilder.Current when setting up Mvc and WebApi, it cannot be ctored by // the IoC container - and yet we don't want that ctor to resolve the factories // as that happen before everything is configured - so, passing a factories // accessor func. - _factoriesAccessor = factoriesAccessor; - } + _factoriesAccessor = factoriesAccessor; + } private IFilteredControllerFactory FactoryForRequest(RequestContext context) { @@ -38,28 +38,28 @@ namespace Umbraco.Web.Mvc return _factories.FirstOrDefault(x => x.CanHandle(context)); } - /// - /// Creates the specified controller by using the specified request context. - /// - /// The context of the HTTP request, which includes the HTTP context and route data. - /// The name of the controller. - /// The controller. - /// The parameter is null. - /// - /// The parameter is null or empty. - /// - public override IController CreateController(RequestContext requestContext, string controllerName) - { - var factory = FactoryForRequest(requestContext); - return factory != null - ? factory.CreateController(requestContext, controllerName) - : base.CreateController(requestContext, controllerName); - } + /// + /// Creates the specified controller by using the specified request context. + /// + /// The context of the HTTP request, which includes the HTTP context and route data. + /// The name of the controller. + /// The controller. + /// The parameter is null. + /// + /// The parameter is null or empty. + /// + public override IController CreateController(RequestContext requestContext, string controllerName) + { + var factory = FactoryForRequest(requestContext); + return factory != null + ? factory.CreateController(requestContext, controllerName) + : base.CreateController(requestContext, controllerName); + } /// /// Retrieves the controller type for the specified name and request context. /// - /// + /// /// /// The controller type. /// @@ -87,27 +87,27 @@ namespace Umbraco.Web.Mvc return GetControllerType(requestContext, controllerName); } - /// - /// Releases the specified controller. - /// - /// The controller to release. - /// - public override void ReleaseController(IController icontroller) - { - var released = false; - var controller = icontroller as Controller; - if (controller != null) - { - var requestContext = controller.ControllerContext.RequestContext; - var factory = FactoryForRequest(requestContext); - if (factory != null) - { - factory.ReleaseController(controller); - released = true; - } - } - if (released == false) + /// + /// Releases the specified controller. + /// + /// The controller to release. + /// + public override void ReleaseController(IController icontroller) + { + var released = false; + var controller = icontroller as Controller; + if (controller != null) + { + var requestContext = controller.ControllerContext.RequestContext; + var factory = FactoryForRequest(requestContext); + if (factory != null) + { + factory.ReleaseController(controller); + released = true; + } + } + if (released == false) base.ReleaseController(icontroller); - } - } -} \ No newline at end of file + } + } +} diff --git a/src/Umbraco.Web/Mvc/MergeModelStateToChildActionAttribute.cs b/src/Umbraco.Web/Mvc/MergeModelStateToChildActionAttribute.cs index 7d2df43962..3b52e32c20 100644 --- a/src/Umbraco.Web/Mvc/MergeModelStateToChildActionAttribute.cs +++ b/src/Umbraco.Web/Mvc/MergeModelStateToChildActionAttribute.cs @@ -1,42 +1,42 @@ -using System.Linq; +using System.Linq; using System.Web.Mvc; namespace Umbraco.Web.Mvc { - /// - /// When a ChildAction is executing and we want the ModelState from the Parent context to be merged in - /// to help with validation, this filter can be used. - /// - /// - /// By default, this filter will only merge when an Http POST is detected but this can be modified in the ctor - /// - public class MergeModelStateToChildActionAttribute : ActionFilterAttribute - { - private readonly string[] _verb; + /// + /// When a ChildAction is executing and we want the ModelState from the Parent context to be merged in + /// to help with validation, this filter can be used. + /// + /// + /// By default, this filter will only merge when an Http POST is detected but this can be modified in the ctor + /// + public class MergeModelStateToChildActionAttribute : ActionFilterAttribute + { + private readonly string[] _verb; - public MergeModelStateToChildActionAttribute() - : this(HttpVerbs.Post) - { + public MergeModelStateToChildActionAttribute() + : this(HttpVerbs.Post) + { - } + } - public MergeModelStateToChildActionAttribute(params HttpVerbs[] verb) - { - _verb = verb.Select(x => x.ToString().ToUpper()).ToArray(); - } + public MergeModelStateToChildActionAttribute(params HttpVerbs[] verb) + { + _verb = verb.Select(x => x.ToString().ToUpper()).ToArray(); + } - public override void OnActionExecuting(ActionExecutingContext filterContext) - { - //check if the verb matches, if so merge the ModelState before the action is executed. - if (_verb.Contains(filterContext.HttpContext.Request.HttpMethod)) - { - if (filterContext.Controller.ControllerContext.IsChildAction) - { - filterContext.Controller.ViewData.ModelState.Merge( - filterContext.Controller.ControllerContext.ParentActionViewContext.ViewData.ModelState); - } - } - base.OnActionExecuting(filterContext); - } - } -} \ No newline at end of file + public override void OnActionExecuting(ActionExecutingContext filterContext) + { + //check if the verb matches, if so merge the ModelState before the action is executed. + if (_verb.Contains(filterContext.HttpContext.Request.HttpMethod)) + { + if (filterContext.Controller.ControllerContext.IsChildAction) + { + filterContext.Controller.ViewData.ModelState.Merge( + filterContext.Controller.ControllerContext.ParentActionViewContext.ViewData.ModelState); + } + } + base.OnActionExecuting(filterContext); + } + } +} diff --git a/src/Umbraco.Web/Mvc/MergeParentContextViewDataAttribute.cs b/src/Umbraco.Web/Mvc/MergeParentContextViewDataAttribute.cs index 1b1783c04e..12938a0eca 100644 --- a/src/Umbraco.Web/Mvc/MergeParentContextViewDataAttribute.cs +++ b/src/Umbraco.Web/Mvc/MergeParentContextViewDataAttribute.cs @@ -1,20 +1,20 @@ -using System.Linq; +using System.Linq; using System.Web.Mvc; namespace Umbraco.Web.Mvc { /// - /// This attribute can be used for when child actions execute and will automatically merge in the viewdata from the parent context to the + /// This attribute can be used for when child actions execute and will automatically merge in the viewdata from the parent context to the /// child action result. /// /// /// This will retain any custom viewdata put into the child viewdata if the same key persists in the parent context's view data. You can always still - /// access the parent's view data normally. + /// access the parent's view data normally. /// This just simplifies working with ChildActions and view data. - /// + /// /// NOTE: This does not mean that the parent context's view data will be merged before the action executes, if you need access to the parent context's view /// data during controller execution you can access it normally. - /// + /// /// NOTE: This recursively merges in all ParentActionViewContext ancestry in case there's child actions inside of child actions. /// public class MergeParentContextViewDataAttribute : ActionFilterAttribute @@ -47,10 +47,10 @@ namespace Umbraco.Web.Mvc //Recurse! if (currentParent.IsChildAction) { - MergeCurrentParent(target, currentParent.ParentActionViewContext); + MergeCurrentParent(target, currentParent.ParentActionViewContext); } - + } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Mvc/MinifyJavaScriptResultAttribute.cs b/src/Umbraco.Web/Mvc/MinifyJavaScriptResultAttribute.cs index 8281af7412..8dee11b844 100644 --- a/src/Umbraco.Web/Mvc/MinifyJavaScriptResultAttribute.cs +++ b/src/Umbraco.Web/Mvc/MinifyJavaScriptResultAttribute.cs @@ -25,13 +25,13 @@ namespace Umbraco.Web.Mvc var jsResult = filterContext.Result as JavaScriptResult; if (jsResult == null) return; if (filterContext.HttpContext.IsDebuggingEnabled) return; - + //minify the result var result = jsResult.Script; var minifier = new JSMin(); - var minified = minifier.Minify(result); + var minified = minifier.Minify(result); jsResult.Script = minified; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Mvc/MvcVersionCheck.cs b/src/Umbraco.Web/Mvc/MvcVersionCheck.cs index 348ce05d7d..60da4d0a60 100644 --- a/src/Umbraco.Web/Mvc/MvcVersionCheck.cs +++ b/src/Umbraco.Web/Mvc/MvcVersionCheck.cs @@ -1,4 +1,4 @@ -namespace Umbraco.Web.Mvc +namespace Umbraco.Web.Mvc { internal class MvcVersionCheck { @@ -7,4 +7,4 @@ namespace Umbraco.Web.Mvc get { return typeof (System.Web.Mvc.Controller).Assembly.GetName().Version; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Mvc/NotChildAction.cs b/src/Umbraco.Web/Mvc/NotChildAction.cs index 8106ac47b1..a06ff28c33 100644 --- a/src/Umbraco.Web/Mvc/NotChildAction.cs +++ b/src/Umbraco.Web/Mvc/NotChildAction.cs @@ -1,9 +1,9 @@ -using System.Web.Mvc; +using System.Web.Mvc; namespace Umbraco.Web.Mvc { /// - /// Used to ensure that actions with duplicate names that are not child actions don't get executed when + /// Used to ensure that actions with duplicate names that are not child actions don't get executed when /// we are Posting and not redirecting. /// /// @@ -17,4 +17,4 @@ namespace Umbraco.Web.Mvc return !isChildAction; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Mvc/NotFoundHandler.cs b/src/Umbraco.Web/Mvc/NotFoundHandler.cs index 1d73f9b5e6..bb98b42028 100644 --- a/src/Umbraco.Web/Mvc/NotFoundHandler.cs +++ b/src/Umbraco.Web/Mvc/NotFoundHandler.cs @@ -1,4 +1,4 @@ -using System.Web; +using System.Web; namespace Umbraco.Web.Mvc { @@ -14,4 +14,4 @@ namespace Umbraco.Web.Mvc get { return true; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Mvc/PluginController.cs b/src/Umbraco.Web/Mvc/PluginController.cs index c93e1144f1..6b5f111585 100644 --- a/src/Umbraco.Web/Mvc/PluginController.cs +++ b/src/Umbraco.Web/Mvc/PluginController.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Concurrent; using System.Web.Mvc; using LightInject; @@ -18,10 +18,10 @@ namespace Umbraco.Web.Mvc /// public abstract class PluginController : Controller, IDiscoverable { - private static readonly ConcurrentDictionary MetadataStorage + private static readonly ConcurrentDictionary MetadataStorage = new ConcurrentDictionary(); - private UmbracoHelper _umbracoHelper; + private UmbracoHelper _umbracoHelper; // for debugging purposes internal Guid InstanceId { get; } = Guid.NewGuid(); @@ -119,4 +119,4 @@ namespace Umbraco.Web.Mvc }); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Mvc/PluginControllerArea.cs b/src/Umbraco.Web/Mvc/PluginControllerArea.cs index d63ef0b2bb..d6a7edd985 100644 --- a/src/Umbraco.Web/Mvc/PluginControllerArea.cs +++ b/src/Umbraco.Web/Mvc/PluginControllerArea.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Web.Mvc; @@ -10,72 +10,72 @@ using Umbraco.Web.WebApi; namespace Umbraco.Web.Mvc { - /// - /// A custom area for controllers that are plugins - /// - internal class PluginControllerArea : AreaRegistration - { - private readonly IEnumerable _surfaceControllers; + /// + /// A custom area for controllers that are plugins + /// + internal class PluginControllerArea : AreaRegistration + { + private readonly IEnumerable _surfaceControllers; private readonly IEnumerable _apiControllers; - private readonly string _areaName; + private readonly string _areaName; - /// - /// The constructor accepts all types of plugin controllers and will verify that ALL of them have the same areaName assigned to them - /// based on their PluginControllerAttribute. If they are not the same an exception will be thrown. - /// - /// - public PluginControllerArea(IEnumerable pluginControllers) - { - var controllers = pluginControllers.ToArray(); + /// + /// The constructor accepts all types of plugin controllers and will verify that ALL of them have the same areaName assigned to them + /// based on their PluginControllerAttribute. If they are not the same an exception will be thrown. + /// + /// + public PluginControllerArea(IEnumerable pluginControllers) + { + var controllers = pluginControllers.ToArray(); - if (controllers.Any(x => x.AreaName.IsNullOrWhiteSpace())) - { - throw new InvalidOperationException("Cannot create a PluginControllerArea unless all plugin controllers assigned have a PluginControllerAttribute assigned"); - } - _areaName = controllers.First().AreaName; - foreach(var c in controllers) - { - if (c.AreaName != _areaName) - { - throw new InvalidOperationException("Cannot create a PluginControllerArea unless all plugin controllers assigned have the same AreaName. The first AreaName found was " + _areaName + " however, the controller of type " + c.GetType().FullName + " has an AreaName of " + c.AreaName); - } - } + if (controllers.Any(x => x.AreaName.IsNullOrWhiteSpace())) + { + throw new InvalidOperationException("Cannot create a PluginControllerArea unless all plugin controllers assigned have a PluginControllerAttribute assigned"); + } + _areaName = controllers.First().AreaName; + foreach(var c in controllers) + { + if (c.AreaName != _areaName) + { + throw new InvalidOperationException("Cannot create a PluginControllerArea unless all plugin controllers assigned have the same AreaName. The first AreaName found was " + _areaName + " however, the controller of type " + c.GetType().FullName + " has an AreaName of " + c.AreaName); + } + } - //get the controllers - _surfaceControllers = controllers.Where(x => TypeHelper.IsTypeAssignableFrom(x.ControllerType)); + //get the controllers + _surfaceControllers = controllers.Where(x => TypeHelper.IsTypeAssignableFrom(x.ControllerType)); _apiControllers = controllers.Where(x => TypeHelper.IsTypeAssignableFrom(x.ControllerType)); - } + } - public override void RegisterArea(AreaRegistrationContext context) - { - MapRouteSurfaceControllers(context.Routes, _surfaceControllers); - MapRouteApiControllers(context.Routes, _apiControllers); - } + public override void RegisterArea(AreaRegistrationContext context) + { + MapRouteSurfaceControllers(context.Routes, _surfaceControllers); + MapRouteApiControllers(context.Routes, _apiControllers); + } - public override string AreaName - { - get { return _areaName; } - } + public override string AreaName + { + get { return _areaName; } + } - /// - /// Registers all surface controller routes - /// - /// - /// - /// - /// The routes will be: - /// - /// /Umbraco/[AreaName]/[ControllerName]/[Action]/[Id] - /// - private void MapRouteSurfaceControllers(RouteCollection routes, IEnumerable surfaceControllers) - { - foreach (var s in surfaceControllers) - { - var route = this.RouteControllerPlugin(s.ControllerName, s.ControllerType, routes, "", "Index", UrlParameter.Optional, "surface"); + /// + /// Registers all surface controller routes + /// + /// + /// + /// + /// The routes will be: + /// + /// /Umbraco/[AreaName]/[ControllerName]/[Action]/[Id] + /// + private void MapRouteSurfaceControllers(RouteCollection routes, IEnumerable surfaceControllers) + { + foreach (var s in surfaceControllers) + { + var route = this.RouteControllerPlugin(s.ControllerName, s.ControllerType, routes, "", "Index", UrlParameter.Optional, "surface"); //set the route handler to our SurfaceRouteHandler route.RouteHandler = new SurfaceRouteHandler(); - } - } + } + } /// /// Registers all api controller routes @@ -86,10 +86,10 @@ namespace Umbraco.Web.Mvc { foreach (var s in apiControllers) { - this.RouteControllerPlugin(s.ControllerName, s.ControllerType, routes, "", "", UrlParameter.Optional, "api", - isMvc: false, + this.RouteControllerPlugin(s.ControllerName, s.ControllerType, routes, "", "", UrlParameter.Optional, "api", + isMvc: false, areaPathPrefix: s.IsBackOffice ? "backoffice" : null); } } - } -} \ No newline at end of file + } +} diff --git a/src/Umbraco.Web/Mvc/PluginControllerAttribute.cs b/src/Umbraco.Web/Mvc/PluginControllerAttribute.cs index 064f39826d..5e5262b2ed 100644 --- a/src/Umbraco.Web/Mvc/PluginControllerAttribute.cs +++ b/src/Umbraco.Web/Mvc/PluginControllerAttribute.cs @@ -1,26 +1,26 @@ -using System; +using System; using System.Linq; namespace Umbraco.Web.Mvc { - /// - /// An attribute applied to a plugin controller that requires that it is routed to its own area - /// - [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] - public class PluginControllerAttribute : Attribute - { - public string AreaName { get; private set; } + /// + /// An attribute applied to a plugin controller that requires that it is routed to its own area + /// + [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] + public class PluginControllerAttribute : Attribute + { + public string AreaName { get; private set; } - public PluginControllerAttribute(string areaName) - { - //validate this, only letters and digits allowed. - if (areaName.Any(c => !Char.IsLetterOrDigit(c))) - { - throw new FormatException("The areaName specified " + areaName + " can only contains letters and digits"); - } + public PluginControllerAttribute(string areaName) + { + //validate this, only letters and digits allowed. + if (areaName.Any(c => !Char.IsLetterOrDigit(c))) + { + throw new FormatException("The areaName specified " + areaName + " can only contains letters and digits"); + } - AreaName = areaName; - } + AreaName = areaName; + } - } -} \ No newline at end of file + } +} diff --git a/src/Umbraco.Web/Mvc/PluginControllerMetadata.cs b/src/Umbraco.Web/Mvc/PluginControllerMetadata.cs index 6de8525de9..a08b11dd7f 100644 --- a/src/Umbraco.Web/Mvc/PluginControllerMetadata.cs +++ b/src/Umbraco.Web/Mvc/PluginControllerMetadata.cs @@ -1,21 +1,21 @@ -using System; +using System; namespace Umbraco.Web.Mvc { - /// - /// Represents some metadata about the controller - /// - internal class PluginControllerMetadata - { - internal Type ControllerType { get; set; } - internal string ControllerName { get; set; } - internal string ControllerNamespace { get; set; } - internal string AreaName { get; set; } + /// + /// Represents some metadata about the controller + /// + internal class PluginControllerMetadata + { + internal Type ControllerType { get; set; } + internal string ControllerName { get; set; } + internal string ControllerNamespace { get; set; } + internal string AreaName { get; set; } /// - /// This is determined by another attribute [IsBackOffice] which slightly modifies the route path + /// This is determined by another attribute [IsBackOffice] which slightly modifies the route path /// allowing us to determine if it is indeed a back office request or not /// internal bool IsBackOffice { get; set; } - } -} \ No newline at end of file + } +} diff --git a/src/Umbraco.Web/Mvc/PluginViewEngine.cs b/src/Umbraco.Web/Mvc/PluginViewEngine.cs index b4b72e36d5..a1b2d886fd 100644 --- a/src/Umbraco.Web/Mvc/PluginViewEngine.cs +++ b/src/Umbraco.Web/Mvc/PluginViewEngine.cs @@ -1,4 +1,4 @@ -using System.IO; +using System.IO; using System.Linq; using System.Web.Mvc; using Lucene.Net.Util; @@ -7,100 +7,100 @@ using Umbraco.Core.IO; namespace Umbraco.Web.Mvc { /// - /// A view engine to look into the App_Plugins folder for views for packaged controllers - /// + /// A view engine to look into the App_Plugins folder for views for packaged controllers + /// public class PluginViewEngine : RazorViewEngine - { - - /// - /// Constructor - /// - public PluginViewEngine() - { - SetViewLocations(); - } + { - private void SetViewLocations() - { - //these are the originals: + /// + /// Constructor + /// + public PluginViewEngine() + { + SetViewLocations(); + } - //base.AreaViewLocationFormats = new string[] { "~/Areas/{2}/Views/{1}/{0}.cshtml", "~/Areas/{2}/Views/{1}/{0}.vbhtml", "~/Areas/{2}/Views/Shared/{0}.cshtml", "~/Areas/{2}/Views/Shared/{0}.vbhtml" }; - //base.AreaMasterLocationFormats = new string[] { "~/Areas/{2}/Views/{1}/{0}.cshtml", "~/Areas/{2}/Views/{1}/{0}.vbhtml", "~/Areas/{2}/Views/Shared/{0}.cshtml", "~/Areas/{2}/Views/Shared/{0}.vbhtml" }; - //base.AreaPartialViewLocationFormats = new string[] { "~/Areas/{2}/Views/{1}/{0}.cshtml", "~/Areas/{2}/Views/{1}/{0}.vbhtml", "~/Areas/{2}/Views/Shared/{0}.cshtml", "~/Areas/{2}/Views/Shared/{0}.vbhtml" }; - //base.ViewLocationFormats = new string[] { "~/Views/{1}/{0}.cshtml", "~/Views/{1}/{0}.vbhtml", "~/Views/Shared/{0}.cshtml", "~/Views/Shared/{0}.vbhtml" }; - //base.MasterLocationFormats = new string[] { "~/Views/{1}/{0}.cshtml", "~/Views/{1}/{0}.vbhtml", "~/Views/Shared/{0}.cshtml", "~/Views/Shared/{0}.vbhtml" }; - //base.PartialViewLocationFormats = new string[] { "~/Views/{1}/{0}.cshtml", "~/Views/{1}/{0}.vbhtml", "~/Views/Shared/{0}.cshtml", "~/Views/Shared/{0}.vbhtml" }; - //base.FileExtensions = new string[] { "cshtml", "vbhtml" }; + private void SetViewLocations() + { + //these are the originals: - var viewLocationsArray = new[] - { - string.Concat(SystemDirectories.AppPlugins, "/{2}/Views/{1}/{0}.cshtml"), - string.Concat(SystemDirectories.AppPlugins, "/{2}/Views/{1}/{0}.vbhtml") - }; + //base.AreaViewLocationFormats = new string[] { "~/Areas/{2}/Views/{1}/{0}.cshtml", "~/Areas/{2}/Views/{1}/{0}.vbhtml", "~/Areas/{2}/Views/Shared/{0}.cshtml", "~/Areas/{2}/Views/Shared/{0}.vbhtml" }; + //base.AreaMasterLocationFormats = new string[] { "~/Areas/{2}/Views/{1}/{0}.cshtml", "~/Areas/{2}/Views/{1}/{0}.vbhtml", "~/Areas/{2}/Views/Shared/{0}.cshtml", "~/Areas/{2}/Views/Shared/{0}.vbhtml" }; + //base.AreaPartialViewLocationFormats = new string[] { "~/Areas/{2}/Views/{1}/{0}.cshtml", "~/Areas/{2}/Views/{1}/{0}.vbhtml", "~/Areas/{2}/Views/Shared/{0}.cshtml", "~/Areas/{2}/Views/Shared/{0}.vbhtml" }; + //base.ViewLocationFormats = new string[] { "~/Views/{1}/{0}.cshtml", "~/Views/{1}/{0}.vbhtml", "~/Views/Shared/{0}.cshtml", "~/Views/Shared/{0}.vbhtml" }; + //base.MasterLocationFormats = new string[] { "~/Views/{1}/{0}.cshtml", "~/Views/{1}/{0}.vbhtml", "~/Views/Shared/{0}.cshtml", "~/Views/Shared/{0}.vbhtml" }; + //base.PartialViewLocationFormats = new string[] { "~/Views/{1}/{0}.cshtml", "~/Views/{1}/{0}.vbhtml", "~/Views/Shared/{0}.cshtml", "~/Views/Shared/{0}.vbhtml" }; + //base.FileExtensions = new string[] { "cshtml", "vbhtml" }; - //set all of the area view locations to the plugin folder - AreaViewLocationFormats = viewLocationsArray - .Concat(new[] - { - string.Concat(SystemDirectories.AppPlugins, "/{2}/Views/Shared/{0}.cshtml"), - string.Concat(SystemDirectories.AppPlugins, "/{2}/Views/Shared/{0}.vbhtml") - }) - .ToArray(); + var viewLocationsArray = new[] + { + string.Concat(SystemDirectories.AppPlugins, "/{2}/Views/{1}/{0}.cshtml"), + string.Concat(SystemDirectories.AppPlugins, "/{2}/Views/{1}/{0}.vbhtml") + }; + + //set all of the area view locations to the plugin folder + AreaViewLocationFormats = viewLocationsArray + .Concat(new[] + { + string.Concat(SystemDirectories.AppPlugins, "/{2}/Views/Shared/{0}.cshtml"), + string.Concat(SystemDirectories.AppPlugins, "/{2}/Views/Shared/{0}.vbhtml") + }) + .ToArray(); AreaMasterLocationFormats = viewLocationsArray; AreaPartialViewLocationFormats = new[] - { - //will be used when we have partial view and child action macros - string.Concat(SystemDirectories.AppPlugins, "/{2}/Views/Partials/{0}.cshtml"), - string.Concat(SystemDirectories.AppPlugins, "/{2}/Views/Partials/{0}.vbhtml"), - string.Concat(SystemDirectories.AppPlugins, "/{2}/Views/MacroPartials/{0}.cshtml"), - string.Concat(SystemDirectories.AppPlugins, "/{2}/Views/MacroPartials/{0}.vbhtml"), - //for partials - string.Concat(SystemDirectories.AppPlugins, "/{2}/Views/{1}/{0}.cshtml"), - string.Concat(SystemDirectories.AppPlugins, "/{2}/Views/{1}/{0}.vbhtml"), - string.Concat(SystemDirectories.AppPlugins, "/{2}/Views/Shared/{0}.cshtml"), - string.Concat(SystemDirectories.AppPlugins, "/{2}/Views/Shared/{0}.vbhtml") - }; + { + //will be used when we have partial view and child action macros + string.Concat(SystemDirectories.AppPlugins, "/{2}/Views/Partials/{0}.cshtml"), + string.Concat(SystemDirectories.AppPlugins, "/{2}/Views/Partials/{0}.vbhtml"), + string.Concat(SystemDirectories.AppPlugins, "/{2}/Views/MacroPartials/{0}.cshtml"), + string.Concat(SystemDirectories.AppPlugins, "/{2}/Views/MacroPartials/{0}.vbhtml"), + //for partials + string.Concat(SystemDirectories.AppPlugins, "/{2}/Views/{1}/{0}.cshtml"), + string.Concat(SystemDirectories.AppPlugins, "/{2}/Views/{1}/{0}.vbhtml"), + string.Concat(SystemDirectories.AppPlugins, "/{2}/Views/Shared/{0}.cshtml"), + string.Concat(SystemDirectories.AppPlugins, "/{2}/Views/Shared/{0}.vbhtml") + }; - } + } - /// - /// Ensures that the correct web.config for razor exists in the /Views folder. - /// - private void EnsureFolderAndWebConfig(ViewEngineResult result) - { - if (result.View == null) return; - var razorResult = result.View as RazorView; - if (razorResult == null) return; + /// + /// Ensures that the correct web.config for razor exists in the /Views folder. + /// + private void EnsureFolderAndWebConfig(ViewEngineResult result) + { + if (result.View == null) return; + var razorResult = result.View as RazorView; + if (razorResult == null) return; - var folder = Path.GetDirectoryName(IOHelper.MapPath(razorResult.ViewPath)); - //now we need to get the /View/ folder - var viewFolder = folder.Substring(0, folder.LastIndexOf("\\Views\\")) + "\\Views"; + var folder = Path.GetDirectoryName(IOHelper.MapPath(razorResult.ViewPath)); + //now we need to get the /View/ folder + var viewFolder = folder.Substring(0, folder.LastIndexOf("\\Views\\")) + "\\Views"; - //ensure the web.config file is in the ~/Views folder - Directory.CreateDirectory(viewFolder); - if (!File.Exists(Path.Combine(viewFolder, "web.config"))) - { - using (var writer = File.CreateText(Path.Combine(viewFolder, "web.config"))) - { + //ensure the web.config file is in the ~/Views folder + Directory.CreateDirectory(viewFolder); + if (!File.Exists(Path.Combine(viewFolder, "web.config"))) + { + using (var writer = File.CreateText(Path.Combine(viewFolder, "web.config"))) + { writer.Write(Strings.WebConfigTemplate); - } - } - } + } + } + } - public override ViewEngineResult FindView(ControllerContext controllerContext, string viewName, string masterName, bool useCache) - { - var result = base.FindView(controllerContext, viewName, masterName, useCache); - EnsureFolderAndWebConfig(result); - return result; - } + public override ViewEngineResult FindView(ControllerContext controllerContext, string viewName, string masterName, bool useCache) + { + var result = base.FindView(controllerContext, viewName, masterName, useCache); + EnsureFolderAndWebConfig(result); + return result; + } - public override ViewEngineResult FindPartialView(ControllerContext controllerContext, string partialViewName, bool useCache) - { - var result = base.FindPartialView(controllerContext, partialViewName, useCache); - EnsureFolderAndWebConfig(result); - return result; - } - } -} \ No newline at end of file + public override ViewEngineResult FindPartialView(ControllerContext controllerContext, string partialViewName, bool useCache) + { + var result = base.FindPartialView(controllerContext, partialViewName, useCache); + EnsureFolderAndWebConfig(result); + return result; + } + } +} diff --git a/src/Umbraco.Web/Mvc/PostedDataProxyInfo.cs b/src/Umbraco.Web/Mvc/PostedDataProxyInfo.cs index fef1ba8647..6253c55523 100644 --- a/src/Umbraco.Web/Mvc/PostedDataProxyInfo.cs +++ b/src/Umbraco.Web/Mvc/PostedDataProxyInfo.cs @@ -1,12 +1,12 @@ -using System; +using System; namespace Umbraco.Web.Mvc { - /// - /// Represents the data required to proxy a request to a surface controller for posted data - /// - internal class PostedDataProxyInfo : RouteDefinition - { - public string Area { get; set; } - } -} \ No newline at end of file + /// + /// Represents the data required to proxy a request to a surface controller for posted data + /// + internal class PostedDataProxyInfo : RouteDefinition + { + public string Area { get; set; } + } +} diff --git a/src/Umbraco.Web/Mvc/PreRenderViewActionFilterAttribute.cs b/src/Umbraco.Web/Mvc/PreRenderViewActionFilterAttribute.cs index f41827965c..54e20f5d56 100644 --- a/src/Umbraco.Web/Mvc/PreRenderViewActionFilterAttribute.cs +++ b/src/Umbraco.Web/Mvc/PreRenderViewActionFilterAttribute.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Web.Mvc; namespace Umbraco.Web.Mvc @@ -15,13 +15,13 @@ namespace Umbraco.Web.Mvc var result = filterContext.Result as ViewResultBase; if (result == null) - { + { return; } var model = result.Model; if (model == null) - { + { return; } @@ -45,4 +45,4 @@ namespace Umbraco.Web.Mvc if (handler != null) handler(null, e); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Mvc/ProfilingView.cs b/src/Umbraco.Web/Mvc/ProfilingView.cs index e6e1066636..af3daae75c 100644 --- a/src/Umbraco.Web/Mvc/ProfilingView.cs +++ b/src/Umbraco.Web/Mvc/ProfilingView.cs @@ -1,4 +1,4 @@ -using System.IO; +using System.IO; using System.Web.Mvc; using Umbraco.Core.Logging; using Umbraco.Web; @@ -6,26 +6,26 @@ using Umbraco.Web.Composing; namespace Umbraco.Core.Profiling { - public class ProfilingView : IView - { - private readonly IView _inner; - private readonly string _name; - private readonly string _viewPath; + public class ProfilingView : IView + { + private readonly IView _inner; + private readonly string _name; + private readonly string _viewPath; - public ProfilingView(IView inner) - { - _inner = inner; - _name = inner.GetType().Name; - var razorView = inner as RazorView; - _viewPath = razorView != null ? razorView.ViewPath : "Unknown"; - } + public ProfilingView(IView inner) + { + _inner = inner; + _name = inner.GetType().Name; + var razorView = inner as RazorView; + _viewPath = razorView != null ? razorView.ViewPath : "Unknown"; + } - public void Render(ViewContext viewContext, TextWriter writer) - { - using (Current.Profiler.Step(string.Format("{0}.Render: {1}", _name, _viewPath))) - { - _inner.Render(viewContext, writer); - } - } - } + public void Render(ViewContext viewContext, TextWriter writer) + { + using (Current.Profiler.Step(string.Format("{0}.Render: {1}", _name, _viewPath))) + { + _inner.Render(viewContext, writer); + } + } + } } diff --git a/src/Umbraco.Web/Mvc/ProfilingViewEngine.cs b/src/Umbraco.Web/Mvc/ProfilingViewEngine.cs index 3376b9c10c..f7a7411a19 100644 --- a/src/Umbraco.Web/Mvc/ProfilingViewEngine.cs +++ b/src/Umbraco.Web/Mvc/ProfilingViewEngine.cs @@ -1,51 +1,51 @@ -using System.Web.Mvc; +using System.Web.Mvc; using Umbraco.Core.Logging; using Umbraco.Web; using Umbraco.Web.Composing; namespace Umbraco.Core.Profiling { - public class ProfilingViewEngine: IViewEngine - { - internal readonly IViewEngine Inner; - private readonly string _name; + public class ProfilingViewEngine: IViewEngine + { + internal readonly IViewEngine Inner; + private readonly string _name; - public ProfilingViewEngine(IViewEngine inner) - { - Inner = inner; - _name = inner.GetType().Name; - } + public ProfilingViewEngine(IViewEngine inner) + { + Inner = inner; + _name = inner.GetType().Name; + } - public ViewEngineResult FindPartialView(ControllerContext controllerContext, string partialViewName, bool useCache) - { - using (Current.Profiler.Step(string.Format("{0}.FindPartialView, {1}, {2}", _name, partialViewName, useCache))) - { - return WrapResult(Inner.FindPartialView(controllerContext, partialViewName, useCache)); - } - } + public ViewEngineResult FindPartialView(ControllerContext controllerContext, string partialViewName, bool useCache) + { + using (Current.Profiler.Step(string.Format("{0}.FindPartialView, {1}, {2}", _name, partialViewName, useCache))) + { + return WrapResult(Inner.FindPartialView(controllerContext, partialViewName, useCache)); + } + } - public ViewEngineResult FindView(ControllerContext controllerContext, string viewName, string masterName, bool useCache) - { - using (Current.Profiler.Step(string.Format("{0}.FindView, {1}, {2}, {3}", _name, viewName, masterName, useCache))) - { - return WrapResult(Inner.FindView(controllerContext, viewName, masterName, useCache)); - } - } + public ViewEngineResult FindView(ControllerContext controllerContext, string viewName, string masterName, bool useCache) + { + using (Current.Profiler.Step(string.Format("{0}.FindView, {1}, {2}, {3}", _name, viewName, masterName, useCache))) + { + return WrapResult(Inner.FindView(controllerContext, viewName, masterName, useCache)); + } + } - private static ViewEngineResult WrapResult(ViewEngineResult innerResult) - { - var profiledResult = innerResult.View != null ? - new ViewEngineResult(new ProfilingView(innerResult.View), innerResult.ViewEngine) : - new ViewEngineResult(innerResult.SearchedLocations); - return profiledResult; - } + private static ViewEngineResult WrapResult(ViewEngineResult innerResult) + { + var profiledResult = innerResult.View != null ? + new ViewEngineResult(new ProfilingView(innerResult.View), innerResult.ViewEngine) : + new ViewEngineResult(innerResult.SearchedLocations); + return profiledResult; + } - public void ReleaseView(ControllerContext controllerContext, IView view) - { - using (Current.Profiler.Step(string.Format("{0}.ReleaseView, {1}", _name, view.GetType().Name))) - { - Inner.ReleaseView(controllerContext, view); - } - } - } + public void ReleaseView(ControllerContext controllerContext, IView view) + { + using (Current.Profiler.Step(string.Format("{0}.ReleaseView, {1}", _name, view.GetType().Name))) + { + Inner.ReleaseView(controllerContext, view); + } + } + } } diff --git a/src/Umbraco.Web/Mvc/QueryStringFilterAttribute.cs b/src/Umbraco.Web/Mvc/QueryStringFilterAttribute.cs index db5ea4869d..fe364fb79b 100644 --- a/src/Umbraco.Web/Mvc/QueryStringFilterAttribute.cs +++ b/src/Umbraco.Web/Mvc/QueryStringFilterAttribute.cs @@ -13,7 +13,7 @@ namespace Umbraco.Web.Mvc /// /// Just like you can POST an arbitrary number of parameters to an Action, you can't GET an arbitrary number /// but this will allow you to do it - /// + /// /// http://stackoverflow.com/questions/488061/passing-multiple-parameters-to-controller-in-asp-net-mvc-also-generating-on-the /// public class QueryStringFilterAttribute : ActionFilterAttribute diff --git a/src/Umbraco.Web/Mvc/RedirectToUmbracoPageResult.cs b/src/Umbraco.Web/Mvc/RedirectToUmbracoPageResult.cs index 25b2df51a3..c73cc12362 100644 --- a/src/Umbraco.Web/Mvc/RedirectToUmbracoPageResult.cs +++ b/src/Umbraco.Web/Mvc/RedirectToUmbracoPageResult.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Specialized; using System.Linq; using System.Web; @@ -10,65 +10,65 @@ using Umbraco.Core.Models.PublishedContent; namespace Umbraco.Web.Mvc { /// - /// Redirects to an Umbraco page by Id or Entity - /// - public class RedirectToUmbracoPageResult : ActionResult - { - private IPublishedContent _publishedContent; - private readonly int _pageId; + /// Redirects to an Umbraco page by Id or Entity + /// + public class RedirectToUmbracoPageResult : ActionResult + { + private IPublishedContent _publishedContent; + private readonly int _pageId; private NameValueCollection _queryStringValues; - private readonly UmbracoContext _umbracoContext; - private string _url; + private readonly UmbracoContext _umbracoContext; + private string _url; - public string Url - { - get - { - if (!_url.IsNullOrWhiteSpace()) return _url; + public string Url + { + get + { + if (!_url.IsNullOrWhiteSpace()) return _url; - if (PublishedContent == null) - { - throw new InvalidOperationException(string.Format("Cannot redirect, no entity was found for id {0}", _pageId)); - } + if (PublishedContent == null) + { + throw new InvalidOperationException(string.Format("Cannot redirect, no entity was found for id {0}", _pageId)); + } - var result = _umbracoContext.UrlProvider.GetUrl(PublishedContent.Id); - if (result != "#") - { - _url = result; - return _url; - } + var result = _umbracoContext.UrlProvider.GetUrl(PublishedContent.Id); + if (result != "#") + { + _url = result; + return _url; + } - throw new InvalidOperationException(string.Format("Could not route to entity with id {0}, the NiceUrlProvider could not generate a URL", _pageId)); + throw new InvalidOperationException(string.Format("Could not route to entity with id {0}, the NiceUrlProvider could not generate a URL", _pageId)); - } - } + } + } public int PageId { get { return _pageId; } } - public IPublishedContent PublishedContent - { - get - { - if (_publishedContent != null) return _publishedContent; + public IPublishedContent PublishedContent + { + get + { + if (_publishedContent != null) return _publishedContent; - //need to get the URL for the page - _publishedContent = UmbracoContext.Current.ContentCache.GetById(_pageId); + //need to get the URL for the page + _publishedContent = UmbracoContext.Current.ContentCache.GetById(_pageId); - return _publishedContent; - } - } + return _publishedContent; + } + } - /// - /// Creates a new RedirectToUmbracoResult - /// - /// - public RedirectToUmbracoPageResult(int pageId) - : this(pageId, UmbracoContext.Current) - { - } + /// + /// Creates a new RedirectToUmbracoResult + /// + /// + public RedirectToUmbracoPageResult(int pageId) + : this(pageId, UmbracoContext.Current) + { + } /// /// Creates a new RedirectToUmbracoResult @@ -90,14 +90,14 @@ namespace Umbraco.Web.Mvc { } - /// - /// Creates a new RedirectToUmbracoResult - /// - /// - public RedirectToUmbracoPageResult(IPublishedContent publishedContent) - : this(publishedContent, UmbracoContext.Current) - { - } + /// + /// Creates a new RedirectToUmbracoResult + /// + /// + public RedirectToUmbracoPageResult(IPublishedContent publishedContent) + : this(publishedContent, UmbracoContext.Current) + { + } /// /// Creates a new RedirectToUmbracoResult @@ -119,16 +119,16 @@ namespace Umbraco.Web.Mvc { } - /// - /// Creates a new RedirectToUmbracoResult - /// - /// - /// - public RedirectToUmbracoPageResult(int pageId, UmbracoContext umbracoContext) - { - _pageId = pageId; - _umbracoContext = umbracoContext; - } + /// + /// Creates a new RedirectToUmbracoResult + /// + /// + /// + public RedirectToUmbracoPageResult(int pageId, UmbracoContext umbracoContext) + { + _pageId = pageId; + _umbracoContext = umbracoContext; + } /// /// Creates a new RedirectToUmbracoResult @@ -156,17 +156,17 @@ namespace Umbraco.Web.Mvc _umbracoContext = umbracoContext; } - /// - /// Creates a new RedirectToUmbracoResult - /// - /// - /// - public RedirectToUmbracoPageResult(IPublishedContent publishedContent, UmbracoContext umbracoContext) - { - _publishedContent = publishedContent; - _pageId = publishedContent.Id; - _umbracoContext = umbracoContext; - } + /// + /// Creates a new RedirectToUmbracoResult + /// + /// + /// + public RedirectToUmbracoPageResult(IPublishedContent publishedContent, UmbracoContext umbracoContext) + { + _publishedContent = publishedContent; + _pageId = publishedContent.Id; + _umbracoContext = umbracoContext; + } /// /// Creates a new RedirectToUmbracoResult @@ -196,16 +196,16 @@ namespace Umbraco.Web.Mvc _umbracoContext = umbracoContext; } - public override void ExecuteResult(ControllerContext context) - { - if (context == null) throw new ArgumentNullException("context"); + public override void ExecuteResult(ControllerContext context) + { + if (context == null) throw new ArgumentNullException("context"); - if (context.IsChildAction) - { - throw new InvalidOperationException("Cannot redirect from a Child Action"); - } + if (context.IsChildAction) + { + throw new InvalidOperationException("Cannot redirect from a Child Action"); + } - var destinationUrl = UrlHelper.GenerateContentUrl(Url, context.HttpContext); + var destinationUrl = UrlHelper.GenerateContentUrl(Url, context.HttpContext); if (_queryStringValues != null && _queryStringValues.Count > 0) { @@ -213,10 +213,10 @@ namespace Umbraco.Web.Mvc _queryStringValues.AllKeys.Select(x => x + "=" + HttpUtility.UrlEncode(_queryStringValues[x]))); } - context.Controller.TempData.Keep(); + context.Controller.TempData.Keep(); - context.HttpContext.Response.Redirect(destinationUrl, endResponse: false); - } + context.HttpContext.Response.Redirect(destinationUrl, endResponse: false); + } private NameValueCollection ParseQueryString(string queryString) { @@ -227,5 +227,5 @@ namespace Umbraco.Web.Mvc return null; } - } -} \ No newline at end of file + } +} diff --git a/src/Umbraco.Web/Mvc/RedirectToUmbracoUrlResult.cs b/src/Umbraco.Web/Mvc/RedirectToUmbracoUrlResult.cs index 342a22c829..ddc989eb57 100644 --- a/src/Umbraco.Web/Mvc/RedirectToUmbracoUrlResult.cs +++ b/src/Umbraco.Web/Mvc/RedirectToUmbracoUrlResult.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Web.Mvc; namespace Umbraco.Web.Mvc @@ -7,8 +7,8 @@ namespace Umbraco.Web.Mvc /// Redirects to the current URL rendering an Umbraco page including it's query strings /// /// - /// This is useful if you need to redirect - /// to the current page but the current page is actually a rewritten URL normally done with something like + /// This is useful if you need to redirect + /// to the current page but the current page is actually a rewritten URL normally done with something like /// Server.Transfer. It is also handy if you want to persist the query strings. /// public class RedirectToUmbracoUrlResult : ActionResult @@ -17,7 +17,7 @@ namespace Umbraco.Web.Mvc /// /// Creates a new RedirectToUmbracoResult - /// + /// /// public RedirectToUmbracoUrlResult(UmbracoContext umbracoContext) { @@ -39,4 +39,4 @@ namespace Umbraco.Web.Mvc context.HttpContext.Response.Redirect(destinationUrl, endResponse: false); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Mvc/ReflectedFixedRazorViewEngine.cs b/src/Umbraco.Web/Mvc/ReflectedFixedRazorViewEngine.cs index 320e8c6d8a..b3a1904efe 100644 --- a/src/Umbraco.Web/Mvc/ReflectedFixedRazorViewEngine.cs +++ b/src/Umbraco.Web/Mvc/ReflectedFixedRazorViewEngine.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Reflection; using System.Web.Mvc; @@ -90,10 +90,10 @@ namespace Umbraco.Web.Mvc { return _wrappedEngine.FindView(controllerContext, viewName, masterName, useCache); } - + public void ReleaseView(ControllerContext controllerContext, IView view) { _wrappedEngine.ReleaseView(controllerContext, view); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Mvc/RenderActionInvoker.cs b/src/Umbraco.Web/Mvc/RenderActionInvoker.cs index 55be6591ad..82354e4bad 100644 --- a/src/Umbraco.Web/Mvc/RenderActionInvoker.cs +++ b/src/Umbraco.Web/Mvc/RenderActionInvoker.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq; @@ -8,35 +8,35 @@ using System.Web.Mvc.Async; namespace Umbraco.Web.Mvc { - /// - /// Ensures that if an action for the Template name is not explicitly defined by a user, that the 'Index' action will execute - /// + /// + /// Ensures that if an action for the Template name is not explicitly defined by a user, that the 'Index' action will execute + /// public class RenderActionInvoker : AsyncControllerActionInvoker - { + { - /// - /// Ensures that if an action for the Template name is not explicitly defined by a user, that the 'Index' action will execute - /// - /// - /// - /// - /// - protected override ActionDescriptor FindAction(ControllerContext controllerContext, ControllerDescriptor controllerDescriptor, string actionName) - { - var ad = base.FindAction(controllerContext, controllerDescriptor, actionName); + /// + /// Ensures that if an action for the Template name is not explicitly defined by a user, that the 'Index' action will execute + /// + /// + /// + /// + /// + protected override ActionDescriptor FindAction(ControllerContext controllerContext, ControllerDescriptor controllerDescriptor, string actionName) + { + var ad = base.FindAction(controllerContext, controllerDescriptor, actionName); - //now we need to check if it exists, if not we need to return the Index by default - if (ad == null) - { + //now we need to check if it exists, if not we need to return the Index by default + if (ad == null) + { //check if the controller is an instance of IRenderController and find the index if (controllerContext.Controller is IRenderController) - { - return controllerDescriptor.FindAction(controllerContext, "Index"); + { + return controllerDescriptor.FindAction(controllerContext, "Index"); } - } - return ad; - } - - } -} \ No newline at end of file + } + return ad; + } + + } +} diff --git a/src/Umbraco.Web/Mvc/RenderControllerFactory.cs b/src/Umbraco.Web/Mvc/RenderControllerFactory.cs index ccc80782a5..76e8ca92d3 100644 --- a/src/Umbraco.Web/Mvc/RenderControllerFactory.cs +++ b/src/Umbraco.Web/Mvc/RenderControllerFactory.cs @@ -1,27 +1,27 @@ -using System.Web.Mvc; +using System.Web.Mvc; using System.Web.Routing; namespace Umbraco.Web.Mvc { /// - /// A controller factory for the render pipeline of Umbraco. This controller factory tries to create a controller with the supplied - /// name, and falls back to UmbracoController if none was found. - /// - /// + /// A controller factory for the render pipeline of Umbraco. This controller factory tries to create a controller with the supplied + /// name, and falls back to UmbracoController if none was found. + /// + /// public class RenderControllerFactory : UmbracoControllerFactory - { - - /// - /// Determines whether this instance can handle the specified request. - /// - /// The request. - /// true if this instance can handle the specified request; otherwise, false. - /// - public override bool CanHandle(RequestContext request) - { - var dataToken = request.RouteData.DataTokens["area"]; - return dataToken == null || string.IsNullOrWhiteSpace(dataToken.ToString()); - } + { + + /// + /// Determines whether this instance can handle the specified request. + /// + /// The request. + /// true if this instance can handle the specified request; otherwise, false. + /// + public override bool CanHandle(RequestContext request) + { + var dataToken = request.RouteData.DataTokens["area"]; + return dataToken == null || string.IsNullOrWhiteSpace(dataToken.ToString()); + } /// /// Creates the controller @@ -34,7 +34,7 @@ namespace Umbraco.Web.Mvc /// public override IController CreateController(RequestContext requestContext, string controllerName) { - var instance = base.CreateController(requestContext, controllerName); + var instance = base.CreateController(requestContext, controllerName); var controllerInstance = instance as Controller; if (controllerInstance != null) { @@ -44,6 +44,6 @@ namespace Umbraco.Web.Mvc return instance; } - - } -} \ No newline at end of file + + } +} diff --git a/src/Umbraco.Web/Mvc/RenderIndexActionSelectorAttribute.cs b/src/Umbraco.Web/Mvc/RenderIndexActionSelectorAttribute.cs index 1d1c56db11..fa80107181 100644 --- a/src/Umbraco.Web/Mvc/RenderIndexActionSelectorAttribute.cs +++ b/src/Umbraco.Web/Mvc/RenderIndexActionSelectorAttribute.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Concurrent; using System.Linq; using System.Reflection; @@ -8,7 +8,7 @@ namespace Umbraco.Web.Mvc { /// /// A custom ActionMethodSelector which will ensure that the RenderMvcController.Index(RenderModel model) action will be executed - /// if the + /// if the /// internal class RenderIndexActionSelectorAttribute : ActionMethodSelectorAttribute { @@ -34,9 +34,9 @@ namespace Umbraco.Web.Mvc var controllerDesc = ControllerDescCache.GetOrAdd(currType, type => new ReflectedControllerDescriptor(currType)); var actions = controllerDesc.GetCanonicalActions(); - //If there are more than one Index action for this controller, then + //If there are more than one Index action for this controller, then // this base class one should not be matched return actions.Count(x => x.ActionName == "Index") <= 1; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Mvc/RenderMvcController.cs b/src/Umbraco.Web/Mvc/RenderMvcController.cs index d7519683fb..888b9534d2 100644 --- a/src/Umbraco.Web/Mvc/RenderMvcController.cs +++ b/src/Umbraco.Web/Mvc/RenderMvcController.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Web.Mvc; using Umbraco.Core; using Umbraco.Core.Cache; @@ -13,7 +13,7 @@ namespace Umbraco.Web.Mvc /// /// Represents the default front-end rendering controller. /// - [PreRenderViewActionFilter] + [PreRenderViewActionFilter] public class RenderMvcController : UmbracoController, IRenderMvcController { private PublishedContentRequest _publishedContentRequest; @@ -90,4 +90,4 @@ namespace Umbraco.Web.Mvc return CurrentTemplate(model); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Mvc/RenderRouteHandler.cs b/src/Umbraco.Web/Mvc/RenderRouteHandler.cs index b31fb91d69..fdbdf6119c 100644 --- a/src/Umbraco.Web/Mvc/RenderRouteHandler.cs +++ b/src/Umbraco.Web/Mvc/RenderRouteHandler.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using System.Web; using System.Web.Compilation; @@ -173,10 +173,10 @@ namespace Umbraco.Web.Mvc if (decodedParts.All(x => x.Key != ReservedAdditionalKeys.Area)) return null; - foreach (var item in decodedParts.Where(x => new[] { - ReservedAdditionalKeys.Controller, - ReservedAdditionalKeys.Action, - ReservedAdditionalKeys.Area }.Contains(x.Key) == false)) + foreach (var item in decodedParts.Where(x => new[] { + ReservedAdditionalKeys.Controller, + ReservedAdditionalKeys.Action, + ReservedAdditionalKeys.Area }.Contains(x.Key) == false)) { // Populate route with additional values which aren't reserved values so they eventually to action parameters requestContext.RouteData.Values[item.Key] = item.Value; @@ -356,9 +356,9 @@ namespace Umbraco.Web.Mvc return new PublishedContentNotFoundHandler("In addition, no template exists to render the custom 404."); // so we have a template, so we should have a rendering engine - if (request.RenderingEngine == RenderingEngine.WebForms) // back to webforms ? + if (request.RenderingEngine == RenderingEngine.WebForms) // back to webforms ? return GetWebFormsHandler(); - + if (request.RenderingEngine != RenderingEngine.Mvc) // else ? return new PublishedContentNotFoundHandler("In addition, no rendering engine exists to render the custom 404."); @@ -385,8 +385,8 @@ namespace Umbraco.Web.Mvc } //Now we can check if we are supposed to render WebForms when the route has not been hijacked - if (request.RenderingEngine == RenderingEngine.WebForms - && request.HasTemplate + if (request.RenderingEngine == RenderingEngine.WebForms + && request.HasTemplate && routeDef.HasHijackedRoute == false) { return GetWebFormsHandler(); @@ -408,7 +408,7 @@ namespace Umbraco.Web.Mvc var handler = GetHandlerOnMissingTemplate(request); // if it's not null it can be either the PublishedContentNotFoundHandler (no document was - // found to handle 404, or document with no template was found) or the WebForms handler + // found to handle 404, or document with no template was found) or the WebForms handler // (a document was found and its template is WebForms) // if it's null it means that a document was found and its template is Mvc @@ -456,6 +456,6 @@ namespace Umbraco.Web.Mvc return _controllerFactory.GetControllerSessionBehavior(requestContext, controllerName); } - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Mvc/RenderViewEngine.cs b/src/Umbraco.Web/Mvc/RenderViewEngine.cs index 6ae8a5d5bb..a4899bf24b 100644 --- a/src/Umbraco.Web/Mvc/RenderViewEngine.cs +++ b/src/Umbraco.Web/Mvc/RenderViewEngine.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.IO; using System.Linq; using System.Web.Mvc; @@ -8,84 +8,84 @@ using Umbraco.Web.Models; namespace Umbraco.Web.Mvc { - /// - /// A view engine to look into the template location specified in the config for the front-end/Rendering part of the cms, - /// this includes paths to render partial macros and media item templates. - /// + /// + /// A view engine to look into the template location specified in the config for the front-end/Rendering part of the cms, + /// this includes paths to render partial macros and media item templates. + /// public class RenderViewEngine : ReflectedFixedRazorViewEngine - { - private readonly IEnumerable _supplementedViewLocations = new[] { "/{0}.cshtml" }; - //NOTE: we will make the main view location the last to be searched since if it is the first to be searched and there is both a view and a partial - // view in both locations and the main view is rendering a partial view with the same name, we will get a stack overflow exception. - // http://issues.umbraco.org/issue/U4-1287, http://issues.umbraco.org/issue/U4-1215 - private readonly IEnumerable _supplementedPartialViewLocations = new[] { "/Partials/{0}.cshtml", "/MacroPartials/{0}.cshtml", "/{0}.cshtml" }; + { + private readonly IEnumerable _supplementedViewLocations = new[] { "/{0}.cshtml" }; + //NOTE: we will make the main view location the last to be searched since if it is the first to be searched and there is both a view and a partial + // view in both locations and the main view is rendering a partial view with the same name, we will get a stack overflow exception. + // http://issues.umbraco.org/issue/U4-1287, http://issues.umbraco.org/issue/U4-1215 + private readonly IEnumerable _supplementedPartialViewLocations = new[] { "/Partials/{0}.cshtml", "/MacroPartials/{0}.cshtml", "/{0}.cshtml" }; - /// - /// Constructor - /// - public RenderViewEngine() - { - const string templateFolder = Constants.ViewLocation; + /// + /// Constructor + /// + public RenderViewEngine() + { + const string templateFolder = Constants.ViewLocation; - var replaceWithUmbracoFolder = _supplementedViewLocations.ForEach(location => templateFolder + location); - var replacePartialWithUmbracoFolder = _supplementedPartialViewLocations.ForEach(location => templateFolder + location); + var replaceWithUmbracoFolder = _supplementedViewLocations.ForEach(location => templateFolder + location); + var replacePartialWithUmbracoFolder = _supplementedPartialViewLocations.ForEach(location => templateFolder + location); - // the Render view engine doesn't support Area's so make those blank + // the Render view engine doesn't support Area's so make those blank ViewLocationFormats = replaceWithUmbracoFolder.ToArray(); - PartialViewLocationFormats = replacePartialWithUmbracoFolder.ToArray(); + PartialViewLocationFormats = replacePartialWithUmbracoFolder.ToArray(); - AreaPartialViewLocationFormats = new string[] { }; - AreaViewLocationFormats = new string[] { }; + AreaPartialViewLocationFormats = new string[] { }; + AreaViewLocationFormats = new string[] { }; - EnsureFoldersAndFiles(); - } + EnsureFoldersAndFiles(); + } - /// - /// Ensures that the correct web.config for razor exists in the /Views folder, the partials folder exist and the ViewStartPage exists. - /// - private static void EnsureFoldersAndFiles() - { - var viewFolder = IOHelper.MapPath(Constants.ViewLocation); + /// + /// Ensures that the correct web.config for razor exists in the /Views folder, the partials folder exist and the ViewStartPage exists. + /// + private static void EnsureFoldersAndFiles() + { + var viewFolder = IOHelper.MapPath(Constants.ViewLocation); - // ensure the web.config file is in the ~/Views folder - Directory.CreateDirectory(viewFolder); - if (File.Exists(Path.Combine(viewFolder, "web.config")) == false) - { - using (var writer = File.CreateText(Path.Combine(viewFolder, "web.config"))) - { - writer.Write(Strings.WebConfigTemplate); - } - } + // ensure the web.config file is in the ~/Views folder + Directory.CreateDirectory(viewFolder); + if (File.Exists(Path.Combine(viewFolder, "web.config")) == false) + { + using (var writer = File.CreateText(Path.Combine(viewFolder, "web.config"))) + { + writer.Write(Strings.WebConfigTemplate); + } + } - //auto create the partials folder - var partialsFolder = Path.Combine(viewFolder, "Partials"); - Directory.CreateDirectory(partialsFolder); + //auto create the partials folder + var partialsFolder = Path.Combine(viewFolder, "Partials"); + Directory.CreateDirectory(partialsFolder); - // We could create a _ViewStart page if it isn't there as well, but we may not allow editing of this page in the back office. - } + // We could create a _ViewStart page if it isn't there as well, but we may not allow editing of this page in the back office. + } - public override ViewEngineResult FindView(ControllerContext controllerContext, string viewName, string masterName, bool useCache) - { - return ShouldFindView(controllerContext, false) - ? base.FindView(controllerContext, viewName, masterName, useCache) + public override ViewEngineResult FindView(ControllerContext controllerContext, string viewName, string masterName, bool useCache) + { + return ShouldFindView(controllerContext, false) + ? base.FindView(controllerContext, viewName, masterName, useCache) : new ViewEngineResult(new string[] { }); - } + } - public override ViewEngineResult FindPartialView(ControllerContext controllerContext, string partialViewName, bool useCache) - { - return ShouldFindView(controllerContext, true) - ? base.FindPartialView(controllerContext, partialViewName, useCache) + public override ViewEngineResult FindPartialView(ControllerContext controllerContext, string partialViewName, bool useCache) + { + return ShouldFindView(controllerContext, true) + ? base.FindPartialView(controllerContext, partialViewName, useCache) : new ViewEngineResult(new string[] { }); - } + } - /// - /// Determines if the view should be found, this is used for view lookup performance and also to ensure - /// less overlap with other user's view engines. This will return true if the Umbraco back office is rendering - /// and its a partial view or if the umbraco front-end is rendering but nothing else. - /// - /// - /// - /// + /// + /// Determines if the view should be found, this is used for view lookup performance and also to ensure + /// less overlap with other user's view engines. This will return true if the Umbraco back office is rendering + /// and its a partial view or if the umbraco front-end is rendering but nothing else. + /// + /// + /// + /// private static bool ShouldFindView(ControllerContext controllerContext, bool isPartial) { var umbracoToken = controllerContext.GetDataTokenInViewContextHierarchy(Core.Constants.Web.UmbracoDataToken); @@ -99,5 +99,5 @@ namespace Umbraco.Web.Mvc return umbracoToken is ContentModel; } - } -} \ No newline at end of file + } +} diff --git a/src/Umbraco.Web/Mvc/RouteDefinition.cs b/src/Umbraco.Web/Mvc/RouteDefinition.cs index fa9443c19d..7a9a37cfe5 100644 --- a/src/Umbraco.Web/Mvc/RouteDefinition.cs +++ b/src/Umbraco.Web/Mvc/RouteDefinition.cs @@ -1,31 +1,31 @@ -using System; +using System; using System.Web.Mvc; using Umbraco.Web.Routing; namespace Umbraco.Web.Mvc { - /// - /// Represents the data required to route to a specific controller/action during an Umbraco request - /// - public class RouteDefinition - { - public string ControllerName { get; set; } - public string ActionName { get; set; } - + /// + /// Represents the data required to route to a specific controller/action during an Umbraco request + /// + public class RouteDefinition + { + public string ControllerName { get; set; } + public string ActionName { get; set; } + /// /// The Controller type found for routing to /// public Type ControllerType { get; set; } - /// - /// The current RenderModel found for the request - /// - public PublishedContentRequest PublishedContentRequest { get; set; } + /// + /// The current RenderModel found for the request + /// + public PublishedContentRequest PublishedContentRequest { get; set; } - /// - /// Gets/sets whether the current request has a hijacked route/user controller routed for it - /// - public bool HasHijackedRoute { get; set; } - } -} \ No newline at end of file + /// + /// Gets/sets whether the current request has a hijacked route/user controller routed for it + /// + public bool HasHijackedRoute { get; set; } + } +} diff --git a/src/Umbraco.Web/Mvc/RouteValueDictionaryExtensions.cs b/src/Umbraco.Web/Mvc/RouteValueDictionaryExtensions.cs index ceb4012a66..decf039a51 100644 --- a/src/Umbraco.Web/Mvc/RouteValueDictionaryExtensions.cs +++ b/src/Umbraco.Web/Mvc/RouteValueDictionaryExtensions.cs @@ -1,41 +1,41 @@ -using System; +using System; using System.Linq; using System.Web.Mvc; using System.Web.Routing; namespace Umbraco.Web.Mvc { - internal static class RouteValueDictionaryExtensions - { + internal static class RouteValueDictionaryExtensions + { - /// - /// Converts a route value dictionary to a form collection - /// - /// - /// - public static FormCollection ToFormCollection(this RouteValueDictionary items) - { - var formCollection = new FormCollection(); - foreach (var i in items) - { - formCollection.Add(i.Key, i.Value != null ? i.Value.ToString() : null); - } - return formCollection; - } + /// + /// Converts a route value dictionary to a form collection + /// + /// + /// + public static FormCollection ToFormCollection(this RouteValueDictionary items) + { + var formCollection = new FormCollection(); + foreach (var i in items) + { + formCollection.Add(i.Key, i.Value != null ? i.Value.ToString() : null); + } + return formCollection; + } - /// - /// Returns the value of a mandatory item in the route items - /// - /// - /// - /// - public static object GetRequiredObject(this RouteValueDictionary items, string key) - { - if (key == null) throw new ArgumentNullException("key"); - if (items.Keys.Contains(key) == false) - throw new ArgumentNullException("The " + key + " parameter was not found but is required"); - return items[key]; - } + /// + /// Returns the value of a mandatory item in the route items + /// + /// + /// + /// + public static object GetRequiredObject(this RouteValueDictionary items, string key) + { + if (key == null) throw new ArgumentNullException("key"); + if (items.Keys.Contains(key) == false) + throw new ArgumentNullException("The " + key + " parameter was not found but is required"); + return items[key]; + } - } -} \ No newline at end of file + } +} diff --git a/src/Umbraco.Web/Mvc/Strings.Designer.cs b/src/Umbraco.Web/Mvc/Strings.Designer.cs index 243a7f7dd9..afcf1c26ff 100644 --- a/src/Umbraco.Web/Mvc/Strings.Designer.cs +++ b/src/Umbraco.Web/Mvc/Strings.Designer.cs @@ -10,8 +10,8 @@ namespace Umbraco.Web.Mvc { using System; - - + + /// /// A strongly-typed resource class, for looking up localized strings, etc. /// @@ -23,15 +23,15 @@ namespace Umbraco.Web.Mvc { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Strings { - + private static global::System.Resources.ResourceManager resourceMan; - + private static global::System.Globalization.CultureInfo resourceCulture; - + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Strings() { } - + /// /// Returns the cached ResourceManager instance used by this class. /// @@ -45,7 +45,7 @@ namespace Umbraco.Web.Mvc { return resourceMan; } } - + /// /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. @@ -59,7 +59,7 @@ namespace Umbraco.Web.Mvc { resourceCulture = value; } } - + /// /// Looks up a localized string similar to <?xml version="1.0"?> ///<configuration> diff --git a/src/Umbraco.Web/Mvc/SurfaceController.cs b/src/Umbraco.Web/Mvc/SurfaceController.cs index c65ad63721..c7a06f06e8 100644 --- a/src/Umbraco.Web/Mvc/SurfaceController.cs +++ b/src/Umbraco.Web/Mvc/SurfaceController.cs @@ -1,4 +1,4 @@ -using System; +using System; using Umbraco.Core; using System.Collections.Specialized; using Umbraco.Core.Models.PublishedContent; @@ -110,8 +110,8 @@ namespace Umbraco.Web.Mvc /// /// /// - /// this is useful if you need to redirect - /// to the current page but the current page is actually a rewritten URL normally done with something like + /// this is useful if you need to redirect + /// to the current page but the current page is actually a rewritten URL normally done with something like /// Server.Transfer. /// protected RedirectToUmbracoUrlResult RedirectToCurrentUmbracoUrl() @@ -161,8 +161,8 @@ namespace Umbraco.Web.Mvc if (currentRouteData.DataTokens.ContainsKey(Core.Constants.Web.UmbracoRouteDefinitionDataToken)) return Attempt.Succeed((RouteDefinition)currentRouteData.DataTokens[Core.Constants.Web.UmbracoRouteDefinitionDataToken]); - currentContext = currentContext.IsChildAction - ? currentContext.ParentActionViewContext + currentContext = currentContext.IsChildAction + ? currentContext.ParentActionViewContext : null; } return Attempt.Fail( @@ -171,4 +171,4 @@ namespace Umbraco.Web.Mvc } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Mvc/SurfaceControllerFactory.cs b/src/Umbraco.Web/Mvc/SurfaceControllerFactory.cs index 8af018e833..abccbf648b 100644 --- a/src/Umbraco.Web/Mvc/SurfaceControllerFactory.cs +++ b/src/Umbraco.Web/Mvc/SurfaceControllerFactory.cs @@ -1,68 +1,68 @@ -using System; +using System; using System.Web.Mvc; using System.Web.Routing; namespace Umbraco.Web.Mvc { - /// - /// Creates SurfaceControllers - /// - [Obsolete("This is not used in the codebase and will be removed from the core in future versions")] - public class SurfaceControllerFactory : RenderControllerFactory - { - /// - /// Check if the correct data tokens are in the route values so that we know its a surface controller route - /// - /// - /// - public override bool CanHandle(RequestContext request) - { - var area = request.RouteData.DataTokens["area"]; - - //if its a non-area route don't handle, all surface controllers will be in the 'umbraco' area - if (area == null || string.IsNullOrWhiteSpace(area.ToString())) - return false; + /// + /// Creates SurfaceControllers + /// + [Obsolete("This is not used in the codebase and will be removed from the core in future versions")] + public class SurfaceControllerFactory : RenderControllerFactory + { + /// + /// Check if the correct data tokens are in the route values so that we know its a surface controller route + /// + /// + /// + public override bool CanHandle(RequestContext request) + { + var area = request.RouteData.DataTokens["area"]; - //ensure there is an umbraco token set - var umbracoToken = request.RouteData.DataTokens[Core.Constants.Web.UmbracoDataToken]; - if (umbracoToken == null || string.IsNullOrWhiteSpace(umbracoToken.ToString())) - return false; + //if its a non-area route don't handle, all surface controllers will be in the 'umbraco' area + if (area == null || string.IsNullOrWhiteSpace(area.ToString())) + return false; - return true; - } + //ensure there is an umbraco token set + var umbracoToken = request.RouteData.DataTokens[Core.Constants.Web.UmbracoDataToken]; + if (umbracoToken == null || string.IsNullOrWhiteSpace(umbracoToken.ToString())) + return false; - /// - /// Create the controller - /// - /// - /// - /// - public override IController CreateController(RequestContext requestContext, string controllerName) - { - //first try to instantiate with the DependencyResolver, if that fails, try with the UmbracoContext as a param, if that fails try with no params. - var controllerType = GetControllerType(requestContext, controllerName); - if (controllerType == null) - throw new InvalidOperationException("Could not find a controller type for the controller name " + controllerName); + return true; + } - object controllerObject; - try - { - controllerObject = DependencyResolver.Current.GetService(controllerType); - } - catch (Exception) - { - try - { - controllerObject = Activator.CreateInstance(controllerType, UmbracoContext.Current); - } - catch (Exception) - { - //if this throws an exception, we'll let it - controllerObject = Activator.CreateInstance(controllerType); - } - } - //if an exception is thrown here, we want it to be thrown as its an invalid cast. - return (IController)controllerObject; - } - } -} \ No newline at end of file + /// + /// Create the controller + /// + /// + /// + /// + public override IController CreateController(RequestContext requestContext, string controllerName) + { + //first try to instantiate with the DependencyResolver, if that fails, try with the UmbracoContext as a param, if that fails try with no params. + var controllerType = GetControllerType(requestContext, controllerName); + if (controllerType == null) + throw new InvalidOperationException("Could not find a controller type for the controller name " + controllerName); + + object controllerObject; + try + { + controllerObject = DependencyResolver.Current.GetService(controllerType); + } + catch (Exception) + { + try + { + controllerObject = Activator.CreateInstance(controllerType, UmbracoContext.Current); + } + catch (Exception) + { + //if this throws an exception, we'll let it + controllerObject = Activator.CreateInstance(controllerType); + } + } + //if an exception is thrown here, we want it to be thrown as its an invalid cast. + return (IController)controllerObject; + } + } +} diff --git a/src/Umbraco.Web/Mvc/SurfaceControllerTypeCollection.cs b/src/Umbraco.Web/Mvc/SurfaceControllerTypeCollection.cs index dfa69825ad..ff0288ffe1 100644 --- a/src/Umbraco.Web/Mvc/SurfaceControllerTypeCollection.cs +++ b/src/Umbraco.Web/Mvc/SurfaceControllerTypeCollection.cs @@ -10,7 +10,7 @@ namespace Umbraco.Web.Mvc internal class SurfaceControllerTypeCollection : BuilderCollectionBase { - public SurfaceControllerTypeCollection(IEnumerable items) + public SurfaceControllerTypeCollection(IEnumerable items) : base(items) { } } diff --git a/src/Umbraco.Web/Mvc/SurfaceRouteHandler.cs b/src/Umbraco.Web/Mvc/SurfaceRouteHandler.cs index 8e56cd715f..3998834223 100644 --- a/src/Umbraco.Web/Mvc/SurfaceRouteHandler.cs +++ b/src/Umbraco.Web/Mvc/SurfaceRouteHandler.cs @@ -13,4 +13,4 @@ namespace Umbraco.Web.Mvc return new UmbracoMvcHandler(requestContext); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Mvc/UmbracoAuthorizeAttribute.cs b/src/Umbraco.Web/Mvc/UmbracoAuthorizeAttribute.cs index c89863f376..e94cffc8c4 100644 --- a/src/Umbraco.Web/Mvc/UmbracoAuthorizeAttribute.cs +++ b/src/Umbraco.Web/Mvc/UmbracoAuthorizeAttribute.cs @@ -7,10 +7,10 @@ using Umbraco.Web.Composing; namespace Umbraco.Web.Mvc { /// - /// Ensures authorization is successful for a back office user. - /// - public sealed class UmbracoAuthorizeAttribute : AuthorizeAttribute - { + /// Ensures authorization is successful for a back office user. + /// + public sealed class UmbracoAuthorizeAttribute : AuthorizeAttribute + { // see note in HttpInstallAuthorizeAttribute private readonly UmbracoContext _umbracoContext; private readonly IRuntimeState _runtimeState; @@ -19,12 +19,12 @@ namespace Umbraco.Web.Mvc private UmbracoContext UmbracoContext => _umbracoContext ?? Current.UmbracoContext; - /// - /// THIS SHOULD BE ONLY USED FOR UNIT TESTS - /// - /// - /// - public UmbracoAuthorizeAttribute(UmbracoContext umbracoContext, IRuntimeState runtimeState) + /// + /// THIS SHOULD BE ONLY USED FOR UNIT TESTS + /// + /// + /// + public UmbracoAuthorizeAttribute(UmbracoContext umbracoContext, IRuntimeState runtimeState) { if (umbracoContext == null) throw new ArgumentNullException(nameof(umbracoContext)); if (runtimeState == null) throw new ArgumentNullException(nameof(runtimeState)); @@ -35,17 +35,17 @@ namespace Umbraco.Web.Mvc public UmbracoAuthorizeAttribute() { } - /// - /// Ensures that the user must be in the Administrator or the Install role - /// - /// - /// - protected override bool AuthorizeCore(HttpContextBase httpContext) - { - if (httpContext == null) throw new ArgumentNullException(nameof(httpContext)); + /// + /// Ensures that the user must be in the Administrator or the Install role + /// + /// + /// + protected override bool AuthorizeCore(HttpContextBase httpContext) + { + if (httpContext == null) throw new ArgumentNullException(nameof(httpContext)); - try - { + try + { // if not configured (install or upgrade) then we can continue // otherwise we need to ensure that a user is logged in return RuntimeState.Level == RuntimeLevel.Install @@ -53,10 +53,10 @@ namespace Umbraco.Web.Mvc || UmbracoContext.Security.ValidateCurrentUser(); } catch (Exception) - { - return false; - } - } + { + return false; + } + } /// /// Override to to ensure no redirect occurs @@ -70,5 +70,5 @@ namespace Umbraco.Web.Mvc filterContext.RequestContext.HttpContext.Response.SuppressFormsAuthenticationRedirect = true; } - } -} \ No newline at end of file + } +} diff --git a/src/Umbraco.Web/Mvc/UmbracoAuthorizedController.cs b/src/Umbraco.Web/Mvc/UmbracoAuthorizedController.cs index 853fc336e7..d0e3ec7b61 100644 --- a/src/Umbraco.Web/Mvc/UmbracoAuthorizedController.cs +++ b/src/Umbraco.Web/Mvc/UmbracoAuthorizedController.cs @@ -2,13 +2,13 @@ { /// /// Provides a base class for authorized Umbraco controllers. - /// - /// - /// This controller essentially just uses a global UmbracoAuthorizeAttribute, inheritors that require more granular control over the - /// authorization of each method can use this attribute instead of inheriting from this controller. - /// - [UmbracoAuthorize] + /// + /// + /// This controller essentially just uses a global UmbracoAuthorizeAttribute, inheritors that require more granular control over the + /// authorization of each method can use this attribute instead of inheriting from this controller. + /// + [UmbracoAuthorize] [DisableBrowserCache] public abstract class UmbracoAuthorizedController : UmbracoController - { } + { } } diff --git a/src/Umbraco.Web/Mvc/UmbracoController.cs b/src/Umbraco.Web/Mvc/UmbracoController.cs index 86ac0361e6..59b0da393f 100644 --- a/src/Umbraco.Web/Mvc/UmbracoController.cs +++ b/src/Umbraco.Web/Mvc/UmbracoController.cs @@ -83,4 +83,4 @@ namespace Umbraco.Web.Mvc /// public virtual WebSecurity Security => UmbracoContext.Security; } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Mvc/UmbracoControllerFactory.cs b/src/Umbraco.Web/Mvc/UmbracoControllerFactory.cs index 9a44c0a804..01c73b92fc 100644 --- a/src/Umbraco.Web/Mvc/UmbracoControllerFactory.cs +++ b/src/Umbraco.Web/Mvc/UmbracoControllerFactory.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Web.Mvc; using System.Web.Routing; using System.Web.SessionState; @@ -15,7 +15,7 @@ namespace Umbraco.Web.Mvc private readonly OverridenDefaultControllerFactory _innerFactory = new OverridenDefaultControllerFactory(); public abstract bool CanHandle(RequestContext request); - + public virtual Type GetControllerType(RequestContext requestContext, string controllerName) { return _innerFactory.GetControllerType(requestContext, controllerName); @@ -82,4 +82,4 @@ namespace Umbraco.Web.Mvc } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Mvc/UmbracoMvcHandler.cs b/src/Umbraco.Web/Mvc/UmbracoMvcHandler.cs index 6e7a92ea10..6238c3dbaf 100644 --- a/src/Umbraco.Web/Mvc/UmbracoMvcHandler.cs +++ b/src/Umbraco.Web/Mvc/UmbracoMvcHandler.cs @@ -5,13 +5,13 @@ namespace Umbraco.Web.Mvc { /// /// MVC handler to facilitate the TemplateRenderer. This handler can execute an MVC request and return it as a string. - /// + /// /// Original: - /// + /// /// This handler also used to intercept creation of controllers and store it for later use. - /// This was needed for the 'return CurrentUmbracoPage()' surface controller functionality + /// This was needed for the 'return CurrentUmbracoPage()' surface controller functionality /// because it needs to send data back to the page controller. - /// + /// /// The creation of this controller has been moved to the UmbracoPageResult class which will create a controller when needed. /// internal class UmbracoMvcHandler : MvcHandler @@ -20,7 +20,7 @@ namespace Umbraco.Web.Mvc : base(requestContext) { } - + /// /// This is used internally purely to render an Umbraco MVC template to string and shouldn't be used for anything else. /// @@ -29,4 +29,4 @@ namespace Umbraco.Web.Mvc base.ProcessRequest(RequestContext.HttpContext); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Mvc/UmbracoPageResult.cs b/src/Umbraco.Web/Mvc/UmbracoPageResult.cs index f27f8cc2d6..05d4b83e58 100644 --- a/src/Umbraco.Web/Mvc/UmbracoPageResult.cs +++ b/src/Umbraco.Web/Mvc/UmbracoPageResult.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.IO; using System.Web; using System.Web.Mvc; @@ -10,43 +10,43 @@ using Umbraco.Web.Composing; namespace Umbraco.Web.Mvc { - /// - /// Used by posted forms to proxy the result to the page in which the current URL matches on - /// - public class UmbracoPageResult : ActionResult - { - private readonly ProfilingLogger _profilingLogger; + /// + /// Used by posted forms to proxy the result to the page in which the current URL matches on + /// + public class UmbracoPageResult : ActionResult + { + private readonly ProfilingLogger _profilingLogger; - public UmbracoPageResult(ProfilingLogger profilingLogger) - { - _profilingLogger = profilingLogger; - } + public UmbracoPageResult(ProfilingLogger profilingLogger) + { + _profilingLogger = profilingLogger; + } [Obsolete("Use the ctor specifying all depenendencies instead")] - public UmbracoPageResult() + public UmbracoPageResult() : this(new ProfilingLogger(Current.Logger, Current.Profiler)) - { - - } + { - public override void ExecuteResult(ControllerContext context) - { - ResetRouteData(context.RouteData); + } + + public override void ExecuteResult(ControllerContext context) + { + ResetRouteData(context.RouteData); ValidateRouteData(context.RouteData); - var routeDef = (RouteDefinition)context.RouteData.DataTokens[Umbraco.Core.Constants.Web.UmbracoRouteDefinitionDataToken]; + var routeDef = (RouteDefinition)context.RouteData.DataTokens[Umbraco.Core.Constants.Web.UmbracoRouteDefinitionDataToken]; - //Special case, if it is webforms but we're posting to an MVC surface controller, then we + //Special case, if it is webforms but we're posting to an MVC surface controller, then we // need to return the webforms result instead - if (routeDef.PublishedContentRequest.RenderingEngine == RenderingEngine.WebForms) - { - EnsureViewContextForWebForms(context); - var webFormsHandler = RenderRouteHandler.GetWebFormsHandler(); - webFormsHandler.ProcessRequest(HttpContext.Current); - } - else - { + if (routeDef.PublishedContentRequest.RenderingEngine == RenderingEngine.WebForms) + { + EnsureViewContextForWebForms(context); + var webFormsHandler = RenderRouteHandler.GetWebFormsHandler(); + webFormsHandler.ProcessRequest(HttpContext.Current); + } + else + { var factory = ControllerBuilder.Current.GetControllerFactory(); context.RouteData.Values["action"] = routeDef.ActionName; ControllerBase controller = null; @@ -62,30 +62,30 @@ namespace Umbraco.Web.Mvc finally { CleanupController(controller, factory); - } - } - } + } + } + } /// /// Executes the controller action /// - private void ExecuteControllerAction(ControllerContext context, IController controller) - { + private void ExecuteControllerAction(ControllerContext context, IController controller) + { using (_profilingLogger.TraceDuration("Executing Umbraco RouteDefinition controller", "Finished")) - { - controller.Execute(context.RequestContext); - } - } - - /// - /// Since we could be returning the current page from a surface controller posted values in which the routing values are changed, we + { + controller.Execute(context.RequestContext); + } + } + + /// + /// Since we could be returning the current page from a surface controller posted values in which the routing values are changed, we /// need to revert these values back to nothing in order for the normal page to render again. /// private static void ResetRouteData(RouteData routeData) - { + { routeData.DataTokens["area"] = null; routeData.DataTokens["Namespaces"] = null; - } + } /// /// Validate that the current page execution is not being handled by the normal umbraco routing system @@ -131,7 +131,7 @@ namespace Umbraco.Web.Mvc controller.ViewData[d.Key] = d.Value; //We cannot simply merge the temp data because during controller execution it will attempt to 'load' temp data - // but since it has not been saved, there will be nothing to load and it will revert to nothing, so the trick is + // but since it has not been saved, there will be nothing to load and it will revert to nothing, so the trick is // to Save the state of the temp data first then it will automatically be picked up. // http://issues.umbraco.org/issue/U4-1339 @@ -141,9 +141,9 @@ namespace Umbraco.Web.Mvc { targetController.TempDataProvider = sourceController.TempDataProvider; targetController.TempData = sourceController.TempData; - targetController.TempData.Save(sourceController.ControllerContext, sourceController.TempDataProvider); + targetController.TempData.Save(sourceController.ControllerContext, sourceController.TempDataProvider); } - + } /// @@ -171,11 +171,11 @@ namespace Umbraco.Web.Mvc controller.DisposeIfDisposable(); } - private class DummyView : IView - { - public void Render(ViewContext viewContext, TextWriter writer) - { - } - } - } -} \ No newline at end of file + private class DummyView : IView + { + public void Render(ViewContext viewContext, TextWriter writer) + { + } + } + } +} diff --git a/src/Umbraco.Web/Mvc/UmbracoViewPageOfTModel.cs b/src/Umbraco.Web/Mvc/UmbracoViewPageOfTModel.cs index 1fd458066f..0d9f101882 100644 --- a/src/Umbraco.Web/Mvc/UmbracoViewPageOfTModel.cs +++ b/src/Umbraco.Web/Mvc/UmbracoViewPageOfTModel.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Text; using System.Web; using System.Web.Mvc; @@ -56,7 +56,7 @@ namespace Umbraco.Web.Mvc /// /// Gets the Umbraco context. /// - public UmbracoContext UmbracoContext => _umbracoContext + public UmbracoContext UmbracoContext => _umbracoContext ?? (_umbracoContext = ViewContext.GetUmbracoContext() ?? Current.UmbracoContext); /// diff --git a/src/Umbraco.Web/Mvc/UmbracoVirtualNodeByIdRouteHandler.cs b/src/Umbraco.Web/Mvc/UmbracoVirtualNodeByIdRouteHandler.cs index f001f35b41..304f59b64b 100644 --- a/src/Umbraco.Web/Mvc/UmbracoVirtualNodeByIdRouteHandler.cs +++ b/src/Umbraco.Web/Mvc/UmbracoVirtualNodeByIdRouteHandler.cs @@ -23,4 +23,4 @@ namespace Umbraco.Web.Mvc return baseContent; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Mvc/UmbracoVirtualNodeRouteHandler.cs b/src/Umbraco.Web/Mvc/UmbracoVirtualNodeRouteHandler.cs index a3d3b79d6e..41940981f6 100644 --- a/src/Umbraco.Web/Mvc/UmbracoVirtualNodeRouteHandler.cs +++ b/src/Umbraco.Web/Mvc/UmbracoVirtualNodeRouteHandler.cs @@ -27,7 +27,7 @@ namespace Umbraco.Web.Mvc /// //check if context is null, we know it will be null if we are dealing with a request that /// //has an extension and by default no Umb ctx is created for the request /// if (ctx == null) { - /// //TODO: Here you can EnsureContext , please note that the requestContext is passed in + /// //TODO: Here you can EnsureContext , please note that the requestContext is passed in /// //therefore your should refrain from using other singletons like HttpContext.Current since /// //you will already have a reference to it. Also if you need an ApplicationContext you should /// //pass this in via a ctor instead of using the ApplicationContext.Current singleton. diff --git a/src/Umbraco.Web/Mvc/UrlHelperExtensions.cs b/src/Umbraco.Web/Mvc/UrlHelperExtensions.cs index 3f2d5c7a3b..e48c2d5275 100644 --- a/src/Umbraco.Web/Mvc/UrlHelperExtensions.cs +++ b/src/Umbraco.Web/Mvc/UrlHelperExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Web.Mvc; using Umbraco.Core; using Umbraco.Core.Configuration; @@ -7,19 +7,19 @@ using Umbraco.Core.Xml; namespace Umbraco.Web.Mvc { - /// - /// Extension methods for UrlHelper - /// - public static class UrlHelperExtensions - { - /// - /// Utility method for checking for valid proxy urls or redirect urls to prevent Open Redirect security issues - /// - /// - /// The url to validate - /// The url of the current local domain (to ensure we can validate if the requested url is local without dependency on the request) - /// True if it's an allowed url - public static bool ValidateProxyUrl(this UrlHelper urlHelper, string url, string callerUrl) + /// + /// Extension methods for UrlHelper + /// + public static class UrlHelperExtensions + { + /// + /// Utility method for checking for valid proxy urls or redirect urls to prevent Open Redirect security issues + /// + /// + /// The url to validate + /// The url of the current local domain (to ensure we can validate if the requested url is local without dependency on the request) + /// True if it's an allowed url + public static bool ValidateProxyUrl(this UrlHelper urlHelper, string url, string callerUrl) { if (Uri.IsWellFormedUriString(url, UriKind.RelativeOrAbsolute) == false) { @@ -82,10 +82,10 @@ namespace Umbraco.Web.Mvc /// /// public static string GetSaveFileServicePath(this UrlHelper url) - { - var result = url.Action("SavePartialView", "SaveFile", new {area = GlobalSettings.UmbracoMvcArea}); + { + var result = url.Action("SavePartialView", "SaveFile", new {area = GlobalSettings.UmbracoMvcArea}); return result.TrimEnd("SavePartialView").EnsureEndsWith('/'); - } + } /// /// Returns the base path (not including the 'action') of the MVC controller "BulkPublishController" @@ -108,5 +108,5 @@ namespace Umbraco.Web.Mvc var result = url.Action("ToSafeAlias", "CoreStrings", new { area = GlobalSettings.UmbracoMvcArea }); return result.TrimEnd("ToSafeAlias"); } - } + } } diff --git a/src/Umbraco.Web/Mvc/ValidateMvcAngularAntiForgeryTokenAttribute.cs b/src/Umbraco.Web/Mvc/ValidateMvcAngularAntiForgeryTokenAttribute.cs index 977f37473b..756ca7f05c 100644 --- a/src/Umbraco.Web/Mvc/ValidateMvcAngularAntiForgeryTokenAttribute.cs +++ b/src/Umbraco.Web/Mvc/ValidateMvcAngularAntiForgeryTokenAttribute.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using System.Net; using System.Security.Claims; @@ -12,7 +12,7 @@ namespace Umbraco.Web.Mvc /// /// /// Code derived from http://ericpanorel.net/2013/07/28/spa-authentication-and-csrf-mvc4-antiforgery-implementation/ - /// + /// /// If the authentication type is cookie based, then this filter will execute, otherwise it will be disabled /// public sealed class ValidateMvcAngularAntiForgeryTokenAttribute : ActionFilterAttribute @@ -58,4 +58,4 @@ namespace Umbraco.Web.Mvc base.OnActionExecuting(filterContext); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Mvc/ViewContextExtensions.cs b/src/Umbraco.Web/Mvc/ViewContextExtensions.cs index 1cb39e2487..ec470aa921 100644 --- a/src/Umbraco.Web/Mvc/ViewContextExtensions.cs +++ b/src/Umbraco.Web/Mvc/ViewContextExtensions.cs @@ -1,53 +1,53 @@ -using System.IO; +using System.IO; using System.Web.Mvc; namespace Umbraco.Web.Mvc { - internal static class ViewContextExtensions - { - /// - /// Creates a new ViewContext from an existing one but specifies a new Model for the ViewData - /// - /// - /// - /// - public static ViewContext CopyWithModel(this ViewContext vc, object model) - { - return new ViewContext - { - Controller = vc.Controller, - HttpContext = vc.HttpContext, - RequestContext = vc.RequestContext, - RouteData = vc.RouteData, - TempData = vc.TempData, - View = vc.View, - ViewData = new ViewDataDictionary(vc) - { - Model = model - }, - FormContext = vc.FormContext, - ClientValidationEnabled = vc.ClientValidationEnabled, - UnobtrusiveJavaScriptEnabled = vc.UnobtrusiveJavaScriptEnabled, - Writer = vc.Writer - }; - } + internal static class ViewContextExtensions + { + /// + /// Creates a new ViewContext from an existing one but specifies a new Model for the ViewData + /// + /// + /// + /// + public static ViewContext CopyWithModel(this ViewContext vc, object model) + { + return new ViewContext + { + Controller = vc.Controller, + HttpContext = vc.HttpContext, + RequestContext = vc.RequestContext, + RouteData = vc.RouteData, + TempData = vc.TempData, + View = vc.View, + ViewData = new ViewDataDictionary(vc) + { + Model = model + }, + FormContext = vc.FormContext, + ClientValidationEnabled = vc.ClientValidationEnabled, + UnobtrusiveJavaScriptEnabled = vc.UnobtrusiveJavaScriptEnabled, + Writer = vc.Writer + }; + } - //public static ViewContext CloneWithWriter(this ViewContext vc, TextWriter writer) - //{ - // return new ViewContext - // { - // Controller = vc.Controller, - // HttpContext = vc.HttpContext, - // RequestContext = vc.RequestContext, - // RouteData = vc.RouteData, - // TempData = vc.TempData, - // View = vc.View, - // ViewData = vc.ViewData, - // FormContext = vc.FormContext, - // ClientValidationEnabled = vc.ClientValidationEnabled, - // UnobtrusiveJavaScriptEnabled = vc.UnobtrusiveJavaScriptEnabled, - // Writer = writer - // }; - //} - } -} \ No newline at end of file + //public static ViewContext CloneWithWriter(this ViewContext vc, TextWriter writer) + //{ + // return new ViewContext + // { + // Controller = vc.Controller, + // HttpContext = vc.HttpContext, + // RequestContext = vc.RequestContext, + // RouteData = vc.RouteData, + // TempData = vc.TempData, + // View = vc.View, + // ViewData = vc.ViewData, + // FormContext = vc.FormContext, + // ClientValidationEnabled = vc.ClientValidationEnabled, + // UnobtrusiveJavaScriptEnabled = vc.UnobtrusiveJavaScriptEnabled, + // Writer = writer + // }; + //} + } +} diff --git a/src/Umbraco.Web/Mvc/ViewDataContainerExtensions.cs b/src/Umbraco.Web/Mvc/ViewDataContainerExtensions.cs index f8f627d39a..9fb301d8c5 100644 --- a/src/Umbraco.Web/Mvc/ViewDataContainerExtensions.cs +++ b/src/Umbraco.Web/Mvc/ViewDataContainerExtensions.cs @@ -1,49 +1,49 @@ -using System.Web.Mvc; +using System.Web.Mvc; namespace Umbraco.Web.Mvc { internal static class ViewDataContainerExtensions - { - private class ViewDataContainer : IViewDataContainer - { - public ViewDataContainer() - { - ViewData = new ViewDataDictionary(); - } - public ViewDataDictionary ViewData { get; set; } - } + { + private class ViewDataContainer : IViewDataContainer + { + public ViewDataContainer() + { + ViewData = new ViewDataDictionary(); + } + public ViewDataDictionary ViewData { get; set; } + } - /// - /// Creates a new IViewDataContainer but with a filtered ModelState - /// - /// - /// - /// - public static IViewDataContainer FilterContainer(this IViewDataContainer container, string prefix) - { - var newContainer = new ViewDataContainer(); - newContainer.ViewData.ModelState.Merge(container.ViewData.ModelState, prefix); + /// + /// Creates a new IViewDataContainer but with a filtered ModelState + /// + /// + /// + /// + public static IViewDataContainer FilterContainer(this IViewDataContainer container, string prefix) + { + var newContainer = new ViewDataContainer(); + newContainer.ViewData.ModelState.Merge(container.ViewData.ModelState, prefix); //change the html field name too - newContainer.ViewData.TemplateInfo.HtmlFieldPrefix = prefix; - return newContainer; - } + newContainer.ViewData.TemplateInfo.HtmlFieldPrefix = prefix; + return newContainer; + } - /// - /// Returns a new IViewContainer based on the current one but supplies a different model to the ViewData - /// - /// - /// - /// - public static IViewDataContainer CopyWithModel(this IViewDataContainer container, object model) - { - return new ViewDataContainer - { - ViewData = new ViewDataDictionary(container.ViewData) - { - Model = model - } - }; - } + /// + /// Returns a new IViewContainer based on the current one but supplies a different model to the ViewData + /// + /// + /// + /// + public static IViewDataContainer CopyWithModel(this IViewDataContainer container, object model) + { + return new ViewDataContainer + { + ViewData = new ViewDataDictionary(container.ViewData) + { + Model = model + } + }; + } - } -} \ No newline at end of file + } +} diff --git a/src/Umbraco.Web/Mvc/ViewDataDictionaryExtensions.cs b/src/Umbraco.Web/Mvc/ViewDataDictionaryExtensions.cs index 71cebe736a..1e088c3744 100644 --- a/src/Umbraco.Web/Mvc/ViewDataDictionaryExtensions.cs +++ b/src/Umbraco.Web/Mvc/ViewDataDictionaryExtensions.cs @@ -1,4 +1,4 @@ -using System.Web.Mvc; +using System.Web.Mvc; using Umbraco.Core; namespace Umbraco.Web.Mvc @@ -15,4 +15,4 @@ namespace Umbraco.Web.Mvc destination.MergeLeft(source); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/NotificationServiceExtensions.cs b/src/Umbraco.Web/NotificationServiceExtensions.cs index 4b1ac5dd6c..0da998ac15 100644 --- a/src/Umbraco.Web/NotificationServiceExtensions.cs +++ b/src/Umbraco.Web/NotificationServiceExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Globalization; using Umbraco.Core; using Umbraco.Core.Configuration; @@ -69,7 +69,7 @@ namespace Umbraco.Web var user = umbracoContext.Security.CurrentUser; var userService = Current.Services.UserService; // fixme inject - //if there is no current user, then use the admin + //if there is no current user, then use the admin if (user == null) { Current.Logger.Debug(typeof(NotificationServiceExtensions), "There is no current Umbraco user logged in, the notifications will be sent from the administrator"); @@ -94,7 +94,7 @@ namespace Umbraco.Web var user = umbracoContext.Security.CurrentUser; var userService = Current.Services.UserService; // fixme inject - //if there is no current user, then use the admin + //if there is no current user, then use the admin if (user == null) { Current.Logger.Debug(typeof(NotificationServiceExtensions), "There is no current Umbraco user logged in, the notifications will be sent from the administrator"); @@ -146,4 +146,4 @@ namespace Umbraco.Web : textService.Localize("notifications/mailBodyHtml", mailingUser.GetUserCulture(textService), strings)); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/OwinMiddlewareConfiguredEventArgs.cs b/src/Umbraco.Web/OwinMiddlewareConfiguredEventArgs.cs index 03c2dc631d..8b4d46a373 100644 --- a/src/Umbraco.Web/OwinMiddlewareConfiguredEventArgs.cs +++ b/src/Umbraco.Web/OwinMiddlewareConfiguredEventArgs.cs @@ -1,4 +1,4 @@ -using System; +using System; using Owin; namespace Umbraco.Web @@ -12,4 +12,4 @@ namespace Umbraco.Web public IAppBuilder AppBuilder { get; private set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PluginManagerExtensions.cs b/src/Umbraco.Web/PluginManagerExtensions.cs index 050b21c522..77ff98a453 100644 --- a/src/Umbraco.Web/PluginManagerExtensions.cs +++ b/src/Umbraco.Web/PluginManagerExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Threading; using Umbraco.Core; @@ -15,11 +15,11 @@ using Umbraco.Web._Legacy.Actions; namespace Umbraco.Web { - /// - /// Extension methods for the PluginTypeResolver - /// - public static class PluginManagerExtensions - { + /// + /// Extension methods for the PluginTypeResolver + /// + public static class PluginManagerExtensions + { /// /// Returns all available IAction in application /// @@ -39,45 +39,45 @@ namespace Umbraco.Web } internal static IEnumerable ResolveSurfaceControllers(this TypeLoader resolver) - { - return resolver.GetTypes(); - } + { + return resolver.GetTypes(); + } internal static IEnumerable ResolveUmbracoApiControllers(this TypeLoader resolver) { return resolver.GetTypes(); } - /// - /// Returns all available ITrees in application - /// - /// - /// - internal static IEnumerable ResolveTrees(this TypeLoader resolver) - { - return resolver.GetTypes(); - } + /// + /// Returns all available ITrees in application + /// + /// + /// + internal static IEnumerable ResolveTrees(this TypeLoader resolver) + { + return resolver.GetTypes(); + } - /// - /// Returns all classes attributed with XsltExtensionAttribute attribute - /// - /// - /// - internal static IEnumerable ResolveXsltExtensions(this TypeLoader resolver) - { - return resolver.GetAttributedTypes(); - } + /// + /// Returns all classes attributed with XsltExtensionAttribute attribute + /// + /// + /// + internal static IEnumerable ResolveXsltExtensions(this TypeLoader resolver) + { + return resolver.GetAttributedTypes(); + } - /// - /// Returns all IThumbnailProvider classes - /// - /// - /// - internal static IEnumerable ResolveThumbnailProviders(this TypeLoader resolver) - { - return resolver.GetTypes(); - } + /// + /// Returns all IThumbnailProvider classes + /// + /// + /// + internal static IEnumerable ResolveThumbnailProviders(this TypeLoader resolver) + { + return resolver.GetTypes(); + } /// /// Returns all IImageUrlProvider classes @@ -90,4 +90,4 @@ namespace Umbraco.Web } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Properties/AssemblyInfo.cs b/src/Umbraco.Web/Properties/AssemblyInfo.cs index 17e9d03210..ca6397f8da 100644 --- a/src/Umbraco.Web/Properties/AssemblyInfo.cs +++ b/src/Umbraco.Web/Properties/AssemblyInfo.cs @@ -1,10 +1,10 @@ -using System.Reflection; +using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Security; // -// General Information about an assembly is controlled through the following +// 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. // @@ -13,8 +13,8 @@ using System.Security; [assembly: AssemblyConfiguration("")] [assembly: AssemblyProduct("Umbraco CMS")] -// 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 +// 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)] diff --git a/src/Umbraco.Web/Properties/Settings1.Designer.cs b/src/Umbraco.Web/Properties/Settings1.Designer.cs index 1b72efc115..c1460bbdcb 100644 --- a/src/Umbraco.Web/Properties/Settings1.Designer.cs +++ b/src/Umbraco.Web/Properties/Settings1.Designer.cs @@ -9,20 +9,20 @@ //------------------------------------------------------------------------------ namespace Umbraco.Web.Properties { - - + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { - + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - + public static Settings Default { get { return defaultInstance; } } - + [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("http://regexlib.com/WebServices.asmx")] @@ -31,7 +31,7 @@ namespace Umbraco.Web.Properties { return ((string)(this["umbraco_com_regexlib_Webservices"])); } } - + [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.WebServiceUrl)] @@ -41,7 +41,7 @@ namespace Umbraco.Web.Properties { return ((string)(this["umbraco_org_umbraco_update_CheckForUpgrade"])); } } - + [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("Somthing")] @@ -50,7 +50,7 @@ namespace Umbraco.Web.Properties { return ((string)(this["test"])); } } - + [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.WebServiceUrl)] diff --git a/src/Umbraco.Web/PropertyEditors/CheckBoxListPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/CheckBoxListPropertyEditor.cs index c7c99564f8..0dced99749 100644 --- a/src/Umbraco.Web/PropertyEditors/CheckBoxListPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/CheckBoxListPropertyEditor.cs @@ -1,4 +1,4 @@ -using Umbraco.Core; +using Umbraco.Core; using Umbraco.Core.Logging; using Umbraco.Core.PropertyEditors; using Umbraco.Core.Services; @@ -9,7 +9,7 @@ namespace Umbraco.Web.PropertyEditors /// A property editor to allow multiple checkbox selection of pre-defined items. /// /// - /// Due to remaining backwards compatible, this stores the id of the checkbox items in the database + /// Due to remaining backwards compatible, this stores the id of the checkbox items in the database /// as INT and we have logic in here to ensure it is formatted correctly including ensuring that the string value is published /// in cache and not the int ID. /// @@ -48,4 +48,4 @@ namespace Umbraco.Web.PropertyEditors } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PropertyEditors/ColorListPreValueEditor.cs b/src/Umbraco.Web/PropertyEditors/ColorListPreValueEditor.cs index a3473948c8..e8bfa3202b 100644 --- a/src/Umbraco.Web/PropertyEditors/ColorListPreValueEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/ColorListPreValueEditor.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Text.RegularExpressions; @@ -13,8 +13,8 @@ namespace Umbraco.Web.PropertyEditors { internal class ColorListPreValueEditor : ValueListPreValueEditor { - - public ColorListPreValueEditor(ILocalizedTextService textService, ILogger logger) + + public ColorListPreValueEditor(ILocalizedTextService textService, ILogger logger) : base(textService, logger) { var field = Fields.First(); @@ -26,7 +26,7 @@ namespace Umbraco.Web.PropertyEditors //change the label field.Name = "Add color"; //need to have some custom validation happening here - field.Validators.Add(new ColorListValidator()); + field.Validators.Add(new ColorListValidator()); } public override IDictionary ConvertDbToEditor(IDictionary defaultPreVals, PreValueCollection persistedPreVals) @@ -42,7 +42,7 @@ namespace Umbraco.Web.PropertyEditors { var json = value as JArray; if (json == null) yield break; - + //validate each item which is a json object for (var index = 0; index < json.Count; index++) { @@ -66,4 +66,4 @@ namespace Umbraco.Web.PropertyEditors } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PropertyEditors/ColorPickerPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/ColorPickerPropertyEditor.cs index 1f79d569ff..6112118968 100644 --- a/src/Umbraco.Web/PropertyEditors/ColorPickerPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/ColorPickerPropertyEditor.cs @@ -1,4 +1,4 @@ -using Umbraco.Core; +using Umbraco.Core; using Umbraco.Core.Logging; using Umbraco.Core.PropertyEditors; using Umbraco.Core.Services; @@ -31,4 +31,4 @@ namespace Umbraco.Web.PropertyEditors } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PropertyEditors/ContentPicker2PropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/ContentPicker2PropertyEditor.cs index da9613fd21..880df08859 100644 --- a/src/Umbraco.Web/PropertyEditors/ContentPicker2PropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/ContentPicker2PropertyEditor.cs @@ -62,4 +62,4 @@ namespace Umbraco.Web.PropertyEditors } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PropertyEditors/ContentPickerPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/ContentPickerPropertyEditor.cs index 6b75df8647..bd47f845ef 100644 --- a/src/Umbraco.Web/PropertyEditors/ContentPickerPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/ContentPickerPropertyEditor.cs @@ -10,7 +10,7 @@ namespace Umbraco.Web.PropertyEditors [PropertyEditor(Constants.PropertyEditors.ContentPickerAlias, "(Obsolete) Content Picker", PropertyEditorValueTypes.Integer, "contentpicker", IsParameterEditor = true, Group = "Pickers", IsDeprecated = true)] public class ContentPickerPropertyEditor : ContentPicker2PropertyEditor { - public ContentPickerPropertyEditor(ILogger logger) + public ContentPickerPropertyEditor(ILogger logger) : base(logger) { InternalPreValues["idType"] = "int"; @@ -23,4 +23,4 @@ namespace Umbraco.Web.PropertyEditors return preValEditor; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PropertyEditors/DatePreValueEditor.cs b/src/Umbraco.Web/PropertyEditors/DatePreValueEditor.cs index dde4d6c2f1..9200be9f7e 100644 --- a/src/Umbraco.Web/PropertyEditors/DatePreValueEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/DatePreValueEditor.cs @@ -1,4 +1,4 @@ -using Umbraco.Core.PropertyEditors; +using Umbraco.Core.PropertyEditors; namespace Umbraco.Web.PropertyEditors { @@ -7,4 +7,4 @@ namespace Umbraco.Web.PropertyEditors [PreValueField("format", "Date format", "textstring", Description = "If left empty then the format is YYYY-MM-DD. (see momentjs.com for supported formats)")] public string DefaultValue { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PropertyEditors/DatePropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/DatePropertyEditor.cs index 331495d119..74227b5272 100644 --- a/src/Umbraco.Web/PropertyEditors/DatePropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/DatePropertyEditor.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Text.RegularExpressions; using Newtonsoft.Json.Linq; @@ -54,7 +54,7 @@ namespace Umbraco.Web.PropertyEditors return string.Empty; } //Dates will be formatted as yyyy-MM-dd - return date.Result.Value.ToString("yyyy-MM-dd"); + return date.Result.Value.ToString("yyyy-MM-dd"); } } @@ -64,4 +64,4 @@ namespace Umbraco.Web.PropertyEditors return new DatePreValueEditor(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PropertyEditors/DateTimePreValueEditor.cs b/src/Umbraco.Web/PropertyEditors/DateTimePreValueEditor.cs index 242893cbca..272f1e58af 100644 --- a/src/Umbraco.Web/PropertyEditors/DateTimePreValueEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/DateTimePreValueEditor.cs @@ -1,4 +1,4 @@ -using Umbraco.Core.PropertyEditors; +using Umbraco.Core.PropertyEditors; namespace Umbraco.Web.PropertyEditors { @@ -7,4 +7,4 @@ namespace Umbraco.Web.PropertyEditors [PreValueField("offsetTime", "Offset time", "boolean", Description = "When enabled the time displayed will be offset with the server's timezone, this is useful for scenarios like scheduled publishing when an editor is in a different timezone than the hosted server")] public bool OffsetTime { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PropertyEditors/DateTimePropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/DateTimePropertyEditor.cs index 38a4c50d6c..82c68e136b 100644 --- a/src/Umbraco.Web/PropertyEditors/DateTimePropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/DateTimePropertyEditor.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using Umbraco.Core; using Umbraco.Core.Logging; @@ -51,4 +51,4 @@ namespace Umbraco.Web.PropertyEditors return new DateTimePreValueEditor(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PropertyEditors/DateTimeValidator.cs b/src/Umbraco.Web/PropertyEditors/DateTimeValidator.cs index 8a41f3c399..b841727faf 100644 --- a/src/Umbraco.Web/PropertyEditors/DateTimeValidator.cs +++ b/src/Umbraco.Web/PropertyEditors/DateTimeValidator.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using Umbraco.Core.Models; @@ -26,11 +26,11 @@ namespace Umbraco.Web.PropertyEditors yield return new ValidationResult(string.Format("The string value {0} cannot be parsed into a DateTime", value), new[] { - //we only store a single value for this editor so the 'member' or 'field' + //we only store a single value for this editor so the 'member' or 'field' // we'll associate this error with will simply be called 'value' - "value" + "value" }); } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PropertyEditors/DecimalPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/DecimalPropertyEditor.cs index e66ec96673..50a69ecc80 100644 --- a/src/Umbraco.Web/PropertyEditors/DecimalPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/DecimalPropertyEditor.cs @@ -1,4 +1,4 @@ -using Umbraco.Core; +using Umbraco.Core; using Umbraco.Core.Logging; using Umbraco.Core.PropertyEditors; @@ -24,7 +24,7 @@ namespace Umbraco.Web.PropertyEditors editor.Validators.Add(new DecimalValidator()); return editor; } - + protected override PreValueEditor CreatePreValueEditor() { return new DecimalPreValueEditor(); @@ -62,6 +62,6 @@ namespace Umbraco.Web.PropertyEditors } } - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PropertyEditors/DropDownMultiplePropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/DropDownMultiplePropertyEditor.cs index 2728f5c86b..ceaa71b2b7 100644 --- a/src/Umbraco.Web/PropertyEditors/DropDownMultiplePropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/DropDownMultiplePropertyEditor.cs @@ -1,4 +1,4 @@ -using Newtonsoft.Json; +using Newtonsoft.Json; using Umbraco.Core; using Umbraco.Core.Logging; using Umbraco.Core.PropertyEditors; @@ -10,7 +10,7 @@ namespace Umbraco.Web.PropertyEditors /// A property editor to allow multiple selection of pre-defined items /// /// - /// Due to maintaining backwards compatibility this data type stores the value as a string which is a comma separated value of the + /// Due to maintaining backwards compatibility this data type stores the value as a string which is a comma separated value of the /// ids of the individual items so we have logic in here to deal with that. /// [ParameterEditor("propertyTypePickerMultiple", "Name", "textbox")] @@ -33,7 +33,7 @@ namespace Umbraco.Web.PropertyEditors } - - -} \ No newline at end of file + + +} diff --git a/src/Umbraco.Web/PropertyEditors/DropDownMultipleWithKeysPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/DropDownMultipleWithKeysPropertyEditor.cs index 392745cc95..def9b8763e 100644 --- a/src/Umbraco.Web/PropertyEditors/DropDownMultipleWithKeysPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/DropDownMultipleWithKeysPropertyEditor.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using Umbraco.Core; using Umbraco.Core.Logging; using Umbraco.Core.Models; @@ -11,7 +11,7 @@ namespace Umbraco.Web.PropertyEditors /// A property editor to allow multiple selection of pre-defined items /// /// - /// Due to maintaining backwards compatibility this data type stores the value as a string which is a comma separated value of the + /// Due to maintaining backwards compatibility this data type stores the value as a string which is a comma separated value of the /// ids of the individual items so we have logic in here to deal with that. /// [PropertyEditor(Constants.PropertyEditors.DropdownlistMultiplePublishKeysAlias, "Dropdown list multiple, publish keys", "dropdown", Group = "lists", Icon = "icon-bulleted-list")] @@ -38,7 +38,7 @@ namespace Umbraco.Web.PropertyEditors } /// - /// A pre-value editor for the 'drop down list multiple' property editor that ensures that 'multiple' is saved for the config in the db but is not + /// A pre-value editor for the 'drop down list multiple' property editor that ensures that 'multiple' is saved for the config in the db but is not /// rendered as a pre-value field. /// /// @@ -46,7 +46,7 @@ namespace Umbraco.Web.PropertyEditors /// internal class DropDownMultiplePreValueEditor : ValueListPreValueEditor { - public DropDownMultiplePreValueEditor(ILocalizedTextService textService, ILogger logger) + public DropDownMultiplePreValueEditor(ILocalizedTextService textService, ILogger logger) : base(textService, logger) { //add the multiple field, we'll make it hidden so it is not seen in the pre-value editor @@ -56,7 +56,7 @@ namespace Umbraco.Web.PropertyEditors Name = "multiple", View = "hidden", HideLabel = true - }); + }); } /// @@ -75,4 +75,4 @@ namespace Umbraco.Web.PropertyEditors } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PropertyEditors/DropDownPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/DropDownPropertyEditor.cs index 4da84a6454..24b42b5e00 100644 --- a/src/Umbraco.Web/PropertyEditors/DropDownPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/DropDownPropertyEditor.cs @@ -1,4 +1,4 @@ -using Newtonsoft.Json; +using Newtonsoft.Json; using Newtonsoft.Json.Linq; using Umbraco.Core; using Umbraco.Core.Logging; @@ -38,4 +38,4 @@ namespace Umbraco.Web.PropertyEditors } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PropertyEditors/DropDownWithKeysPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/DropDownWithKeysPropertyEditor.cs index 604a3416c0..a1d0d2e46d 100644 --- a/src/Umbraco.Web/PropertyEditors/DropDownWithKeysPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/DropDownWithKeysPropertyEditor.cs @@ -1,4 +1,4 @@ -using Umbraco.Core; +using Umbraco.Core; using Umbraco.Core.Logging; using Umbraco.Core.PropertyEditors; using Umbraco.Core.Services; @@ -35,4 +35,4 @@ namespace Umbraco.Web.PropertyEditors return new ValueListPreValueEditor(_textService, Logger); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PropertyEditors/EmailAddressPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/EmailAddressPropertyEditor.cs index 2c695f2e5f..57f11ad5e5 100644 --- a/src/Umbraco.Web/PropertyEditors/EmailAddressPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/EmailAddressPropertyEditor.cs @@ -1,4 +1,4 @@ -using Umbraco.Core; +using Umbraco.Core; using Umbraco.Core.Logging; using Umbraco.Core.PropertyEditors; @@ -36,4 +36,4 @@ namespace Umbraco.Web.PropertyEditors } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PropertyEditors/FileUploadPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/FileUploadPropertyEditor.cs index c1b584b655..e63d2a5e50 100644 --- a/src/Umbraco.Web/PropertyEditors/FileUploadPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/FileUploadPropertyEditor.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; @@ -34,7 +34,7 @@ namespace Umbraco.Web.PropertyEditors /// The corresponding property value editor. protected override PropertyValueEditor CreateValueEditor() { - var baseEditor = base.CreateValueEditor(); + var baseEditor = base.CreateValueEditor(); baseEditor.Validators.Add(new UploadFileTypeValidator()); return new FileUploadPropertyValueEditor(baseEditor, _mediaFileSystem); } @@ -163,11 +163,11 @@ namespace Umbraco.Web.PropertyEditors _mediaFileSystem.UploadAutoFillProperties.Reset(model, autoFillConfig); else _mediaFileSystem.UploadAutoFillProperties.Populate(model, autoFillConfig, _mediaFileSystem.GetRelativePath(svalue)); - } + } } /// - /// A custom pre-val editor to ensure that the data is stored how the legacy data was stored in + /// A custom pre-val editor to ensure that the data is stored how the legacy data was stored in /// internal class FileUploadPreValueEditor : ValueListPreValueEditor { @@ -219,7 +219,7 @@ namespace Umbraco.Web.PropertyEditors { var result = base.ConvertEditorToDb(editorValue, currentValue); - //this should just be a dictionary of values, we want to re-format this so that it is just one value in the dictionary that is + //this should just be a dictionary of values, we want to re-format this so that it is just one value in the dictionary that is // semi-colon delimited var values = result.Select(item => item.Value.Value).ToList(); @@ -253,7 +253,7 @@ namespace Umbraco.Web.PropertyEditors { //we'll make the server field the index number of the value so it can be wired up to the view "item_" + index.ToInvariantString() - }); + }); } } } diff --git a/src/Umbraco.Web/PropertyEditors/FileUploadPropertyValueEditor.cs b/src/Umbraco.Web/PropertyEditors/FileUploadPropertyValueEditor.cs index f8f2e30e1e..d4682ff2bb 100644 --- a/src/Umbraco.Web/PropertyEditors/FileUploadPropertyValueEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/FileUploadPropertyValueEditor.cs @@ -140,4 +140,4 @@ namespace Umbraco.Web.PropertyEditors return string.Join(",", newPaths.Select(x => _mediaFileSystem.GetUrl(x))); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PropertyEditors/FolderBrowserPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/FolderBrowserPropertyEditor.cs index 9a690d9bec..40cd693380 100644 --- a/src/Umbraco.Web/PropertyEditors/FolderBrowserPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/FolderBrowserPropertyEditor.cs @@ -16,4 +16,4 @@ namespace Umbraco.Web.PropertyEditors { } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PropertyEditors/GridPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/GridPropertyEditor.cs index 47fe344b2f..025f0622eb 100644 --- a/src/Umbraco.Web/PropertyEditors/GridPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/GridPropertyEditor.cs @@ -16,7 +16,7 @@ namespace Umbraco.Web.PropertyEditors [PropertyEditor(Constants.PropertyEditors.GridAlias, "Grid layout", "grid", HideLabel = true, IsParameterEditor = false, ValueType = PropertyEditorValueTypes.Json, Group="rich content", Icon="icon-layout")] public class GridPropertyEditor : PropertyEditor { - public GridPropertyEditor(ILogger logger) + public GridPropertyEditor(ILogger logger) : base(logger) { } @@ -48,7 +48,7 @@ namespace Umbraco.Web.PropertyEditors foreach (var areaVal in areaVals) { - //TODO: If it's not a string, then it's a json formatted value - + //TODO: If it's not a string, then it's a json formatted value - // we cannot really index this in a smart way since it could be 'anything' if (areaVal.Type == JTokenType.String) { @@ -86,12 +86,12 @@ namespace Umbraco.Web.PropertyEditors catch (InvalidCastException) { //swallow...on purpose, there's a chance that this isn't the json format we are looking for - // and we don't want that to affect the website. + // and we don't want that to affect the website. } catch (JsonException) { - //swallow...on purpose, there's a chance that this isn't json and we don't want that to affect - // the website. + //swallow...on purpose, there's a chance that this isn't json and we don't want that to affect + // the website. } catch (ArgumentException) { diff --git a/src/Umbraco.Web/PropertyEditors/ImageCropperPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/ImageCropperPropertyEditor.cs index fcea6c42d1..cc3c16dd6c 100644 --- a/src/Umbraco.Web/PropertyEditors/ImageCropperPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/ImageCropperPropertyEditor.cs @@ -211,7 +211,7 @@ namespace Umbraco.Web.PropertyEditors /// The content. private void AutoFillProperties(IContentBase model) { - var properties = model.Properties.Where(x => IsCropperField(x, false)); + var properties = model.Properties.Where(x => IsCropperField(x, false)); foreach (var property in properties) { @@ -249,7 +249,7 @@ namespace Umbraco.Web.PropertyEditors _autoFillProperties.Reset(model, autoFillConfig); else _autoFillProperties.Populate(model, autoFillConfig, _mediaFileSystem.GetRelativePath(src)); - } + } } internal class ImageCropperPreValueEditor : PreValueEditor diff --git a/src/Umbraco.Web/PropertyEditors/IntegerPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/IntegerPropertyEditor.cs index ec3125181d..da7fdf2b3a 100644 --- a/src/Umbraco.Web/PropertyEditors/IntegerPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/IntegerPropertyEditor.cs @@ -1,4 +1,4 @@ -using Umbraco.Core; +using Umbraco.Core; using Umbraco.Core.Logging; using Umbraco.Core.PropertyEditors; @@ -24,7 +24,7 @@ namespace Umbraco.Web.PropertyEditors editor.Validators.Add(new IntegerValidator()); return editor; } - + protected override PreValueEditor CreatePreValueEditor() { return new IntegerPreValueEditor(); @@ -62,4 +62,4 @@ namespace Umbraco.Web.PropertyEditors } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PropertyEditors/LabelPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/LabelPropertyEditor.cs index 84d868aa7f..f0f8006072 100644 --- a/src/Umbraco.Web/PropertyEditors/LabelPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/LabelPropertyEditor.cs @@ -152,4 +152,4 @@ namespace Umbraco.Web.PropertyEditors } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PropertyEditors/ListViewPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/ListViewPropertyEditor.cs index 7cf4b2b681..be1ea75518 100644 --- a/src/Umbraco.Web/PropertyEditors/ListViewPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/ListViewPropertyEditor.cs @@ -93,7 +93,7 @@ namespace Umbraco.Web.PropertyEditors public bool AllowBulkMove { get; set; } - public bool AllowBulkDelete { get; set; } + public bool AllowBulkDelete { get; set; } } } } diff --git a/src/Umbraco.Web/PropertyEditors/MacroContainerPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/MacroContainerPropertyEditor.cs index 95ad92a7ea..0cc537c939 100644 --- a/src/Umbraco.Web/PropertyEditors/MacroContainerPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/MacroContainerPropertyEditor.cs @@ -7,7 +7,7 @@ namespace Umbraco.Web.PropertyEditors [PropertyEditor(Constants.PropertyEditors.MacroContainerAlias, "(Obsolete) Macro Picker", "macrocontainer", ValueType = PropertyEditorValueTypes.Text, Group="rich content", Icon="icon-settings-alt", IsDeprecated = true)] public class MacroContainerPropertyEditor : PropertyEditor { - public MacroContainerPropertyEditor(ILogger logger) + public MacroContainerPropertyEditor(ILogger logger) : base(logger) { } diff --git a/src/Umbraco.Web/PropertyEditors/MarkdownPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/MarkdownPropertyEditor.cs index 4ea62b5edd..5ce51aac29 100644 --- a/src/Umbraco.Web/PropertyEditors/MarkdownPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/MarkdownPropertyEditor.cs @@ -1,4 +1,4 @@ -using Umbraco.Core; +using Umbraco.Core; using Umbraco.Core.Logging; using Umbraco.Core.PropertyEditors; @@ -16,7 +16,7 @@ namespace Umbraco.Web.PropertyEditors protected override PreValueEditor CreatePreValueEditor() { - return new MarkdownPreValueEditor(); + return new MarkdownPreValueEditor(); } internal class MarkdownPreValueEditor : PreValueEditor @@ -28,4 +28,4 @@ namespace Umbraco.Web.PropertyEditors public string DefaultValue { get; set; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PropertyEditors/MediaPicker2PropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/MediaPicker2PropertyEditor.cs index 9cc2428ae5..ec911bc4d6 100644 --- a/src/Umbraco.Web/PropertyEditors/MediaPicker2PropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/MediaPicker2PropertyEditor.cs @@ -71,4 +71,4 @@ namespace Umbraco.Web.PropertyEditors } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PropertyEditors/MediaPickerPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/MediaPickerPropertyEditor.cs index e067efa348..38d7991e45 100644 --- a/src/Umbraco.Web/PropertyEditors/MediaPickerPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/MediaPickerPropertyEditor.cs @@ -14,7 +14,7 @@ namespace Umbraco.Web.PropertyEditors [PropertyEditor(Constants.PropertyEditors.MediaPickerAlias, "(Obsolete) Media Picker", PropertyEditorValueTypes.Integer, "mediapicker", Group="media", Icon="icon-picture", IsDeprecated = true)] public class MediaPickerPropertyEditor : MediaPicker2PropertyEditor { - public MediaPickerPropertyEditor(ILogger logger) + public MediaPickerPropertyEditor(ILogger logger) : base(logger) { InternalPreValues = new Dictionary diff --git a/src/Umbraco.Web/PropertyEditors/MemberPicker2PropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/MemberPicker2PropertyEditor.cs index b225a79d04..cee1be88f3 100644 --- a/src/Umbraco.Web/PropertyEditors/MemberPicker2PropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/MemberPicker2PropertyEditor.cs @@ -25,4 +25,4 @@ namespace Umbraco.Web.PropertyEditors set => InternalPreValues = value; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PropertyEditors/MemberPickerPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/MemberPickerPropertyEditor.cs index a8f195d520..2402db8614 100644 --- a/src/Umbraco.Web/PropertyEditors/MemberPickerPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/MemberPickerPropertyEditor.cs @@ -12,7 +12,7 @@ namespace Umbraco.Web.PropertyEditors /// /// The constructor will setup the property editor based on the attribute if one is found /// - public MemberPickerPropertyEditor(ILogger logger) + public MemberPickerPropertyEditor(ILogger logger) : base(logger) { InternalPreValues["idType"] = "int"; diff --git a/src/Umbraco.Web/PropertyEditors/MultiNodeTreePicker2PropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/MultiNodeTreePicker2PropertyEditor.cs index 2a6a863754..0fb72755b0 100644 --- a/src/Umbraco.Web/PropertyEditors/MultiNodeTreePicker2PropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/MultiNodeTreePicker2PropertyEditor.cs @@ -121,4 +121,4 @@ namespace Umbraco.Web.PropertyEditors } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PropertyEditors/MultiNodeTreePickerPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/MultiNodeTreePickerPropertyEditor.cs index 771f467203..8ba2d5df7c 100644 --- a/src/Umbraco.Web/PropertyEditors/MultiNodeTreePickerPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/MultiNodeTreePickerPropertyEditor.cs @@ -14,7 +14,7 @@ namespace Umbraco.Web.PropertyEditors { InternalPreValues["idType"] = "int"; } - + protected override PreValueEditor CreatePreValueEditor() { var preValEditor = base.CreatePreValueEditor(); diff --git a/src/Umbraco.Web/PropertyEditors/MultipleMediaPickerPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/MultipleMediaPickerPropertyEditor.cs index f65588e875..a7c8aba17c 100644 --- a/src/Umbraco.Web/PropertyEditors/MultipleMediaPickerPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/MultipleMediaPickerPropertyEditor.cs @@ -24,4 +24,4 @@ namespace Umbraco.Web.PropertyEditors return preValEditor; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PropertyEditors/MultipleTextStringPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/MultipleTextStringPropertyEditor.cs index 7379c0b1b8..e59712f011 100644 --- a/src/Umbraco.Web/PropertyEditors/MultipleTextStringPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/MultipleTextStringPropertyEditor.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using System.Collections.Generic; using Newtonsoft.Json; @@ -121,7 +121,7 @@ namespace Umbraco.Web.PropertyEditors public MultipleTextStringPropertyValueEditor(PropertyValueEditor wrapped) : base(wrapped) { } - + /// /// The value passed in from the editor will be an array of simple objects so we'll need to parse them to get the string /// @@ -152,20 +152,20 @@ namespace Umbraco.Web.PropertyEditors { //swallow max = -1; - } + } } //The legacy property editor saved this data as new line delimited! strange but we have to maintain that. var array = asArray.OfType() .Where(x => x["value"] != null) .Select(x => x["value"].Value()); - + //only allow the max if over 0 if (max > 0) { - return string.Join(Environment.NewLine, array.Take(max)); + return string.Join(Environment.NewLine, array.Take(max)); } - + return string.Join(Environment.NewLine, array); } diff --git a/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultipleContentPickerParameterEditor.cs b/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultipleContentPickerParameterEditor.cs index 1fb9b267ab..bbc5dc08c8 100644 --- a/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultipleContentPickerParameterEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultipleContentPickerParameterEditor.cs @@ -11,4 +11,4 @@ namespace Umbraco.Web.PropertyEditors.ParameterEditors Configuration.Add("multiPicker", "1"); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultipleContentTypeParameterEditor.cs b/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultipleContentTypeParameterEditor.cs index 6e4645db1e..0e887e10e4 100644 --- a/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultipleContentTypeParameterEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultipleContentTypeParameterEditor.cs @@ -11,4 +11,4 @@ namespace Umbraco.Web.PropertyEditors.ParameterEditors Configuration.Add("entityType", "DocumentType"); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultipleMediaPickerParameterEditor.cs b/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultipleMediaPickerParameterEditor.cs index 038552798d..7ab39173ac 100644 --- a/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultipleMediaPickerParameterEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultipleMediaPickerParameterEditor.cs @@ -11,4 +11,4 @@ namespace Umbraco.Web.PropertyEditors.ParameterEditors Configuration.Add("multiPicker", "1"); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultiplePropertyGroupParameterEditor.cs b/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultiplePropertyGroupParameterEditor.cs index d1b6d11ca7..fff2bfc92b 100644 --- a/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultiplePropertyGroupParameterEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultiplePropertyGroupParameterEditor.cs @@ -13,4 +13,4 @@ namespace Umbraco.Web.PropertyEditors.ParameterEditors Configuration.Add("publishBy", "alias"); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultiplePropertyTypeParameterEditor.cs b/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultiplePropertyTypeParameterEditor.cs index f2872dfb32..7d8ca48c60 100644 --- a/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultiplePropertyTypeParameterEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultiplePropertyTypeParameterEditor.cs @@ -13,4 +13,4 @@ namespace Umbraco.Web.PropertyEditors.ParameterEditors Configuration.Add("publishBy", "alias"); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PropertyEditors/ParameterEditors/PropertyGroupParameterEditor.cs b/src/Umbraco.Web/PropertyEditors/ParameterEditors/PropertyGroupParameterEditor.cs index 6310abe020..17406f0f2b 100644 --- a/src/Umbraco.Web/PropertyEditors/ParameterEditors/PropertyGroupParameterEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/ParameterEditors/PropertyGroupParameterEditor.cs @@ -13,4 +13,4 @@ namespace Umbraco.Web.PropertyEditors.ParameterEditors Configuration.Add("publishBy", "alias"); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PropertyEditors/ParameterEditors/PropertyTypeParameterEditor.cs b/src/Umbraco.Web/PropertyEditors/ParameterEditors/PropertyTypeParameterEditor.cs index f19dd27c8c..1d8d1e1c80 100644 --- a/src/Umbraco.Web/PropertyEditors/ParameterEditors/PropertyTypeParameterEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/ParameterEditors/PropertyTypeParameterEditor.cs @@ -13,4 +13,4 @@ namespace Umbraco.Web.PropertyEditors.ParameterEditors Configuration.Add("publishBy", "alias"); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PropertyEditors/ParameterEditors/SingleMediaPickerParameterEditor.cs b/src/Umbraco.Web/PropertyEditors/ParameterEditors/SingleMediaPickerParameterEditor.cs index 918387d0b2..932b3ce44a 100644 --- a/src/Umbraco.Web/PropertyEditors/ParameterEditors/SingleMediaPickerParameterEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/ParameterEditors/SingleMediaPickerParameterEditor.cs @@ -11,4 +11,4 @@ namespace Umbraco.Web.PropertyEditors.ParameterEditors Configuration.Add("multiPicker", "0"); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PropertyEditors/PropertyEditorAssetAttribute.cs b/src/Umbraco.Web/PropertyEditors/PropertyEditorAssetAttribute.cs index db4b37a066..0953fa2e4c 100644 --- a/src/Umbraco.Web/PropertyEditors/PropertyEditorAssetAttribute.cs +++ b/src/Umbraco.Web/PropertyEditors/PropertyEditorAssetAttribute.cs @@ -1,4 +1,4 @@ -using System; +using System; using ClientDependency.Core; namespace Umbraco.Web.PropertyEditors @@ -15,7 +15,7 @@ namespace Umbraco.Web.PropertyEditors public ClientDependencyType AssetType { get; private set; } public string FilePath { get; private set; } public int Priority { get; set; } - + /// /// Returns a CDF file reference /// @@ -37,4 +37,4 @@ namespace Umbraco.Web.PropertyEditors Priority = int.MinValue; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PropertyEditors/PropertyValueEditorWrapper.cs b/src/Umbraco.Web/PropertyEditors/PropertyValueEditorWrapper.cs index 8bd7c7b146..ed4c01e851 100644 --- a/src/Umbraco.Web/PropertyEditors/PropertyValueEditorWrapper.cs +++ b/src/Umbraco.Web/PropertyEditors/PropertyValueEditorWrapper.cs @@ -1,4 +1,4 @@ -using Umbraco.Core.PropertyEditors; +using Umbraco.Core.PropertyEditors; namespace Umbraco.Web.PropertyEditors { @@ -19,4 +19,4 @@ namespace Umbraco.Web.PropertyEditors } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PropertyEditors/PublishValueValueEditor.cs b/src/Umbraco.Web/PropertyEditors/PublishValueValueEditor.cs index 0d2a66fc88..ab532bd7a3 100644 --- a/src/Umbraco.Web/PropertyEditors/PublishValueValueEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/PublishValueValueEditor.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using Umbraco.Core; using Umbraco.Core.Logging; @@ -60,7 +60,7 @@ namespace Umbraco.Web.PropertyEditors _logger.Warn("Could not find a pre value with ID " + preValId + " for property alias " + property.Alias); } } - + return base.ConvertDbToString(property, propertyType, dataTypeService); } @@ -75,4 +75,4 @@ namespace Umbraco.Web.PropertyEditors return null; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PropertyEditors/PublishValuesMultipleValueEditor.cs b/src/Umbraco.Web/PropertyEditors/PublishValuesMultipleValueEditor.cs index 8d0ecb0e30..23519d6a99 100644 --- a/src/Umbraco.Web/PropertyEditors/PublishValuesMultipleValueEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/PublishValuesMultipleValueEditor.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using Newtonsoft.Json.Linq; using Umbraco.Core; @@ -61,7 +61,7 @@ namespace Umbraco.Web.PropertyEditors if (preValues != null) { //get all pre-values matching our Ids - return string.Join(",", + return string.Join(",", preValues.Where(x => selectedIds.Contains(x.Value.Id.ToInvariantString())).Select(x => x.Value.Value)); } @@ -82,7 +82,7 @@ namespace Umbraco.Web.PropertyEditors } /// - /// When multiple values are selected a json array will be posted back so we need to format for storage in + /// When multiple values are selected a json array will be posted back so we need to format for storage in /// the database which is a comma separated ID value /// /// @@ -101,4 +101,4 @@ namespace Umbraco.Web.PropertyEditors return string.Join(",", values); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PropertyEditors/RadioButtonsPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/RadioButtonsPropertyEditor.cs index 63f4ef5e9b..8adda3616d 100644 --- a/src/Umbraco.Web/PropertyEditors/RadioButtonsPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/RadioButtonsPropertyEditor.cs @@ -1,4 +1,4 @@ -using Umbraco.Core; +using Umbraco.Core; using Umbraco.Core.Logging; using Umbraco.Core.PropertyEditors; using Umbraco.Core.Services; @@ -23,4 +23,4 @@ namespace Umbraco.Web.PropertyEditors { } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PropertyEditors/RelatedLinks2PropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/RelatedLinks2PropertyEditor.cs index 0a0ed8a97f..e0a1e68ba9 100644 --- a/src/Umbraco.Web/PropertyEditors/RelatedLinks2PropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/RelatedLinks2PropertyEditor.cs @@ -36,4 +36,4 @@ namespace Umbraco.Web.PropertyEditors public int Maximum { get; set; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PropertyEditors/RichTextPreValueController.cs b/src/Umbraco.Web/PropertyEditors/RichTextPreValueController.cs index 4b364df27f..96863c3ff9 100644 --- a/src/Umbraco.Web/PropertyEditors/RichTextPreValueController.cs +++ b/src/Umbraco.Web/PropertyEditors/RichTextPreValueController.cs @@ -129,4 +129,4 @@ namespace Umbraco.Web.PropertyEditors } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PropertyEditors/RichTextPreValueEditor.cs b/src/Umbraco.Web/PropertyEditors/RichTextPreValueEditor.cs index cd08a8ad45..c3a782c050 100644 --- a/src/Umbraco.Web/PropertyEditors/RichTextPreValueEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/RichTextPreValueEditor.cs @@ -49,7 +49,7 @@ namespace Umbraco.Web.PropertyEditors // // [PreValueField(typeof(EditorPreValueField))] // public string Editor { get; set; } - + // [PreValueField("", "views/propertyeditors/rte/rte.prevalues.html", HideLabel = true)] // public class EditorPreValueField : PreValueField // { diff --git a/src/Umbraco.Web/PropertyEditors/RichTextPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/RichTextPropertyEditor.cs index 0b01cbabef..e6bba13bb9 100644 --- a/src/Umbraco.Web/PropertyEditors/RichTextPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/RichTextPropertyEditor.cs @@ -94,5 +94,5 @@ namespace Umbraco.Web.PropertyEditors } } - -} \ No newline at end of file + +} diff --git a/src/Umbraco.Web/PropertyEditors/SliderPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/SliderPropertyEditor.cs index 7548574871..e71165cec3 100644 --- a/src/Umbraco.Web/PropertyEditors/SliderPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/SliderPropertyEditor.cs @@ -21,13 +21,13 @@ namespace Umbraco.Web.PropertyEditors internal class SliderPreValueEditor : PreValueEditor { - + [PreValueField("enableRange", "Enable range", "boolean")] public string Range { get; set; } [PreValueField("orientation", "Orientation", "views/propertyeditors/slider/orientation.prevalues.html")] public string Orientation { get; set; } - + [PreValueField("initVal1", "Initial value", "number")] public int InitialValue { get; set; } @@ -39,7 +39,7 @@ namespace Umbraco.Web.PropertyEditors [PreValueField("maxVal", "Maximum value", "number")] public int MaximumValue { get; set; } - + [PreValueField("step", "Step increments", "number")] public int StepIncrements { get; set; } @@ -77,4 +77,4 @@ namespace Umbraco.Web.PropertyEditors public string TicksSnapBounds { get; set; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PropertyEditors/TagPropertyEditorTagDefinition.cs b/src/Umbraco.Web/PropertyEditors/TagPropertyEditorTagDefinition.cs index 8e721366b8..b804de1d39 100644 --- a/src/Umbraco.Web/PropertyEditors/TagPropertyEditorTagDefinition.cs +++ b/src/Umbraco.Web/PropertyEditors/TagPropertyEditorTagDefinition.cs @@ -36,4 +36,4 @@ namespace Umbraco.Web.PropertyEditors } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PropertyEditors/TagsDataController.cs b/src/Umbraco.Web/PropertyEditors/TagsDataController.cs index 0daf22abe7..dc0a0787dd 100644 --- a/src/Umbraco.Web/PropertyEditors/TagsDataController.cs +++ b/src/Umbraco.Web/PropertyEditors/TagsDataController.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using Umbraco.Web.Models; using Umbraco.Web.Mvc; using Umbraco.Web.WebApi; @@ -20,4 +20,4 @@ namespace Umbraco.Web.PropertyEditors return Umbraco.TagQuery.GetAllTags(tagGroup); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PropertyEditors/TagsPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/TagsPropertyEditor.cs index 56e12c3128..562fc27778 100644 --- a/src/Umbraco.Web/PropertyEditors/TagsPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/TagsPropertyEditor.cs @@ -68,7 +68,7 @@ namespace Umbraco.Web.PropertyEditors /// /// /// This will become legacy as soon as we implement overridable pre-values. - /// + /// /// The default validator used is the RequiredValueValidator but this can be overridden by property editors /// if they need to do some custom validation, or if the value being validated is a json object. /// @@ -76,7 +76,7 @@ namespace Umbraco.Web.PropertyEditors { get { return new RequiredTagsValueValidator(); } } - + /// /// Custom validator to validate a required value against an empty json value /// @@ -154,4 +154,4 @@ namespace Umbraco.Web.PropertyEditors } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PropertyEditors/TrueFalsePropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/TrueFalsePropertyEditor.cs index 720efbc19b..f7fb7d963e 100644 --- a/src/Umbraco.Web/PropertyEditors/TrueFalsePropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/TrueFalsePropertyEditor.cs @@ -24,4 +24,4 @@ namespace Umbraco.Web.PropertyEditors public string Default { get; set; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PropertyEditors/UploadFileTypeValidator.cs b/src/Umbraco.Web/PropertyEditors/UploadFileTypeValidator.cs index 2a20434d80..7f430dda55 100644 --- a/src/Umbraco.Web/PropertyEditors/UploadFileTypeValidator.cs +++ b/src/Umbraco.Web/PropertyEditors/UploadFileTypeValidator.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.IO; @@ -32,10 +32,10 @@ namespace Umbraco.Web.PropertyEditors yield return new ValidationResult(Current.Services.TextService.Localize("errors/dissallowedMediaType"), new[] { - //we only store a single value for this editor so the 'member' or 'field' + //we only store a single value for this editor so the 'member' or 'field' // we'll associate this error with will simply be called 'value' "value" - }); + }); } } @@ -49,4 +49,4 @@ namespace Umbraco.Web.PropertyEditors } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PropertyEditors/UserPickerPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/UserPickerPropertyEditor.cs index 6384397ebb..714fab572a 100644 --- a/src/Umbraco.Web/PropertyEditors/UserPickerPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/UserPickerPropertyEditor.cs @@ -27,4 +27,4 @@ namespace Umbraco.Web.PropertyEditors set { _defaultPreValues = value; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PropertyEditors/ValueConverters/ImageCropDataSetTypeConverter.cs b/src/Umbraco.Web/PropertyEditors/ValueConverters/ImageCropDataSetTypeConverter.cs index 5e248e2fac..05fb637a2d 100644 --- a/src/Umbraco.Web/PropertyEditors/ValueConverters/ImageCropDataSetTypeConverter.cs +++ b/src/Umbraco.Web/PropertyEditors/ValueConverters/ImageCropDataSetTypeConverter.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.ComponentModel; using System.Globalization; using System.Linq; @@ -27,9 +27,9 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters if (cropDataSet == null) return null; - return TypeHelper.IsTypeAssignableFrom(destinationType) - ? JObject.FromObject(cropDataSet) + return TypeHelper.IsTypeAssignableFrom(destinationType) + ? JObject.FromObject(cropDataSet) : base.ConvertTo(context, culture, value, destinationType); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PropertyEditors/ValueConverters/ImageCropperValueConverter.cs b/src/Umbraco.Web/PropertyEditors/ValueConverters/ImageCropperValueConverter.cs index 1f18a3075f..19b137da28 100644 --- a/src/Umbraco.Web/PropertyEditors/ValueConverters/ImageCropperValueConverter.cs +++ b/src/Umbraco.Web/PropertyEditors/ValueConverters/ImageCropperValueConverter.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Globalization; using Newtonsoft.Json; using Newtonsoft.Json.Linq; @@ -43,4 +43,4 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters return json.ToObject(serializer); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PropertyEditors/ValueConverters/MacroContainerValueConverter.cs b/src/Umbraco.Web/PropertyEditors/ValueConverters/MacroContainerValueConverter.cs index 71b8b89996..b8ad1c72cd 100644 --- a/src/Umbraco.Web/PropertyEditors/ValueConverters/MacroContainerValueConverter.cs +++ b/src/Umbraco.Web/PropertyEditors/ValueConverters/MacroContainerValueConverter.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Text; using System.Web; using Umbraco.Core; @@ -74,4 +74,4 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters return sourceString; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PropertyEditors/ValueConverters/MediaPickerPropertyConverter.cs b/src/Umbraco.Web/PropertyEditors/ValueConverters/MediaPickerPropertyConverter.cs index 816f6c4832..0cbc2ecb35 100644 --- a/src/Umbraco.Web/PropertyEditors/ValueConverters/MediaPickerPropertyConverter.cs +++ b/src/Umbraco.Web/PropertyEditors/ValueConverters/MediaPickerPropertyConverter.cs @@ -45,12 +45,12 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters public override Type GetPropertyValueType(PublishedPropertyType propertyType) { - return IsMultipleDataType(propertyType.DataTypeId, propertyType.PropertyEditorAlias) - ? typeof(IEnumerable) + return IsMultipleDataType(propertyType.DataTypeId, propertyType.PropertyEditorAlias) + ? typeof(IEnumerable) : typeof(IPublishedContent); } - public override PropertyCacheLevel GetPropertyCacheLevel(PublishedPropertyType propertyType) + public override PropertyCacheLevel GetPropertyCacheLevel(PublishedPropertyType propertyType) => PropertyCacheLevel.Facade; private bool IsMultipleDataType(int dataTypeId, string propertyEditorAlias) @@ -72,7 +72,7 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters return preValue != null && preValue.Value.TryConvertTo().Result; } - //in some odd cases, the pre-values in the db won't exist but their default pre-values contain this key so check there + //in some odd cases, the pre-values in the db won't exist but their default pre-values contain this key so check there if (_propertyEditors.TryGet(propertyEditorAlias, out PropertyEditor propertyEditor)) { var preValue = propertyEditor.DefaultPreValues @@ -129,4 +129,4 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters Storages.Clear(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PropertyEditors/ValueConverters/MultipleMediaPickerPropertyConverter.cs b/src/Umbraco.Web/PropertyEditors/ValueConverters/MultipleMediaPickerPropertyConverter.cs index 8a1239696f..d48aed40b9 100644 --- a/src/Umbraco.Web/PropertyEditors/ValueConverters/MultipleMediaPickerPropertyConverter.cs +++ b/src/Umbraco.Web/PropertyEditors/ValueConverters/MultipleMediaPickerPropertyConverter.cs @@ -45,8 +45,8 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters public override Type GetPropertyValueType(PublishedPropertyType propertyType) { - return IsMultipleDataType(propertyType.DataTypeId, propertyType.PropertyEditorAlias) - ? typeof(IEnumerable) + return IsMultipleDataType(propertyType.DataTypeId, propertyType.PropertyEditorAlias) + ? typeof(IEnumerable) : typeof(IPublishedContent); } @@ -112,7 +112,7 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters // single value picker var nodeId = (int)source; - + return umbHelper.Media(nodeId); } @@ -144,8 +144,8 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters return preValue != null && preValue.Value.TryConvertTo().Result; } - - //in some odd cases, the pre-values in the db won't exist but their default pre-values contain this key so check there + + //in some odd cases, the pre-values in the db won't exist but their default pre-values contain this key so check there if (_propertyEditors.TryGet(propertyEditorAlias, out PropertyEditor propertyEditor)) { var preValue = propertyEditor.DefaultPreValues @@ -166,4 +166,4 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters Storages.Clear(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PropertyEditors/ValueConverters/RelatedLinksLegacyValueConverter.cs b/src/Umbraco.Web/PropertyEditors/ValueConverters/RelatedLinksLegacyValueConverter.cs index 9dac4ca1fc..f8fe19ebe0 100644 --- a/src/Umbraco.Web/PropertyEditors/ValueConverters/RelatedLinksLegacyValueConverter.cs +++ b/src/Umbraco.Web/PropertyEditors/ValueConverters/RelatedLinksLegacyValueConverter.cs @@ -86,10 +86,10 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters a["link"] = helper.NiceUrl(content.Id); } break; - } + } } } - } + } } return obj; } @@ -117,7 +117,7 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters var d = new XmlDocument(); var e = d.CreateElement("links"); d.AppendChild(e); - + foreach (dynamic link in obj) { var ee = d.CreateElement("link"); diff --git a/src/Umbraco.Web/PropertyEditors/ValueConverters/RteMacroRenderingValueConverter.cs b/src/Umbraco.Web/PropertyEditors/ValueConverters/RteMacroRenderingValueConverter.cs index 9349b98e61..32190d2c19 100644 --- a/src/Umbraco.Web/PropertyEditors/ValueConverters/RteMacroRenderingValueConverter.cs +++ b/src/Umbraco.Web/PropertyEditors/ValueConverters/RteMacroRenderingValueConverter.cs @@ -1,4 +1,4 @@ -using System.Text; +using System.Text; using Umbraco.Core; using Umbraco.Core.Macros; using Umbraco.Core.PropertyEditors; @@ -13,19 +13,19 @@ using Umbraco.Core.Services; namespace Umbraco.Web.PropertyEditors.ValueConverters { /// - /// A value converter for TinyMCE that will ensure any macro content is rendered properly even when + /// A value converter for TinyMCE that will ensure any macro content is rendered properly even when /// used dynamically. /// [DefaultPropertyValueConverter] public class RteMacroRenderingValueConverter : TinyMceValueConverter - { + { private readonly IUmbracoContextAccessor _umbracoContextAccessor; private readonly ServiceContext _services; private readonly CacheHelper _appCache; public override PropertyCacheLevel GetPropertyCacheLevel(PublishedPropertyType propertyType) { - // because that version of RTE converter parses {locallink} and executes macros, its value has + // because that version of RTE converter parses {locallink} and executes macros, its value has // to be cached at the facade level, because we have no idea what the macros may depend on actually. return PropertyCacheLevel.Facade; } @@ -41,7 +41,7 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters // global UmbracoContext.Current.InPreviewMode status. So it // should never execute in // over the same UmbracoContext with // different preview modes. - private string RenderRteMacros(string source, bool preview) + private string RenderRteMacros(string source, bool preview) { var umbracoContext = _umbracoContextAccessor.UmbracoContext; using (umbracoContext.ForcedPreview(preview)) // force for macro rendering @@ -119,4 +119,4 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters return sourceString; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PropertyEditors/ValueListPreValueEditor.cs b/src/Umbraco.Web/PropertyEditors/ValueListPreValueEditor.cs index d57e237fa9..0cfc667835 100644 --- a/src/Umbraco.Web/PropertyEditors/ValueListPreValueEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/ValueListPreValueEditor.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; @@ -43,18 +43,18 @@ namespace Umbraco.Web.PropertyEditors new PreValueField(new EnsureUniqueValuesValidator()) { Description = "Add and remove values for the list", - //we're going to call this 'items' because we are going to override the - //serialization of the pre-values to ensure that each one gets saved with it's own key + //we're going to call this 'items' because we are going to override the + //serialization of the pre-values to ensure that each one gets saved with it's own key //(new db row per pre-value, thus to maintain backwards compatibility) - //It's also important to note that by default the dropdown angular controller is expecting the + //It's also important to note that by default the dropdown angular controller is expecting the // config options to come in with a property called 'items' Key = "items", Name = _textService.Localize("editdatatype/addPrevalue"), // todo: inject View = "multivalues" - } + } }; - } + } /// /// The editor is expecting a json array for a field with a key named "items" so we need to format the persisted values @@ -71,7 +71,7 @@ namespace Umbraco.Web.PropertyEditors // the sorted order and the js has to sort anyways. .OrderBy(x => x.SortOrder) .ToList(); - + //the items list will be a dictionary of it's id -> value we need to use the id for persistence for backwards compatibility return new Dictionary {{"items", arrayOfVals.ToDictionary(x => x.Id, x => PreValueAsDictionary(x))}}; } @@ -101,7 +101,7 @@ namespace Umbraco.Web.PropertyEditors { var val = editorValue["items"] as JArray; var result = new Dictionary(); - + if (val == null) { return result; @@ -111,12 +111,12 @@ namespace Umbraco.Web.PropertyEditors { var index = 0; - //get all values in the array that are not empty + //get all values in the array that are not empty foreach (var item in val.OfType() .Where(jItem => jItem["value"] != null) .Select(jItem => new { - idAsString = jItem["id"] == null ? "0" : jItem["id"].ToString(), + idAsString = jItem["id"] == null ? "0" : jItem["id"].ToString(), valAsString = jItem["value"].ToString() }) .Where(x => x.valAsString.IsNullOrWhiteSpace() == false)) @@ -129,7 +129,7 @@ namespace Umbraco.Web.PropertyEditors } catch (Exception ex) { - _logger.Error("Could not deserialize the posted value: " + val, ex); + _logger.Error("Could not deserialize the posted value: " + val, ex); } return result; @@ -151,7 +151,7 @@ namespace Umbraco.Web.PropertyEditors .Select((jItem, index) => new {value = jItem["value"].ToString(), index = index}) .Where(asString => asString.value.IsNullOrWhiteSpace() == false) .GroupBy(x => x.value); - + foreach (var g in groupedValues.Where(g => g.Count() > 1)) { yield return new ValidationResult("The value " + g.Last().value + " must be unique", new[] diff --git a/src/Umbraco.Web/PublishedCache/IFacadeService.cs b/src/Umbraco.Web/PublishedCache/IFacadeService.cs index d5b6c43a58..1154ffbee6 100644 --- a/src/Umbraco.Web/PublishedCache/IFacadeService.cs +++ b/src/Umbraco.Web/PublishedCache/IFacadeService.cs @@ -17,20 +17,20 @@ namespace Umbraco.Web.PublishedCache /* Various places (such as Node) want to access the XML content, today as an XmlDocument * but to migrate to a new cache, they're migrating to an XPathNavigator. Still, they need * to find out how to get that navigator. - * + * * Because a cache such as the DrippingCache is contextual ie it has a "snapshot" nothing * and remains consistent over the snapshot, the navigator should come from the "current" * snapshot. - * + * * The service creates those snapshots in IPublishedCaches objects. - * + * * Places such as Node need to be able to find the "current" one so the factory has a * notion of what is "current". In most cases, the IPublishedCaches object is created * and registered against an UmbracoContext, and that context is then used as "current". - * + * * But for tests we need to have a way to specify what's the "current" object & preview. * Which is defined in PublishedCachesServiceBase. - * + * */ /// @@ -60,10 +60,10 @@ namespace Umbraco.Web.PublishedCache * the content only, or the content's branch, or the whole tree + it could be possible * to register filters against the factory to filter out which nodes should be preview * vs non preview. - * + * * EnterPreview() returns the previewToken. It is up to callers to store that token * wherever they want, most probably in a cookie. - * + * */ /// @@ -112,7 +112,7 @@ namespace Umbraco.Web.PublishedCache * and the order-of-execution of the handlers cannot be guaranteed, which means that some * user code may run before Umbraco is finished updating itself. Instead, the cache refreshers * explicitely notify the service of changes. - * + * */ /// @@ -164,7 +164,7 @@ namespace Umbraco.Web.PublishedCache /// The source value. /// A fragment property. IPublishedProperty CreateFragmentProperty(PublishedPropertyType propertyType, Guid itemKey, bool previewing, PropertyCacheLevel referenceCacheLevel, object sourceValue = null); - + #endregion } } diff --git a/src/Umbraco.Web/PublishedCache/NuCache/ContentNode.cs b/src/Umbraco.Web/PublishedCache/NuCache/ContentNode.cs index 83f6333d8b..24311c3876 100644 --- a/src/Umbraco.Web/PublishedCache/NuCache/ContentNode.cs +++ b/src/Umbraco.Web/PublishedCache/NuCache/ContentNode.cs @@ -146,7 +146,7 @@ namespace Umbraco.Web.PublishedCache.NuCache { Node = this, ContentTypeId = ContentType.Id, - + DraftData = ((PublishedContent) Draft)?._contentData, PublishedData = ((PublishedContent) Published)?._contentData }; diff --git a/src/Umbraco.Web/PublishedCache/NuCache/MemberCache.cs b/src/Umbraco.Web/PublishedCache/NuCache/MemberCache.cs index 16115f7624..e6570a9b67 100644 --- a/src/Umbraco.Web/PublishedCache/NuCache/MemberCache.cs +++ b/src/Umbraco.Web/PublishedCache/NuCache/MemberCache.cs @@ -69,8 +69,8 @@ namespace Umbraco.Web.PublishedCache.NuCache { EnsureProvider(); var member = _memberService.GetById(memberId); - return member == null - ? null + return member == null + ? null : PublishedMember.Create(member, GetContentType(member.ContentTypeId), _previewDefault, _facadeAccessor); }); } diff --git a/src/Umbraco.Web/PublishedCache/NuCache/Navigable/NavigableContentType.cs b/src/Umbraco.Web/PublishedCache/NuCache/Navigable/NavigableContentType.cs index 87ce56409f..7e93a175d7 100644 --- a/src/Umbraco.Web/PublishedCache/NuCache/Navigable/NavigableContentType.cs +++ b/src/Umbraco.Web/PublishedCache/NuCache/Navigable/NavigableContentType.cs @@ -14,7 +14,7 @@ namespace Umbraco.Web.PublishedCache.NuCache.Navigable // called by the conditional weak table -- must be public // ReSharper disable EmptyConstructor - public NavigableContentType() + public NavigableContentType() // ReSharper restore EmptyConstructor { } @@ -34,16 +34,16 @@ namespace Umbraco.Web.PublishedCache.NuCache.Navigable { BuiltinProperties = new INavigableFieldType[] { - new NavigablePropertyType("nodeName"), - new NavigablePropertyType("parentId"), + new NavigablePropertyType("nodeName"), + new NavigablePropertyType("parentId"), new NavigablePropertyType("createDate", v => XmlConvert.ToString((DateTime)v, "yyyy-MM-ddTHH:mm:ss")), - new NavigablePropertyType("updateDate", v => XmlConvert.ToString((DateTime)v, "yyyy-MM-ddTHH:mm:ss")), - new NavigablePropertyType("isDoc", v => XmlConvert.ToString((bool)v)), - new NavigablePropertyType("sortOrder"), - new NavigablePropertyType("level"), - new NavigablePropertyType("templateId"), - new NavigablePropertyType("writerId"), - new NavigablePropertyType("creatorId"), + new NavigablePropertyType("updateDate", v => XmlConvert.ToString((DateTime)v, "yyyy-MM-ddTHH:mm:ss")), + new NavigablePropertyType("isDoc", v => XmlConvert.ToString((bool)v)), + new NavigablePropertyType("sortOrder"), + new NavigablePropertyType("level"), + new NavigablePropertyType("templateId"), + new NavigablePropertyType("writerId"), + new NavigablePropertyType("creatorId"), new NavigablePropertyType("urlName"), new NavigablePropertyType("isDraft", v => XmlConvert.ToString((bool)v)) }; diff --git a/src/Umbraco.Web/PublishedCache/PublishedFragmentPropertyBase.cs b/src/Umbraco.Web/PublishedCache/PublishedFragmentPropertyBase.cs index fd0d972c8b..06df7df1d7 100644 --- a/src/Umbraco.Web/PublishedCache/PublishedFragmentPropertyBase.cs +++ b/src/Umbraco.Web/PublishedCache/PublishedFragmentPropertyBase.cs @@ -162,4 +162,4 @@ namespace Umbraco.Web.PublishedCache } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PublishedCache/RawValueProperty.cs b/src/Umbraco.Web/PublishedCache/RawValueProperty.cs index 0928455f42..32322e42f7 100644 --- a/src/Umbraco.Web/PublishedCache/RawValueProperty.cs +++ b/src/Umbraco.Web/PublishedCache/RawValueProperty.cs @@ -1,4 +1,4 @@ -using System; +using System; using Umbraco.Core.Models.PublishedContent; using Umbraco.Core.PropertyEditors; @@ -46,4 +46,4 @@ namespace Umbraco.Web.PublishedCache _xpathValue = new Lazy(() => PropertyType.ConvertInterToXPath(PropertyCacheLevel.Unknown, _sourceValue.Value, _isPreviewing)); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PublishedCache/UmbracoContextFacadeAccessor.cs b/src/Umbraco.Web/PublishedCache/UmbracoContextFacadeAccessor.cs index f8feca4e54..8cdd67fa37 100644 --- a/src/Umbraco.Web/PublishedCache/UmbracoContextFacadeAccessor.cs +++ b/src/Umbraco.Web/PublishedCache/UmbracoContextFacadeAccessor.cs @@ -26,4 +26,4 @@ namespace Umbraco.Web.PublishedCache } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/FacadeService.cs b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/FacadeService.cs index dacc5e8783..7f5edf8965 100644 --- a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/FacadeService.cs +++ b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/FacadeService.cs @@ -36,8 +36,8 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache // used in WebBootManager + tests public FacadeService(ServiceContext serviceContext, IScopeProvider scopeProvider, - IScopeUnitOfWorkProvider uowProvider, - ICacheProvider requestCache, + IScopeUnitOfWorkProvider uowProvider, + ICacheProvider requestCache, IEnumerable segmentProviders, IFacadeAccessor facadeAccessor, ILogger logger, @@ -49,11 +49,11 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache // used in some tests internal FacadeService(ServiceContext serviceContext, IScopeProvider scopeProvider, - IScopeUnitOfWorkProvider uowProvider, + IScopeUnitOfWorkProvider uowProvider, ICacheProvider requestCache, IFacadeAccessor facadeAccessor, ILogger logger, - PublishedContentTypeCache contentTypeCache, + PublishedContentTypeCache contentTypeCache, MainDom mainDom, bool testing, bool enableRepositoryEvents) : this(serviceContext, scopeProvider, uowProvider, requestCache, Enumerable.Empty(), facadeAccessor, logger, contentTypeCache, mainDom, testing, enableRepositoryEvents) @@ -61,12 +61,12 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache private FacadeService(ServiceContext serviceContext, IScopeProvider scopeProvider, - IScopeUnitOfWorkProvider uowProvider, + IScopeUnitOfWorkProvider uowProvider, ICacheProvider requestCache, IEnumerable segmentProviders, IFacadeAccessor facadeAccessor, ILogger logger, - PublishedContentTypeCache contentTypeCache, + PublishedContentTypeCache contentTypeCache, MainDom mainDom, bool testing, bool enableRepositoryEvents) : base(facadeAccessor) diff --git a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedContentCache.cs b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedContentCache.cs index 7233f36645..f3829c35c0 100644 --- a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedContentCache.cs +++ b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedContentCache.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Globalization; using System.Xml; @@ -310,9 +310,9 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache #region Converters private IPublishedContent ConvertToDocument(XmlNode xmlNode, bool isPreviewing) - { + { return xmlNode == null ? null : XmlPublishedContent.Get(xmlNode, isPreviewing, _cacheProvider, _contentTypeCache); - } + } private IEnumerable ConvertToDocuments(XmlNodeList xmlNodes, bool isPreviewing) { @@ -325,9 +325,9 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache #region Getters public override IPublishedContent GetById(bool preview, int nodeId) - { - return ConvertToDocument(GetXml(preview).GetElementById(nodeId.ToString(CultureInfo.InvariantCulture)), preview); - } + { + return ConvertToDocument(GetXml(preview).GetElementById(nodeId.ToString(CultureInfo.InvariantCulture)), preview); + } public override IPublishedContent GetById(bool preview, Guid nodeId) { @@ -380,7 +380,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache public override IEnumerable GetAtRoot(bool preview) { return ConvertToDocuments(GetXml(preview).SelectNodes(XPathStrings.RootDocuments), preview); - } + } public override IPublishedContent GetSingleByXPath(bool preview, string xpath, XPathVariable[] vars) { @@ -430,9 +430,9 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache public override bool HasContent(bool preview) { - var xml = GetXml(preview); + var xml = GetXml(preview); var node = xml?.SelectSingleNode(XPathStrings.RootDocuments); - return node != null; + return node != null; } public override XPathNavigator CreateNavigator(bool preview) @@ -539,4 +539,4 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedMediaCache.cs b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedMediaCache.cs index 42726e76fb..1cd1871f4d 100644 --- a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedMediaCache.cs +++ b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedMediaCache.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Configuration; @@ -34,55 +34,55 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache internal class PublishedMediaCache : PublishedCacheBase, IPublishedMediaCache { private readonly IMediaService _mediaService; - private readonly IUserService _userService; + private readonly IUserService _userService; // by default these are null unless specified by the ctor dedicated to tests // when they are null the cache derives them from the ExamineManager, see // method GetExamineManagerSafe(). // - private readonly ILuceneSearcher _searchProvider; + private readonly ILuceneSearcher _searchProvider; private readonly BaseIndexProvider _indexProvider; private readonly XmlStore _xmlStore; private readonly PublishedContentTypeCache _contentTypeCache; // must be specified by the ctor - private readonly ICacheProvider _cacheProvider; + private readonly ICacheProvider _cacheProvider; - public PublishedMediaCache(XmlStore xmlStore, IMediaService mediaService, IUserService userService, ICacheProvider cacheProvider, PublishedContentTypeCache contentTypeCache) - : base(false) - { + public PublishedMediaCache(XmlStore xmlStore, IMediaService mediaService, IUserService userService, ICacheProvider cacheProvider, PublishedContentTypeCache contentTypeCache) + : base(false) + { if (mediaService == null) throw new ArgumentNullException(nameof(mediaService)); if (userService == null) throw new ArgumentNullException(nameof(userService)); _mediaService = mediaService; _userService = userService; _cacheProvider = cacheProvider; - _xmlStore = xmlStore; - _contentTypeCache = contentTypeCache; - } + _xmlStore = xmlStore; + _contentTypeCache = contentTypeCache; + } /// /// Generally used for unit testing to use an explicit examine searcher /// - /// - /// + /// + /// /// /// - /// - /// - internal PublishedMediaCache(IMediaService mediaService, IUserService userService, ILuceneSearcher searchProvider, BaseIndexProvider indexProvider, ICacheProvider cacheProvider, PublishedContentTypeCache contentTypeCache) + /// + /// + internal PublishedMediaCache(IMediaService mediaService, IUserService userService, ILuceneSearcher searchProvider, BaseIndexProvider indexProvider, ICacheProvider cacheProvider, PublishedContentTypeCache contentTypeCache) : base(false) { if (mediaService == null) throw new ArgumentNullException(nameof(mediaService)); if (userService == null) throw new ArgumentNullException(nameof(userService)); if (searchProvider == null) throw new ArgumentNullException(nameof(searchProvider)); - if (indexProvider == null) throw new ArgumentNullException(nameof(indexProvider)); + if (indexProvider == null) throw new ArgumentNullException(nameof(indexProvider)); _mediaService = mediaService; _userService = userService; _searchProvider = searchProvider; _indexProvider = indexProvider; - _cacheProvider = cacheProvider; + _cacheProvider = cacheProvider; _contentTypeCache = contentTypeCache; } @@ -102,15 +102,15 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache } public override bool HasById(bool preview, int contentId) - { + { return GetUmbracoMedia(contentId) != null; - } + } - public override IEnumerable GetAtRoot(bool preview) + public override IEnumerable GetAtRoot(bool preview) { //TODO: We should be able to look these ids first in Examine! - var rootMedia = _mediaService.GetRootMedia(); + var rootMedia = _mediaService.GetRootMedia(); return rootMedia.Select(m => GetUmbracoMedia(m.Id)); } @@ -210,49 +210,49 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache return _indexProvider; var eMgr = GetExamineManagerSafe(); - if (eMgr == null) return null; + if (eMgr == null) return null; - try - { - //by default use the InternalSearcher + try + { + //by default use the InternalSearcher var indexer = eMgr.IndexProviderCollection[Constants.Examine.InternalIndexer]; - if (indexer.IndexerData.IncludeNodeTypes.Any() || indexer.IndexerData.ExcludeNodeTypes.Any()) - { - Current.Logger.Warn("The InternalIndexer for examine is configured incorrectly, it should not list any include/exclude node types or field names, it should simply be configured as: " + ""); - } - return indexer; - } - catch (Exception ex) - { - Current.Logger.Error("Could not retrieve the InternalIndexer", ex); - //something didn't work, continue returning null. - } - return null; + if (indexer.IndexerData.IncludeNodeTypes.Any() || indexer.IndexerData.ExcludeNodeTypes.Any()) + { + Current.Logger.Warn("The InternalIndexer for examine is configured incorrectly, it should not list any include/exclude node types or field names, it should simply be configured as: " + ""); + } + return indexer; + } + catch (Exception ex) + { + Current.Logger.Error("Could not retrieve the InternalIndexer", ex); + //something didn't work, continue returning null. + } + return null; } - private ILuceneSearcher GetSearchProviderSafe() + private ILuceneSearcher GetSearchProviderSafe() { if (_searchProvider != null) return _searchProvider; var eMgr = GetExamineManagerSafe(); - if (eMgr == null) return null; + if (eMgr == null) return null; try { //by default use the InternalSearcher return eMgr.GetSearcher(Constants.Examine.InternalIndexer); - } - catch (FileNotFoundException) - { - //Currently examine is throwing FileNotFound exceptions when we have a loadbalanced filestore and a node is published in umbraco - //See this thread: http://examine.cdodeplex.com/discussions/264341 - //Catch the exception here for the time being, and just fallback to GetMedia - //TODO: Need to fix examine in LB scenarios! - } - catch (NullReferenceException) - { - //This will occur when the search provider cannot be initialized. In newer examine versions the initialization is lazy and therefore + } + catch (FileNotFoundException) + { + //Currently examine is throwing FileNotFound exceptions when we have a loadbalanced filestore and a node is published in umbraco + //See this thread: http://examine.cdodeplex.com/discussions/264341 + //Catch the exception here for the time being, and just fallback to GetMedia + //TODO: Need to fix examine in LB scenarios! + } + catch (NullReferenceException) + { + //This will occur when the search provider cannot be initialized. In newer examine versions the initialization is lazy and therefore // the manager will return the singleton without throwing initialization errors, however if examine isn't configured correctly a null // reference error will occur because the examine settings are null. } @@ -335,7 +335,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache () => ExamineIndexMissMax); return ConvertFromIMedia(media); - } + } private const int ExamineIndexMissMax = 10; private int _examineIndexMiss; @@ -359,7 +359,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache internal CacheValues ConvertFromSearchResult(SearchResult searchResult) { // note: fixing fields in 7.x, removed by Shan for 8.0 - var values = new Dictionary(searchResult.Fields); + var values = new Dictionary(searchResult.Fields); return new CacheValues { @@ -370,7 +370,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache internal CacheValues ConvertFromXPathNavigator(XPathNavigator xpath, bool forceNav = false) { - if (xpath == null) throw new ArgumentNullException(nameof(xpath)); + if (xpath == null) throw new ArgumentNullException(nameof(xpath)); var values = new Dictionary { { "nodeName", xpath.GetAttribute("nodeName", "") } }; values["nodeTypeAlias"] = xpath.Name; @@ -420,8 +420,8 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache { Values = values, XPath = forceNav ? xpath : null // outside of tests we do NOT want to cache the navigator! - }; - } + }; + } internal CacheValues ConvertFromIMedia(IMedia media) { @@ -533,10 +533,10 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache } //if there's no result then return null. Previously we defaulted back to library.GetMedia below - //but this will always get called for when we are getting descendents since many items won't have - //children and then we are hitting the database again! - //So instead we're going to rely on Examine to have the correct results like it should. - return Enumerable.Empty(); + //but this will always get called for when we are getting descendents since many items won't have + //children and then we are hitting the database again! + //So instead we're going to rely on Examine to have the correct results like it should. + return Enumerable.Empty(); } catch (FileNotFoundException) { @@ -634,14 +634,14 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache XPathNavigator nav, bool fromExamine) { - if (valueDictionary == null) throw new ArgumentNullException(nameof(valueDictionary)); - if (getParent == null) throw new ArgumentNullException(nameof(getParent)); - if (getProperty == null) throw new ArgumentNullException(nameof(getProperty)); + if (valueDictionary == null) throw new ArgumentNullException(nameof(valueDictionary)); + if (getParent == null) throw new ArgumentNullException(nameof(getParent)); + if (getProperty == null) throw new ArgumentNullException(nameof(getProperty)); _getParent = new Lazy(() => getParent(ParentId)); _getChildren = new Lazy>(() => getChildren(Id, nav)); _getProperty = getProperty; - _cacheProvider = cacheProvider; + _cacheProvider = cacheProvider; LoadedFromExamine = fromExamine; @@ -651,11 +651,11 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache ValidateAndSetProperty(valueDictionary, val => _sortOrder = int.Parse(val), "sortOrder"); ValidateAndSetProperty(valueDictionary, val => _name = val, "nodeName", "__nodeName"); ValidateAndSetProperty(valueDictionary, val => _urlName = val, "urlName"); - ValidateAndSetProperty(valueDictionary, val => _documentTypeAlias = val, "nodeTypeAlias", LuceneIndexer.NodeTypeAliasFieldName); + ValidateAndSetProperty(valueDictionary, val => _documentTypeAlias = val, "nodeTypeAlias", LuceneIndexer.NodeTypeAliasFieldName); ValidateAndSetProperty(valueDictionary, val => _documentTypeId = int.Parse(val), "nodeType"); - //ValidateAndSetProperty(valueDictionary, val => _writerName = val, "writerName"); + //ValidateAndSetProperty(valueDictionary, val => _writerName = val, "writerName"); ValidateAndSetProperty(valueDictionary, val => _creatorName = val, "creatorName", "writerName"); //this is a bit of a hack fix for: U4-1132 - //ValidateAndSetProperty(valueDictionary, val => _writerId = int.Parse(val), "writerID"); + //ValidateAndSetProperty(valueDictionary, val => _writerId = int.Parse(val), "writerID"); ValidateAndSetProperty(valueDictionary, val => _creatorId = int.Parse(val), "creatorID", "writerID"); //this is a bit of a hack fix for: U4-1132 ValidateAndSetProperty(valueDictionary, val => _path = val, "path", "__Path"); ValidateAndSetProperty(valueDictionary, val => _createDate = ParseDateTimeValue(val), "createDate"); @@ -671,7 +671,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache } }, "parentID"); - _contentType = contentTypeCache.Get(PublishedItemType.Media, _documentTypeAlias); + _contentType = contentTypeCache.Get(PublishedItemType.Media, _documentTypeAlias); _properties = new Collection(); //handle content type properties @@ -709,18 +709,18 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache private DateTime ParseDateTimeValue(string val) { - if (LoadedFromExamine == false) + if (LoadedFromExamine == false) return DateTime.Parse(val); - //we need to parse the date time using Lucene converters - var ticks = long.Parse(val); - return new DateTime(ticks); + //we need to parse the date time using Lucene converters + var ticks = long.Parse(val); + return new DateTime(ticks); } /// /// Flag to get/set if this was laoded from examine cache /// - internal bool LoadedFromExamine { get; } + internal bool LoadedFromExamine { get; } //private readonly Func _getParent; private readonly Lazy _getParent; @@ -732,51 +732,51 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache /// /// Returns 'Media' as the item type /// - public override PublishedItemType ItemType => PublishedItemType.Media; + public override PublishedItemType ItemType => PublishedItemType.Media; - public override IPublishedContent Parent => _getParent.Value; + public override IPublishedContent Parent => _getParent.Value; public int ParentId { get; private set; } - public override int Id => _id; + public override int Id => _id; - public override Guid Key => _key; + public override Guid Key => _key; - public override int TemplateId => 0; + public override int TemplateId => 0; - public override int SortOrder => _sortOrder; + public override int SortOrder => _sortOrder; - public override string Name => _name; + public override string Name => _name; - public override string UrlName => _urlName; + public override string UrlName => _urlName; - public override string DocumentTypeAlias => _documentTypeAlias; + public override string DocumentTypeAlias => _documentTypeAlias; - public override int DocumentTypeId => _documentTypeId; + public override int DocumentTypeId => _documentTypeId; - public override string WriterName => _creatorName; + public override string WriterName => _creatorName; - public override string CreatorName => _creatorName; + public override string CreatorName => _creatorName; - public override int WriterId => _creatorId; + public override int WriterId => _creatorId; - public override int CreatorId => _creatorId; + public override int CreatorId => _creatorId; - public override string Path => _path; + public override string Path => _path; - public override DateTime CreateDate => _createDate; + public override DateTime CreateDate => _createDate; - public override DateTime UpdateDate => _updateDate; + public override DateTime UpdateDate => _updateDate; - public override Guid Version => Guid.Empty; + public override Guid Version => Guid.Empty; - public override int Level => _level; + public override int Level => _level; - public override bool IsDraft => false; + public override bool IsDraft => false; - public override IEnumerable Properties => _properties; + public override IEnumerable Properties => _properties; - public override IEnumerable Children => _getChildren.Value; + public override IEnumerable Children => _getChildren.Value; public override IPublishedProperty GetProperty(string alias) { @@ -785,7 +785,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache public override PublishedContentType ContentType => _contentType; - // override to implement cache + // override to implement cache // cache at context level, ie once for the whole request // but cache is not shared by requests because we wouldn't know how to clear it public override IPublishedProperty GetProperty(string alias, bool recurse) @@ -831,8 +831,8 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache } } - internal void Resync() - { + internal void Resync() + { // clear recursive properties cached by XmlPublishedContent.GetProperty // assume that nothing else is going to cache IPublishedProperty items (else would need to do ByKeySearch) // NOTE all properties cleared when clearing the content cache (see content cache) @@ -852,12 +852,12 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache return _contentTypeCache.Get(PublishedItemType.Media, alias); } - public override IEnumerable GetByContentType(PublishedContentType contentType) - { - throw new NotImplementedException(); - } + public override IEnumerable GetByContentType(PublishedContentType contentType) + { + throw new NotImplementedException(); + } - #endregion + #endregion // REFACTORING diff --git a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/SafeXmlReaderWriter.cs b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/SafeXmlReaderWriter.cs index bf44eea3fa..a84d443397 100644 --- a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/SafeXmlReaderWriter.cs +++ b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/SafeXmlReaderWriter.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Xml; using Umbraco.Core; using Umbraco.Core.Scoping; @@ -141,4 +141,4 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/XmlPublishedContent.cs b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/XmlPublishedContent.cs index a9a416d5a5..b29642fcaa 100644 --- a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/XmlPublishedContent.cs +++ b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/XmlPublishedContent.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Xml; @@ -14,72 +14,72 @@ using Umbraco.Web.Models; namespace Umbraco.Web.PublishedCache.XmlPublishedCache { - /// - /// Represents an IPublishedContent which is created based on an Xml structure. - /// - [Serializable] - [XmlType(Namespace = "http://umbraco.org/webservices/")] - internal class XmlPublishedContent : PublishedContentBase - { - private XmlPublishedContent(XmlNode xmlNode, bool isPreviewing, ICacheProvider cacheProvider, PublishedContentTypeCache contentTypeCache) - { - _xmlNode = xmlNode; - _isPreviewing = isPreviewing; + /// + /// Represents an IPublishedContent which is created based on an Xml structure. + /// + [Serializable] + [XmlType(Namespace = "http://umbraco.org/webservices/")] + internal class XmlPublishedContent : PublishedContentBase + { + private XmlPublishedContent(XmlNode xmlNode, bool isPreviewing, ICacheProvider cacheProvider, PublishedContentTypeCache contentTypeCache) + { + _xmlNode = xmlNode; + _isPreviewing = isPreviewing; - _cacheProvider = cacheProvider; - _contentTypeCache = contentTypeCache; - } + _cacheProvider = cacheProvider; + _contentTypeCache = contentTypeCache; + } - private readonly XmlNode _xmlNode; + private readonly XmlNode _xmlNode; private readonly bool _isPreviewing; - private readonly ICacheProvider _cacheProvider; // at facade/request level (see PublishedContentCache) - private readonly PublishedContentTypeCache _contentTypeCache; + private readonly ICacheProvider _cacheProvider; // at facade/request level (see PublishedContentCache) + private readonly PublishedContentTypeCache _contentTypeCache; private bool _nodeInitialized; - private bool _parentInitialized; - private bool _childrenInitialized; + private bool _parentInitialized; + private bool _childrenInitialized; - private IEnumerable _children = Enumerable.Empty(); - private IPublishedContent _parent; + private IEnumerable _children = Enumerable.Empty(); + private IPublishedContent _parent; private PublishedContentType _contentType; private Dictionary _properties; private int _id; - private Guid _key; - private int _template; - private string _name; - private string _docTypeAlias; - private int _docTypeId; - private string _writerName; - private string _creatorName; - private int _writerId; - private int _creatorId; - private string _urlName; - private string _path; - private DateTime _createDate; - private DateTime _updateDate; - private Guid _version; - private int _sortOrder; - private int _level; - private bool _isDraft; + private Guid _key; + private int _template; + private string _name; + private string _docTypeAlias; + private int _docTypeId; + private string _writerName; + private string _creatorName; + private int _writerId; + private int _creatorId; + private string _urlName; + private string _path; + private DateTime _createDate; + private DateTime _updateDate; + private Guid _version; + private int _sortOrder; + private int _level; + private bool _isDraft; - public override IEnumerable Children - { - get - { - if (_nodeInitialized == false) InitializeNode(); + public override IEnumerable Children + { + get + { + if (_nodeInitialized == false) InitializeNode(); if (_childrenInitialized == false) InitializeChildren(); - return _children; - } - } + return _children; + } + } - public override IPublishedProperty GetProperty(string alias) - { + public override IPublishedProperty GetProperty(string alias) + { if (_nodeInitialized == false) InitializeNode(); IPublishedProperty property; - return _properties.TryGetValue(alias, out property) ? property : null; - } + return _properties.TryGetValue(alias, out property) ? property : null; + } // override to implement cache // cache at context level, ie once for the whole request @@ -95,188 +95,188 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache // note: cleared by PublishedContentCache.Resync - any change here must be applied there } - public override PublishedItemType ItemType => PublishedItemType.Content; + public override PublishedItemType ItemType => PublishedItemType.Content; - public override IPublishedContent Parent - { - get - { - if (_nodeInitialized == false) InitializeNode(); + public override IPublishedContent Parent + { + get + { + if (_nodeInitialized == false) InitializeNode(); if (_parentInitialized == false) InitializeParent(); - return _parent; - } - } + return _parent; + } + } public override int Id - { - get - { - if (_nodeInitialized == false) InitializeNode(); - return _id; - } - } + { + get + { + if (_nodeInitialized == false) InitializeNode(); + return _id; + } + } - public override Guid Key - { - get - { - if (_nodeInitialized == false) InitializeNode(); - return _key; - } - } + public override Guid Key + { + get + { + if (_nodeInitialized == false) InitializeNode(); + return _key; + } + } - public override int TemplateId - { - get - { - if (_nodeInitialized == false) InitializeNode(); - return _template; - } - } + public override int TemplateId + { + get + { + if (_nodeInitialized == false) InitializeNode(); + return _template; + } + } - public override int SortOrder - { - get - { - if (_nodeInitialized == false) InitializeNode(); - return _sortOrder; - } - } + public override int SortOrder + { + get + { + if (_nodeInitialized == false) InitializeNode(); + return _sortOrder; + } + } - public override string Name - { - get - { - if (_nodeInitialized == false) InitializeNode(); - return _name; - } - } + public override string Name + { + get + { + if (_nodeInitialized == false) InitializeNode(); + return _name; + } + } - public override string DocumentTypeAlias - { - get - { - if (_nodeInitialized == false) InitializeNode(); - return _docTypeAlias; - } - } + public override string DocumentTypeAlias + { + get + { + if (_nodeInitialized == false) InitializeNode(); + return _docTypeAlias; + } + } - public override int DocumentTypeId - { - get - { - if (_nodeInitialized == false) InitializeNode(); - return _docTypeId; - } - } + public override int DocumentTypeId + { + get + { + if (_nodeInitialized == false) InitializeNode(); + return _docTypeId; + } + } - public override string WriterName - { - get - { - if (_nodeInitialized == false) InitializeNode(); - return _writerName; - } - } + public override string WriterName + { + get + { + if (_nodeInitialized == false) InitializeNode(); + return _writerName; + } + } - public override string CreatorName - { - get - { - if (_nodeInitialized == false) InitializeNode(); - return _creatorName; - } - } + public override string CreatorName + { + get + { + if (_nodeInitialized == false) InitializeNode(); + return _creatorName; + } + } - public override int WriterId - { - get - { - if (_nodeInitialized == false) InitializeNode(); - return _writerId; - } - } + public override int WriterId + { + get + { + if (_nodeInitialized == false) InitializeNode(); + return _writerId; + } + } - public override int CreatorId - { - get - { - if (_nodeInitialized == false) InitializeNode(); - return _creatorId; - } - } + public override int CreatorId + { + get + { + if (_nodeInitialized == false) InitializeNode(); + return _creatorId; + } + } - public override string Path - { - get - { - if (_nodeInitialized == false) InitializeNode(); - return _path; - } - } + public override string Path + { + get + { + if (_nodeInitialized == false) InitializeNode(); + return _path; + } + } - public override DateTime CreateDate - { - get - { - if (_nodeInitialized == false) InitializeNode(); - return _createDate; - } - } + public override DateTime CreateDate + { + get + { + if (_nodeInitialized == false) InitializeNode(); + return _createDate; + } + } - public override DateTime UpdateDate - { - get - { - if (_nodeInitialized == false) InitializeNode(); - return _updateDate; - } - } + public override DateTime UpdateDate + { + get + { + if (_nodeInitialized == false) InitializeNode(); + return _updateDate; + } + } - public override Guid Version - { - get - { - if (_nodeInitialized == false) InitializeNode(); - return _version; - } - } + public override Guid Version + { + get + { + if (_nodeInitialized == false) InitializeNode(); + return _version; + } + } - public override string UrlName - { - get - { - if (_nodeInitialized == false) InitializeNode(); - return _urlName; - } - } + public override string UrlName + { + get + { + if (_nodeInitialized == false) InitializeNode(); + return _urlName; + } + } - public override int Level - { - get - { - if (_nodeInitialized == false) InitializeNode(); - return _level; - } - } + public override int Level + { + get + { + if (_nodeInitialized == false) InitializeNode(); + return _level; + } + } - public override bool IsDraft - { - get - { - if (_nodeInitialized == false) InitializeNode(); - return _isDraft; - } - } + public override bool IsDraft + { + get + { + if (_nodeInitialized == false) InitializeNode(); + return _isDraft; + } + } - public override IEnumerable Properties - { - get - { - if (_nodeInitialized == false) InitializeNode(); - return _properties.Values; - } - } + public override IEnumerable Properties + { + get + { + if (_nodeInitialized == false) InitializeNode(); + return _properties.Values; + } + } public override PublishedContentType ContentType { @@ -287,145 +287,145 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache } } - private void InitializeParent() - { - var parent = _xmlNode?.ParentNode; + private void InitializeParent() + { + var parent = _xmlNode?.ParentNode; if (parent == null) return; - if (parent.Attributes?.GetNamedItem("isDoc") != null) - _parent = Get(parent, _isPreviewing, _cacheProvider, _contentTypeCache); + if (parent.Attributes?.GetNamedItem("isDoc") != null) + _parent = Get(parent, _isPreviewing, _cacheProvider, _contentTypeCache); // warn: this is not thread-safe... _parentInitialized = true; - } + } - private void InitializeNode() - { - InitializeNode(_xmlNode, _isPreviewing, - out _id, out _key, out _template, out _sortOrder, out _name, out _writerName, - out _urlName, out _creatorName, out _creatorId, out _writerId, out _docTypeAlias, out _docTypeId, out _path, - out _version, out _createDate, out _updateDate, out _level, out _isDraft, out _contentType, out _properties, - _contentTypeCache.Get); + private void InitializeNode() + { + InitializeNode(_xmlNode, _isPreviewing, + out _id, out _key, out _template, out _sortOrder, out _name, out _writerName, + out _urlName, out _creatorName, out _creatorId, out _writerId, out _docTypeAlias, out _docTypeId, out _path, + out _version, out _createDate, out _updateDate, out _level, out _isDraft, out _contentType, out _properties, + _contentTypeCache.Get); - // warn: this is not thread-safe... - _nodeInitialized = true; - } + // warn: this is not thread-safe... + _nodeInitialized = true; + } - internal static void InitializeNode(XmlNode xmlNode, bool isPreviewing, - out int id, out Guid key, out int template, out int sortOrder, out string name, out string writerName, out string urlName, - out string creatorName, out int creatorId, out int writerId, out string docTypeAlias, out int docTypeId, out string path, - out Guid version, out DateTime createDate, out DateTime updateDate, out int level, out bool isDraft, - out PublishedContentType contentType, out Dictionary properties, - Func getPublishedContentType) - { - //initialize the out params with defaults: - writerName = null; - docTypeAlias = null; - id = template = sortOrder = template = creatorId = writerId = docTypeId = level = default(int); - key = version = default(Guid); - name = writerName = urlName = creatorName = docTypeAlias = path = null; - createDate = updateDate = default(DateTime); - isDraft = false; - contentType = null; - properties = null; + internal static void InitializeNode(XmlNode xmlNode, bool isPreviewing, + out int id, out Guid key, out int template, out int sortOrder, out string name, out string writerName, out string urlName, + out string creatorName, out int creatorId, out int writerId, out string docTypeAlias, out int docTypeId, out string path, + out Guid version, out DateTime createDate, out DateTime updateDate, out int level, out bool isDraft, + out PublishedContentType contentType, out Dictionary properties, + Func getPublishedContentType) + { + //initialize the out params with defaults: + writerName = null; + docTypeAlias = null; + id = template = sortOrder = template = creatorId = writerId = docTypeId = level = default(int); + key = version = default(Guid); + name = writerName = urlName = creatorName = docTypeAlias = path = null; + createDate = updateDate = default(DateTime); + isDraft = false; + contentType = null; + properties = null; if (xmlNode == null) return; - if (xmlNode.Attributes != null) - { - id = int.Parse(xmlNode.Attributes.GetNamedItem("id").Value); + if (xmlNode.Attributes != null) + { + id = int.Parse(xmlNode.Attributes.GetNamedItem("id").Value); if (xmlNode.Attributes.GetNamedItem("key") != null) // because, migration - key = Guid.Parse(xmlNode.Attributes.GetNamedItem("key").Value); - if (xmlNode.Attributes.GetNamedItem("template") != null) - template = int.Parse(xmlNode.Attributes.GetNamedItem("template").Value); - if (xmlNode.Attributes.GetNamedItem("sortOrder") != null) - sortOrder = int.Parse(xmlNode.Attributes.GetNamedItem("sortOrder").Value); - if (xmlNode.Attributes.GetNamedItem("nodeName") != null) - name = xmlNode.Attributes.GetNamedItem("nodeName").Value; - if (xmlNode.Attributes.GetNamedItem("writerName") != null) - writerName = xmlNode.Attributes.GetNamedItem("writerName").Value; - if (xmlNode.Attributes.GetNamedItem("urlName") != null) - urlName = xmlNode.Attributes.GetNamedItem("urlName").Value; - if (xmlNode.Attributes.GetNamedItem("creatorName") != null) - creatorName = xmlNode.Attributes.GetNamedItem("creatorName").Value; + key = Guid.Parse(xmlNode.Attributes.GetNamedItem("key").Value); + if (xmlNode.Attributes.GetNamedItem("template") != null) + template = int.Parse(xmlNode.Attributes.GetNamedItem("template").Value); + if (xmlNode.Attributes.GetNamedItem("sortOrder") != null) + sortOrder = int.Parse(xmlNode.Attributes.GetNamedItem("sortOrder").Value); + if (xmlNode.Attributes.GetNamedItem("nodeName") != null) + name = xmlNode.Attributes.GetNamedItem("nodeName").Value; + if (xmlNode.Attributes.GetNamedItem("writerName") != null) + writerName = xmlNode.Attributes.GetNamedItem("writerName").Value; + if (xmlNode.Attributes.GetNamedItem("urlName") != null) + urlName = xmlNode.Attributes.GetNamedItem("urlName").Value; + if (xmlNode.Attributes.GetNamedItem("creatorName") != null) + creatorName = xmlNode.Attributes.GetNamedItem("creatorName").Value; - //Added the actual userID, as a user cannot be looked up via full name only... - if (xmlNode.Attributes.GetNamedItem("creatorID") != null) - creatorId = int.Parse(xmlNode.Attributes.GetNamedItem("creatorID").Value); - if (xmlNode.Attributes.GetNamedItem("writerID") != null) - writerId = int.Parse(xmlNode.Attributes.GetNamedItem("writerID").Value); + //Added the actual userID, as a user cannot be looked up via full name only... + if (xmlNode.Attributes.GetNamedItem("creatorID") != null) + creatorId = int.Parse(xmlNode.Attributes.GetNamedItem("creatorID").Value); + if (xmlNode.Attributes.GetNamedItem("writerID") != null) + writerId = int.Parse(xmlNode.Attributes.GetNamedItem("writerID").Value); docTypeAlias = xmlNode.Name; - if (xmlNode.Attributes.GetNamedItem("nodeType") != null) - docTypeId = int.Parse(xmlNode.Attributes.GetNamedItem("nodeType").Value); - if (xmlNode.Attributes.GetNamedItem("path") != null) - path = xmlNode.Attributes.GetNamedItem("path").Value; - if (xmlNode.Attributes.GetNamedItem("version") != null) - version = new Guid(xmlNode.Attributes.GetNamedItem("version").Value); - if (xmlNode.Attributes.GetNamedItem("createDate") != null) - createDate = DateTime.Parse(xmlNode.Attributes.GetNamedItem("createDate").Value); - if (xmlNode.Attributes.GetNamedItem("updateDate") != null) - updateDate = DateTime.Parse(xmlNode.Attributes.GetNamedItem("updateDate").Value); - if (xmlNode.Attributes.GetNamedItem("level") != null) - level = int.Parse(xmlNode.Attributes.GetNamedItem("level").Value); + if (xmlNode.Attributes.GetNamedItem("nodeType") != null) + docTypeId = int.Parse(xmlNode.Attributes.GetNamedItem("nodeType").Value); + if (xmlNode.Attributes.GetNamedItem("path") != null) + path = xmlNode.Attributes.GetNamedItem("path").Value; + if (xmlNode.Attributes.GetNamedItem("version") != null) + version = new Guid(xmlNode.Attributes.GetNamedItem("version").Value); + if (xmlNode.Attributes.GetNamedItem("createDate") != null) + createDate = DateTime.Parse(xmlNode.Attributes.GetNamedItem("createDate").Value); + if (xmlNode.Attributes.GetNamedItem("updateDate") != null) + updateDate = DateTime.Parse(xmlNode.Attributes.GetNamedItem("updateDate").Value); + if (xmlNode.Attributes.GetNamedItem("level") != null) + level = int.Parse(xmlNode.Attributes.GetNamedItem("level").Value); isDraft = xmlNode.Attributes.GetNamedItem("isDraft") != null; } - //dictionary to store the property node data - var propertyNodes = new Dictionary(); + //dictionary to store the property node data + var propertyNodes = new Dictionary(); - foreach (XmlNode n in xmlNode.ChildNodes) - { - var e = n as XmlElement; - if (e == null) continue; - if (e.HasAttribute("isDoc") == false) - { - PopulatePropertyNodes(propertyNodes, e, false); - } - else break; //we are not longer on property elements - } + foreach (XmlNode n in xmlNode.ChildNodes) + { + var e = n as XmlElement; + if (e == null) continue; + if (e.HasAttribute("isDoc") == false) + { + PopulatePropertyNodes(propertyNodes, e, false); + } + else break; //we are not longer on property elements + } - //lookup the content type and create the properties collection - try - { - contentType = getPublishedContentType(PublishedItemType.Content, docTypeAlias); + //lookup the content type and create the properties collection + try + { + contentType = getPublishedContentType(PublishedItemType.Content, docTypeAlias); - } - catch (InvalidOperationException e) - { + } + catch (InvalidOperationException e) + { // fixme - enable! - //content.Instance.RefreshContentFromDatabase(); - throw new InvalidOperationException($"{e.Message}. This usually indicates that the content cache is corrupt; the content cache has been rebuilt in an attempt to self-fix the issue."); - } + //content.Instance.RefreshContentFromDatabase(); + throw new InvalidOperationException($"{e.Message}. This usually indicates that the content cache is corrupt; the content cache has been rebuilt in an attempt to self-fix the issue."); + } //fill in the property collection - properties = new Dictionary(StringComparer.OrdinalIgnoreCase); - foreach (var propertyType in contentType.PropertyTypes) - { + properties = new Dictionary(StringComparer.OrdinalIgnoreCase); + foreach (var propertyType in contentType.PropertyTypes) + { var val = propertyNodes.TryGetValue(propertyType.PropertyTypeAlias.ToLowerInvariant(), out XmlNode n) ? new XmlPublishedProperty(propertyType, isPreviewing, n) : new XmlPublishedProperty(propertyType, isPreviewing); properties[propertyType.PropertyTypeAlias] = val; - } - } + } + } - private static void PopulatePropertyNodes(IDictionary propertyNodes, XmlNode n, bool legacy) - { - var attrs = n.Attributes; - if (attrs == null) return; + private static void PopulatePropertyNodes(IDictionary propertyNodes, XmlNode n, bool legacy) + { + var attrs = n.Attributes; + if (attrs == null) return; - var alias = legacy - ? attrs.GetNamedItem("alias").Value - : n.Name; - propertyNodes[alias.ToLowerInvariant()] = n; - } + var alias = legacy + ? attrs.GetNamedItem("alias").Value + : n.Name; + propertyNodes[alias.ToLowerInvariant()] = n; + } private void InitializeChildren() - { - if (_xmlNode == null) return; + { + if (_xmlNode == null) return; // load children const string childXPath = "* [@isDoc]"; @@ -441,7 +441,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache // warn: this is not thread-safe _childrenInitialized = true; - } + } /// /// Gets an IPublishedContent corresponding to an Xml cache node. @@ -465,11 +465,11 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache return (IPublishedContent) cacheProvider.GetCacheItem(key, () => (new XmlPublishedContent(node, isPreviewing, cacheProvider, contentTypeCache)).CreateModel()); } - public static void ClearRequest() - { - Current.ApplicationCache.RequestCache.ClearCacheByKeySearch(CacheKeyPrefix); - } + public static void ClearRequest() + { + Current.ApplicationCache.RequestCache.ClearCacheByKeySearch(CacheKeyPrefix); + } - private const string CacheKeyPrefix = "CONTENTCACHE_XMLPUBLISHEDCONTENT_"; - } -} \ No newline at end of file + private const string CacheKeyPrefix = "CONTENTCACHE_XMLPUBLISHEDCONTENT_"; + } +} diff --git a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/XmlPublishedProperty.cs b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/XmlPublishedProperty.cs index 370e49f844..48f242b1ca 100644 --- a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/XmlPublishedProperty.cs +++ b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/XmlPublishedProperty.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Xml; using System.Xml.Serialization; using Umbraco.Core.Models.PublishedContent; @@ -8,14 +8,14 @@ using Umbraco.Core.Xml; namespace Umbraco.Web.PublishedCache.XmlPublishedCache { - /// - /// Represents an IDocumentProperty which is created based on an Xml structure. - /// - [Serializable] - [XmlType(Namespace = "http://umbraco.org/webservices/")] - internal class XmlPublishedProperty : PublishedPropertyBase - { - private readonly string _sourceValue; // the raw, xml node value + /// + /// Represents an IDocumentProperty which is created based on an Xml structure. + /// + [Serializable] + [XmlType(Namespace = "http://umbraco.org/webservices/")] + internal class XmlPublishedProperty : PublishedPropertyBase + { + private readonly string _sourceValue; // the raw, xml node value // Xml cache not using XPath value... and as for the rest... // we're single threaded here, keep it simple @@ -28,14 +28,14 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache /// public override object SourceValue => _sourceValue; - // in the Xml cache, everything is a string, and to have a value + // in the Xml cache, everything is a string, and to have a value // you want to have a non-null, non-empty string. - public override bool HasValue => _sourceValue.Trim().Length > 0; + public override bool HasValue => _sourceValue.Trim().Length > 0; - public override object Value - { - get - { + public override object Value + { + get + { // NOT caching the source (intermediate) value since we'll never need it // everything in Xml cache is per-request anyways // also, properties should not be shared between requests and therefore @@ -54,10 +54,10 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache public XmlPublishedProperty(PublishedPropertyType propertyType, bool isPreviewing, XmlNode propertyXmlData) : this(propertyType, isPreviewing) - { - if (propertyXmlData == null) - throw new ArgumentNullException(nameof(propertyXmlData), "Property xml source is null"); - _sourceValue = XmlHelper.GetNodeValue(propertyXmlData); + { + if (propertyXmlData == null) + throw new ArgumentNullException(nameof(propertyXmlData), "Property xml source is null"); + _sourceValue = XmlHelper.GetNodeValue(propertyXmlData); } public XmlPublishedProperty(PublishedPropertyType propertyType, bool isPreviewing, string propertyData) @@ -74,5 +74,5 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache _sourceValue = string.Empty; _isPreviewing = isPreviewing; } - } -} \ No newline at end of file + } +} diff --git a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/XmlStoreFilePersister.cs b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/XmlStoreFilePersister.cs index 516a95722e..8a68812d4d 100644 --- a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/XmlStoreFilePersister.cs +++ b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/XmlStoreFilePersister.cs @@ -179,4 +179,4 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache _timer.Dispose(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PublishedContentExtensions.cs b/src/Umbraco.Web/PublishedContentExtensions.cs index e85e3cec7b..d7a5ade1b8 100644 --- a/src/Umbraco.Web/PublishedContentExtensions.cs +++ b/src/Umbraco.Web/PublishedContentExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Data; using System.Globalization; @@ -17,31 +17,31 @@ namespace Umbraco.Web /// /// Provides extension methods for IPublishedContent. /// - public static class PublishedContentExtensions + public static class PublishedContentExtensions { #region Urls - /// - /// Gets the url for the content. - /// - /// The content. - /// The url for the content. - /// Better use the Url property but that method is here to complement UrlAbsolute(). - public static string Url(this IPublishedContent content) - { - return content.Url; - } + /// + /// Gets the url for the content. + /// + /// The content. + /// The url for the content. + /// Better use the Url property but that method is here to complement UrlAbsolute(). + public static string Url(this IPublishedContent content) + { + return content.Url; + } - /// - /// Gets the absolute url for the content. - /// - /// The content. - /// The absolute url for the content. + /// + /// Gets the absolute url for the content. + /// + /// The content. + /// The absolute url for the content. //[Obsolete("UrlWithDomain() is obsolete, use the UrlAbsolute() method instead.")] public static string UrlWithDomain(this IPublishedContent content) - { - return content.UrlAbsolute(); - } + { + return content.UrlAbsolute(); + } /// /// Gets the absolute url for the content. @@ -71,15 +71,15 @@ namespace Umbraco.Web #region Template /// - /// Returns the current template Alias - /// - /// - /// - public static string GetTemplateAlias(this IPublishedContent content) + /// Returns the current template Alias + /// + /// + /// + public static string GetTemplateAlias(this IPublishedContent content) { var template = Current.Services.FileService.GetTemplate(content.TemplateId); - return template == null ? string.Empty : template.Alias; - } + return template == null ? string.Empty : template.Alias; + } #endregion @@ -213,62 +213,62 @@ namespace Umbraco.Web if (property == null) return defaultValue; return property.Value(withDefaultValue, defaultValue); - } + } - #endregion + #endregion - #region Search + #region Search public static IEnumerable Search(this IPublishedContent content, string term, bool useWildCards = true, string searchProvider = null) - { - var searcher = Examine.ExamineManager.Instance.DefaultSearchProvider; - if (string.IsNullOrEmpty(searchProvider) == false) - searcher = Examine.ExamineManager.Instance.SearchProviderCollection[searchProvider]; + { + var searcher = Examine.ExamineManager.Instance.DefaultSearchProvider; + if (string.IsNullOrEmpty(searchProvider) == false) + searcher = Examine.ExamineManager.Instance.SearchProviderCollection[searchProvider]; - var t = term.Escape().Value; - if (useWildCards) - t = term.MultipleCharacterWildcard().Value; + var t = term.Escape().Value; + if (useWildCards) + t = term.MultipleCharacterWildcard().Value; - var luceneQuery = "+__Path:(" + content.Path.Replace("-", "\\-") + "*) +" + t; - var crit = searcher.CreateSearchCriteria().RawQuery(luceneQuery); + var luceneQuery = "+__Path:(" + content.Path.Replace("-", "\\-") + "*) +" + t; + var crit = searcher.CreateSearchCriteria().RawQuery(luceneQuery); - return content.Search(crit, searcher); - } + return content.Search(crit, searcher); + } public static IEnumerable SearchDescendants(this IPublishedContent content, string term, bool useWildCards = true, string searchProvider = null) - { - return content.Search(term, useWildCards, searchProvider); - } + { + return content.Search(term, useWildCards, searchProvider); + } public static IEnumerable SearchChildren(this IPublishedContent content, string term, bool useWildCards = true, string searchProvider = null) - { - var searcher = Examine.ExamineManager.Instance.DefaultSearchProvider; - if (string.IsNullOrEmpty(searchProvider) == false) - searcher = Examine.ExamineManager.Instance.SearchProviderCollection[searchProvider]; + { + var searcher = Examine.ExamineManager.Instance.DefaultSearchProvider; + if (string.IsNullOrEmpty(searchProvider) == false) + searcher = Examine.ExamineManager.Instance.SearchProviderCollection[searchProvider]; - var t = term.Escape().Value; - if (useWildCards) - t = term.MultipleCharacterWildcard().Value; + var t = term.Escape().Value; + if (useWildCards) + t = term.MultipleCharacterWildcard().Value; - var luceneQuery = "+parentID:" + content.Id + " +" + t; - var crit = searcher.CreateSearchCriteria().RawQuery(luceneQuery); + var luceneQuery = "+parentID:" + content.Id + " +" + t; + var crit = searcher.CreateSearchCriteria().RawQuery(luceneQuery); - return content.Search(crit, searcher); - } + return content.Search(crit, searcher); + } public static IEnumerable Search(this IPublishedContent content, Examine.SearchCriteria.ISearchCriteria criteria, Examine.Providers.BaseSearchProvider searchProvider = null) - { - var s = Examine.ExamineManager.Instance.DefaultSearchProvider; - if (searchProvider != null) - s = searchProvider; + { + var s = Examine.ExamineManager.Instance.DefaultSearchProvider; + if (searchProvider != null) + s = searchProvider; - var results = s.Search(criteria); - return results.ConvertSearchResultToPublishedContent(UmbracoContext.Current.ContentCache); - } + var results = s.Search(criteria); + return results.ConvertSearchResultToPublishedContent(UmbracoContext.Current.ContentCache); + } - #endregion + #endregion - #region IsSomething: misc. + #region IsSomething: misc. /// /// Gets a value indicating whether the content is visible. @@ -293,72 +293,72 @@ namespace Umbraco.Web /// The content to determine content type of. /// The alias of the content type to test against. /// True if the content is of the specified content type; otherwise false. - public static bool IsDocumentType(this IPublishedContent content, string docTypeAlias) - { - return content.DocumentTypeAlias.InvariantEquals(docTypeAlias); - } + public static bool IsDocumentType(this IPublishedContent content, string docTypeAlias) + { + return content.DocumentTypeAlias.InvariantEquals(docTypeAlias); + } - /// - /// Determines whether the specified content is a specified content type or it's derived types. - /// - /// The content to determine content type of. - /// The alias of the content type to test against. - /// When true, recurses up the content type tree to check inheritance; when false just calls IsDocumentType(this IPublishedContent content, string docTypeAlias). - /// True if the content is of the specified content type or a derived content type; otherwise false. - public static bool IsDocumentType(this IPublishedContent content, string docTypeAlias, bool recursive) - { - if (content.IsDocumentType(docTypeAlias)) - return true; + /// + /// Determines whether the specified content is a specified content type or it's derived types. + /// + /// The content to determine content type of. + /// The alias of the content type to test against. + /// When true, recurses up the content type tree to check inheritance; when false just calls IsDocumentType(this IPublishedContent content, string docTypeAlias). + /// True if the content is of the specified content type or a derived content type; otherwise false. + public static bool IsDocumentType(this IPublishedContent content, string docTypeAlias, bool recursive) + { + if (content.IsDocumentType(docTypeAlias)) + return true; - return recursive && IsDocumentTypeRecursive(content, docTypeAlias); - } + return recursive && IsDocumentTypeRecursive(content, docTypeAlias); + } - private static bool IsDocumentTypeRecursive(IPublishedContent content, string docTypeAlias) - { - var contentTypeService = Current.Services.ContentTypeService; // fixme - inject - var type = contentTypeService.Get(content.DocumentTypeAlias); - while (type != null && type.ParentId > 0) - { - type = contentTypeService.Get(type.ParentId); - if (type.Alias.InvariantEquals(docTypeAlias)) - return true; - } - return false; - } + private static bool IsDocumentTypeRecursive(IPublishedContent content, string docTypeAlias) + { + var contentTypeService = Current.Services.ContentTypeService; // fixme - inject + var type = contentTypeService.Get(content.DocumentTypeAlias); + while (type != null && type.ParentId > 0) + { + type = contentTypeService.Get(type.ParentId); + if (type.Alias.InvariantEquals(docTypeAlias)) + return true; + } + return false; + } - public static bool IsNull(this IPublishedContent content, string alias, bool recurse) - { - return content.HasValue(alias, recurse) == false; - } + public static bool IsNull(this IPublishedContent content, string alias, bool recurse) + { + return content.HasValue(alias, recurse) == false; + } - public static bool IsNull(this IPublishedContent content, string alias) - { - return content.HasValue(alias) == false; - } + public static bool IsNull(this IPublishedContent content, string alias) + { + return content.HasValue(alias) == false; + } #endregion #region IsSomething: equality public static bool IsEqual(this IPublishedContent content, IPublishedContent other) - { - return content.Id == other.Id; - } + { + return content.Id == other.Id; + } public static HtmlString IsEqual(this IPublishedContent content, IPublishedContent other, string valueIfTrue) { return content.IsEqual(other, valueIfTrue, string.Empty); } - public static HtmlString IsEqual(this IPublishedContent content, IPublishedContent other, string valueIfTrue, string valueIfFalse) - { - return new HtmlString(content.IsEqual(other) ? valueIfTrue : valueIfFalse); - } + public static HtmlString IsEqual(this IPublishedContent content, IPublishedContent other, string valueIfTrue, string valueIfFalse) + { + return new HtmlString(content.IsEqual(other) ? valueIfTrue : valueIfFalse); + } - public static bool IsNotEqual(this IPublishedContent content, IPublishedContent other) - { - return content.IsEqual(other) == false; - } + public static bool IsNotEqual(this IPublishedContent content, IPublishedContent other) + { + return content.IsEqual(other) == false; + } public static HtmlString IsNotEqual(this IPublishedContent content, IPublishedContent other, string valueIfTrue) { @@ -366,9 +366,9 @@ namespace Umbraco.Web } public static HtmlString IsNotEqual(this IPublishedContent content, IPublishedContent other, string valueIfTrue, string valueIfFalse) - { - return new HtmlString(content.IsNotEqual(other) ? valueIfTrue : valueIfFalse); - } + { + return new HtmlString(content.IsNotEqual(other) ? valueIfTrue : valueIfFalse); + } #endregion @@ -377,62 +377,62 @@ namespace Umbraco.Web public static bool IsDescendant(this IPublishedContent content, IPublishedContent other) { return content.Ancestors().Any(x => x.Id == other.Id); - } + } - public static HtmlString IsDescendant(this IPublishedContent content, IPublishedContent other, string valueIfTrue) - { - return content.IsDescendant(other, valueIfTrue, string.Empty); - } + public static HtmlString IsDescendant(this IPublishedContent content, IPublishedContent other, string valueIfTrue) + { + return content.IsDescendant(other, valueIfTrue, string.Empty); + } - public static HtmlString IsDescendant(this IPublishedContent content, IPublishedContent other, string valueIfTrue, string valueIfFalse) - { + public static HtmlString IsDescendant(this IPublishedContent content, IPublishedContent other, string valueIfTrue, string valueIfFalse) + { return new HtmlString(content.IsDescendant(other) ? valueIfTrue : valueIfFalse); - } + } - public static bool IsDescendantOrSelf(this IPublishedContent content, IPublishedContent other) - { + public static bool IsDescendantOrSelf(this IPublishedContent content, IPublishedContent other) + { return content.AncestorsOrSelf().Any(x => x.Id == other.Id); } - public static HtmlString IsDescendantOrSelf(this IPublishedContent content, IPublishedContent other, string valueIfTrue) - { + public static HtmlString IsDescendantOrSelf(this IPublishedContent content, IPublishedContent other, string valueIfTrue) + { return content.IsDescendantOrSelf(other, valueIfTrue, string.Empty); } - public static HtmlString IsDescendantOrSelf(this IPublishedContent content, IPublishedContent other, string valueIfTrue, string valueIfFalse) - { + public static HtmlString IsDescendantOrSelf(this IPublishedContent content, IPublishedContent other, string valueIfTrue, string valueIfFalse) + { return new HtmlString(content.IsDescendantOrSelf(other) ? valueIfTrue : valueIfFalse); } - public static bool IsAncestor(this IPublishedContent content, IPublishedContent other) - { + public static bool IsAncestor(this IPublishedContent content, IPublishedContent other) + { // avoid using Descendants(), that's expensive - return other.Ancestors().Any(x => x.Id == content.Id); - } + return other.Ancestors().Any(x => x.Id == content.Id); + } - public static HtmlString IsAncestor(this IPublishedContent content, IPublishedContent other, string valueIfTrue) - { + public static HtmlString IsAncestor(this IPublishedContent content, IPublishedContent other, string valueIfTrue) + { return content.IsAncestor(other, valueIfTrue, string.Empty); } - public static HtmlString IsAncestor(this IPublishedContent content, IPublishedContent other, string valueIfTrue, string valueIfFalse) - { + public static HtmlString IsAncestor(this IPublishedContent content, IPublishedContent other, string valueIfTrue, string valueIfFalse) + { return new HtmlString(content.IsAncestor(other) ? valueIfTrue : valueIfFalse); } - public static bool IsAncestorOrSelf(this IPublishedContent content, IPublishedContent other) - { + public static bool IsAncestorOrSelf(this IPublishedContent content, IPublishedContent other) + { // avoid using DescendantsOrSelf(), that's expensive return other.AncestorsOrSelf().Any(x => x.Id == content.Id); } - public static HtmlString IsAncestorOrSelf(this IPublishedContent content, IPublishedContent other, string valueIfTrue) - { + public static HtmlString IsAncestorOrSelf(this IPublishedContent content, IPublishedContent other, string valueIfTrue) + { return content.IsAncestorOrSelf(other, valueIfTrue, string.Empty); } - public static HtmlString IsAncestorOrSelf(this IPublishedContent content, IPublishedContent other, string valueIfTrue, string valueIfFalse) - { + public static HtmlString IsAncestorOrSelf(this IPublishedContent content, IPublishedContent other, string valueIfTrue, string valueIfFalse) + { return new HtmlString(content.IsAncestorOrSelf(other) ? valueIfTrue : valueIfFalse); } @@ -440,14 +440,14 @@ namespace Umbraco.Web #region Axes: ancestors, ancestors-or-self - // as per XPath 1.0 specs 2.2, + // as per XPath 1.0 specs �2.2, // - the ancestor axis contains the ancestors of the context node; the ancestors of the context node consist // of the parent of context node and the parent's parent and so on; thus, the ancestor axis will always // include the root node, unless the context node is the root node. // - the ancestor-or-self axis contains the context node and the ancestors of the context node; thus, // the ancestor axis will always include the root node. // - // as per XPath 2.0 specs 3.2.1.1, + // as per XPath 2.0 specs �3.2.1.1, // - the ancestor axis is defined as the transitive closure of the parent axis; it contains the ancestors // of the context node (the parent, the parent of the parent, and so on) - The ancestor axis includes the // root node of the tree in which the context node is found, unless the context node is the root node. @@ -457,7 +457,7 @@ namespace Umbraco.Web // the ancestor and ancestor-or-self axis are reverse axes ie they contain the context node or nodes that // are before the context node in document order. // - // document order is defined by 2.4.1 as: + // document order is defined by �2.4.1 as: // - the root node is the first node. // - every node occurs before all of its children and descendants. // - the relative order of siblings is the order in which they occur in the children property of their parent node. @@ -737,7 +737,7 @@ namespace Umbraco.Web #endregion - #region Axes: descendants, descendants-or-self + #region Axes: descendants, descendants-or-self /// /// Returns all DescendantsOrSelf of all content referenced @@ -768,12 +768,12 @@ namespace Umbraco.Web } - // as per XPath 1.0 specs 2.2, + // as per XPath 1.0 specs �2.2, // - the descendant axis contains the descendants of the context node; a descendant is a child or a child of a child and so on; thus // the descendant axis never contains attribute or namespace nodes. // - the descendant-or-self axis contains the context node and the descendants of the context node. // - // as per XPath 2.0 specs 3.2.1.1, + // as per XPath 2.0 specs �3.2.1.1, // - the descendant axis is defined as the transitive closure of the child axis; it contains the descendants of the context node (the // children, the children of the children, and so on). // - the descendant-or-self axis contains the context node and the descendants of the context node. @@ -781,7 +781,7 @@ namespace Umbraco.Web // the descendant and descendant-or-self axis are forward axes ie they contain the context node or nodes that are after the context // node in document order. // - // document order is defined by 2.4.1 as: + // document order is defined by �2.4.1 as: // - the root node is the first node. // - every node occurs before all of its children and descendants. // - the relative order of siblings is the order in which they occur in the children property of their parent node. @@ -798,9 +798,9 @@ namespace Umbraco.Web } public static IEnumerable Descendants(this IPublishedContent content, string contentTypeAlias) - { - return content.DescendantsOrSelf(false, p => p.DocumentTypeAlias == contentTypeAlias); - } + { + return content.DescendantsOrSelf(false, p => p.DocumentTypeAlias == contentTypeAlias); + } public static IEnumerable Descendants(this IPublishedContent content) where T : class, IPublishedContent @@ -820,14 +820,14 @@ namespace Umbraco.Web } public static IEnumerable DescendantsOrSelf(this IPublishedContent content, int level) - { - return content.DescendantsOrSelf(true, p => p.Level >= level); - } + { + return content.DescendantsOrSelf(true, p => p.Level >= level); + } public static IEnumerable DescendantsOrSelf(this IPublishedContent content, string contentTypeAlias) - { - return content.DescendantsOrSelf(true, p => p.DocumentTypeAlias == contentTypeAlias); - } + { + return content.DescendantsOrSelf(true, p => p.DocumentTypeAlias == contentTypeAlias); + } public static IEnumerable DescendantsOrSelf(this IPublishedContent content) where T : class, IPublishedContent @@ -919,62 +919,62 @@ namespace Umbraco.Web #endregion - #region Axes: following-sibling, preceding-sibling, following, preceding + pseudo-axes up, down, next, previous + #region Axes: following-sibling, preceding-sibling, following, preceding + pseudo-axes up, down, next, previous // up pseudo-axe ~ ancestors // bogus, kept for backward compatibility but we should get rid of it // better use ancestors - public static IPublishedContent Up(this IPublishedContent content) - { - return content.Parent; - } + public static IPublishedContent Up(this IPublishedContent content) + { + return content.Parent; + } - public static IPublishedContent Up(this IPublishedContent content, int number) - { + public static IPublishedContent Up(this IPublishedContent content, int number) + { if (number < 0) throw new ArgumentOutOfRangeException(nameof(number), "Must be greater than, or equal to, zero."); - return number == 0 ? content : content.EnumerateAncestors(false).Skip(number).FirstOrDefault(); - } + return number == 0 ? content : content.EnumerateAncestors(false).Skip(number).FirstOrDefault(); + } - public static IPublishedContent Up(this IPublishedContent content, string contentTypeAlias) - { - return string.IsNullOrEmpty(contentTypeAlias) + public static IPublishedContent Up(this IPublishedContent content, string contentTypeAlias) + { + return string.IsNullOrEmpty(contentTypeAlias) ? content.Parent : content.Ancestor(contentTypeAlias); - } + } // down pseudo-axe ~ children (not descendants) // bogus, kept for backward compatibility but we should get rid of it // better use descendants - public static IPublishedContent Down(this IPublishedContent content) - { - return content.Children.FirstOrDefault(); - } + public static IPublishedContent Down(this IPublishedContent content) + { + return content.Children.FirstOrDefault(); + } - public static IPublishedContent Down(this IPublishedContent content, int number) - { + public static IPublishedContent Down(this IPublishedContent content, int number) + { if (number < 0) throw new ArgumentOutOfRangeException(nameof(number), "Must be greater than, or equal to, zero."); - if (number == 0) return content; + if (number == 0) return content; content = content.Children.FirstOrDefault(); while (content != null && --number > 0) content = content.Children.FirstOrDefault(); - return content; - } + return content; + } - public static IPublishedContent Down(this IPublishedContent content, string contentTypeAlias) - { - if (string.IsNullOrEmpty(contentTypeAlias)) - return content.Children.FirstOrDefault(); + public static IPublishedContent Down(this IPublishedContent content, string contentTypeAlias) + { + if (string.IsNullOrEmpty(contentTypeAlias)) + return content.Children.FirstOrDefault(); // note: this is what legacy did, but with a broken Descendant // so fixing Descendant will change how it works... - return content.Descendant(contentTypeAlias); - } + return content.Descendant(contentTypeAlias); + } #endregion @@ -1000,15 +1000,15 @@ namespace Umbraco.Web #region Axes: children /// - /// Gets the children of the content. - /// - /// The content. - /// The children of the content. - /// + /// Gets the children of the content. + /// + /// The content. + /// The children of the content. + /// /// Children are sorted by their sortOrder. /// This method exists for consistency, it is the same as calling content.Children as a property. - /// - public static IEnumerable Children(this IPublishedContent content) + /// + public static IEnumerable Children(this IPublishedContent content) { if (content == null) throw new ArgumentNullException(nameof(content)); return content.Children; @@ -1095,9 +1095,9 @@ namespace Umbraco.Web /// An optional content type alias. /// The children of the content. public static DataTable ChildrenAsTable(this IPublishedContent content, ServiceContext services, string contentTypeAliasFilter = "") - { + { return GenerateDataTable(content, services, contentTypeAliasFilter); - } + } /// /// Gets the children of the content in a DataTable. @@ -1107,61 +1107,61 @@ namespace Umbraco.Web /// An optional content type alias. /// The children of the content. private static DataTable GenerateDataTable(IPublishedContent content, ServiceContext services, string contentTypeAliasFilter = "") - { - var firstNode = contentTypeAliasFilter.IsNullOrWhiteSpace() - ? content.Children.Any() - ? content.Children.ElementAt(0) - : null - : content.Children.FirstOrDefault(x => x.DocumentTypeAlias == contentTypeAliasFilter); - if (firstNode == null) - return new DataTable(); //no children found + { + var firstNode = contentTypeAliasFilter.IsNullOrWhiteSpace() + ? content.Children.Any() + ? content.Children.ElementAt(0) + : null + : content.Children.FirstOrDefault(x => x.DocumentTypeAlias == contentTypeAliasFilter); + if (firstNode == null) + return new DataTable(); //no children found - //use new utility class to create table so that we don't have to maintain code in many places, just one - var dt = Core.DataTableExtensions.GenerateDataTable( - //pass in the alias of the first child node since this is the node type we're rendering headers for - firstNode.DocumentTypeAlias, - //pass in the callback to extract the Dictionary of all defined aliases to their names - alias => GetPropertyAliasesAndNames(services, alias), - //pass in a callback to populate the datatable, yup its a bit ugly but it's already legacy and we just want to maintain code in one place. - () => - { - //create all row data - var tableData = Core.DataTableExtensions.CreateTableData(); - //loop through each child and create row data for it - foreach (var n in content.Children.OrderBy(x => x.SortOrder)) - { - if (contentTypeAliasFilter.IsNullOrWhiteSpace() == false) - { - if (n.DocumentTypeAlias != contentTypeAliasFilter) - continue; //skip this one, it doesn't match the filter - } + //use new utility class to create table so that we don't have to maintain code in many places, just one + var dt = Core.DataTableExtensions.GenerateDataTable( + //pass in the alias of the first child node since this is the node type we're rendering headers for + firstNode.DocumentTypeAlias, + //pass in the callback to extract the Dictionary of all defined aliases to their names + alias => GetPropertyAliasesAndNames(services, alias), + //pass in a callback to populate the datatable, yup its a bit ugly but it's already legacy and we just want to maintain code in one place. + () => + { + //create all row data + var tableData = Core.DataTableExtensions.CreateTableData(); + //loop through each child and create row data for it + foreach (var n in content.Children.OrderBy(x => x.SortOrder)) + { + if (contentTypeAliasFilter.IsNullOrWhiteSpace() == false) + { + if (n.DocumentTypeAlias != contentTypeAliasFilter) + continue; //skip this one, it doesn't match the filter + } - var standardVals = new Dictionary - { - { "Id", n.Id }, - { "NodeName", n.Name }, - { "NodeTypeAlias", n.DocumentTypeAlias }, - { "CreateDate", n.CreateDate }, - { "UpdateDate", n.UpdateDate }, - { "CreatorName", n.CreatorName }, - { "WriterName", n.WriterName }, - { "Url", n.Url } - }; + var standardVals = new Dictionary + { + { "Id", n.Id }, + { "NodeName", n.Name }, + { "NodeTypeAlias", n.DocumentTypeAlias }, + { "CreateDate", n.CreateDate }, + { "UpdateDate", n.UpdateDate }, + { "CreatorName", n.CreatorName }, + { "WriterName", n.WriterName }, + { "Url", n.Url } + }; - var userVals = new Dictionary(); + var userVals = new Dictionary(); foreach (var p in from IPublishedProperty p in n.Properties where p.SourceValue != null select p) { // probably want the "object value" of the property here... - userVals[p.PropertyTypeAlias] = p.Value; - } - //add the row data - Core.DataTableExtensions.AddRowData(tableData, standardVals, userVals); - } - return tableData; - } - ); - return dt; - } + userVals[p.PropertyTypeAlias] = p.Value; + } + //add the row data + Core.DataTableExtensions.AddRowData(tableData, standardVals, userVals); + } + return tableData; + } + ); + return dt; + } #endregion @@ -1183,13 +1183,13 @@ namespace Umbraco.Web private static Func> _getPropertyAliasesAndNames; - /// - /// This is used only for unit tests to set the delegate to look up aliases/names dictionary of a content type - /// - internal static Func> GetPropertyAliasesAndNames - { - get { return _getPropertyAliasesAndNames ?? GetAliasesAndNames; } - set { _getPropertyAliasesAndNames = value; } + /// + /// This is used only for unit tests to set the delegate to look up aliases/names dictionary of a content type + /// + internal static Func> GetPropertyAliasesAndNames + { + get { return _getPropertyAliasesAndNames ?? GetAliasesAndNames; } + set { _getPropertyAliasesAndNames = value; } } private static Dictionary GetAliasesAndNames(ServiceContext services, string alias) diff --git a/src/Umbraco.Web/PublishedContentQuery.cs b/src/Umbraco.Web/PublishedContentQuery.cs index c2457ef5ff..5b8688e0e2 100644 --- a/src/Umbraco.Web/PublishedContentQuery.cs +++ b/src/Umbraco.Web/PublishedContentQuery.cs @@ -63,7 +63,7 @@ namespace Umbraco.Web ? ItemByXPath(xpath, vars, _contentCache) : _query.ContentSingleAtXPath(xpath, vars); } - + public IEnumerable Content(IEnumerable ids) { return _query == null @@ -102,7 +102,7 @@ namespace Umbraco.Web #endregion #region Media - + public IPublishedContent Media(int id) { return _query == null @@ -166,7 +166,7 @@ namespace Umbraco.Web //{ // var doc = cache.GetSingleByXPath(xpath, vars); // return doc; - //} + //} private static IEnumerable ItemsByIds(IPublishedCache cache, IEnumerable ids) { @@ -238,4 +238,4 @@ namespace Umbraco.Web #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/PublishedFragmentExtensions.cs b/src/Umbraco.Web/PublishedFragmentExtensions.cs index e435305f2f..5d2b143f70 100644 --- a/src/Umbraco.Web/PublishedFragmentExtensions.cs +++ b/src/Umbraco.Web/PublishedFragmentExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Web; @@ -261,4 +261,4 @@ namespace Umbraco.Web #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/RelatedLinksTypeConverter.cs b/src/Umbraco.Web/RelatedLinksTypeConverter.cs index c49f9a222c..e06b5b5c62 100644 --- a/src/Umbraco.Web/RelatedLinksTypeConverter.cs +++ b/src/Umbraco.Web/RelatedLinksTypeConverter.cs @@ -24,7 +24,7 @@ namespace Umbraco.Web public RelatedLinksTypeConverter() { - + } private static readonly Type[] ConvertableTypes = new[] diff --git a/src/Umbraco.Web/RenderFieldCaseType.cs b/src/Umbraco.Web/RenderFieldCaseType.cs index ebb9b386c4..5b4a08cdf8 100644 --- a/src/Umbraco.Web/RenderFieldCaseType.cs +++ b/src/Umbraco.Web/RenderFieldCaseType.cs @@ -1,13 +1,13 @@ -namespace Umbraco.Web +namespace Umbraco.Web { - /// - /// Used in the .Field method when rendering an Umbraco field to specify what case type it should be - /// - public enum RenderFieldCaseType - { - Upper, - Lower, - Title, - Unchanged - } -} \ No newline at end of file + /// + /// Used in the .Field method when rendering an Umbraco field to specify what case type it should be + /// + public enum RenderFieldCaseType + { + Upper, + Lower, + Title, + Unchanged + } +} diff --git a/src/Umbraco.Web/RenderFieldEncodingType.cs b/src/Umbraco.Web/RenderFieldEncodingType.cs index 001fb2023d..f1df312784 100644 --- a/src/Umbraco.Web/RenderFieldEncodingType.cs +++ b/src/Umbraco.Web/RenderFieldEncodingType.cs @@ -1,13 +1,13 @@ -namespace Umbraco.Web +namespace Umbraco.Web { - /// - /// Used in the .Field method to render an Umbraco field to specify what encoding to use - /// - public enum RenderFieldEncodingType - { - Url, - Html, - Unchanged - } -} \ No newline at end of file + /// + /// Used in the .Field method to render an Umbraco field to specify what encoding to use + /// + public enum RenderFieldEncodingType + { + Url, + Html, + Unchanged + } +} diff --git a/src/Umbraco.Web/RouteCollectionExtensions.cs b/src/Umbraco.Web/RouteCollectionExtensions.cs index 586ecf6476..0a5a7d40a6 100644 --- a/src/Umbraco.Web/RouteCollectionExtensions.cs +++ b/src/Umbraco.Web/RouteCollectionExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Web.Mvc; @@ -9,7 +9,7 @@ using Umbraco.Web.Mvc; namespace Umbraco.Web { public static class RouteCollectionExtensions - { + { /// /// Maps an Umbraco route with an UmbracoVirtualNodeRouteHandler /// @@ -55,81 +55,81 @@ namespace Umbraco.Web return apiRoute; } - public static void IgnoreStandardExclusions(this RouteCollection routes) - { - // Ignore standard stuff... - using (routes.GetWriteLock()) - { - var exclusions = new Dictionary() - { - {"{resource}.axd/{*pathInfo}", null}, - {"{*allaxd}", new { allaxd = @".*\.axd(/.*)?" }}, - {"{*allashx}", new { allashx = @".*\.ashx(/.*)?" }}, - {"{*allaspx}", new { allaspx = @".*\.aspx(/.*)?" }}, - {"{*favicon}", new { favicon = @"(.*/)?favicon.ico(/.*)?" }}, - }; - //ensure they're not re-added - foreach (var e in exclusions.Where(e => !routes.OfType().Any(x => x.Url == e.Key))) - { - if (e.Value == null) - { - routes.IgnoreRoute(e.Key); - } - else - { - routes.IgnoreRoute(e.Key, e.Value); - } - } - } - } + public static void IgnoreStandardExclusions(this RouteCollection routes) + { + // Ignore standard stuff... + using (routes.GetWriteLock()) + { + var exclusions = new Dictionary() + { + {"{resource}.axd/{*pathInfo}", null}, + {"{*allaxd}", new { allaxd = @".*\.axd(/.*)?" }}, + {"{*allashx}", new { allashx = @".*\.ashx(/.*)?" }}, + {"{*allaspx}", new { allaspx = @".*\.aspx(/.*)?" }}, + {"{*favicon}", new { favicon = @"(.*/)?favicon.ico(/.*)?" }}, + }; + //ensure they're not re-added + foreach (var e in exclusions.Where(e => !routes.OfType().Any(x => x.Url == e.Key))) + { + if (e.Value == null) + { + routes.IgnoreRoute(e.Key); + } + else + { + routes.IgnoreRoute(e.Key, e.Value); + } + } + } + } - /// - /// Extension method to manually regsiter an area - /// - /// - /// - public static void RegisterArea(this RouteCollection routes) - where T : AreaRegistration, new() - { + /// + /// Extension method to manually regsiter an area + /// + /// + /// + public static void RegisterArea(this RouteCollection routes) + where T : AreaRegistration, new() + { - // instantiate the area registration - var area = new T(); + // instantiate the area registration + var area = new T(); - // create a context, which is just the name and routes collection - var context = new AreaRegistrationContext(area.AreaName, routes); + // create a context, which is just the name and routes collection + var context = new AreaRegistrationContext(area.AreaName, routes); - // register it! - area.RegisterArea(context); - } + // register it! + area.RegisterArea(context); + } - ///// - ///// Extension method to manually regsiter an area from the container - ///// - ///// - ///// - ///// - //public static void RegisterArea(this RouteCollection routes, Framework.DependencyManagement.IDependencyResolver container) - // where T : AreaRegistration - //{ + ///// + ///// Extension method to manually regsiter an area from the container + ///// + ///// + ///// + ///// + //public static void RegisterArea(this RouteCollection routes, Framework.DependencyManagement.IDependencyResolver container) + // where T : AreaRegistration + //{ - // var area = container.Resolve() as AreaRegistration; - // if (area == null) - // { - // throw new InvalidCastException("Could not resolve type " + typeof(T).FullName + " to AreaRegistration"); - // } + // var area = container.Resolve() as AreaRegistration; + // if (area == null) + // { + // throw new InvalidCastException("Could not resolve type " + typeof(T).FullName + " to AreaRegistration"); + // } - // // create a context, which is just the name and routes collection - // var context = new AreaRegistrationContext(area.AreaName, routes); + // // create a context, which is just the name and routes collection + // var context = new AreaRegistrationContext(area.AreaName, routes); - // // register it! - // area.RegisterArea(context); - //} + // // register it! + // area.RegisterArea(context); + //} - public static void RegisterArea(this RouteCollection routes, T area) where T : AreaRegistration - { - area.RegisterArea(new AreaRegistrationContext(area.AreaName, routes)); - } + public static void RegisterArea(this RouteCollection routes, T area) where T : AreaRegistration + { + area.RegisterArea(new AreaRegistrationContext(area.AreaName, routes)); + } - } -} \ No newline at end of file + } +} diff --git a/src/Umbraco.Web/Routing/ContentFinderByIdPath.cs b/src/Umbraco.Web/Routing/ContentFinderByIdPath.cs index 891b8d5c35..19893415fe 100644 --- a/src/Umbraco.Web/Routing/ContentFinderByIdPath.cs +++ b/src/Umbraco.Web/Routing/ContentFinderByIdPath.cs @@ -1,4 +1,4 @@ -using Umbraco.Core.Logging; +using Umbraco.Core.Logging; using Umbraco.Core; using Umbraco.Core.Configuration; using Umbraco.Core.Configuration.UmbracoSettings; @@ -6,34 +6,34 @@ using Umbraco.Core.Models.PublishedContent; namespace Umbraco.Web.Routing { - /// - /// Provides an implementation of that handles page identifiers. - /// - /// - /// Handles /1234 where 1234 is the identified of a document. - /// - public class ContentFinderByIdPath : IContentFinder + /// + /// Provides an implementation of that handles page identifiers. + /// + /// + /// Handles /1234 where 1234 is the identified of a document. + /// + public class ContentFinderByIdPath : IContentFinder { - private readonly ILogger _logger; - private readonly IWebRoutingSection _webRoutingSection; + private readonly ILogger _logger; + private readonly IWebRoutingSection _webRoutingSection; - public ContentFinderByIdPath(ILogger logger) + public ContentFinderByIdPath(ILogger logger) : this(UmbracoConfig.For.UmbracoSettings().WebRouting) - { - _logger = logger; - } + { + _logger = logger; + } - public ContentFinderByIdPath(IWebRoutingSection webRoutingSection) - { - _webRoutingSection = webRoutingSection; - } + public ContentFinderByIdPath(IWebRoutingSection webRoutingSection) + { + _webRoutingSection = webRoutingSection; + } - /// - /// Tries to find and assign an Umbraco document to a PublishedContentRequest. - /// - /// The PublishedContentRequest. - /// A value indicating whether an Umbraco document was found and assigned. - public bool TryFindContent(PublishedContentRequest frequest) + /// + /// Tries to find and assign an Umbraco document to a PublishedContentRequest. + /// + /// The PublishedContentRequest. + /// A value indicating whether an Umbraco document was found and assigned. + public bool TryFindContent(PublishedContentRequest frequest) { if (frequest.UmbracoContext != null && frequest.UmbracoContext.InPreviewMode == false @@ -41,25 +41,25 @@ namespace Umbraco.Web.Routing return false; IPublishedContent node = null; - var path = frequest.Uri.GetAbsolutePathDecoded(); + var path = frequest.Uri.GetAbsolutePathDecoded(); var nodeId = -1; - if (path != "/") // no id if "/" + if (path != "/") // no id if "/" { - var noSlashPath = path.Substring(1); + var noSlashPath = path.Substring(1); if (int.TryParse(noSlashPath, out nodeId) == false) nodeId = -1; if (nodeId > 0) { - _logger.Debug("Id={0}", () => nodeId); + _logger.Debug("Id={0}", () => nodeId); node = frequest.UmbracoContext.ContentCache.GetById(nodeId); if (node != null) { - frequest.PublishedContent = node; - _logger.Debug("Found node with id={0}", () => frequest.PublishedContent.Id); + frequest.PublishedContent = node; + _logger.Debug("Found node with id={0}", () => frequest.PublishedContent.Id); } else { @@ -69,9 +69,9 @@ namespace Umbraco.Web.Routing } if (nodeId == -1) - _logger.Debug("Not a node id"); + _logger.Debug("Not a node id"); return node != null; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Routing/ContentFinderByLegacy404.cs b/src/Umbraco.Web/Routing/ContentFinderByLegacy404.cs index a59fa2c6c7..f4a3bc5d42 100644 --- a/src/Umbraco.Web/Routing/ContentFinderByLegacy404.cs +++ b/src/Umbraco.Web/Routing/ContentFinderByLegacy404.cs @@ -8,84 +8,84 @@ using Umbraco.Core.Services; namespace Umbraco.Web.Routing { - /// - /// Provides an implementation of that runs the legacy 404 logic. - /// - public class ContentFinderByLegacy404 : IContentLastChanceFinder - { - + /// + /// Provides an implementation of that runs the legacy 404 logic. + /// + public class ContentFinderByLegacy404 : IContentLastChanceFinder + { + private readonly ILogger _logger; - private readonly IEntityService _entityService; - private readonly IContentSection _contentConfigSection; + private readonly IEntityService _entityService; + private readonly IContentSection _contentConfigSection; - public ContentFinderByLegacy404(ILogger logger, IEntityService entityService, IContentSection contentConfigSection) - { - _logger = logger; - _entityService = entityService; - _contentConfigSection = contentConfigSection; - } + public ContentFinderByLegacy404(ILogger logger, IEntityService entityService, IContentSection contentConfigSection) + { + _logger = logger; + _entityService = entityService; + _contentConfigSection = contentConfigSection; + } - /// - /// Tries to find and assign an Umbraco document to a PublishedContentRequest. - /// - /// The PublishedContentRequest. - /// A value indicating whether an Umbraco document was found and assigned. - public bool TryFindContent(PublishedContentRequest frequest) - { - _logger.Debug("Looking for a page to handle 404."); + /// + /// Tries to find and assign an Umbraco document to a PublishedContentRequest. + /// + /// The PublishedContentRequest. + /// A value indicating whether an Umbraco document was found and assigned. + public bool TryFindContent(PublishedContentRequest frequest) + { + _logger.Debug("Looking for a page to handle 404."); // try to find a culture as best as we can - var errorCulture = CultureInfo.CurrentUICulture; - if (frequest.HasDomain) - { - errorCulture = frequest.Domain.Culture; - } - else - { - var route = frequest.Uri.GetAbsolutePathDecoded(); - var pos = route.LastIndexOf('/'); - IPublishedContent node = null; - while (pos > 1) - { - route = route.Substring(0, pos); + var errorCulture = CultureInfo.CurrentUICulture; + if (frequest.HasDomain) + { + errorCulture = frequest.Domain.Culture; + } + else + { + var route = frequest.Uri.GetAbsolutePathDecoded(); + var pos = route.LastIndexOf('/'); + IPublishedContent node = null; + while (pos > 1) + { + route = route.Substring(0, pos); node = frequest.UmbracoContext.ContentCache.GetByRoute(route); - if (node != null) break; + if (node != null) break; pos = route.LastIndexOf('/'); } - if (node != null) - { - var d = DomainHelper.FindWildcardDomainInPath(frequest.UmbracoContext.Facade.DomainCache.GetAll(true), node.Path, null); - if (d != null) - errorCulture = d.Culture; - } + if (node != null) + { + var d = DomainHelper.FindWildcardDomainInPath(frequest.UmbracoContext.Facade.DomainCache.GetAll(true), node.Path, null); + if (d != null) + errorCulture = d.Culture; + } } - var error404 = NotFoundHandlerHelper.GetCurrentNotFoundPageId( + var error404 = NotFoundHandlerHelper.GetCurrentNotFoundPageId( _contentConfigSection.Error404Collection.ToArray(), _entityService, new PublishedContentQuery(frequest.UmbracoContext.ContentCache, frequest.UmbracoContext.MediaCache), errorCulture); - IPublishedContent content = null; + IPublishedContent content = null; if (error404.HasValue) - { + { _logger.Debug("Got id={0}.", () => error404.Value); content = frequest.UmbracoContext.ContentCache.GetById(error404.Value); - _logger.Debug(content == null - ? "Could not find content with that id." - : "Found corresponding content."); - } - else - { - _logger.Debug("Got nothing."); - } + _logger.Debug(content == null + ? "Could not find content with that id." + : "Found corresponding content."); + } + else + { + _logger.Debug("Got nothing."); + } - frequest.PublishedContent = content; + frequest.PublishedContent = content; frequest.Is404 = true; - return content != null; - } - } + return content != null; + } + } } diff --git a/src/Umbraco.Web/Routing/ContentFinderByNiceUrl.cs b/src/Umbraco.Web/Routing/ContentFinderByNiceUrl.cs index a1edff6f2f..45aad8ed5d 100644 --- a/src/Umbraco.Web/Routing/ContentFinderByNiceUrl.cs +++ b/src/Umbraco.Web/Routing/ContentFinderByNiceUrl.cs @@ -1,52 +1,52 @@ -using Umbraco.Core.Logging; +using Umbraco.Core.Logging; using Umbraco.Core; using Umbraco.Core.Models.PublishedContent; namespace Umbraco.Web.Routing { - /// - /// Provides an implementation of that handles page nice urls. - /// - /// - /// Handles /foo/bar where /foo/bar is the nice url of a document. - /// + /// + /// Provides an implementation of that handles page nice urls. + /// + /// + /// Handles /foo/bar where /foo/bar is the nice url of a document. + /// public class ContentFinderByNiceUrl : IContentFinder { - protected ILogger Logger { get; } + protected ILogger Logger { get; } - public ContentFinderByNiceUrl(ILogger logger) - { - Logger = logger; - } - - /// - /// Tries to find and assign an Umbraco document to a PublishedContentRequest. - /// - /// The PublishedContentRequest. - /// A value indicating whether an Umbraco document was found and assigned. - public virtual bool TryFindContent(PublishedContentRequest frequest) + public ContentFinderByNiceUrl(ILogger logger) { - string route; - if (frequest.HasDomain) - route = frequest.Domain.ContentId + DomainHelper.PathRelativeToDomain(frequest.Domain.Uri, frequest.Uri.GetAbsolutePathDecoded()); - else - route = frequest.Uri.GetAbsolutePathDecoded(); + Logger = logger; + } - var node = FindContent(frequest, route); + /// + /// Tries to find and assign an Umbraco document to a PublishedContentRequest. + /// + /// The PublishedContentRequest. + /// A value indicating whether an Umbraco document was found and assigned. + public virtual bool TryFindContent(PublishedContentRequest frequest) + { + string route; + if (frequest.HasDomain) + route = frequest.Domain.ContentId + DomainHelper.PathRelativeToDomain(frequest.Domain.Uri, frequest.Uri.GetAbsolutePathDecoded()); + else + route = frequest.Uri.GetAbsolutePathDecoded(); + + var node = FindContent(frequest, route); return node != null; } - /// - /// Tries to find an Umbraco document for a PublishedContentRequest and a route. - /// - /// The document request. - /// The route. - /// The document node, or null. + /// + /// Tries to find an Umbraco document for a PublishedContentRequest and a route. + /// + /// The document request. + /// The route. + /// The document node, or null. protected IPublishedContent FindContent(PublishedContentRequest docreq, string route) { - Logger.Debug("Test route \"{0}\"", () => route); + Logger.Debug("Test route \"{0}\"", () => route); - var node = docreq.UmbracoContext.ContentCache.GetByRoute(route); + var node = docreq.UmbracoContext.ContentCache.GetByRoute(route); if (node != null) { docreq.PublishedContent = node; @@ -57,7 +57,7 @@ namespace Umbraco.Web.Routing Logger.Debug("No match."); } - return node; + return node; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Routing/ContentFinderByNiceUrlAndTemplate.cs b/src/Umbraco.Web/Routing/ContentFinderByNiceUrlAndTemplate.cs index 69fd949124..ab4a796b9b 100644 --- a/src/Umbraco.Web/Routing/ContentFinderByNiceUrlAndTemplate.cs +++ b/src/Umbraco.Web/Routing/ContentFinderByNiceUrlAndTemplate.cs @@ -1,4 +1,4 @@ -using Umbraco.Core.Logging; +using Umbraco.Core.Logging; using Umbraco.Core.Models; using Umbraco.Core; using Umbraco.Core.Configuration; @@ -64,4 +64,4 @@ namespace Umbraco.Web.Routing return node != null; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Routing/ContentFinderByPageIdQuery.cs b/src/Umbraco.Web/Routing/ContentFinderByPageIdQuery.cs index 1d31a13d88..62edf358b3 100644 --- a/src/Umbraco.Web/Routing/ContentFinderByPageIdQuery.cs +++ b/src/Umbraco.Web/Routing/ContentFinderByPageIdQuery.cs @@ -1,28 +1,28 @@ -namespace Umbraco.Web.Routing +namespace Umbraco.Web.Routing { - /// - /// This looks up a document by checking for the umbPageId of a request/query string - /// - /// - /// This is used by library.RenderTemplate and also some of the macro rendering functionality like in - /// macroResultWrapper.aspx - /// + /// + /// This looks up a document by checking for the umbPageId of a request/query string + /// + /// + /// This is used by library.RenderTemplate and also some of the macro rendering functionality like in + /// macroResultWrapper.aspx + /// public class ContentFinderByPageIdQuery : IContentFinder - { - public bool TryFindContent(PublishedContentRequest frequest) - { - int pageId; - if (int.TryParse(frequest.UmbracoContext.HttpContext.Request["umbPageID"], out pageId)) - { - var doc = frequest.UmbracoContext.ContentCache.GetById(pageId); + { + public bool TryFindContent(PublishedContentRequest frequest) + { + int pageId; + if (int.TryParse(frequest.UmbracoContext.HttpContext.Request["umbPageID"], out pageId)) + { + var doc = frequest.UmbracoContext.ContentCache.GetById(pageId); - if (doc != null) - { - frequest.PublishedContent = doc; - return true; - } - } - return false; - } - } -} \ No newline at end of file + if (doc != null) + { + frequest.PublishedContent = doc; + return true; + } + } + return false; + } + } +} diff --git a/src/Umbraco.Web/Routing/ContentFinderByProfile.cs b/src/Umbraco.Web/Routing/ContentFinderByProfile.cs index 5e64751db2..38eaef8fcf 100644 --- a/src/Umbraco.Web/Routing/ContentFinderByProfile.cs +++ b/src/Umbraco.Web/Routing/ContentFinderByProfile.cs @@ -1,4 +1,4 @@ -using Umbraco.Core.Configuration; +using Umbraco.Core.Configuration; using Umbraco.Core.Logging; using Umbraco.Core; using Umbraco.Core.Models.PublishedContent; @@ -41,7 +41,7 @@ namespace Umbraco.Web.Routing isProfile = true; Logger.Debug("Path \"{0}\" is the profile path", () => path); - var route = frequest.HasDomain ? (frequest.Domain.ContentId + path) : path; + var route = frequest.HasDomain ? (frequest.Domain.ContentId + path) : path; node = FindContent(frequest, route); if (node != null) @@ -64,4 +64,4 @@ namespace Umbraco.Web.Routing return node != null; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Routing/ContentFinderByRedirectUrl.cs b/src/Umbraco.Web/Routing/ContentFinderByRedirectUrl.cs index b6c15d8f5d..7612c2c2ed 100644 --- a/src/Umbraco.Web/Routing/ContentFinderByRedirectUrl.cs +++ b/src/Umbraco.Web/Routing/ContentFinderByRedirectUrl.cs @@ -40,7 +40,7 @@ namespace Umbraco.Web.Routing // From: http://stackoverflow.com/a/22468386/5018 // See http://issues.umbraco.org/issue/U4-8361#comment=67-30532 - // Setting automatic 301 redirects to not be cached because browsers cache these very aggressively which then leads + // Setting automatic 301 redirects to not be cached because browsers cache these very aggressively which then leads // to problems if you rename a page back to it's original name or create a new page with the original name frequest.Cacheability = HttpCacheability.NoCache; frequest.CacheExtensions = new List { "no-store, must-revalidate" }; diff --git a/src/Umbraco.Web/Routing/ContentFinderByUrlAlias.cs b/src/Umbraco.Web/Routing/ContentFinderByUrlAlias.cs index 30d05fa1a9..bff17afb64 100644 --- a/src/Umbraco.Web/Routing/ContentFinderByUrlAlias.cs +++ b/src/Umbraco.Web/Routing/ContentFinderByUrlAlias.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Text; using System.Linq; using Umbraco.Core.Logging; @@ -9,46 +9,46 @@ using Umbraco.Web.PublishedCache; namespace Umbraco.Web.Routing { - /// - /// Provides an implementation of that handles page aliases. - /// - /// - /// Handles /just/about/anything where /just/about/anything is contained in the umbracoUrlAlias property of a document. - /// The alias is the full path to the document. There can be more than one alias, separated by commas. - /// + /// + /// Provides an implementation of that handles page aliases. + /// + /// + /// Handles /just/about/anything where /just/about/anything is contained in the umbracoUrlAlias property of a document. + /// The alias is the full path to the document. There can be more than one alias, separated by commas. + /// public class ContentFinderByUrlAlias : IContentFinder { protected ILogger Logger { get; } public ContentFinderByUrlAlias(ILogger logger) - { - Logger = logger; - } + { + Logger = logger; + } - /// - /// Tries to find and assign an Umbraco document to a PublishedContentRequest. - /// - /// The PublishedContentRequest. - /// A value indicating whether an Umbraco document was found and assigned. - public bool TryFindContent(PublishedContentRequest frequest) - { - IPublishedContent node = null; + /// + /// Tries to find and assign an Umbraco document to a PublishedContentRequest. + /// + /// The PublishedContentRequest. + /// A value indicating whether an Umbraco document was found and assigned. + public bool TryFindContent(PublishedContentRequest frequest) + { + IPublishedContent node = null; - if (frequest.Uri.AbsolutePath != "/") // no alias if "/" - { - node = FindContentByAlias(frequest.UmbracoContext.ContentCache, - frequest.HasDomain ? frequest.Domain.ContentId : 0, - frequest.Uri.GetAbsolutePathDecoded()); + if (frequest.Uri.AbsolutePath != "/") // no alias if "/" + { + node = FindContentByAlias(frequest.UmbracoContext.ContentCache, + frequest.HasDomain ? frequest.Domain.ContentId : 0, + frequest.Uri.GetAbsolutePathDecoded()); - if (node != null) - { - frequest.PublishedContent = node; - Logger.Debug("Path \"{0}\" is an alias for id={1}", () => frequest.Uri.AbsolutePath, () => frequest.PublishedContent.Id); - } - } + if (node != null) + { + frequest.PublishedContent = node; + Logger.Debug("Path \"{0}\" is an alias for id={1}", () => frequest.Uri.AbsolutePath, () => frequest.PublishedContent.Id); + } + } - return node != null; - } + return node != null; + } private static IPublishedContent FindContentByAlias(IPublishedContentCache cache, int rootNodeId, string alias) { @@ -84,14 +84,14 @@ namespace Umbraco.Web.Routing static class XPathStrings { - public static string Root => "/root"; + public static string Root => "/root"; public const string DescendantDocumentById = "//* [@isDoc and @id={0}]"; public const string DescendantDocumentByAlias = "//* [@isDoc and (" + "contains(concat(',',translate(umbracoUrlAlias, ' ', ''),','),',{0},')" + " or contains(concat(',',translate(umbracoUrlAlias, ' ', ''),','),',/{0},')" + ")]"; - } + } - #endregion + #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Routing/CustomRouteUrlProvider.cs b/src/Umbraco.Web/Routing/CustomRouteUrlProvider.cs index 989cabe388..e8d83430f8 100644 --- a/src/Umbraco.Web/Routing/CustomRouteUrlProvider.cs +++ b/src/Umbraco.Web/Routing/CustomRouteUrlProvider.cs @@ -5,7 +5,7 @@ namespace Umbraco.Web.Routing { /// /// This url provider is used purely to deal with umbraco custom routes that utilize UmbracoVirtualNodeRouteHandler and will return - /// the URL returned from the current PublishedContentRequest.PublishedContent (virtual node) if the request is in fact a virtual route and + /// the URL returned from the current PublishedContentRequest.PublishedContent (virtual node) if the request is in fact a virtual route and /// the id that is being requested matches the id of the current PublishedContentRequest.PublishedContent. /// internal class CustomRouteUrlProvider : IUrlProvider @@ -30,14 +30,14 @@ namespace Umbraco.Web.Routing if (umbracoContext.HttpContext.Request.RequestContext.RouteData.DataTokens == null) return null; if (umbracoContext.HttpContext.Request.RequestContext.RouteData.DataTokens.ContainsKey(Umbraco.Core.Constants.Web.CustomRouteDataToken) == false) return null; //ok so it's a custom route with published content assigned, check if the id being requested for is the same id as the assigned published content - return id == umbracoContext.PublishedContentRequest.PublishedContent.Id - ? umbracoContext.PublishedContentRequest.PublishedContent.Url + return id == umbracoContext.PublishedContentRequest.PublishedContent.Id + ? umbracoContext.PublishedContentRequest.PublishedContent.Url : null; } /// - /// This always returns null because this url provider is used purely to deal with Umbraco custom routes with - /// UmbracoVirtualNodeRouteHandler, we really only care about the normal URL so that RedirectToCurrentUmbracoPage() works + /// This always returns null because this url provider is used purely to deal with Umbraco custom routes with + /// UmbracoVirtualNodeRouteHandler, we really only care about the normal URL so that RedirectToCurrentUmbracoPage() works /// with SurfaceControllers /// /// @@ -49,4 +49,4 @@ namespace Umbraco.Web.Routing return null; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Routing/DomainAndUri.cs b/src/Umbraco.Web/Routing/DomainAndUri.cs index 33d3ea4877..00157a63e3 100644 --- a/src/Umbraco.Web/Routing/DomainAndUri.cs +++ b/src/Umbraco.Web/Routing/DomainAndUri.cs @@ -31,7 +31,7 @@ namespace Umbraco.Web.Routing } catch (UriFormatException) { - throw new ArgumentException($"Failed to parse invalid domain: node id={domain.ContentId}, hostname=\"{Name.ToCSharpString()}\"." + throw new ArgumentException($"Failed to parse invalid domain: node id={domain.ContentId}, hostname=\"{Name.ToCSharpString()}\"." + " Hostname should be a valid uri.", nameof(domain)); } } diff --git a/src/Umbraco.Web/Routing/DomainHelper.cs b/src/Umbraco.Web/Routing/DomainHelper.cs index 517f01d8d0..38ccb02063 100644 --- a/src/Umbraco.Web/Routing/DomainHelper.cs +++ b/src/Umbraco.Web/Routing/DomainHelper.cs @@ -10,8 +10,8 @@ namespace Umbraco.Web.Routing /// /// Provides utilities to handle domains. /// - public class DomainHelper - { + public class DomainHelper + { private readonly IDomainCache _domainCache; public DomainHelper(IDomainCache domainCache) @@ -112,7 +112,7 @@ namespace Umbraco.Web.Routing { // sanitize the list to have proper uris for comparison (scheme, path end with /) // we need to end with / because example.com/foo cannot match example.com/foobar - // we need to order so example.com/foo matches before example.com/ + // we need to order so example.com/foo matches before example.com/ var domainsAndUris = domains .Where(d => d.IsWildcard == false) //.Select(SanitizeForBackwardCompatibility) diff --git a/src/Umbraco.Web/Routing/EnsureRoutableOutcome.cs b/src/Umbraco.Web/Routing/EnsureRoutableOutcome.cs index eec30b54f6..375d81fe4c 100644 --- a/src/Umbraco.Web/Routing/EnsureRoutableOutcome.cs +++ b/src/Umbraco.Web/Routing/EnsureRoutableOutcome.cs @@ -1,4 +1,4 @@ -namespace Umbraco.Web.Routing +namespace Umbraco.Web.Routing { /// /// Represents the outcome of trying to route an incoming request. @@ -36,4 +36,4 @@ namespace Umbraco.Web.Routing /// NoContent = 12 } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Routing/FacadeRouter.cs b/src/Umbraco.Web/Routing/FacadeRouter.cs index 014bdcd64d..0cc0601cf4 100644 --- a/src/Umbraco.Web/Routing/FacadeRouter.cs +++ b/src/Umbraco.Web/Routing/FacadeRouter.cs @@ -22,8 +22,8 @@ namespace Umbraco.Web.Routing // there is only one instance of this class and it has all // the dependencies injected - internal class FacadeRouter - { + internal class FacadeRouter + { // fixme - coupling PublishedContentRequest & PublishedContentRequestEngine // is bad // could be entirely stateless! and unique! or merged into the request entirely! @@ -31,12 +31,12 @@ namespace Umbraco.Web.Routing // fixme - maybe we should be initialized with UmbracoContext accessor instead? - private readonly IWebRoutingSection _webRoutingSection; + private readonly IWebRoutingSection _webRoutingSection; private readonly ContentFinderCollection _contentFinders; - private readonly IContentLastChanceFinder _contentLastChanceFinder; + private readonly IContentLastChanceFinder _contentLastChanceFinder; private readonly ServiceContext _services; private readonly ProfilingLogger _profilingLogger; - private readonly ILogger _logger; + private readonly ILogger _logger; /// /// Initializes a new instance of the class. @@ -48,53 +48,53 @@ namespace Umbraco.Web.Routing ServiceContext services, ProfilingLogger proflog, Func> getRolesForLogin = null) - { - if (webRoutingSection == null) throw new ArgumentNullException(nameof(webRoutingSection)); // fixme usage? + { + if (webRoutingSection == null) throw new ArgumentNullException(nameof(webRoutingSection)); // fixme usage? - _webRoutingSection = webRoutingSection; + _webRoutingSection = webRoutingSection; _contentFinders = contentFinders ?? throw new ArgumentNullException(nameof(contentFinders)); _contentLastChanceFinder = contentLastChanceFinder ?? throw new ArgumentNullException(nameof(contentLastChanceFinder)); _services = services ?? throw new ArgumentNullException(nameof(services)); _profilingLogger = proflog ?? throw new ArgumentNullException(nameof(proflog)); - _logger = proflog.Logger; + _logger = proflog.Logger; - GetRolesForLogin = getRolesForLogin ?? (s => Roles.Provider.GetRolesForUser(s)); - } + GetRolesForLogin = getRolesForLogin ?? (s => Roles.Provider.GetRolesForUser(s)); + } - private Func> GetRolesForLogin { get; } + private Func> GetRolesForLogin { get; } - public PublishedContentRequest CreateRequest(UmbracoContext umbracoContext, Uri uri = null) - { + public PublishedContentRequest CreateRequest(UmbracoContext umbracoContext, Uri uri = null) + { return new PublishedContentRequest(this, umbracoContext, uri ?? umbracoContext.CleanedUmbracoUrl); - } + } #region Request - /// - /// Tries to route the request. - /// - internal bool TryRouteRequest(PublishedContentRequest request) - { - // disabled - is it going to change the routing? - //_pcr.OnPreparing(); + /// + /// Tries to route the request. + /// + internal bool TryRouteRequest(PublishedContentRequest request) + { + // disabled - is it going to change the routing? + //_pcr.OnPreparing(); - FindDomain(request); - if (request.IsRedirect) return false; - if (request.HasPublishedContent) return true; - FindPublishedContent(request); - if (request.IsRedirect) return false; + FindDomain(request); + if (request.IsRedirect) return false; + if (request.HasPublishedContent) return true; + FindPublishedContent(request); + if (request.IsRedirect) return false; - // don't handle anything - we just want to ensure that we find the content - //HandlePublishedContent(); - //FindTemplate(); - //FollowExternalRedirect(); - //HandleWildcardDomains(); + // don't handle anything - we just want to ensure that we find the content + //HandlePublishedContent(); + //FindTemplate(); + //FollowExternalRedirect(); + //HandleWildcardDomains(); - // disabled - we just want to ensure that we find the content - //_pcr.OnPrepared(); + // disabled - we just want to ensure that we find the content + //_pcr.OnPrepared(); - return request.HasPublishedContent; - } + return request.HasPublishedContent; + } /// /// Prepares the request. @@ -103,7 +103,7 @@ namespace Umbraco.Web.Routing /// Returns false if the request was not successfully prepared /// public bool PrepareRequest(PublishedContentRequest request) - { + { // note - at that point the original legacy module did something do handle IIS custom 404 errors // ie pages looking like /anything.aspx?404;/path/to/document - I guess the reason was to support // "directory urls" without having to do wildcard mapping to ASP.NET on old IIS. This is a pain @@ -118,27 +118,27 @@ namespace Umbraco.Web.Routing // request.OnPreparing(); - //find domain - FindDomain(request); + //find domain + FindDomain(request); - // if request has been flagged to redirect then return - // whoever called us is in charge of actually redirecting - if (request.IsRedirect) - { - return false; - } + // if request has been flagged to redirect then return + // whoever called us is in charge of actually redirecting + if (request.IsRedirect) + { + return false; + } - // set the culture on the thread - once, so it's set when running document lookups - Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture = request.Culture; + // set the culture on the thread - once, so it's set when running document lookups + Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture = request.Culture; //find the published content if it's not assigned. This could be manually assigned with a custom route handler, or // with something like EnsurePublishedContentRequestAttribute or UmbracoVirtualNodeRouteHandler. Those in turn call this method // to setup the rest of the pipeline but we don't want to run the finders since there's one assigned. - if (request.PublishedContent == null) - { + if (request.PublishedContent == null) + { // find the document & template FindPublishedContentAndTemplate(request); - } + } // handle wildcard domains HandleWildcardDomains(request); @@ -157,8 +157,8 @@ namespace Umbraco.Web.Routing // to find out the appropriate template //complete the PCR and assign the remaining values - return ConfigureRequest(request); - } + return ConfigureRequest(request); + } /// /// Called by PrepareRequest once everything has been discovered, resolved and assigned to the PCR. This method @@ -211,73 +211,73 @@ namespace Umbraco.Web.Routing return true; } - /// - /// Updates the request when there is no template to render the content. - /// - /// This is called from Mvc when there's a document to render but no template. - public void UpdateRequestOnMissingTemplate(PublishedContentRequest request) - { - // clear content - var content = request.PublishedContent; + /// + /// Updates the request when there is no template to render the content. + /// + /// This is called from Mvc when there's a document to render but no template. + public void UpdateRequestOnMissingTemplate(PublishedContentRequest request) + { + // clear content + var content = request.PublishedContent; request.PublishedContent = null; - HandlePublishedContent(request); // will go 404 - FindTemplate(request); + HandlePublishedContent(request); // will go 404 + FindTemplate(request); - // if request has been flagged to redirect then return - // whoever called us is in charge of redirecting - if (request.IsRedirect) - return; + // if request has been flagged to redirect then return + // whoever called us is in charge of redirecting + if (request.IsRedirect) + return; - if (request.HasPublishedContent == false) - { + if (request.HasPublishedContent == false) + { // means the engine could not find a proper document to handle 404 // restore the saved content so we know it exists request.PublishedContent = content; - return; - } + return; + } - if (request.HasTemplate == false) - { - // means we may have a document, but we have no template - // at that point there isn't much we can do and there is no point returning - // to Mvc since Mvc can't do much either - return; - } + if (request.HasTemplate == false) + { + // means we may have a document, but we have no template + // at that point there isn't much we can do and there is no point returning + // to Mvc since Mvc can't do much either + return; + } // see note in PrepareRequest() - // assign the legacy page back to the docrequest - // handlers like default.aspx will want it and most macros currently need it - request.UmbracoPage = new page(request); + // assign the legacy page back to the docrequest + // handlers like default.aspx will want it and most macros currently need it + request.UmbracoPage = new page(request); // these two are used by many legacy objects request.UmbracoContext.HttpContext.Items["pageID"] = request.PublishedContent.Id; request.UmbracoContext.HttpContext.Items["pageElements"] = request.UmbracoPage.Elements; - } + } - #endregion + #endregion - #region Domain + #region Domain - /// - /// Finds the site root (if any) matching the http request, and updates the PublishedContentRequest accordingly. - /// - /// A value indicating whether a domain was found. - internal bool FindDomain(PublishedContentRequest request) - { - const string tracePrefix = "FindDomain: "; + /// + /// Finds the site root (if any) matching the http request, and updates the PublishedContentRequest accordingly. + /// + /// A value indicating whether a domain was found. + internal bool FindDomain(PublishedContentRequest request) + { + const string tracePrefix = "FindDomain: "; - // note - we are not handling schemes nor ports here. + // note - we are not handling schemes nor ports here. - _logger.Debug("{0}Uri=\"{1}\"", () => tracePrefix, () => request.Uri); + _logger.Debug("{0}Uri=\"{1}\"", () => tracePrefix, () => request.Uri); - // try to find a domain matching the current request + // try to find a domain matching the current request var domainAndUri = DomainHelper.DomainForUri(request.UmbracoContext.Facade.DomainCache.GetAll(false), request.Uri); - // handle domain - always has a contentId and a culture - if (domainAndUri != null) - { + // handle domain - always has a contentId and a culture + if (domainAndUri != null) + { // matching an existing domain _logger.Debug("{0}Matches domain=\"{1}\", rootId={2}, culture=\"{3}\"", () => tracePrefix, @@ -296,50 +296,50 @@ namespace Umbraco.Web.Routing // } } else - { - // not matching any existing domain - _logger.Debug("{0}Matches no domain", () => tracePrefix); + { + // not matching any existing domain + _logger.Debug("{0}Matches no domain", () => tracePrefix); var defaultLanguage = _services.LocalizationService.GetAllLanguages().FirstOrDefault(); request.Culture = defaultLanguage == null ? CultureInfo.CurrentUICulture : new CultureInfo(defaultLanguage.IsoCode); - } + } - _logger.Debug("{0}Culture=\"{1}\"", () => tracePrefix, () => request.Culture.Name); + _logger.Debug("{0}Culture=\"{1}\"", () => tracePrefix, () => request.Culture.Name); - return request.Domain != null; - } + return request.Domain != null; + } - /// - /// Looks for wildcard domains in the path and updates Culture accordingly. - /// - internal void HandleWildcardDomains(PublishedContentRequest request) - { - const string tracePrefix = "HandleWildcardDomains: "; + /// + /// Looks for wildcard domains in the path and updates Culture accordingly. + /// + internal void HandleWildcardDomains(PublishedContentRequest request) + { + const string tracePrefix = "HandleWildcardDomains: "; - if (request.HasPublishedContent == false) - return; + if (request.HasPublishedContent == false) + return; - var nodePath = request.PublishedContent.Path; - _logger.Debug("{0}Path=\"{1}\"", () => tracePrefix, () => nodePath); + var nodePath = request.PublishedContent.Path; + _logger.Debug("{0}Path=\"{1}\"", () => tracePrefix, () => nodePath); var rootNodeId = request.HasDomain ? request.Domain.ContentId : (int?)null; var domain = DomainHelper.FindWildcardDomainInPath(request.UmbracoContext.Facade.DomainCache.GetAll(true), nodePath, rootNodeId); // always has a contentId and a culture - if (domain != null) - { + if (domain != null) + { request.Culture = domain.Culture; _logger.Debug("{0}Got domain on node {1}, set culture to \"{2}\".", () => tracePrefix, () => domain.ContentId, () => request.Culture.Name); } - else - { - _logger.Debug("{0}No match.", () => tracePrefix); - } - } + else + { + _logger.Debug("{0}No match.", () => tracePrefix); + } + } - #endregion + #endregion - #region Rendering engine + #region Rendering engine /// /// Finds the rendering engine to use to render a template specified by its alias. @@ -386,264 +386,264 @@ namespace Umbraco.Web.Routing return directory.GetFiles().Any(f => extensions.Any(e => f.Name.InvariantEquals(alias + e))); } - #endregion + #endregion - #region Document and template + #region Document and template /// /// Gets a template. /// /// The template alias /// The template. - public ITemplate GetTemplate(string alias) - { - return _services.FileService.GetTemplate(alias); - } + public ITemplate GetTemplate(string alias) + { + return _services.FileService.GetTemplate(alias); + } - /// - /// Finds the Umbraco document (if any) matching the request, and updates the PublishedContentRequest accordingly. - /// - /// A value indicating whether a document and template were found. - private void FindPublishedContentAndTemplate(PublishedContentRequest request) - { - const string tracePrefix = "FindPublishedContentAndTemplate: "; - _logger.Debug("{0}Path=\"{1}\"", () => tracePrefix, () => request.Uri.AbsolutePath); + /// + /// Finds the Umbraco document (if any) matching the request, and updates the PublishedContentRequest accordingly. + /// + /// A value indicating whether a document and template were found. + private void FindPublishedContentAndTemplate(PublishedContentRequest request) + { + const string tracePrefix = "FindPublishedContentAndTemplate: "; + _logger.Debug("{0}Path=\"{1}\"", () => tracePrefix, () => request.Uri.AbsolutePath); - // run the document finders - FindPublishedContent(request); + // run the document finders + FindPublishedContent(request); // if request has been flagged to redirect then return // whoever called us is in charge of actually redirecting // -- do not process anything any further -- if (request.IsRedirect) - return; + return; - // not handling umbracoRedirect here but after LookupDocument2 - // so internal redirect, 404, etc has precedence over redirect + // not handling umbracoRedirect here but after LookupDocument2 + // so internal redirect, 404, etc has precedence over redirect - // handle not-found, redirects, access... - HandlePublishedContent(request); + // handle not-found, redirects, access... + HandlePublishedContent(request); - // find a template - FindTemplate(request); + // find a template + FindTemplate(request); - // handle umbracoRedirect - FollowExternalRedirect(request); - } + // handle umbracoRedirect + FollowExternalRedirect(request); + } - /// - /// Tries to find the document matching the request, by running the IPublishedContentFinder instances. - /// + /// + /// Tries to find the document matching the request, by running the IPublishedContentFinder instances. + /// /// There is no finder collection. - internal void FindPublishedContent(PublishedContentRequest request) - { - const string tracePrefix = "FindPublishedContent: "; + internal void FindPublishedContent(PublishedContentRequest request) + { + const string tracePrefix = "FindPublishedContent: "; - // look for the document - // the first successful finder, if any, will set this.PublishedContent, and may also set this.Template - // some finders may implement caching + // look for the document + // the first successful finder, if any, will set this.PublishedContent, and may also set this.Template + // some finders may implement caching using (_profilingLogger.DebugDuration( $"{tracePrefix}Begin finders", $"{tracePrefix}End finders, {(request.HasPublishedContent ? "a document was found" : "no document was found")}")) - { + { //iterate but return on first one that finds it - var found = _contentFinders.Any(finder => - { + var found = _contentFinders.Any(finder => + { _logger.Debug("Finder " + finder.GetType().FullName); - return finder.TryFindContent(request); - }); - } + return finder.TryFindContent(request); + }); + } // indicate that the published content (if any) we have at the moment is the // one that was found by the standard finders before anything else took place. request.SetIsInitialPublishedContent(); - } + } - /// - /// Handles the published content (if any). - /// - /// - /// Handles "not found", internal redirects, access validation... - /// things that must be handled in one place because they can create loops - /// - private void HandlePublishedContent(PublishedContentRequest request) - { - const string tracePrefix = "HandlePublishedContent: "; + /// + /// Handles the published content (if any). + /// + /// + /// Handles "not found", internal redirects, access validation... + /// things that must be handled in one place because they can create loops + /// + private void HandlePublishedContent(PublishedContentRequest request) + { + const string tracePrefix = "HandlePublishedContent: "; - // because these might loop, we have to have some sort of infinite loop detection - int i = 0, j = 0; - const int maxLoop = 8; - do - { - _logger.Debug("{0}{1}", () => tracePrefix, () => (i == 0 ? "Begin" : "Loop")); + // because these might loop, we have to have some sort of infinite loop detection + int i = 0, j = 0; + const int maxLoop = 8; + do + { + _logger.Debug("{0}{1}", () => tracePrefix, () => (i == 0 ? "Begin" : "Loop")); - // handle not found - if (request.HasPublishedContent == false) - { + // handle not found + if (request.HasPublishedContent == false) + { request.Is404 = true; - _logger.Debug("{0}No document, try last chance lookup", () => tracePrefix); + _logger.Debug("{0}No document, try last chance lookup", () => tracePrefix); - // if it fails then give up, there isn't much more that we can do - if (_contentLastChanceFinder.TryFindContent(request) == false) - { - _logger.Debug("{0}Failed to find a document, give up", () => tracePrefix); - break; - } + // if it fails then give up, there isn't much more that we can do + if (_contentLastChanceFinder.TryFindContent(request) == false) + { + _logger.Debug("{0}Failed to find a document, give up", () => tracePrefix); + break; + } - _logger.Debug("{0}Found a document", () => tracePrefix); - } + _logger.Debug("{0}Found a document", () => tracePrefix); + } - // follow internal redirects as long as it's not running out of control ie infinite loop of some sort - j = 0; - while (FollowInternalRedirects(request) && j++ < maxLoop) - { } - if (j == maxLoop) // we're running out of control - break; + // follow internal redirects as long as it's not running out of control ie infinite loop of some sort + j = 0; + while (FollowInternalRedirects(request) && j++ < maxLoop) + { } + if (j == maxLoop) // we're running out of control + break; - // ensure access - if (request.HasPublishedContent) - EnsurePublishedContentAccess(request); + // ensure access + if (request.HasPublishedContent) + EnsurePublishedContentAccess(request); - // loop while we don't have page, ie the redirect or access - // got us to nowhere and now we need to run the notFoundLookup again - // as long as it's not running out of control ie infinite loop of some sort + // loop while we don't have page, ie the redirect or access + // got us to nowhere and now we need to run the notFoundLookup again + // as long as it's not running out of control ie infinite loop of some sort - } while (request.HasPublishedContent == false && i++ < maxLoop); + } while (request.HasPublishedContent == false && i++ < maxLoop); - if (i == maxLoop || j == maxLoop) - { - _logger.Debug("{0}Looks like we're running into an infinite loop, abort", () => tracePrefix); + if (i == maxLoop || j == maxLoop) + { + _logger.Debug("{0}Looks like we're running into an infinite loop, abort", () => tracePrefix); request.PublishedContent = null; - } + } - _logger.Debug("{0}End", () => tracePrefix); - } + _logger.Debug("{0}End", () => tracePrefix); + } - /// - /// Follows internal redirections through the umbracoInternalRedirectId document property. - /// - /// A value indicating whether redirection took place and led to a new published document. - /// - /// Redirecting to a different site root and/or culture will not pick the new site root nor the new culture. - /// As per legacy, if the redirect does not work, we just ignore it. - /// - private bool FollowInternalRedirects(PublishedContentRequest request) - { - const string tracePrefix = "FollowInternalRedirects: "; + /// + /// Follows internal redirections through the umbracoInternalRedirectId document property. + /// + /// A value indicating whether redirection took place and led to a new published document. + /// + /// Redirecting to a different site root and/or culture will not pick the new site root nor the new culture. + /// As per legacy, if the redirect does not work, we just ignore it. + /// + private bool FollowInternalRedirects(PublishedContentRequest request) + { + const string tracePrefix = "FollowInternalRedirects: "; - if (request.PublishedContent == null) - throw new InvalidOperationException("There is no PublishedContent."); + if (request.PublishedContent == null) + throw new InvalidOperationException("There is no PublishedContent."); - // don't try to find a redirect if the property doesn't exist - if (request.PublishedContent.HasProperty(Constants.Conventions.Content.InternalRedirectId) == false) - return false; + // don't try to find a redirect if the property doesn't exist + if (request.PublishedContent.HasProperty(Constants.Conventions.Content.InternalRedirectId) == false) + return false; var redirect = false; - var valid = false; - IPublishedContent internalRedirectNode = null; + var valid = false; + IPublishedContent internalRedirectNode = null; var internalRedirectId = request.PublishedContent.Value(Constants.Conventions.Content.InternalRedirectId, -1); - if (internalRedirectId > 0) - { - // try and get the redirect node from a legacy integer ID - valid = true; - internalRedirectNode = request.UmbracoContext.ContentCache.GetById(internalRedirectId); + if (internalRedirectId > 0) + { + // try and get the redirect node from a legacy integer ID + valid = true; + internalRedirectNode = request.UmbracoContext.ContentCache.GetById(internalRedirectId); + } + else + { + var udiInternalRedirectId = request.PublishedContent.Value(Constants.Conventions.Content.InternalRedirectId); + if (udiInternalRedirectId != null) + { + // try and get the redirect node from a UDI Guid + valid = true; + internalRedirectNode = request.UmbracoContext.ContentCache.GetById(udiInternalRedirectId.Guid); + } } - else - { - var udiInternalRedirectId = request.PublishedContent.Value(Constants.Conventions.Content.InternalRedirectId); - if (udiInternalRedirectId != null) - { - // try and get the redirect node from a UDI Guid - valid = true; - internalRedirectNode = request.UmbracoContext.ContentCache.GetById(udiInternalRedirectId.Guid); - } - } - if (valid == false) - { - // bad redirect - log and display the current page (legacy behavior) - _logger.Debug($"{tracePrefix}Failed to redirect to id={request.PublishedContent.GetProperty(Constants.Conventions.Content.InternalRedirectId).SourceValue}: value is not an int nor a GuidUdi."); - } + if (valid == false) + { + // bad redirect - log and display the current page (legacy behavior) + _logger.Debug($"{tracePrefix}Failed to redirect to id={request.PublishedContent.GetProperty(Constants.Conventions.Content.InternalRedirectId).SourceValue}: value is not an int nor a GuidUdi."); + } if (internalRedirectNode == null) { _logger.Debug($"{tracePrefix}Failed to redirect to id={request.PublishedContent.GetProperty(Constants.Conventions.Content.InternalRedirectId).SourceValue}: no such published document."); } - else if (internalRedirectId == request.PublishedContent.Id) - { - // redirect to self - _logger.Debug($"{tracePrefix}Redirecting to self, ignore"); - } - else - { + else if (internalRedirectId == request.PublishedContent.Id) + { + // redirect to self + _logger.Debug($"{tracePrefix}Redirecting to self, ignore"); + } + else + { request.SetInternalRedirectPublishedContent(internalRedirectNode); // don't use .PublishedContent here - redirect = true; - _logger.Debug($"{tracePrefix}Redirecting to id={internalRedirectId}"); - } + redirect = true; + _logger.Debug($"{tracePrefix}Redirecting to id={internalRedirectId}"); + } - return redirect; - } + return redirect; + } - /// - /// Ensures that access to current node is permitted. - /// - /// Redirecting to a different site root and/or culture will not pick the new site root nor the new culture. - private void EnsurePublishedContentAccess(PublishedContentRequest request) - { - const string tracePrefix = "EnsurePublishedContentAccess: "; + /// + /// Ensures that access to current node is permitted. + /// + /// Redirecting to a different site root and/or culture will not pick the new site root nor the new culture. + private void EnsurePublishedContentAccess(PublishedContentRequest request) + { + const string tracePrefix = "EnsurePublishedContentAccess: "; - if (request.PublishedContent == null) - throw new InvalidOperationException("There is no PublishedContent."); + if (request.PublishedContent == null) + throw new InvalidOperationException("There is no PublishedContent."); - var path = request.PublishedContent.Path; + var path = request.PublishedContent.Path; - var publicAccessAttempt = _services.PublicAccessService.IsProtected(path); + var publicAccessAttempt = _services.PublicAccessService.IsProtected(path); if (publicAccessAttempt) - { - _logger.Debug("{0}Page is protected, check for access", () => tracePrefix); + { + _logger.Debug("{0}Page is protected, check for access", () => tracePrefix); - var membershipHelper = new MembershipHelper(request.UmbracoContext); + var membershipHelper = new MembershipHelper(request.UmbracoContext); - if (membershipHelper.IsLoggedIn() == false) - { - _logger.Debug("{0}Not logged in, redirect to login page", () => tracePrefix); + if (membershipHelper.IsLoggedIn() == false) + { + _logger.Debug("{0}Not logged in, redirect to login page", () => tracePrefix); var loginPageId = publicAccessAttempt.Result.LoginNodeId; - if (loginPageId != request.PublishedContent.Id) + if (loginPageId != request.PublishedContent.Id) request.PublishedContent = request.UmbracoContext.Facade.ContentCache.GetById(loginPageId); - } + } else if (_services.PublicAccessService.HasAccess(request.PublishedContent.Id, _services.ContentService, GetRolesForLogin(membershipHelper.CurrentUserName)) == false) - { - _logger.Debug("{0}Current member has not access, redirect to error page", () => tracePrefix); - var errorPageId = publicAccessAttempt.Result.NoAccessNodeId; - if (errorPageId != request.PublishedContent.Id) + { + _logger.Debug("{0}Current member has not access, redirect to error page", () => tracePrefix); + var errorPageId = publicAccessAttempt.Result.NoAccessNodeId; + if (errorPageId != request.PublishedContent.Id) request.PublishedContent = request.UmbracoContext.Facade.ContentCache.GetById(errorPageId); - } - else - { - _logger.Debug("{0}Current member has access", () => tracePrefix); - } - } - else - { - _logger.Debug("{0}Page is not protected", () => tracePrefix); - } - } + } + else + { + _logger.Debug("{0}Current member has access", () => tracePrefix); + } + } + else + { + _logger.Debug("{0}Page is not protected", () => tracePrefix); + } + } - /// - /// Finds a template for the current node, if any. - /// - private void FindTemplate(PublishedContentRequest request) - { - // NOTE: at the moment there is only 1 way to find a template, and then ppl must - // use the Prepared event to change the template if they wish. Should we also - // implement an ITemplateFinder logic? + /// + /// Finds a template for the current node, if any. + /// + private void FindTemplate(PublishedContentRequest request) + { + // NOTE: at the moment there is only 1 way to find a template, and then ppl must + // use the Prepared event to change the template if they wish. Should we also + // implement an ITemplateFinder logic? - const string tracePrefix = "FindTemplate: "; + const string tracePrefix = "FindTemplate: "; if (request.PublishedContent == null) { @@ -651,120 +651,120 @@ namespace Umbraco.Web.Routing return; } - // read the alternate template alias, from querystring, form, cookie or server vars, - // only if the published content is the initial once, else the alternate template - // does not apply + // read the alternate template alias, from querystring, form, cookie or server vars, + // only if the published content is the initial once, else the alternate template + // does not apply // + optionnally, apply the alternate template on internal redirects var useAltTemplate = _webRoutingSection.DisableAlternativeTemplates == false && (request.IsInitialPublishedContent || (_webRoutingSection.InternalRedirectPreservesTemplate && request.IsInternalRedirectPublishedContent)); var altTemplate = useAltTemplate ? request.UmbracoContext.HttpContext.Request[Constants.Conventions.Url.AltTemplate] - : null; + : null; - if (string.IsNullOrWhiteSpace(altTemplate)) - { - // we don't have an alternate template specified. use the current one if there's one already, - // which can happen if a content lookup also set the template (LookupByNiceUrlAndTemplate...), - // else lookup the template id on the document then lookup the template with that id. + if (string.IsNullOrWhiteSpace(altTemplate)) + { + // we don't have an alternate template specified. use the current one if there's one already, + // which can happen if a content lookup also set the template (LookupByNiceUrlAndTemplate...), + // else lookup the template id on the document then lookup the template with that id. - if (request.HasTemplate) - { - _logger.Debug("{0}Has a template already, and no alternate template.", () => tracePrefix); - return; - } + if (request.HasTemplate) + { + _logger.Debug("{0}Has a template already, and no alternate template.", () => tracePrefix); + return; + } - // TODO: When we remove the need for a database for templates, then this id should be irrelavent, - // not sure how were going to do this nicely. + // TODO: When we remove the need for a database for templates, then this id should be irrelavent, + // not sure how were going to do this nicely. - var templateId = request.PublishedContent.TemplateId; + var templateId = request.PublishedContent.TemplateId; - if (templateId > 0) - { - _logger.Debug("{0}Look for template id={1}", () => tracePrefix, () => templateId); - var template = _services.FileService.GetTemplate(templateId); - if (template == null) - throw new InvalidOperationException("The template with Id " + templateId + " does not exist, the page cannot render"); + if (templateId > 0) + { + _logger.Debug("{0}Look for template id={1}", () => tracePrefix, () => templateId); + var template = _services.FileService.GetTemplate(templateId); + if (template == null) + throw new InvalidOperationException("The template with Id " + templateId + " does not exist, the page cannot render"); request.TemplateModel = template; - _logger.Debug("{0}Got template id={1} alias=\"{2}\"", () => tracePrefix, () => template.Id, () => template.Alias); - } - else - { - _logger.Debug("{0}No specified template.", () => tracePrefix); - } - } - else - { - // we have an alternate template specified. lookup the template with that alias - // this means the we override any template that a content lookup might have set - // so /path/to/page/template1?altTemplate=template2 will use template2 + _logger.Debug("{0}Got template id={1} alias=\"{2}\"", () => tracePrefix, () => template.Id, () => template.Alias); + } + else + { + _logger.Debug("{0}No specified template.", () => tracePrefix); + } + } + else + { + // we have an alternate template specified. lookup the template with that alias + // this means the we override any template that a content lookup might have set + // so /path/to/page/template1?altTemplate=template2 will use template2 - // ignore if the alias does not match - just trace + // ignore if the alias does not match - just trace - if (request.HasTemplate) - _logger.Debug("{0}Has a template already, but also an alternate template.", () => tracePrefix); - _logger.Debug("{0}Look for alternate template alias=\"{1}\"", () => tracePrefix, () => altTemplate); + if (request.HasTemplate) + _logger.Debug("{0}Has a template already, but also an alternate template.", () => tracePrefix); + _logger.Debug("{0}Look for alternate template alias=\"{1}\"", () => tracePrefix, () => altTemplate); - var template = _services.FileService.GetTemplate(altTemplate); - if (template != null) - { + var template = _services.FileService.GetTemplate(altTemplate); + if (template != null) + { request.TemplateModel = template; - _logger.Debug("{0}Got template id={1} alias=\"{2}\"", () => tracePrefix, () => template.Id, () => template.Alias); - } - else - { - _logger.Debug("{0}The template with alias=\"{1}\" does not exist, ignoring.", () => tracePrefix, () => altTemplate); - } - } + _logger.Debug("{0}Got template id={1} alias=\"{2}\"", () => tracePrefix, () => template.Id, () => template.Alias); + } + else + { + _logger.Debug("{0}The template with alias=\"{1}\" does not exist, ignoring.", () => tracePrefix, () => altTemplate); + } + } - if (request.HasTemplate == false) - { - _logger.Debug("{0}No template was found.", () => tracePrefix); + if (request.HasTemplate == false) + { + _logger.Debug("{0}No template was found.", () => tracePrefix); - // initial idea was: if we're not already 404 and UmbracoSettings.HandleMissingTemplateAs404 is true - // then reset _pcr.Document to null to force a 404. - // - // but: because we want to let MVC hijack routes even though no template is defined, we decide that - // a missing template is OK but the request will then be forwarded to MVC, which will need to take - // care of everything. - // - // so, don't set _pcr.Document to null here - } - else - { - _logger.Debug("{0}Running with template id={1} alias=\"{2}\"", () => tracePrefix, () => request.TemplateModel.Id, () => request.TemplateModel.Alias); - } - } + // initial idea was: if we're not already 404 and UmbracoSettings.HandleMissingTemplateAs404 is true + // then reset _pcr.Document to null to force a 404. + // + // but: because we want to let MVC hijack routes even though no template is defined, we decide that + // a missing template is OK but the request will then be forwarded to MVC, which will need to take + // care of everything. + // + // so, don't set _pcr.Document to null here + } + else + { + _logger.Debug("{0}Running with template id={1} alias=\"{2}\"", () => tracePrefix, () => request.TemplateModel.Id, () => request.TemplateModel.Alias); + } + } - /// - /// Follows external redirection through umbracoRedirect document property. - /// - /// As per legacy, if the redirect does not work, we just ignore it. - private void FollowExternalRedirect(PublishedContentRequest request) - { - if (request.HasPublishedContent == false) return; + /// + /// Follows external redirection through umbracoRedirect document property. + /// + /// As per legacy, if the redirect does not work, we just ignore it. + private void FollowExternalRedirect(PublishedContentRequest request) + { + if (request.HasPublishedContent == false) return; - // don't try to find a redirect if the property doesn't exist - if (request.PublishedContent.HasProperty(Constants.Conventions.Content.Redirect) == false) - return; + // don't try to find a redirect if the property doesn't exist + if (request.PublishedContent.HasProperty(Constants.Conventions.Content.Redirect) == false) + return; var redirectId = request.PublishedContent.Value(Constants.Conventions.Content.Redirect, -1); - var redirectUrl = "#"; - if (redirectId > 0) - { - redirectUrl = request.UmbracoContext.UrlProvider.GetUrl(redirectId); - } - else - { - // might be a UDI instead of an int Id - var redirectUdi = request.PublishedContent.Value(Constants.Conventions.Content.Redirect); - if (redirectUdi != null) - redirectUrl = request.UmbracoContext.UrlProvider.GetUrl(redirectUdi.Guid); - } + var redirectUrl = "#"; + if (redirectId > 0) + { + redirectUrl = request.UmbracoContext.UrlProvider.GetUrl(redirectId); + } + else + { + // might be a UDI instead of an int Id + var redirectUdi = request.PublishedContent.Value(Constants.Conventions.Content.Redirect); + if (redirectUdi != null) + redirectUrl = request.UmbracoContext.UrlProvider.GetUrl(redirectUdi.Guid); + } if (redirectUrl != "#") request.SetRedirect(redirectUrl); - } + } - #endregion - } + #endregion + } } diff --git a/src/Umbraco.Web/Routing/IContentFinder.cs b/src/Umbraco.Web/Routing/IContentFinder.cs index 5f8e5f0575..b917896a03 100644 --- a/src/Umbraco.Web/Routing/IContentFinder.cs +++ b/src/Umbraco.Web/Routing/IContentFinder.cs @@ -1,16 +1,16 @@ -namespace Umbraco.Web.Routing +namespace Umbraco.Web.Routing { - /// - /// Provides a method to try to find and assign an Umbraco document to a PublishedContentRequest. - /// - public interface IContentFinder + /// + /// Provides a method to try to find and assign an Umbraco document to a PublishedContentRequest. + /// + public interface IContentFinder { - /// - /// Tries to find and assign an Umbraco document to a PublishedContentRequest. - /// + /// + /// Tries to find and assign an Umbraco document to a PublishedContentRequest. + /// /// The PublishedContentRequest. - /// A value indicating whether an Umbraco document was found and assigned. - /// Optionally, can also assign the template or anything else on the document request, although that is not required. - bool TryFindContent(PublishedContentRequest frequest); + /// A value indicating whether an Umbraco document was found and assigned. + /// Optionally, can also assign the template or anything else on the document request, although that is not required. + bool TryFindContent(PublishedContentRequest frequest); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Routing/IUrlProvider.cs b/src/Umbraco.Web/Routing/IUrlProvider.cs index 79b27f888a..ae38f6d422 100644 --- a/src/Umbraco.Web/Routing/IUrlProvider.cs +++ b/src/Umbraco.Web/Routing/IUrlProvider.cs @@ -11,13 +11,13 @@ namespace Umbraco.Web.Routing { /// /// Gets the nice url of a published content. - /// + /// /// The Umbraco context. /// The published content id. - /// The current absolute url. - /// The url mode. - /// The url for the published content. - /// + /// The current absolute url. + /// The url mode. + /// The url for the published content. + /// /// The url is absolute or relative depending on mode and on current. /// If the provider is unable to provide a url, it should return null. /// diff --git a/src/Umbraco.Web/Routing/LegacyRequestInitializer.cs b/src/Umbraco.Web/Routing/LegacyRequestInitializer.cs index d2a233a943..9be9b76547 100644 --- a/src/Umbraco.Web/Routing/LegacyRequestInitializer.cs +++ b/src/Umbraco.Web/Routing/LegacyRequestInitializer.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Web; namespace Umbraco.Web.Routing @@ -8,16 +8,16 @@ namespace Umbraco.Web.Routing /// internal class LegacyRequestInitializer { - private readonly Uri _requestUrl; - private readonly HttpContextBase _httpContext; + private readonly Uri _requestUrl; + private readonly HttpContextBase _httpContext; public LegacyRequestInitializer(Uri requestUrl, HttpContextBase httpContext) { - _requestUrl = requestUrl; - _httpContext = httpContext; + _requestUrl = requestUrl; + _httpContext = httpContext; } - public void InitializeRequest() + public void InitializeRequest() { var uri = _requestUrl; @@ -33,4 +33,4 @@ namespace Umbraco.Web.Routing _httpContext.Items["VirtualUrl"] = uri.PathAndQuery; //String.Format("{0}{1}{2}", uri.AbsolutePath, string.IsNullOrWhiteSpace(frequest.QueryString) ? "" : "?", docreq.QueryString); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Routing/NotFoundHandlerHelper.cs b/src/Umbraco.Web/Routing/NotFoundHandlerHelper.cs index 9415a7f725..4dcfc9f1ce 100644 --- a/src/Umbraco.Web/Routing/NotFoundHandlerHelper.cs +++ b/src/Umbraco.Web/Routing/NotFoundHandlerHelper.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Globalization; using System.Linq; using Umbraco.Core; @@ -38,7 +38,7 @@ namespace Umbraco.Web.Routing } internal static int? GetCurrentNotFoundPageId( - IContentErrorPage[] error404Collection, + IContentErrorPage[] error404Collection, IEntityService entityService, IPublishedContentQuery publishedContentQuery, CultureInfo errorCulture) @@ -74,8 +74,8 @@ namespace Umbraco.Web.Routing if (errorPage.HasContentKey) { //need to get the Id for the GUID - //TODO: When we start storing GUIDs into the IPublishedContent, then we won't have to look this up - // but until then we need to look it up in the db. For now we've implemented a cached service for + //TODO: When we start storing GUIDs into the IPublishedContent, then we won't have to look this up + // but until then we need to look it up in the db. For now we've implemented a cached service for // converting Int -> Guid and vice versa. var found = entityService.GetIdForKey(errorPage.ContentKey, UmbracoObjectTypes.Document); if (found) @@ -115,4 +115,4 @@ namespace Umbraco.Web.Routing } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Routing/PublishedContentNotFoundHandler.cs b/src/Umbraco.Web/Routing/PublishedContentNotFoundHandler.cs index dadbe85a9d..9c18ff5ef9 100644 --- a/src/Umbraco.Web/Routing/PublishedContentNotFoundHandler.cs +++ b/src/Umbraco.Web/Routing/PublishedContentNotFoundHandler.cs @@ -2,50 +2,50 @@ namespace Umbraco.Web.Routing { - /// - /// Gets executed when no document can be found in Umbraco - /// - internal class PublishedContentNotFoundHandler : IHttpHandler - { - private readonly string _message; + /// + /// Gets executed when no document can be found in Umbraco + /// + internal class PublishedContentNotFoundHandler : IHttpHandler + { + private readonly string _message; - public PublishedContentNotFoundHandler() - { } + public PublishedContentNotFoundHandler() + { } - public PublishedContentNotFoundHandler(string message) - { - _message = message; - } + public PublishedContentNotFoundHandler(string message) + { + _message = message; + } - public void ProcessRequest(HttpContext context) - { - WriteOutput(context); - } + public void ProcessRequest(HttpContext context) + { + WriteOutput(context); + } - internal void WriteOutput(HttpContext context) - { - var response = context.Response; + internal void WriteOutput(HttpContext context) + { + var response = context.Response; - response.Clear(); + response.Clear(); - var frequest = UmbracoContext.Current.PublishedContentRequest; - var reason = "Cannot render the page at url '{0}'."; - if (frequest.HasPublishedContent == false) - reason = "No umbraco document matches the url '{0}'."; - else if (frequest.HasTemplate == false) - reason = "No template exists to render the document at url '{0}'."; + var frequest = UmbracoContext.Current.PublishedContentRequest; + var reason = "Cannot render the page at url '{0}'."; + if (frequest.HasPublishedContent == false) + reason = "No umbraco document matches the url '{0}'."; + else if (frequest.HasTemplate == false) + reason = "No template exists to render the document at url '{0}'."; - response.Write("

Page not found

"); - response.Write("

"); - response.Write(string.Format(reason, HttpUtility.HtmlEncode(UmbracoContext.Current.OriginalRequestUrl.PathAndQuery))); - response.Write("

"); - if (string.IsNullOrWhiteSpace(_message) == false) - response.Write("

" + _message + "

"); - response.Write("

This page can be replaced with a custom 404. Check the documentation for \"custom 404\".

"); - response.Write("

This page is intentionally left ugly ;-)

"); - response.Write(""); - } + response.Write("

Page not found

"); + response.Write("

"); + response.Write(string.Format(reason, HttpUtility.HtmlEncode(UmbracoContext.Current.OriginalRequestUrl.PathAndQuery))); + response.Write("

"); + if (string.IsNullOrWhiteSpace(_message) == false) + response.Write("

" + _message + "

"); + response.Write("

This page can be replaced with a custom 404. Check the documentation for \"custom 404\".

"); + response.Write("

This page is intentionally left ugly ;-)

"); + response.Write(""); + } - public bool IsReusable => false; - } + public bool IsReusable => false; + } } diff --git a/src/Umbraco.Web/Routing/PublishedContentRequest.cs b/src/Umbraco.Web/Routing/PublishedContentRequest.cs index eac59b2ae8..d50ee8baba 100644 --- a/src/Umbraco.Web/Routing/PublishedContentRequest.cs +++ b/src/Umbraco.Web/Routing/PublishedContentRequest.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Globalization; using System.Web; @@ -18,7 +18,7 @@ namespace Umbraco.Web.Routing ///
public class PublishedContentRequest { - private readonly FacadeRouter _facadeRouter; + private readonly FacadeRouter _facadeRouter; private bool _readonly; // after prepared private bool _readonlyUri; // after preparing @@ -75,10 +75,10 @@ namespace Umbraco.Web.Routing /// /// Prepares the request. /// - public void Prepare() - { - _facadeRouter.PrepareRequest(this); - } + public void Prepare() + { + _facadeRouter.PrepareRequest(this); + } #region Events @@ -101,7 +101,7 @@ namespace Umbraco.Web.Routing /// /// Triggers the Preparing event. /// - internal void OnPreparing() + internal void OnPreparing() { Preparing?.Invoke(this, EventArgs.Empty); _readonlyUri = true; @@ -148,7 +148,7 @@ namespace Umbraco.Web.Routing /// preserve or reset the template, if any. public void SetInternalRedirectPublishedContent(IPublishedContent content) { - if (content == null) throw new ArgumentNullException(nameof(content)); + if (content == null) throw new ArgumentNullException(nameof(content)); EnsureWriteable(); // unless a template has been set already by the finder, @@ -185,18 +185,18 @@ namespace Umbraco.Web.Routing } /// - /// Gets the initial requested content. - /// - /// The initial requested content is the content that was found by the finders, - /// before anything such as 404, redirect... took place. - public IPublishedContent InitialPublishedContent => _initialPublishedContent; + /// Gets the initial requested content. + ///
+ /// The initial requested content is the content that was found by the finders, + /// before anything such as 404, redirect... took place. + public IPublishedContent InitialPublishedContent => _initialPublishedContent; /// /// Gets value indicating whether the current published content is the initial one. /// - public bool IsInitialPublishedContent => _initialPublishedContent != null && _initialPublishedContent == _publishedContent; + public bool IsInitialPublishedContent => _initialPublishedContent != null && _initialPublishedContent == _publishedContent; - /// + /// /// Indicates that the current PublishedContent is the initial one. /// public void SetIsInitialPublishedContent() @@ -249,7 +249,7 @@ namespace Umbraco.Web.Routing /// public string TemplateAlias => _template?.Alias; - /// + /// /// Tries to set the template to use to display the requested content. /// /// The alias of the template. @@ -294,7 +294,7 @@ namespace Umbraco.Web.Routing /// Resets the template. /// /// The RenderingEngine becomes unknown. - public void ResetTemplate() + public void ResetTemplate() { EnsureWriteable(); TemplateModel = null; @@ -323,25 +323,25 @@ namespace Umbraco.Web.Routing /// Is a DomainAndUri object ie a standard Domain plus the fully qualified uri. For example, /// the Domain may contain "example.com" whereas the Uri will be fully qualified eg "http://example.com/". public DomainAndUri Domain - { - get { return _domain; } - set - { - EnsureWriteable(); - _domain = value; - } - } + { + get { return _domain; } + set + { + EnsureWriteable(); + _domain = value; + } + } - /// - /// Gets a value indicating whether the content request has a domain. - /// - public bool HasDomain => Domain != null; + /// + /// Gets a value indicating whether the content request has a domain. + /// + public bool HasDomain => Domain != null; - /// - /// Gets or sets the content request's culture. - /// - public CultureInfo Culture - { + /// + /// Gets or sets the content request's culture. + /// + public CultureInfo Culture + { get { return _culture; } set { @@ -353,41 +353,41 @@ namespace Umbraco.Web.Routing // note: do we want to have an ordered list of alternate cultures, // to allow for fallbacks when doing dictionnary lookup and such? - #endregion + #endregion - #region Rendering + #region Rendering - /// - /// Gets or sets whether the rendering engine is MVC or WebForms. - /// - public RenderingEngine RenderingEngine { get; internal set; } + /// + /// Gets or sets whether the rendering engine is MVC or WebForms. + /// + public RenderingEngine RenderingEngine { get; internal set; } - #endregion + #endregion #region Status /// /// Gets or sets a value indicating whether the requested content could not be found. /// - /// This is set in the PublishedContentRequestBuilder and can also be used in + /// This is set in the PublishedContentRequestBuilder and can also be used in /// custom content finders or Prepared event handlers, where we want to allow developers /// to indicate a request is 404 but not to cancel it. public bool Is404 - { - get { return _is404; } - set - { - EnsureWriteable(); - _is404 = value; - } - } + { + get { return _is404; } + set + { + EnsureWriteable(); + _is404 = value; + } + } /// /// Gets a value indicating whether the content request triggers a redirect (permanent or not). /// public bool IsRedirect => string.IsNullOrWhiteSpace(RedirectUrl) == false; - /// + /// /// Gets or sets a value indicating whether the redirect is permanent. /// public bool IsRedirectPermanent { get; private set; } @@ -516,4 +516,4 @@ namespace Umbraco.Web.Routing #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Routing/RoutableAttemptEventArgs.cs b/src/Umbraco.Web/Routing/RoutableAttemptEventArgs.cs index ee93623252..389c7127e3 100644 --- a/src/Umbraco.Web/Routing/RoutableAttemptEventArgs.cs +++ b/src/Umbraco.Web/Routing/RoutableAttemptEventArgs.cs @@ -1,4 +1,4 @@ -using System.Web; +using System.Web; namespace Umbraco.Web.Routing { @@ -15,4 +15,4 @@ namespace Umbraco.Web.Routing Outcome = reason; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Routing/SiteDomainHelper.cs b/src/Umbraco.Web/Routing/SiteDomainHelper.cs index 5170ce1f5a..1ceab6293a 100644 --- a/src/Umbraco.Web/Routing/SiteDomainHelper.cs +++ b/src/Umbraco.Web/Routing/SiteDomainHelper.cs @@ -4,38 +4,38 @@ using System.Linq; using System.Threading; using System.Text.RegularExpressions; using Umbraco.Core; - + namespace Umbraco.Web.Routing { - /// - /// Provides utilities to handle site domains. - /// - public class SiteDomainHelper : ISiteDomainHelper - { + /// + /// Provides utilities to handle site domains. + /// + public class SiteDomainHelper : ISiteDomainHelper + { #region Configure - + private static readonly ReaderWriterLockSlim ConfigLock = new ReaderWriterLockSlim(); - private static Dictionary _sites; + private static Dictionary _sites; private static Dictionary> _bindings; private static Dictionary> _qualifiedSites; // these are for unit tests *only* internal static Dictionary Sites { get { return _sites; } } - internal static Dictionary> Bindings { get { return _bindings; } } + internal static Dictionary> Bindings { get { return _bindings; } } // these are for validation - //private const string DomainValidationSource = @"^(\*|((?i:http[s]?://)?([-\w]+(\.[-\w]+)*)(:\d+)?(/[-\w]*)?))$"; + //private const string DomainValidationSource = @"^(\*|((?i:http[s]?://)?([-\w]+(\.[-\w]+)*)(:\d+)?(/[-\w]*)?))$"; private const string DomainValidationSource = @"^(((?i:http[s]?://)?([-\w]+(\.[-\w]+)*)(:\d+)?(/)?))$"; - private static readonly Regex DomainValidation = new Regex(DomainValidationSource, RegexOptions.IgnoreCase | RegexOptions.Compiled); - + private static readonly Regex DomainValidation = new Regex(DomainValidationSource, RegexOptions.IgnoreCase | RegexOptions.Compiled); + /// /// Returns a disposable object that represents safe write access to config. /// /// Should be used in a using(SiteDomainHelper.ConfigWriteLock) { ... } mode. protected static IDisposable ConfigWriteLock - { + { get { return new WriteLock(ConfigLock); } - } + } /// /// Returns a disposable object that represents safe read access to config. @@ -149,15 +149,15 @@ namespace Umbraco.Web.Routing { foreach (var key in keys.Where(key => !_sites.ContainsKey(key))) throw new ArgumentException(string.Format("Not an existing site key: {0}", key), "keys"); - + _bindings = _bindings ?? new Dictionary>(); - + var allkeys = _bindings .Where(kvp => keys.Contains(kvp.Key)) .SelectMany(kvp => kvp.Value) .Union(keys) .ToArray(); - + foreach (var key in allkeys) { if (!_bindings.ContainsKey(key)) @@ -193,19 +193,19 @@ namespace Umbraco.Web.Routing return MapDomain(domainAndUris, qualifiedSites, currentAuthority); } - /// - /// Filters a list of DomainAndUri to pick those that best matches the current request. - /// - /// The Uri of the current request. - /// The list of DomainAndUri to filter. + /// + /// Filters a list of DomainAndUri to pick those that best matches the current request. + /// + /// The Uri of the current request. + /// The list of DomainAndUri to filter. /// A value indicating whether to exclude the current/default domain. - /// The selected DomainAndUri items. - /// The filter must return something, even empty, else an exception will be thrown. - public virtual IEnumerable MapDomains(Uri current, DomainAndUri[] domainAndUris, bool excludeDefault) + /// The selected DomainAndUri items. + /// The filter must return something, even empty, else an exception will be thrown. + public virtual IEnumerable MapDomains(Uri current, DomainAndUri[] domainAndUris, bool excludeDefault) { var currentAuthority = current.GetLeftPart(UriPartial.Authority); KeyValuePair[] candidateSites = null; - IEnumerable ret = domainAndUris; + IEnumerable ret = domainAndUris; using (ConfigReadLock) // so nothing changes between GetQualifiedSites and access to bindings { @@ -252,7 +252,7 @@ namespace Umbraco.Web.Routing } } } - + // if we are able to filter, then filter, else return the whole lot return candidateSites == null ? ret : ret.Where(d => { @@ -260,27 +260,27 @@ namespace Umbraco.Web.Routing return candidateSites.Any(site => site.Value.Contains(authority)); }); } - - private static Dictionary GetQualifiedSites(Uri current) - { - using (ConfigReadLock) - { - return GetQualifiedSitesInsideLock(current); - } - } - - private static Dictionary GetQualifiedSitesInsideLock(Uri current) + + private static Dictionary GetQualifiedSites(Uri current) + { + using (ConfigReadLock) + { + return GetQualifiedSitesInsideLock(current); + } + } + + private static Dictionary GetQualifiedSitesInsideLock(Uri current) { // we do our best, but can't do the impossible if (_sites == null) return null; - + // cached? if (_qualifiedSites != null && _qualifiedSites.ContainsKey(current.Scheme)) return _qualifiedSites[current.Scheme]; - + _qualifiedSites = _qualifiedSites ?? new Dictionary>(); - + // convert sites into authority sites based upon current scheme // because some domains in the sites might not have a scheme -- and cache return _qualifiedSites[current.Scheme] = _sites @@ -288,7 +288,7 @@ namespace Umbraco.Web.Routing kvp => kvp.Key, kvp => kvp.Value.Select(d => new Uri(UriUtility.StartWithScheme(d, current.Scheme)).GetLeftPart(UriPartial.Authority)).ToArray() ); - + // .ToDictionary will evaluate and create the dictionary immediately // the new value is .ToArray so it will also be evaluated immediately // therefore it is safe to return and exit the configuration lock @@ -308,7 +308,7 @@ namespace Umbraco.Web.Routing // find a site that contains the current authority var currentSite = qualifiedSites.FirstOrDefault(site => site.Value.Contains(currentAuthority)); - // if current belongs to a site - try to pick the first element + // if current belongs to a site - try to pick the first element // from domainAndUris that also belongs to that site var ret = currentSite.Equals(default(KeyValuePair)) ? null diff --git a/src/Umbraco.Web/Routing/UmbracoRequestEventArgs.cs b/src/Umbraco.Web/Routing/UmbracoRequestEventArgs.cs index 3516277275..0372011150 100644 --- a/src/Umbraco.Web/Routing/UmbracoRequestEventArgs.cs +++ b/src/Umbraco.Web/Routing/UmbracoRequestEventArgs.cs @@ -17,4 +17,4 @@ namespace Umbraco.Web.Routing HttpContext = httpContext; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Routing/UrlProvider.cs b/src/Umbraco.Web/Routing/UrlProvider.cs index 0dfac6bbfb..ea48a7093a 100644 --- a/src/Umbraco.Web/Routing/UrlProvider.cs +++ b/src/Umbraco.Web/Routing/UrlProvider.cs @@ -36,7 +36,7 @@ namespace Umbraco.Web.Routing if (Enum.TryParse(routingSettings.UrlProviderMode, out provider)) { Mode = provider; - } + } } /// @@ -216,7 +216,7 @@ namespace Umbraco.Web.Routing internal string GetUrlFromRoute(int id, string route) { var provider = _urlProviders.OfType().FirstOrDefault(); - var url = provider == null + var url = provider == null ? route // what else? : provider.GetUrlFromRoute(route, UmbracoContext.Current, id, _umbracoContext.CleanedUmbracoUrl, Mode); return url ?? "#"; diff --git a/src/Umbraco.Web/Routing/UrlProviderCollection.cs b/src/Umbraco.Web/Routing/UrlProviderCollection.cs index a9c1ddaf06..7e08c37f06 100644 --- a/src/Umbraco.Web/Routing/UrlProviderCollection.cs +++ b/src/Umbraco.Web/Routing/UrlProviderCollection.cs @@ -5,7 +5,7 @@ namespace Umbraco.Web.Routing { public class UrlProviderCollection : BuilderCollectionBase { - public UrlProviderCollection(IEnumerable items) + public UrlProviderCollection(IEnumerable items) : base(items) { } } diff --git a/src/Umbraco.Web/Routing/UrlProviderCollectionBuilder.cs b/src/Umbraco.Web/Routing/UrlProviderCollectionBuilder.cs index c0357dbc8e..196c8a7a25 100644 --- a/src/Umbraco.Web/Routing/UrlProviderCollectionBuilder.cs +++ b/src/Umbraco.Web/Routing/UrlProviderCollectionBuilder.cs @@ -5,7 +5,7 @@ namespace Umbraco.Web.Routing { public class UrlProviderCollectionBuilder : OrderedCollectionBuilderBase { - public UrlProviderCollectionBuilder(IServiceContainer container) + public UrlProviderCollectionBuilder(IServiceContainer container) : base(container) { } diff --git a/src/Umbraco.Web/Routing/UrlProviderExtensions.cs b/src/Umbraco.Web/Routing/UrlProviderExtensions.cs index feb30e9624..6d186cb314 100644 --- a/src/Umbraco.Web/Routing/UrlProviderExtensions.cs +++ b/src/Umbraco.Web/Routing/UrlProviderExtensions.cs @@ -113,4 +113,4 @@ namespace Umbraco.Web.Routing return urls; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Routing/UrlProviderMode.cs b/src/Umbraco.Web/Routing/UrlProviderMode.cs index 9ca1b9f32a..de2963c30f 100644 --- a/src/Umbraco.Web/Routing/UrlProviderMode.cs +++ b/src/Umbraco.Web/Routing/UrlProviderMode.cs @@ -4,7 +4,7 @@ /// Specifies the type of urls that the url provider should produce. /// /// - /// The AutoLegacy option is equivalent to Auto but it also respects the legacy useDomainPrefixes setting. + /// The AutoLegacy option is equivalent to Auto but it also respects the legacy useDomainPrefixes setting. /// When that setting is true, then all urls are absolute. Otherwise, urls will be relative or absolute, depending on hostnames. /// The Relative option can lead to invalid results when combined with hostnames, but it is the only way to reproduce /// the true, pre-4.10, always-relative behavior of Umbraco. diff --git a/src/Umbraco.Web/Routing/WebServicesRouteConstraint.cs b/src/Umbraco.Web/Routing/WebServicesRouteConstraint.cs index 0f9d6305b1..95adc01640 100644 --- a/src/Umbraco.Web/Routing/WebServicesRouteConstraint.cs +++ b/src/Umbraco.Web/Routing/WebServicesRouteConstraint.cs @@ -10,15 +10,15 @@ namespace Umbraco.Web.Routing //public class WebServicesRouteConstraint : IRouteConstraint //{ // public bool Match( - // HttpContextBase httpContext, - // Route route, - // string parameterName, - // RouteValueDictionary values, + // HttpContextBase httpContext, + // Route route, + // string parameterName, + // RouteValueDictionary values, // RouteDirection routeDirection) // { // if (routeDirection == RouteDirection.UrlGeneration) // { - + // } // return true; // } diff --git a/src/Umbraco.Web/Scheduling/BackgroundTaskRunnerOptions.cs b/src/Umbraco.Web/Scheduling/BackgroundTaskRunnerOptions.cs index 28c814db24..5813799f05 100644 --- a/src/Umbraco.Web/Scheduling/BackgroundTaskRunnerOptions.cs +++ b/src/Umbraco.Web/Scheduling/BackgroundTaskRunnerOptions.cs @@ -1,4 +1,4 @@ -namespace Umbraco.Web.Scheduling +namespace Umbraco.Web.Scheduling { /// /// Provides options to the class. @@ -50,4 +50,4 @@ namespace Umbraco.Web.Scheduling /// public bool Hosted { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Scheduling/IBackgroundTask.cs b/src/Umbraco.Web/Scheduling/IBackgroundTask.cs index 2e67ed1790..b1285d0080 100644 --- a/src/Umbraco.Web/Scheduling/IBackgroundTask.cs +++ b/src/Umbraco.Web/Scheduling/IBackgroundTask.cs @@ -27,4 +27,4 @@ namespace Umbraco.Web.Scheduling /// bool IsAsync { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Scheduling/IBackgroundTaskRunner.cs b/src/Umbraco.Web/Scheduling/IBackgroundTaskRunner.cs index 8c0117541b..e8fd754622 100644 --- a/src/Umbraco.Web/Scheduling/IBackgroundTaskRunner.cs +++ b/src/Umbraco.Web/Scheduling/IBackgroundTaskRunner.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Web.Hosting; namespace Umbraco.Web.Scheduling @@ -17,4 +17,4 @@ namespace Umbraco.Web.Scheduling // fixme - complete the interface? } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Scheduling/KeepAlive.cs b/src/Umbraco.Web/Scheduling/KeepAlive.cs index f58b234cdc..5221d8b499 100644 --- a/src/Umbraco.Web/Scheduling/KeepAlive.cs +++ b/src/Umbraco.Web/Scheduling/KeepAlive.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Net.Http; using System.Threading; using System.Threading.Tasks; @@ -13,7 +13,7 @@ namespace Umbraco.Web.Scheduling private readonly ILogger _logger; private readonly ProfilingLogger _proflog; - public KeepAlive(IBackgroundTaskRunner runner, int delayMilliseconds, int periodMilliseconds, + public KeepAlive(IBackgroundTaskRunner runner, int delayMilliseconds, int periodMilliseconds, IRuntimeState runtime, ILogger logger, ProfilingLogger proflog) : base(runner, delayMilliseconds, periodMilliseconds) { @@ -62,4 +62,4 @@ namespace Umbraco.Web.Scheduling public override bool IsAsync => true; } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Scheduling/LogScrubber.cs b/src/Umbraco.Web/Scheduling/LogScrubber.cs index d13ff372cf..9edd203856 100644 --- a/src/Umbraco.Web/Scheduling/LogScrubber.cs +++ b/src/Umbraco.Web/Scheduling/LogScrubber.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Threading; using System.Threading.Tasks; using Umbraco.Core; @@ -97,4 +97,4 @@ namespace Umbraco.Web.Scheduling public override bool IsAsync => false; } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Scheduling/RecurringTaskBase.cs b/src/Umbraco.Web/Scheduling/RecurringTaskBase.cs index 447a98527e..7a51890c12 100644 --- a/src/Umbraco.Web/Scheduling/RecurringTaskBase.cs +++ b/src/Umbraco.Web/Scheduling/RecurringTaskBase.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Threading; using System.Threading.Tasks; @@ -104,4 +104,4 @@ namespace Umbraco.Web.Scheduling _timer.Dispose(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Scheduling/ScheduledPublishing.cs b/src/Umbraco.Web/Scheduling/ScheduledPublishing.cs index ba9e1f776d..4f2a54b6f9 100644 --- a/src/Umbraco.Web/Scheduling/ScheduledPublishing.cs +++ b/src/Umbraco.Web/Scheduling/ScheduledPublishing.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Net.Http; using System.Threading; using System.Threading.Tasks; @@ -114,4 +114,4 @@ namespace Umbraco.Web.Scheduling public override bool IsAsync => true; } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Scheduling/ScheduledTasks.cs b/src/Umbraco.Web/Scheduling/ScheduledTasks.cs index d6764312a9..86d8efc9dd 100644 --- a/src/Umbraco.Web/Scheduling/ScheduledTasks.cs +++ b/src/Umbraco.Web/Scheduling/ScheduledTasks.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.Net; using System.Net.Http; @@ -121,4 +121,4 @@ namespace Umbraco.Web.Scheduling public override bool IsAsync => true; } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Scheduling/TaskAndFactoryExtensions.cs b/src/Umbraco.Web/Scheduling/TaskAndFactoryExtensions.cs index a57ea904b0..7220e77e0c 100644 --- a/src/Umbraco.Web/Scheduling/TaskAndFactoryExtensions.cs +++ b/src/Umbraco.Web/Scheduling/TaskAndFactoryExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Threading; using System.Threading.Tasks; @@ -59,4 +59,4 @@ namespace Umbraco.Web.Scheduling #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Scheduling/TaskEventArgs.cs b/src/Umbraco.Web/Scheduling/TaskEventArgs.cs index 5e83b14231..972bc12901 100644 --- a/src/Umbraco.Web/Scheduling/TaskEventArgs.cs +++ b/src/Umbraco.Web/Scheduling/TaskEventArgs.cs @@ -39,4 +39,4 @@ namespace Umbraco.Web.Scheduling /// public Exception Exception { get; private set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Scheduling/ThreadingTaskImmutable.cs b/src/Umbraco.Web/Scheduling/ThreadingTaskImmutable.cs index 1bb5fcbf41..b1ea0d7f71 100644 --- a/src/Umbraco.Web/Scheduling/ThreadingTaskImmutable.cs +++ b/src/Umbraco.Web/Scheduling/ThreadingTaskImmutable.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Runtime.CompilerServices; using System.Threading.Tasks; @@ -41,4 +41,4 @@ namespace Umbraco.Web.Scheduling get { return _task.Status; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Search/ExamineComponent.cs b/src/Umbraco.Web/Search/ExamineComponent.cs index 6bd116467e..ef34f74b80 100644 --- a/src/Umbraco.Web/Search/ExamineComponent.cs +++ b/src/Umbraco.Web/Search/ExamineComponent.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Globalization; using System.Linq; @@ -29,9 +29,9 @@ namespace Umbraco.Web.Search ///
[RuntimeLevel(MinLevel = RuntimeLevel.Run)] public sealed class ExamineComponent : UmbracoComponentBase, IUmbracoCoreComponent - { - public void Initialize(IRuntimeState runtime, PropertyEditorCollection propertyEditors, IExamineIndexCollectionAccessor indexCollection, ILogger logger) - { + { + public void Initialize(IRuntimeState runtime, PropertyEditorCollection propertyEditors, IExamineIndexCollectionAccessor indexCollection, ILogger logger) + { logger.Info("Starting initialize async background thread."); // make it async in order not to slow down the boot @@ -60,7 +60,7 @@ namespace Umbraco.Web.Search logger.Error("Failed to bind grid property editor.", e); } }); - bg.Start(); + bg.Start(); // the rest is the original Examine event handler @@ -68,20 +68,20 @@ namespace Umbraco.Web.Search //TODO: For now we'll make this true, it means that indexes will be near real time // we'll see about what implications this may have - should be great in most scenarios - DefaultExamineSession.RequireImmediateConsistency = true; + DefaultExamineSession.RequireImmediateConsistency = true; - var registeredProviders = ExamineManager.Instance.IndexProviderCollection - .OfType().Count(x => x.EnableDefaultEventHandler); + var registeredProviders = ExamineManager.Instance.IndexProviderCollection + .OfType().Count(x => x.EnableDefaultEventHandler); logger.Info($"Adding examine event handlers for {registeredProviders} index providers."); - // don't bind event handlers if we're not suppose to listen - if (registeredProviders == 0) - return; + // don't bind event handlers if we're not suppose to listen + if (registeredProviders == 0) + return; // bind to distributed cache events - this ensures that this logic occurs on ALL servers // that are taking part in a load balanced environment. - ContentCacheRefresher.CacheUpdated += ContentCacheRefresherUpdated; + ContentCacheRefresher.CacheUpdated += ContentCacheRefresherUpdated; MediaCacheRefresher.CacheUpdated += MediaCacheRefresherUpdated; MemberCacheRefresher.CacheUpdated += MemberCacheRefresherUpdated; @@ -90,16 +90,16 @@ namespace Umbraco.Web.Search // because, could not make sense of it? var contentIndexer = ExamineManager.Instance.IndexProviderCollection[Constants.Examine.InternalIndexer] as UmbracoContentIndexer; - if (contentIndexer != null) - { - contentIndexer.DocumentWriting += IndexerDocumentWriting; - } - var memberIndexer = ExamineManager.Instance.IndexProviderCollection[Constants.Examine.InternalMemberIndexer] as UmbracoMemberIndexer; - if (memberIndexer != null) - { - memberIndexer.DocumentWriting += IndexerDocumentWriting; - } - } + if (contentIndexer != null) + { + contentIndexer.DocumentWriting += IndexerDocumentWriting; + } + var memberIndexer = ExamineManager.Instance.IndexProviderCollection[Constants.Examine.InternalMemberIndexer] as UmbracoMemberIndexer; + if (memberIndexer != null) + { + memberIndexer.DocumentWriting += IndexerDocumentWriting; + } + } private static void RebuildIndexes(bool onlyEmptyIndexes) { @@ -119,7 +119,7 @@ namespace Umbraco.Web.Search } static void MemberCacheRefresherUpdated(MemberCacheRefresher sender, CacheRefresherEventArgs args) - { + { switch (args.MessageType) { case MessageType.RefreshById: @@ -158,22 +158,22 @@ namespace Umbraco.Web.Search //We don't support these, these message types will not fire for unpublished content break; } - } + } - static void MediaCacheRefresherUpdated(MediaCacheRefresher sender, CacheRefresherEventArgs args) + static void MediaCacheRefresherUpdated(MediaCacheRefresher sender, CacheRefresherEventArgs args) { if (args.MessageType != MessageType.RefreshByPayload) throw new NotSupportedException(); var mediaService = Current.Services.MediaService; - foreach (var payload in (MediaCacheRefresher.JsonPayload[]) args.MessageObject) - { + foreach (var payload in (MediaCacheRefresher.JsonPayload[]) args.MessageObject) + { if (payload.ChangeTypes.HasType(TreeChangeTypes.Remove)) - { + { // remove from *all* indexes - DeleteIndexForEntity(payload.Id, false); - } + DeleteIndexForEntity(payload.Id, false); + } else if (payload.ChangeTypes.HasType(TreeChangeTypes.RefreshAll)) { // ExamineEvents does not support RefreshAll @@ -182,7 +182,7 @@ namespace Umbraco.Web.Search } else // RefreshNode or RefreshBranch (maybe trashed) { - var media = mediaService.GetById(payload.Id); + var media = mediaService.GetById(payload.Id); if (media == null || media.Trashed) { // gone fishing, remove entirely @@ -203,24 +203,24 @@ namespace Umbraco.Web.Search } } } - } + } } - static void ContentCacheRefresherUpdated(ContentCacheRefresher sender, CacheRefresherEventArgs args) - { + static void ContentCacheRefresherUpdated(ContentCacheRefresher sender, CacheRefresherEventArgs args) + { if (args.MessageType != MessageType.RefreshByPayload) throw new NotSupportedException(); - var contentService = Current.Services.ContentService; + var contentService = Current.Services.ContentService; - foreach (var payload in (ContentCacheRefresher.JsonPayload[]) args.MessageObject) - { + foreach (var payload in (ContentCacheRefresher.JsonPayload[]) args.MessageObject) + { if (payload.ChangeTypes.HasType(TreeChangeTypes.Remove)) - { + { // delete content entirely (with descendants) // false: remove entirely from all indexes DeleteIndexForEntity(payload.Id, false); - } + } else if (payload.ChangeTypes.HasType(TreeChangeTypes.RefreshAll)) { // ExamineEvents does not support RefreshAll @@ -229,10 +229,10 @@ namespace Umbraco.Web.Search } else // RefreshNode or RefreshBranch (maybe trashed) { - // don't try to be too clever - refresh entirely + // don't try to be too clever - refresh entirely // there has to be race conds in there ;-( - var content = contentService.GetById(payload.Id); + var content = contentService.GetById(payload.Id); if (content == null || content.Trashed) { // gone fishing, remove entirely from all indexes (with descendants) @@ -286,8 +286,8 @@ namespace Umbraco.Web.Search // ReIndexForContent is NOT taking care of descendants so we have to reload everything // again in order to process the branch - we COULD improve that by just reloading the // XML from database instead of reloading content & re-serializing! - } - } + } + } private static void ReIndexForContent(IContent content, IContent published) { @@ -326,13 +326,13 @@ namespace Umbraco.Web.Search } private static void ReIndexForMember(IMember member) - { - ExamineManager.Instance.ReIndexNode( - member.ToXml(), IndexTypes.Member, - ExamineManager.Instance.IndexProviderCollection.OfType() + { + ExamineManager.Instance.ReIndexNode( + member.ToXml(), IndexTypes.Member, + ExamineManager.Instance.IndexProviderCollection.OfType() //ensure that only the providers are flagged to listen execute - .Where(x => x.EnableDefaultEventHandler)); - } + .Where(x => x.EnableDefaultEventHandler)); + } private static void ReIndexForMedia(IMedia sender, bool isMediaPublished) { @@ -376,19 +376,19 @@ namespace Umbraco.Web.Search /// private static void IndexerDocumentWriting(object sender, DocumentWritingEventArgs e) - { - if (e.Fields.Keys.Contains("nodeName")) - { + { + if (e.Fields.Keys.Contains("nodeName")) + { //TODO: This logic should really be put into the content indexer instead of hidden here!! - //add the lower cased version - e.Document.Add(new Field("__nodeName", - e.Fields["nodeName"].ToLower(), - Field.Store.YES, - Field.Index.ANALYZED, - Field.TermVector.NO - )); - } - } - } -} \ No newline at end of file + //add the lower cased version + e.Document.Add(new Field("__nodeName", + e.Fields["nodeName"].ToLower(), + Field.Store.YES, + Field.Index.ANALYZED, + Field.TermVector.NO + )); + } + } + } +} diff --git a/src/Umbraco.Web/Search/ExamineIndexerModel.cs b/src/Umbraco.Web/Search/ExamineIndexerModel.cs index 01da32c952..c8cf2ff622 100644 --- a/src/Umbraco.Web/Search/ExamineIndexerModel.cs +++ b/src/Umbraco.Web/Search/ExamineIndexerModel.cs @@ -10,7 +10,7 @@ namespace Umbraco.Web.Search { [DataMember(Name = "fieldDefinitions")] public IEnumerable FieldDefinitions { get; set; } - + /// /// The number of docs in the index /// @@ -41,4 +41,4 @@ namespace Umbraco.Web.Search [DataMember(Name = "isLuceneIndex")] public bool IsLuceneIndex { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Search/LuceneIndexerExtensions.cs b/src/Umbraco.Web/Search/LuceneIndexerExtensions.cs index 99c319cee2..f333eca267 100644 --- a/src/Umbraco.Web/Search/LuceneIndexerExtensions.cs +++ b/src/Umbraco.Web/Search/LuceneIndexerExtensions.cs @@ -122,7 +122,7 @@ namespace Umbraco.Web.Search /// If the index does not exist we'll consider it locked /// public static bool IsIndexLocked(this LuceneIndexer indexer) - { + { return indexer.IndexExists() == false || IndexWriter.IsLocked(indexer.GetLuceneDirectory()); } @@ -151,4 +151,4 @@ namespace Umbraco.Web.Search } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Security/Identity/AppBuilderExtensions.cs b/src/Umbraco.Web/Security/Identity/AppBuilderExtensions.cs index bbfc9e1e21..f2f99aeea3 100644 --- a/src/Umbraco.Web/Security/Identity/AppBuilderExtensions.cs +++ b/src/Umbraco.Web/Security/Identity/AppBuilderExtensions.cs @@ -45,7 +45,7 @@ namespace Umbraco.Web.Security.Identity services.MemberTypeService, services.ExternalLoginService, userMembershipProvider)); - + app.SetBackOfficeUserManagerType(); //Create a sign in manager per request @@ -201,21 +201,21 @@ namespace Umbraco.Web.Security.Identity /// /// This is required because a developer can specify a custom user manager and due to generic types the key name will registered /// differently in the owin context - /// + /// private static void SetBackOfficeUserManagerType(this IAppBuilder app) where TManager : BackOfficeUserManager where TUser : BackOfficeIdentityUser { if (_markerSet) throw new InvalidOperationException("The back office user manager marker has already been set, only one back office user manager can be configured"); - //on each request set the user manager getter - + //on each request set the user manager getter - // this is required purely because Microsoft.Owin.IOwinContext is super inflexible with it's Get since it can only be // a generic strongly typed instance app.Use((context, func) => { context.Set(BackOfficeUserManager.OwinMarkerKey, new BackOfficeUserManagerMarker()); return func(); - }); + }); } private static void UseUmbracoBackOfficeCookieAuthenticationInternal(this IAppBuilder app, CookieAuthenticationOptions options, IRuntimeState runtimeState, PipelineStage stage) @@ -351,4 +351,4 @@ namespace Umbraco.Web.Security.Identity return authOptions; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Security/Identity/AuthenticationManagerExtensions.cs b/src/Umbraco.Web/Security/Identity/AuthenticationManagerExtensions.cs index 0acd002d42..4dfa5a7f5b 100644 --- a/src/Umbraco.Web/Security/Identity/AuthenticationManagerExtensions.cs +++ b/src/Umbraco.Web/Security/Identity/AuthenticationManagerExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Security.Claims; using System.Threading.Tasks; using Microsoft.AspNet.Identity; @@ -83,4 +83,4 @@ namespace Umbraco.Web.Security.Identity return GetExternalLoginInfo(await manager.AuthenticateAsync(authenticationType)); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Security/Identity/AuthenticationOptionsExtensions.cs b/src/Umbraco.Web/Security/Identity/AuthenticationOptionsExtensions.cs index dd04ce7392..08e367eeeb 100644 --- a/src/Umbraco.Web/Security/Identity/AuthenticationOptionsExtensions.cs +++ b/src/Umbraco.Web/Security/Identity/AuthenticationOptionsExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.Owin; using Microsoft.Owin.Security; using Umbraco.Core; @@ -23,10 +23,10 @@ namespace Umbraco.Web.Security.Identity public static void SetSignInChallengeResultCallback( this AuthenticationOptions authOptions, Func authProperties) - { + { authOptions.Description.Properties["ChallengeResultCallback"] = authProperties; } - + public static AuthenticationProperties GetSignInChallengeResult(this AuthenticationDescription authenticationDescription, IOwinContext ctx) { if (authenticationDescription.Properties.ContainsKey("ChallengeResultCallback") == false) return null; @@ -70,7 +70,7 @@ namespace Umbraco.Web.Security.Identity /// This is important if the identity provider is to be able to authenticate when upgrading Umbraco. We will try to extract this from /// any options passed in via reflection since none of the default OWIN providers inherit from a base class but so far all of them have a consistent /// name for the 'CallbackPath' property which is of type PathString. So we'll try to extract it if it's not found or supplied. - /// + /// /// If a value is extracted or supplied, this will be added to an internal list which the UmbracoModule will use to allow the request to pass /// through without redirecting to the installer. /// @@ -81,7 +81,7 @@ namespace Umbraco.Web.Security.Identity //Ensure the prefix is set if (options.AuthenticationType.StartsWith(Constants.Security.BackOfficeExternalAuthenticationTypePrefix) == false) { - options.AuthenticationType = Constants.Security.BackOfficeExternalAuthenticationTypePrefix + options.AuthenticationType; + options.AuthenticationType = Constants.Security.BackOfficeExternalAuthenticationTypePrefix + options.AuthenticationType; } options.Description.Properties["SocialStyle"] = style; @@ -117,4 +117,4 @@ namespace Umbraco.Web.Security.Identity } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Security/Identity/BackOfficeCookieManager.cs b/src/Umbraco.Web/Security/Identity/BackOfficeCookieManager.cs index b447007f56..e8c2ade640 100644 --- a/src/Umbraco.Web/Security/Identity/BackOfficeCookieManager.cs +++ b/src/Umbraco.Web/Security/Identity/BackOfficeCookieManager.cs @@ -13,7 +13,7 @@ namespace Umbraco.Web.Security.Identity /// A custom cookie manager that is used to read the cookie from the request. ///
/// - /// Umbraco's back office cookie needs to be read on two paths: /umbraco and /install and /base therefore we cannot just set the cookie path to be /umbraco, + /// Umbraco's back office cookie needs to be read on two paths: /umbraco and /install and /base therefore we cannot just set the cookie path to be /umbraco, /// instead we'll specify our own cookie manager and return null if the request isn't for an acceptable path. /// internal class BackOfficeCookieManager : ChunkingCookieManager, ICookieManager @@ -47,12 +47,12 @@ namespace Umbraco.Web.Security.Identity { return null; } - + return ShouldAuthenticateRequest( - context, - _umbracoContextAccessor.UmbracoContext.OriginalRequestUrl) == false + context, + _umbracoContextAccessor.UmbracoContext.OriginalRequestUrl) == false //Don't auth request, don't return a cookie - ? null + ? null //Return the default implementation : GetRequestCookie(context, key); } @@ -84,23 +84,23 @@ namespace Umbraco.Web.Security.Identity var request = owinContext.Request; var httpContext = owinContext.TryGetHttpContext(); - + //check the explicit paths if (_explicitPaths != null) { return _explicitPaths.Any(x => x.InvariantEquals(request.Uri.AbsolutePath)); } - + //check user seconds path if (request.Uri.AbsolutePath.InvariantEquals(_getRemainingSecondsPath)) return false; if (//check the explicit flag (checkForceAuthTokens && owinContext.Get("umbraco-force-auth") != null) - || (checkForceAuthTokens && httpContext.Success && httpContext.Result.Items["umbraco-force-auth"] != null) + || (checkForceAuthTokens && httpContext.Success && httpContext.Result.Items["umbraco-force-auth"] != null) //check back office || request.Uri.IsBackOfficeRequest(HttpRuntime.AppDomainAppVirtualPath) //check installer - || request.Uri.IsInstallerRequest()) + || request.Uri.IsInstallerRequest()) { return true; } @@ -108,4 +108,4 @@ namespace Umbraco.Web.Security.Identity } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Security/Identity/ExternalSignInAutoLinkOptions.cs b/src/Umbraco.Web/Security/Identity/ExternalSignInAutoLinkOptions.cs index 32dd13c209..59fbc1aacc 100644 --- a/src/Umbraco.Web/Security/Identity/ExternalSignInAutoLinkOptions.cs +++ b/src/Umbraco.Web/Security/Identity/ExternalSignInAutoLinkOptions.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.AspNet.Identity.Owin; using Microsoft.Owin; using Umbraco.Core; @@ -15,8 +15,8 @@ namespace Umbraco.Web.Security.Identity { public ExternalSignInAutoLinkOptions( bool autoLinkExternalAccount = false, - string defaultUserType = "editor", - string[] defaultAllowedSections = null, + string defaultUserType = "editor", + string[] defaultAllowedSections = null, string defaultCulture = null) { if (string.IsNullOrEmpty(defaultUserType)) throw new ArgumentNullOrEmptyException(nameof(defaultUserType)); @@ -57,16 +57,16 @@ namespace Umbraco.Web.Security.Identity /// /// For private external auth providers such as Active Directory, which when set to true will automatically /// create a local user if the external provider login was successful. - /// + /// /// For public auth providers this should always be false!!! /// public bool ShouldAutoLinkExternalAccount(UmbracoContext umbracoContext, ExternalLoginInfo loginInfo) { return _autoLinkExternalAccount; } - + private readonly string _defaultCulture; - + /// /// The default Culture to use for auto-linking users /// @@ -75,4 +75,4 @@ namespace Umbraco.Web.Security.Identity return _defaultCulture; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Security/Identity/FixWindowsAuthMiddlware.cs b/src/Umbraco.Web/Security/Identity/FixWindowsAuthMiddlware.cs index 911a304019..aea1b14ecd 100644 --- a/src/Umbraco.Web/Security/Identity/FixWindowsAuthMiddlware.cs +++ b/src/Umbraco.Web/Security/Identity/FixWindowsAuthMiddlware.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; using System.Security.Claims; using System.Security.Principal; using System.Threading.Tasks; @@ -14,7 +14,7 @@ namespace Umbraco.Web.Security.Identity /// handler and now two identities have been assigned. Unfortunately, at some stage in the pipeline - I'm pretty sure /// it's the Role Provider Module - it again changes the user's Principal to a RolePrincipal and discards the second /// Identity which is the Back office identity thus preventing a user from accessing the back office... it's very annoying. - /// + /// /// To fix this, we re-set the user Principal to only have a single identity: the back office one, since we know this is /// for a back office request. /// @@ -48,4 +48,4 @@ namespace Umbraco.Web.Security.Identity } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Security/Identity/ForceRenewalCookieAuthenticationHandler.cs b/src/Umbraco.Web/Security/Identity/ForceRenewalCookieAuthenticationHandler.cs index c1026de7df..e52e21e4b9 100644 --- a/src/Umbraco.Web/Security/Identity/ForceRenewalCookieAuthenticationHandler.cs +++ b/src/Umbraco.Web/Security/Identity/ForceRenewalCookieAuthenticationHandler.cs @@ -1,4 +1,4 @@ -using System; +using System; using Umbraco.Core; using System.Threading.Tasks; using Microsoft.Owin; @@ -72,7 +72,7 @@ namespace Umbraco.Web.Security.Identity var httpCtx = Context.TryGetHttpContext(); //check for the special flag in either the owin or http context var shouldRenew = Context.Get("umbraco-force-auth") != null || (httpCtx.Success && httpCtx.Result.Items["umbraco-force-auth"] != null); - + if (shouldRenew) { var signin = Helper.LookupSignIn(Options.AuthenticationType); @@ -107,16 +107,16 @@ namespace Umbraco.Web.Security.Identity //now save back all the required cookie details var cookieValue = Options.TicketDataFormat.Protect(ticket); - var cookieOptions = ((UmbracoBackOfficeCookieAuthOptions)Options).CreateRequestCookieOptions(Context, ticket); + var cookieOptions = ((UmbracoBackOfficeCookieAuthOptions)Options).CreateRequestCookieOptions(Context, ticket); Options.CookieManager.AppendResponseCookie( Context, Options.CookieName, cookieValue, cookieOptions); - } + } + - } } } @@ -125,4 +125,4 @@ namespace Umbraco.Web.Security.Identity return Task.FromResult(0); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Security/Identity/ForceRenewalCookieAuthenticationMiddleware.cs b/src/Umbraco.Web/Security/Identity/ForceRenewalCookieAuthenticationMiddleware.cs index 77a7a335f0..02d27eccbb 100644 --- a/src/Umbraco.Web/Security/Identity/ForceRenewalCookieAuthenticationMiddleware.cs +++ b/src/Umbraco.Web/Security/Identity/ForceRenewalCookieAuthenticationMiddleware.cs @@ -1,4 +1,4 @@ -using Microsoft.Owin; +using Microsoft.Owin; using Microsoft.Owin.Security.Cookies; using Microsoft.Owin.Security.Infrastructure; using Owin; @@ -13,8 +13,8 @@ namespace Umbraco.Web.Security.Identity private readonly IUmbracoContextAccessor _umbracoContextAccessor; public ForceRenewalCookieAuthenticationMiddleware( - OwinMiddleware next, - IAppBuilder app, + OwinMiddleware next, + IAppBuilder app, UmbracoBackOfficeCookieAuthOptions options, IUmbracoContextAccessor umbracoContextAccessor) : base(next, app, options) { @@ -26,4 +26,4 @@ namespace Umbraco.Web.Security.Identity return new ForceRenewalCookieAuthenticationHandler(_umbracoContextAccessor); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Security/Identity/FormsAuthenticationSecureDataFormat.cs b/src/Umbraco.Web/Security/Identity/FormsAuthenticationSecureDataFormat.cs index 77e0fe9faf..5000528a1b 100644 --- a/src/Umbraco.Web/Security/Identity/FormsAuthenticationSecureDataFormat.cs +++ b/src/Umbraco.Web/Security/Identity/FormsAuthenticationSecureDataFormat.cs @@ -27,15 +27,15 @@ namespace Umbraco.Web.Security.Identity { var backofficeIdentity = (UmbracoBackOfficeIdentity)data.Identity; var userDataString = JsonConvert.SerializeObject(backofficeIdentity.UserData); - + var ticket = new FormsAuthenticationTicket( 5, data.Identity.Name, - data.Properties.IssuedUtc.HasValue - ? data.Properties.IssuedUtc.Value.LocalDateTime + data.Properties.IssuedUtc.HasValue + ? data.Properties.IssuedUtc.Value.LocalDateTime : DateTime.Now, - data.Properties.ExpiresUtc.HasValue - ? data.Properties.ExpiresUtc.Value.LocalDateTime + data.Properties.ExpiresUtc.HasValue + ? data.Properties.ExpiresUtc.Value.LocalDateTime : DateTime.Now.AddMinutes(_loginTimeoutMinutes), data.Properties.IsPersistent, userDataString, @@ -76,4 +76,4 @@ namespace Umbraco.Web.Security.Identity return ticket; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Security/Identity/GetUserSecondsMiddleWare.cs b/src/Umbraco.Web/Security/Identity/GetUserSecondsMiddleWare.cs index 8ec49c4681..68a356fa82 100644 --- a/src/Umbraco.Web/Security/Identity/GetUserSecondsMiddleWare.cs +++ b/src/Umbraco.Web/Security/Identity/GetUserSecondsMiddleWare.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics; using System.Globalization; using System.Threading.Tasks; @@ -43,7 +43,7 @@ namespace Umbraco.Web.Security.Identity { var request = context.Request; var response = context.Response; - + if (request.Uri.Scheme.InvariantStartsWith("http") && request.Uri.AbsolutePath.InvariantEquals( string.Format("{0}/backoffice/UmbracoApi/Authentication/GetRemainingTimeoutSeconds", GlobalSettings.Path))) @@ -65,7 +65,7 @@ namespace Umbraco.Web.Security.Identity response.Headers.Add("Expires", new[] { "-1" }); response.Headers.Add("Date", new[] { _authOptions.SystemClock.UtcNow.ToString("R") }); - //Ok, so here we need to check if we want to process/renew the auth ticket for each + //Ok, so here we need to check if we want to process/renew the auth ticket for each // of these requests. If that is the case, the user will really never be logged out until they // close their browser (there will be edge cases of that, especially when debugging) if (_security.KeepUserLoggedIn) @@ -98,7 +98,7 @@ namespace Umbraco.Web.Security.Identity remainingSeconds = (ticket.Properties.ExpiresUtc.Value - currentUtc).TotalSeconds; } - } + } } else if (remainingSeconds <= 30) { @@ -122,4 +122,4 @@ namespace Umbraco.Web.Security.Identity } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Security/Identity/IUmbracoBackOfficeTwoFactorOptions.cs b/src/Umbraco.Web/Security/Identity/IUmbracoBackOfficeTwoFactorOptions.cs index 54d1d6bdce..8a1ffc4614 100644 --- a/src/Umbraco.Web/Security/Identity/IUmbracoBackOfficeTwoFactorOptions.cs +++ b/src/Umbraco.Web/Security/Identity/IUmbracoBackOfficeTwoFactorOptions.cs @@ -1,4 +1,4 @@ -using Microsoft.Owin; +using Microsoft.Owin; namespace Umbraco.Web.Security.Identity { @@ -9,4 +9,4 @@ namespace Umbraco.Web.Security.Identity { string GetTwoFactorView(IOwinContext owinContext, UmbracoContext umbracoContext, string username); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Security/Identity/PreviewAuthenticationMiddleware.cs b/src/Umbraco.Web/Security/Identity/PreviewAuthenticationMiddleware.cs index 7ab071ecea..bd92c44590 100644 --- a/src/Umbraco.Web/Security/Identity/PreviewAuthenticationMiddleware.cs +++ b/src/Umbraco.Web/Security/Identity/PreviewAuthenticationMiddleware.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Globalization; using System.IO; @@ -50,7 +50,7 @@ namespace Umbraco.Web.Security.Identity if (request.Uri.IsClientSideRequest() == false) { var claimsPrincipal = context.Request.User as ClaimsPrincipal; - var isPreview = request.HasPreviewCookie() + var isPreview = request.HasPreviewCookie() && claimsPrincipal != null && request.Uri != null && request.Uri.IsBackOfficeRequest(HttpRuntime.AppDomainAppVirtualPath) == false; @@ -62,13 +62,13 @@ namespace Umbraco.Web.Security.Identity var cookie = request.Cookies[_cookieOptions.CookieName]; if (cookie.IsNullOrWhiteSpace() == false) - { + { var unprotected = _cookieOptions.TicketDataFormat.Unprotect(cookie); if (unprotected != null) { - //Ok, we've got a real ticket, now we can add this ticket's identity to the current - // Principal, this means we'll have 2 identities assigned to the principal which we can - // use to authorize the preview and allow for a back office User. + //Ok, we've got a real ticket, now we can add this ticket's identity to the current + // Principal, this means we'll have 2 identities assigned to the principal which we can + // use to authorize the preview and allow for a back office User. claimsPrincipal.AddIdentity(UmbracoBackOfficeIdentity.FromClaimsIdentity(unprotected.Identity)); } } @@ -81,4 +81,4 @@ namespace Umbraco.Web.Security.Identity } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Security/Identity/UmbracoBackOfficeCookieAuthOptions.cs b/src/Umbraco.Web/Security/Identity/UmbracoBackOfficeCookieAuthOptions.cs index 6537159915..714337fb2d 100644 --- a/src/Umbraco.Web/Security/Identity/UmbracoBackOfficeCookieAuthOptions.cs +++ b/src/Umbraco.Web/Security/Identity/UmbracoBackOfficeCookieAuthOptions.cs @@ -18,15 +18,15 @@ namespace Umbraco.Web.Security.Identity public UmbracoBackOfficeCookieAuthOptions() : this(UmbracoConfig.For.UmbracoSettings().Security, GlobalSettings.TimeOutInMinutes, GlobalSettings.UseSSL) - { + { } - + public UmbracoBackOfficeCookieAuthOptions( string[] explicitPaths, ISecuritySection securitySection, int loginTimeoutMinutes, bool forceSsl, - bool useLegacyFormsAuthDataFormat = true) + bool useLegacyFormsAuthDataFormat = true) { LoginTimeoutMinutes = loginTimeoutMinutes; AuthenticationType = Constants.Security.BackOfficeAuthenticationType; @@ -43,7 +43,7 @@ namespace Umbraco.Web.Security.Identity CookieName = securitySection.AuthCookieName; CookieHttpOnly = true; CookieSecure = forceSsl ? CookieSecureOption.Always : CookieSecureOption.SameAsRequest; - CookiePath = "/"; + CookiePath = "/"; //Custom cookie manager so we can filter requests CookieManager = new BackOfficeCookieManager(Current.UmbracoContextAccessor, Current.RuntimeState, explicitPaths); @@ -88,6 +88,6 @@ namespace Umbraco.Web.Security.Identity return cookieOptions; } - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Security/LegacyDefaultAppMapping.cs b/src/Umbraco.Web/Security/LegacyDefaultAppMapping.cs index 99d0b71f5b..54ed9aea33 100644 --- a/src/Umbraco.Web/Security/LegacyDefaultAppMapping.cs +++ b/src/Umbraco.Web/Security/LegacyDefaultAppMapping.cs @@ -7,15 +7,15 @@ using System.Text; namespace Umbraco.Web.Security { /// - /// This is used specifically to assign a default 'app' to a particular section in order to validate the + /// This is used specifically to assign a default 'app' to a particular section in order to validate the /// currently logged in user's allowed applications /// /// /// This relates to these issues: /// http://issues.umbraco.org/issue/U4-2021 /// http://issues.umbraco.org/issue/U4-529 - /// - /// In order to fix these issues we need to pass in an 'app' parameter but since we don't want to break compatibility + /// + /// In order to fix these issues we need to pass in an 'app' parameter but since we don't want to break compatibility /// we will create this mapping to map a 'default application' to a section action (like creating or deleting) /// public static class LegacyDefaultAppMapping @@ -24,7 +24,7 @@ namespace Umbraco.Web.Security /// Constructor that assigns all initial known mappings /// static LegacyDefaultAppMapping() - { + { } private static readonly ConcurrentDictionary NodeTypeAliasMapping = new ConcurrentDictionary(); diff --git a/src/Umbraco.Web/Security/OwinExtensions.cs b/src/Umbraco.Web/Security/OwinExtensions.cs index 8217dc7f6c..0df0c28cf6 100644 --- a/src/Umbraco.Web/Security/OwinExtensions.cs +++ b/src/Umbraco.Web/Security/OwinExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Web; using Microsoft.AspNet.Identity.Owin; using Microsoft.Owin; @@ -10,7 +10,7 @@ using Umbraco.Web.Security.Identity; namespace Umbraco.Web.Security { internal static class OwinExtensions - { + { /// /// Nasty little hack to get httpcontextbase from an owin context @@ -24,4 +24,4 @@ namespace Umbraco.Web.Security } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Security/Providers/MembersMembershipProvider.cs b/src/Umbraco.Web/Security/Providers/MembersMembershipProvider.cs index 9854e9e94a..5d6723260a 100644 --- a/src/Umbraco.Web/Security/Providers/MembersMembershipProvider.cs +++ b/src/Umbraco.Web/Security/Providers/MembersMembershipProvider.cs @@ -17,7 +17,7 @@ using Umbraco.Web.Composing; namespace Umbraco.Web.Security.Providers { /// - /// Custom Membership Provider for Umbraco Members (User authentication for Frontend applications NOT umbraco CMS) + /// Custom Membership Provider for Umbraco Members (User authentication for Frontend applications NOT umbraco CMS) /// public class MembersMembershipProvider : UmbracoMembershipProvider, IUmbracoMemberTypeMembershipProvider { @@ -51,7 +51,7 @@ namespace Umbraco.Web.Security.Providers { get { return "MembersMembershipProvider"; } } - + protected override MembershipUser ConvertToMembershipUser(IMember entity) { return entity.AsConcreteMembershipUser(Name, _providerKeyAsGuid); diff --git a/src/Umbraco.Web/Security/Providers/MembersRoleProvider.cs b/src/Umbraco.Web/Security/Providers/MembersRoleProvider.cs index 1173e2b249..89507a6c5b 100644 --- a/src/Umbraco.Web/Security/Providers/MembersRoleProvider.cs +++ b/src/Umbraco.Web/Security/Providers/MembersRoleProvider.cs @@ -1,4 +1,4 @@ -using System.Collections.Specialized; +using System.Collections.Specialized; using System.Configuration.Provider; using System.Linq; using System.Web.Security; @@ -21,11 +21,11 @@ namespace Umbraco.Web.Security.Providers public MembersRoleProvider() : this(Current.Services.MemberService) - { + { } private string _applicationName; - + public override bool IsUserInRole(string username, string roleName) { return GetRolesForUser(username).Any(x => x == roleName); @@ -99,4 +99,4 @@ namespace Umbraco.Web.Security.Providers } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Security/Providers/UmbracoMembershipProvider.cs b/src/Umbraco.Web/Security/Providers/UmbracoMembershipProvider.cs index bd5aff997b..21433b2542 100644 --- a/src/Umbraco.Web/Security/Providers/UmbracoMembershipProvider.cs +++ b/src/Umbraco.Web/Security/Providers/UmbracoMembershipProvider.cs @@ -16,7 +16,7 @@ using Umbraco.Web.Composing; namespace Umbraco.Web.Security.Providers { - + /// /// Abstract Membership Provider that users any implementation of IMembershipMemberService{TEntity} service @@ -27,7 +27,7 @@ namespace Umbraco.Web.Security.Providers { protected IMembershipMemberService MemberService { get; private set; } - + protected UmbracoMembershipProvider(IMembershipMemberService memberService) { MemberService = memberService; @@ -53,10 +53,10 @@ namespace Umbraco.Web.Security.Providers /// The friendly name of the provider. /// A collection of the name/value pairs representing the provider-specific attributes specified in the configuration for this provider. /// The name of the provider is null. - /// An attempt is made to call - /// on a provider after the provider + /// An attempt is made to call + /// on a provider after the provider /// has already been initialized. - /// The name of the provider has a length of zero. + /// The name of the provider has a length of zero. public override void Initialize(string name, NameValueCollection config) { if (config == null) {throw new ArgumentNullException("config");} @@ -80,14 +80,14 @@ namespace Umbraco.Web.Security.Providers /// protected override bool PerformChangePassword(string username, string oldPassword, string newPassword) { - //NOTE: due to backwards compatibilty reasons (and UX reasons), this provider doesn't care about the old password and + //NOTE: due to backwards compatibilty reasons (and UX reasons), this provider doesn't care about the old password and // allows simply setting the password manually so we don't really care about the old password. // This is allowed based on the overridden AllowManuallyChangingPassword option. // in order to support updating passwords from the umbraco core, we can't validate the old password var m = MemberService.GetByUsername(username); if (m == null) return false; - + string salt; var encodedPassword = EncryptOrHashNewPassword(newPassword, out salt); @@ -140,7 +140,7 @@ namespace Umbraco.Web.Security.Providers /// /// A object populated with the information for the newly created user. /// - protected override MembershipUser PerformCreateUser(string memberTypeAlias, string username, string password, string email, string passwordQuestion, + protected override MembershipUser PerformCreateUser(string memberTypeAlias, string username, string password, string email, string passwordQuestion, string passwordAnswer, bool isApproved, object providerUserKey, out MembershipCreateStatus status) { // See if the user already exists @@ -165,10 +165,10 @@ namespace Umbraco.Web.Security.Providers var member = MemberService.CreateWithIdentity( username, - email, - FormatPasswordForStorage(encodedPassword, salt), + email, + FormatPasswordForStorage(encodedPassword, salt), memberTypeAlias); - + member.PasswordQuestion = passwordQuestion; member.RawPasswordAnswerValue = EncryptString(passwordAnswer); member.IsApproved = isApproved; @@ -215,7 +215,7 @@ namespace Umbraco.Web.Security.Providers long totalRecords2; var byEmail = MemberService.FindByEmail(emailToMatch, pageIndex, pageSize, out totalRecords2, StringPropertyMatchType.Wildcard).ToArray(); totalRecords = Convert.ToInt32(totalRecords2); - + var collection = new MembershipUserCollection(); foreach (var m in byEmail) { @@ -264,7 +264,7 @@ namespace Umbraco.Web.Security.Providers long totalRecords2; var pagedMembers = MemberService.GetAll(pageIndex, pageSize, out totalRecords2); totalRecords = Convert.ToInt32(totalRecords2); - + foreach (var m in pagedMembers) { membersList.Add(ConvertToMembershipUser(m)); @@ -276,7 +276,7 @@ namespace Umbraco.Web.Security.Providers /// Gets the number of users currently accessing the application. /// /// - /// The number of users currently accessing the application. + /// The number of users currently accessing the application. /// /// /// The way this is done is the same way that it is done in the MS SqlMembershipProvider - We query for any members @@ -297,7 +297,7 @@ namespace Umbraco.Web.Security.Providers /// The password for the specified user name. /// protected override string PerformGetPassword(string username, string answer) - { + { var m = MemberService.GetByUsername(username); if (m == null) { @@ -420,7 +420,7 @@ namespace Umbraco.Web.Security.Providers // throw new ProviderException("Password answer required for password reset."); //} - + var m = MemberService.GetByUsername(username); if (m == null) { @@ -444,7 +444,7 @@ namespace Umbraco.Web.Security.Providers m.RawPasswordValue = FormatPasswordForStorage(encodedPassword, salt); m.LastPasswordChangeDate = DateTime.Now; MemberService.Save(m); - + return generatedPassword; } @@ -462,7 +462,7 @@ namespace Umbraco.Web.Security.Providers if (member == null) { throw new ProviderException(string.Format("No member with the username '{0}' found", username)); - } + } // Non need to update if (member.IsLockedOut == false) return true; @@ -478,7 +478,7 @@ namespace Umbraco.Web.Security.Providers /// /// Updates e-mail approved status, lock status and comment on a user. /// - /// A object that represents the user to update and the updated information for the user. + /// A object that represents the user to update and the updated information for the user. public override void UpdateUser(MembershipUser user) { var m = MemberService.GetByUsername(user.UserName); @@ -498,7 +498,7 @@ namespace Umbraco.Web.Security.Providers } } m.Email = user.Email; - + m.IsApproved = user.IsApproved; m.IsLockedOut = user.IsLockedOut; if (user.IsLockedOut) @@ -611,7 +611,7 @@ namespace Umbraco.Web.Security.Providers - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Security/Providers/UsersMembershipProvider.cs b/src/Umbraco.Web/Security/Providers/UsersMembershipProvider.cs index 6aa9080d6a..b7677a7225 100644 --- a/src/Umbraco.Web/Security/Providers/UsersMembershipProvider.cs +++ b/src/Umbraco.Web/Security/Providers/UsersMembershipProvider.cs @@ -13,7 +13,7 @@ using Umbraco.Web.Composing; namespace Umbraco.Web.Security.Providers { /// - /// Custom Membership Provider for Umbraco Users (User authentication for Umbraco Backend CMS) + /// Custom Membership Provider for Umbraco Users (User authentication for Umbraco Backend CMS) /// public class UsersMembershipProvider : UmbracoMembershipProvider, IUsersMembershipProvider { @@ -84,4 +84,4 @@ namespace Umbraco.Web.Security.Providers } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Security/ValidateRequestAttempt.cs b/src/Umbraco.Web/Security/ValidateRequestAttempt.cs index 62fd68a2ef..475ba93576 100644 --- a/src/Umbraco.Web/Security/ValidateRequestAttempt.cs +++ b/src/Umbraco.Web/Security/ValidateRequestAttempt.cs @@ -5,9 +5,9 @@ Success, FailedNoPrivileges, - //FailedTimedOut, + //FailedTimedOut, FailedNoContextId, FailedNoSsl } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Security/WebAuthExtensions.cs b/src/Umbraco.Web/Security/WebAuthExtensions.cs index 52963d1852..138dd36b67 100644 --- a/src/Umbraco.Web/Security/WebAuthExtensions.cs +++ b/src/Umbraco.Web/Security/WebAuthExtensions.cs @@ -1,4 +1,4 @@ -using System.Net.Http; +using System.Net.Http; using System.Security.Claims; using System.Security.Principal; using System.ServiceModel.Channels; @@ -27,7 +27,7 @@ namespace Umbraco.Web.Security Mapper.Map(user))); //It is actually not good enough to set this on the current app Context and the thread, it also needs - // to be set explicitly on the HttpContext.Current !! This is a strange web api thing that is actually + // to be set explicitly on the HttpContext.Current !! This is a strange web api thing that is actually // an underlying fault of asp.net not propogating the User correctly. if (HttpContext.Current != null) { @@ -60,7 +60,7 @@ namespace Umbraco.Web.Security userData)); //It is actually not good enough to set this on the current app Context and the thread, it also needs - // to be set explicitly on the HttpContext.Current !! This is a strange web api thing that is actually + // to be set explicitly on the HttpContext.Current !! This is a strange web api thing that is actually // an underlying fault of asp.net not propogating the User correctly. if (HttpContext.Current != null) { @@ -71,4 +71,4 @@ namespace Umbraco.Web.Security return principal; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Security/WebSecurity.cs b/src/Umbraco.Web/Security/WebSecurity.cs index d2d6246d5f..505ec33a73 100644 --- a/src/Umbraco.Web/Security/WebSecurity.cs +++ b/src/Umbraco.Web/Security/WebSecurity.cs @@ -192,7 +192,7 @@ namespace Umbraco.Web.Security /// /// /// This will return an instance no matter what membership provider is installed for the back office, it will automatically - /// create any missing accounts if one is not found and a custom membership provider or is being used. + /// create any missing accounts if one is not found and a custom membership provider or is being used. /// internal IUser GetBackOfficeUser(string username) { diff --git a/src/Umbraco.Web/SignalR/IPreviewHub.cs b/src/Umbraco.Web/SignalR/IPreviewHub.cs index 010fd39651..2eb722c40d 100644 --- a/src/Umbraco.Web/SignalR/IPreviewHub.cs +++ b/src/Umbraco.Web/SignalR/IPreviewHub.cs @@ -9,4 +9,4 @@ // ReSharper restore InconsistentNaming } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/SignalR/PreviewHubComponent.cs b/src/Umbraco.Web/SignalR/PreviewHubComponent.cs index 2fac27a592..07467d3bfa 100644 --- a/src/Umbraco.Web/SignalR/PreviewHubComponent.cs +++ b/src/Umbraco.Web/SignalR/PreviewHubComponent.cs @@ -44,4 +44,4 @@ namespace Umbraco.Web.SignalR }; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Strategies/Migrations/ClearCsrfCookiesAfterUpgrade.cs b/src/Umbraco.Web/Strategies/Migrations/ClearCsrfCookiesAfterUpgrade.cs index 27ede520fa..a390652232 100644 --- a/src/Umbraco.Web/Strategies/Migrations/ClearCsrfCookiesAfterUpgrade.cs +++ b/src/Umbraco.Web/Strategies/Migrations/ClearCsrfCookiesAfterUpgrade.cs @@ -22,4 +22,4 @@ namespace Umbraco.Web.Strategies.Migrations http.ExpireCookie(AngularAntiForgeryHelper.CsrfValidationCookieName); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Strategies/Migrations/ClearMediaXmlCacheForDeletedItemsAfterUpgrade.cs b/src/Umbraco.Web/Strategies/Migrations/ClearMediaXmlCacheForDeletedItemsAfterUpgrade.cs index 578fc61750..88591b5983 100644 --- a/src/Umbraco.Web/Strategies/Migrations/ClearMediaXmlCacheForDeletedItemsAfterUpgrade.cs +++ b/src/Umbraco.Web/Strategies/Migrations/ClearMediaXmlCacheForDeletedItemsAfterUpgrade.cs @@ -48,4 +48,4 @@ namespace Umbraco.Web.Strategies.Migrations } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Strategies/Migrations/EnsureListViewDataTypeIsCreated.cs b/src/Umbraco.Web/Strategies/Migrations/EnsureListViewDataTypeIsCreated.cs index a4fef951a0..a11c794844 100644 --- a/src/Umbraco.Web/Strategies/Migrations/EnsureListViewDataTypeIsCreated.cs +++ b/src/Umbraco.Web/Strategies/Migrations/EnsureListViewDataTypeIsCreated.cs @@ -102,4 +102,4 @@ namespace Umbraco.Web.Strategies.Migrations } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Strategies/Migrations/IPostMigration.cs b/src/Umbraco.Web/Strategies/Migrations/IPostMigration.cs index 16e3a6e22b..912fe9f0b1 100644 --- a/src/Umbraco.Web/Strategies/Migrations/IPostMigration.cs +++ b/src/Umbraco.Web/Strategies/Migrations/IPostMigration.cs @@ -7,4 +7,4 @@ namespace Umbraco.Web.Strategies.Migrations { void Migrated(MigrationRunner runner, MigrationEventArgs args); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Strategies/Migrations/PostMigrationCollection.cs b/src/Umbraco.Web/Strategies/Migrations/PostMigrationCollection.cs index c17e8f84e3..6ad883a3f8 100644 --- a/src/Umbraco.Web/Strategies/Migrations/PostMigrationCollection.cs +++ b/src/Umbraco.Web/Strategies/Migrations/PostMigrationCollection.cs @@ -5,8 +5,8 @@ namespace Umbraco.Web.Strategies.Migrations { public class PostMigrationCollection : BuilderCollectionBase { - public PostMigrationCollection(IEnumerable items) + public PostMigrationCollection(IEnumerable items) : base(items) { } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Strategies/Migrations/PostMigrationCollectionBuilder.cs b/src/Umbraco.Web/Strategies/Migrations/PostMigrationCollectionBuilder.cs index fef5bd338b..a450de70a2 100644 --- a/src/Umbraco.Web/Strategies/Migrations/PostMigrationCollectionBuilder.cs +++ b/src/Umbraco.Web/Strategies/Migrations/PostMigrationCollectionBuilder.cs @@ -5,7 +5,7 @@ namespace Umbraco.Web.Strategies.Migrations { public class PostMigrationCollectionBuilder : LazyCollectionBuilderBase { - public PostMigrationCollectionBuilder(IServiceContainer container) + public PostMigrationCollectionBuilder(IServiceContainer container) : base(container) { } @@ -13,4 +13,4 @@ namespace Umbraco.Web.Strategies.Migrations protected override ILifetime CollectionLifetime => null; // transient } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Strategies/Migrations/PostMigrationComponent.cs b/src/Umbraco.Web/Strategies/Migrations/PostMigrationComponent.cs index 9bd2a24130..1d15ce26fc 100644 --- a/src/Umbraco.Web/Strategies/Migrations/PostMigrationComponent.cs +++ b/src/Umbraco.Web/Strategies/Migrations/PostMigrationComponent.cs @@ -31,4 +31,4 @@ namespace Umbraco.Web.Strategies.Migrations internal static PostMigrationCollectionBuilder PostMigrations(this Composition composition) => composition.Container.GetInstance(); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Strategies/Migrations/PublishAfterUpgradeToVersionSixth.cs b/src/Umbraco.Web/Strategies/Migrations/PublishAfterUpgradeToVersionSixth.cs index 323a765d21..364d088ac9 100644 --- a/src/Umbraco.Web/Strategies/Migrations/PublishAfterUpgradeToVersionSixth.cs +++ b/src/Umbraco.Web/Strategies/Migrations/PublishAfterUpgradeToVersionSixth.cs @@ -73,4 +73,4 @@ namespace Umbraco.Web.Strategies.Migrations } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Strategies/Migrations/RebuildXmlCachesAfterUpgrade.cs b/src/Umbraco.Web/Strategies/Migrations/RebuildXmlCachesAfterUpgrade.cs index 3461fc34df..fcc7d1f792 100644 --- a/src/Umbraco.Web/Strategies/Migrations/RebuildXmlCachesAfterUpgrade.cs +++ b/src/Umbraco.Web/Strategies/Migrations/RebuildXmlCachesAfterUpgrade.cs @@ -55,4 +55,4 @@ namespace Umbraco.Web.Strategies.Migrations } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Strategies/NotificationsComponent.cs b/src/Umbraco.Web/Strategies/NotificationsComponent.cs index 322e0db355..1391c76107 100644 --- a/src/Umbraco.Web/Strategies/NotificationsComponent.cs +++ b/src/Umbraco.Web/Strategies/NotificationsComponent.cs @@ -48,7 +48,7 @@ namespace Umbraco.Web.Strategies //Send notifications for the delete action ContentService.Deleted += (sender, args) => args.DeletedEntities.ForEach(content => notificationService.SendNotification(content, ActionDelete.Instance)); - + //Send notifications for the unpublish action ContentService.UnPublished += (sender, args) => args.PublishedEntities.ForEach(content => notificationService.SendNotification(content, ActionUnPublish.Instance)); diff --git a/src/Umbraco.Web/Strategies/PublicAccessComponent.cs b/src/Umbraco.Web/Strategies/PublicAccessComponent.cs index a251009165..b21831306b 100644 --- a/src/Umbraco.Web/Strategies/PublicAccessComponent.cs +++ b/src/Umbraco.Web/Strategies/PublicAccessComponent.cs @@ -21,7 +21,7 @@ namespace Umbraco.Web.Strategies foreach (var grp in e.SavedEntities) { //check if the name has changed - if (grp.AdditionalData.ContainsKey("previousName") + if (grp.AdditionalData.ContainsKey("previousName") && grp.AdditionalData["previousName"] != null && grp.AdditionalData["previousName"].ToString().IsNullOrWhiteSpace() == false && grp.AdditionalData["previousName"].ToString() != grp.Name) diff --git a/src/Umbraco.Web/TagQuery.cs b/src/Umbraco.Web/TagQuery.cs index 02e862003c..0b6ecda986 100644 --- a/src/Umbraco.Web/TagQuery.cs +++ b/src/Umbraco.Web/TagQuery.cs @@ -59,7 +59,7 @@ namespace Umbraco.Web _tagService = tagService; _contentQuery = contentQuery; } - + /// /// Returns all content that is tagged with the specified tag value and optional tag group /// @@ -215,4 +215,4 @@ namespace Umbraco.Web return Mapper.Map>(_tagService.GetTagsForEntity(contentId, tagGroup)); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Templates/TemplateRenderer.cs b/src/Umbraco.Web/Templates/TemplateRenderer.cs index 29c46b49ae..d601203992 100644 --- a/src/Umbraco.Web/Templates/TemplateRenderer.cs +++ b/src/Umbraco.Web/Templates/TemplateRenderer.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Globalization; using System.IO; using System.Linq; @@ -17,28 +17,28 @@ using Umbraco.Web.Composing; namespace Umbraco.Web.Templates { - /// - /// This is used purely for the RenderTemplate functionality in Umbraco - /// - /// - /// This allows you to render either an MVC or Webforms template based purely off of a node id and an optional alttemplate id as string output. - /// - internal class TemplateRenderer - { - private readonly IFileService _fileService = Current.Services.FileService; // fixme inject - private readonly UmbracoContext _umbracoContext; - private object _oldPageId; - private object _oldPageElements; - private PublishedContentRequest _oldPublishedContentRequest; - private object _oldAltTemplate; + /// + /// This is used purely for the RenderTemplate functionality in Umbraco + /// + /// + /// This allows you to render either an MVC or Webforms template based purely off of a node id and an optional alttemplate id as string output. + /// + internal class TemplateRenderer + { + private readonly IFileService _fileService = Current.Services.FileService; // fixme inject + private readonly UmbracoContext _umbracoContext; + private object _oldPageId; + private object _oldPageElements; + private PublishedContentRequest _oldPublishedContentRequest; + private object _oldAltTemplate; - public TemplateRenderer(UmbracoContext umbracoContext, int pageId, int? altTemplateId) - { - if (umbracoContext == null) throw new ArgumentNullException(nameof(umbracoContext)); - PageId = pageId; - AltTemplate = altTemplateId; - _umbracoContext = umbracoContext; - } + public TemplateRenderer(UmbracoContext umbracoContext, int pageId, int? altTemplateId) + { + if (umbracoContext == null) throw new ArgumentNullException(nameof(umbracoContext)); + PageId = pageId; + AltTemplate = altTemplateId; + _umbracoContext = umbracoContext; + } // todo - inject! private FacadeRouter FacadeRouter => Core.Composing.Current.Container.GetInstance(); @@ -49,28 +49,28 @@ namespace Umbraco.Web.Templates /// public int PageId { get; } - /// - /// Gets/sets the alt template to render if there is one - /// - public int? AltTemplate { get; } + /// + /// Gets/sets the alt template to render if there is one + /// + public int? AltTemplate { get; } - public void Render(StringWriter writer) - { - if (writer == null) throw new ArgumentNullException(nameof(writer)); + public void Render(StringWriter writer) + { + if (writer == null) throw new ArgumentNullException(nameof(writer)); - // instanciate a request a process - // important to use CleanedUmbracoUrl - lowercase path-only version of the current url, though this isn't going to matter - // terribly much for this implementation since we are just creating a doc content request to modify it's properties manually. + // instanciate a request a process + // important to use CleanedUmbracoUrl - lowercase path-only version of the current url, though this isn't going to matter + // terribly much for this implementation since we are just creating a doc content request to modify it's properties manually. // fixme - previously that would create an aengine... - var contentRequest = FacadeRouter.CreateRequest(_umbracoContext); + var contentRequest = FacadeRouter.CreateRequest(_umbracoContext); var doc = contentRequest.UmbracoContext.ContentCache.GetById(PageId); - if (doc == null) - { - writer.Write("", PageId); - return; - } + if (doc == null) + { + writer.Write("", PageId); + return; + } //in some cases the UmbracoContext will not have a PublishedContentRequest assigned to it if we are not in the //execution of a front-end rendered page. In this case set the culture to the default. @@ -78,39 +78,39 @@ namespace Umbraco.Web.Templates if (_umbracoContext.PublishedContentRequest == null) { var defaultLanguage = Current.Services.LocalizationService.GetAllLanguages().FirstOrDefault(); - contentRequest.Culture = defaultLanguage == null - ? CultureInfo.CurrentUICulture + contentRequest.Culture = defaultLanguage == null + ? CultureInfo.CurrentUICulture : defaultLanguage.CultureInfo; } else { - contentRequest.Culture = _umbracoContext.PublishedContentRequest.Culture; + contentRequest.Culture = _umbracoContext.PublishedContentRequest.Culture; } - - //set the doc that was found by id - contentRequest.PublishedContent = doc; - //set the template, either based on the AltTemplate found or the standard template of the doc - contentRequest.TemplateModel = UmbracoConfig.For.UmbracoSettings().WebRouting.DisableAlternativeTemplates || AltTemplate.HasValue == false + + //set the doc that was found by id + contentRequest.PublishedContent = doc; + //set the template, either based on the AltTemplate found or the standard template of the doc + contentRequest.TemplateModel = UmbracoConfig.For.UmbracoSettings().WebRouting.DisableAlternativeTemplates || AltTemplate.HasValue == false ? _fileService.GetTemplate(doc.TemplateId) : _fileService.GetTemplate(AltTemplate.Value); - //if there is not template then exit - if (contentRequest.HasTemplate == false) - { - if (AltTemplate.HasValue == false) - { - writer.Write("", doc.TemplateId); - } - else - { - writer.Write("", AltTemplate); - } - return; - } + //if there is not template then exit + if (contentRequest.HasTemplate == false) + { + if (AltTemplate.HasValue == false) + { + writer.Write("", doc.TemplateId); + } + else + { + writer.Write("", AltTemplate); + } + return; + } - //First, save all of the items locally that we know are used in the chain of execution, we'll need to restore these - //after this page has rendered. - SaveExistingItems(); + //First, save all of the items locally that we know are used in the chain of execution, we'll need to restore these + //after this page has rendered. + SaveExistingItems(); try { @@ -125,50 +125,50 @@ namespace Umbraco.Web.Templates //restore items on context objects to continuing rendering the parent template RestoreItems(); } - - } - private void ExecuteTemplateRendering(TextWriter sw, PublishedContentRequest contentRequest) - { - //NOTE: Before we used to build up the query strings here but this is not necessary because when we do a - // Server.Execute in the TemplateRenderer, we pass in a 'true' to 'preserveForm' which automatically preserves all current - // query strings so there's no need for this. HOWEVER, once we get MVC involved, we might have to do some fun things, - // though this will happen in the TemplateRenderer. + } - //var queryString = _umbracoContext.HttpContext.Request.QueryString.AllKeys - // .ToDictionary(key => key, key => context.Request.QueryString[key]); - - switch (contentRequest.RenderingEngine) - { - case RenderingEngine.Mvc: - var requestContext = new RequestContext(_umbracoContext.HttpContext, new RouteData() - { - Route = RouteTable.Routes["Umbraco_default"] - }); - var routeHandler = new RenderRouteHandler(_umbracoContext, ControllerBuilder.Current.GetControllerFactory()); - var routeDef = routeHandler.GetUmbracoRouteDefinition(requestContext, contentRequest); - var renderModel = new ContentModel(contentRequest.PublishedContent); - //manually add the action/controller, this is required by mvc - requestContext.RouteData.Values.Add("action", routeDef.ActionName); - requestContext.RouteData.Values.Add("controller", routeDef.ControllerName); - //add the rest of the required route data - routeHandler.SetupRouteDataForRequest(renderModel, requestContext, contentRequest); + private void ExecuteTemplateRendering(TextWriter sw, PublishedContentRequest contentRequest) + { + //NOTE: Before we used to build up the query strings here but this is not necessary because when we do a + // Server.Execute in the TemplateRenderer, we pass in a 'true' to 'preserveForm' which automatically preserves all current + // query strings so there's no need for this. HOWEVER, once we get MVC involved, we might have to do some fun things, + // though this will happen in the TemplateRenderer. + + //var queryString = _umbracoContext.HttpContext.Request.QueryString.AllKeys + // .ToDictionary(key => key, key => context.Request.QueryString[key]); + + switch (contentRequest.RenderingEngine) + { + case RenderingEngine.Mvc: + var requestContext = new RequestContext(_umbracoContext.HttpContext, new RouteData() + { + Route = RouteTable.Routes["Umbraco_default"] + }); + var routeHandler = new RenderRouteHandler(_umbracoContext, ControllerBuilder.Current.GetControllerFactory()); + var routeDef = routeHandler.GetUmbracoRouteDefinition(requestContext, contentRequest); + var renderModel = new ContentModel(contentRequest.PublishedContent); + //manually add the action/controller, this is required by mvc + requestContext.RouteData.Values.Add("action", routeDef.ActionName); + requestContext.RouteData.Values.Add("controller", routeDef.ControllerName); + //add the rest of the required route data + routeHandler.SetupRouteDataForRequest(renderModel, requestContext, contentRequest); var stringOutput = RenderUmbracoRequestToString(requestContext); - - sw.Write(stringOutput); - break; - case RenderingEngine.WebForms: - default: - var webFormshandler = (global::umbraco.UmbracoDefault)BuildManager - .CreateInstanceFromVirtualPath("~/default.aspx", typeof(global::umbraco.UmbracoDefault)); - //the 'true' parameter will ensure that the current query strings are carried through, we don't have - // to build up the url again, it will just work. - _umbracoContext.HttpContext.Server.Execute(webFormshandler, sw, true); - break; - } - - } + + sw.Write(stringOutput); + break; + case RenderingEngine.WebForms: + default: + var webFormshandler = (global::umbraco.UmbracoDefault)BuildManager + .CreateInstanceFromVirtualPath("~/default.aspx", typeof(global::umbraco.UmbracoDefault)); + //the 'true' parameter will ensure that the current query strings are carried through, we don't have + // to build up the url again, it will just work. + _umbracoContext.HttpContext.Server.Execute(webFormshandler, sw, true); + break; + } + + } /// /// This will execute the UmbracoMvcHandler for the request specified and get the string output. @@ -197,39 +197,39 @@ namespace Umbraco.Web.Templates return newWriter.ToString(); } - private void SetNewItemsOnContextObjects(PublishedContentRequest contentRequest) - { - // handlers like default.aspx will want it and most macros currently need it - contentRequest.UmbracoPage = new page(contentRequest); - //now, set the new ones for this page execution - _umbracoContext.HttpContext.Items["pageID"] = contentRequest.PublishedContent.Id; - _umbracoContext.HttpContext.Items["pageElements"] = contentRequest.UmbracoPage.Elements; - _umbracoContext.HttpContext.Items[Core.Constants.Conventions.Url.AltTemplate] = null; - _umbracoContext.PublishedContentRequest = contentRequest; - } + private void SetNewItemsOnContextObjects(PublishedContentRequest contentRequest) + { + // handlers like default.aspx will want it and most macros currently need it + contentRequest.UmbracoPage = new page(contentRequest); + //now, set the new ones for this page execution + _umbracoContext.HttpContext.Items["pageID"] = contentRequest.PublishedContent.Id; + _umbracoContext.HttpContext.Items["pageElements"] = contentRequest.UmbracoPage.Elements; + _umbracoContext.HttpContext.Items[Core.Constants.Conventions.Url.AltTemplate] = null; + _umbracoContext.PublishedContentRequest = contentRequest; + } - /// - /// Save all items that we know are used for rendering execution to variables so we can restore after rendering - /// - private void SaveExistingItems() - { - //Many objects require that these legacy items are in the http context items... before we render this template we need to first - //save the values in them so that we can re-set them after we render so the rest of the execution works as per normal. - _oldPageId = _umbracoContext.HttpContext.Items["pageID"]; - _oldPageElements = _umbracoContext.HttpContext.Items["pageElements"]; - _oldPublishedContentRequest = _umbracoContext.PublishedContentRequest; - _oldAltTemplate = _umbracoContext.HttpContext.Items[Umbraco.Core.Constants.Conventions.Url.AltTemplate]; - } + /// + /// Save all items that we know are used for rendering execution to variables so we can restore after rendering + /// + private void SaveExistingItems() + { + //Many objects require that these legacy items are in the http context items... before we render this template we need to first + //save the values in them so that we can re-set them after we render so the rest of the execution works as per normal. + _oldPageId = _umbracoContext.HttpContext.Items["pageID"]; + _oldPageElements = _umbracoContext.HttpContext.Items["pageElements"]; + _oldPublishedContentRequest = _umbracoContext.PublishedContentRequest; + _oldAltTemplate = _umbracoContext.HttpContext.Items[Umbraco.Core.Constants.Conventions.Url.AltTemplate]; + } - /// - /// Restores all items back to their context's to continue normal page rendering execution - /// - private void RestoreItems() - { - _umbracoContext.PublishedContentRequest = _oldPublishedContentRequest; - _umbracoContext.HttpContext.Items["pageID"] = _oldPageId; - _umbracoContext.HttpContext.Items["pageElements"] = _oldPageElements; - _umbracoContext.HttpContext.Items[Umbraco.Core.Constants.Conventions.Url.AltTemplate] = _oldAltTemplate; - } - } -} \ No newline at end of file + /// + /// Restores all items back to their context's to continue normal page rendering execution + /// + private void RestoreItems() + { + _umbracoContext.PublishedContentRequest = _oldPublishedContentRequest; + _umbracoContext.HttpContext.Items["pageID"] = _oldPageId; + _umbracoContext.HttpContext.Items["pageElements"] = _oldPageElements; + _umbracoContext.HttpContext.Items[Umbraco.Core.Constants.Conventions.Url.AltTemplate] = _oldAltTemplate; + } + } +} diff --git a/src/Umbraco.Web/Templates/TemplateUtilities.cs b/src/Umbraco.Web/Templates/TemplateUtilities.cs index 422e3deedf..71e0d3e550 100644 --- a/src/Umbraco.Web/Templates/TemplateUtilities.cs +++ b/src/Umbraco.Web/Templates/TemplateUtilities.cs @@ -9,7 +9,7 @@ using Umbraco.Web.Routing; namespace Umbraco.Web.Templates { - //NOTE: I realize there is only one class in this namespace but I'm pretty positive that there will be more classes in + //NOTE: I realize there is only one class in this namespace but I'm pretty positive that there will be more classes in //this namespace once we start migrating and cleaning up more code. /// @@ -62,7 +62,7 @@ namespace Umbraco.Web.Templates { var newLink = urlProvider.GetUrl(intId); text = text.Replace(tag.Value, "href=\"" + newLink); - } + } } } @@ -76,7 +76,7 @@ namespace Umbraco.Web.Templates /// [Obsolete("Use the overload specifying all dependencies instead")] public static string ParseInternalLinks(string text) - { + { //don't attempt to proceed without a context as we cannot lookup urls without one if (UmbracoContext.Current == null) return text; @@ -84,7 +84,7 @@ namespace Umbraco.Web.Templates var urlProvider = UmbracoContext.Current.UrlProvider; return ParseInternalLinks(text, urlProvider); } - + // static compiled regex for faster performance private static readonly Regex LocalLinkPattern = new Regex(@"href=""[/]?(?:\{|\%7B)localLink:([a-zA-Z0-9-://]+)(?:\}|\%7D)", RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace); @@ -105,11 +105,11 @@ namespace Umbraco.Web.Templates { if (UmbracoConfig.For.UmbracoSettings().Content.ResolveUrlsFromTextString == false) return text; - using (var timer = Current.ProfilingLogger.DebugDuration(typeof(IOHelper), "ResolveUrlsFromTextString starting", "ResolveUrlsFromTextString complete")) + using (var timer = Current.ProfilingLogger.DebugDuration(typeof(IOHelper), "ResolveUrlsFromTextString starting", "ResolveUrlsFromTextString complete")) { // find all relative urls (ie. urls that contain ~) var tags = ResolveUrlPattern.Matches(text); - Current.Logger.Debug(typeof(IOHelper), "After regex: " + timer.Stopwatch.ElapsedMilliseconds + " matched: " + tags.Count); + Current.Logger.Debug(typeof(IOHelper), "After regex: " + timer.Stopwatch.ElapsedMilliseconds + " matched: " + tags.Count); foreach (Match tag in tags) { var url = ""; diff --git a/src/Umbraco.Web/Trees/ActionUrlMethod.cs b/src/Umbraco.Web/Trees/ActionUrlMethod.cs index 1b2ab635bc..e178f085ec 100644 --- a/src/Umbraco.Web/Trees/ActionUrlMethod.cs +++ b/src/Umbraco.Web/Trees/ActionUrlMethod.cs @@ -8,4 +8,4 @@ Dialog, BlankWindow } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Trees/ApplicationTreeExtensions.cs b/src/Umbraco.Web/Trees/ApplicationTreeExtensions.cs index b804c16ed1..60e022a1bf 100644 --- a/src/Umbraco.Web/Trees/ApplicationTreeExtensions.cs +++ b/src/Umbraco.Web/Trees/ApplicationTreeExtensions.cs @@ -46,7 +46,7 @@ namespace Umbraco.Web.Trees /// /// /// - /// This ensures that authorization filters are applied to the sub request + /// This ensures that authorization filters are applied to the sub request /// internal static async Task> TryGetRootNodeFromControllerTree(this ApplicationTree appTree, FormDataCollection formCollection, HttpControllerContext controllerContext) { @@ -55,17 +55,17 @@ namespace Umbraco.Web.Trees { return Attempt.Fail(foundControllerTreeAttempt.Exception); } - + var foundControllerTree = foundControllerTreeAttempt.Result; //instantiate it, since we are proxying, we need to setup the instance with our current context var instance = (TreeController)DependencyResolver.Current.GetService(foundControllerTree); - //NOTE: This is all required in order to execute the auth-filters for the sub request, we + //NOTE: This is all required in order to execute the auth-filters for the sub request, we // need to "trick" web-api into thinking that it is actually executing the proxied controller. var urlHelper = controllerContext.Request.GetUrlHelper(); //create the proxied URL for the controller action - var proxiedUrl = controllerContext.Request.RequestUri.GetLeftPart(UriPartial.Authority) + + var proxiedUrl = controllerContext.Request.RequestUri.GetLeftPart(UriPartial.Authority) + urlHelper.GetUmbracoApiService("GetRootNode", instance.GetType()); //add the query strings to it proxiedUrl += "?" + formCollection.ToQueryString(); @@ -85,12 +85,12 @@ namespace Umbraco.Web.Trees if (WebApiVersionCheck.WebApiVersion >= Version.Parse("5.0.0")) { - //In WebApi2, this is required to be set: + //In WebApi2, this is required to be set: // proxiedControllerContext.RequestContext = controllerContext.RequestContext // but we need to do this with reflection because of codebase changes between version 4/5 //NOTE: Use TypeHelper here since the reflection is cached var controllerContextRequestContext = TypeHelper.GetProperty(controllerContext.GetType(), "RequestContext").GetValue(controllerContext); - TypeHelper.GetProperty(proxiedControllerContext.GetType(), "RequestContext").SetValue(proxiedControllerContext, controllerContextRequestContext); + TypeHelper.GetProperty(proxiedControllerContext.GetType(), "RequestContext").SetValue(proxiedControllerContext, controllerContextRequestContext); } instance.ControllerContext = proxiedControllerContext; @@ -114,11 +114,11 @@ namespace Umbraco.Web.Trees { throw new HttpResponseException(result); } - + //return the root var node = instance.GetRootNode(formCollection); return node == null - ? Attempt.Fail(new InvalidOperationException("Could not return a root node for tree " + appTree.Type)) + ? Attempt.Fail(new InvalidOperationException("Could not return a root node for tree " + appTree.Type)) : Attempt.Succeed(node); } @@ -160,7 +160,7 @@ namespace Umbraco.Web.Trees var newRoot = temp.GetRootNode(formCollection); return Attempt.Succeed(newRoot); - + } internal static Attempt TryGetRootXmlNodeFromLegacyTree(this ApplicationTree appTree, FormDataCollection formCollection, UrlHelper urlHelper) @@ -176,7 +176,7 @@ namespace Umbraco.Web.Trees bTree.SetTreeParameters(treeParams); var xmlRoot = bTree.RootNode; - + return Attempt.Succeed(xmlRoot); } @@ -184,8 +184,8 @@ namespace Umbraco.Web.Trees { //This is how the legacy trees worked.... var treeDef = TreeDefinitionCollection.Instance.FindTree(appTree.Alias); - return treeDef == null - ? Attempt.Fail(new InstanceNotFoundException("Could not find tree of type " + appTree.Alias)) + return treeDef == null + ? Attempt.Fail(new InstanceNotFoundException("Could not find tree of type " + appTree.Alias)) : Attempt.Succeed(treeDef); } @@ -209,7 +209,7 @@ namespace Umbraco.Web.Trees var currentSection = formCollection.GetRequiredString("section"); - var result = LegacyTreeDataConverter.ConvertFromLegacyMenu(rootAttempt.Result, currentSection); + var result = LegacyTreeDataConverter.ConvertFromLegacyMenu(rootAttempt.Result, currentSection); return Attempt.Succeed(result); } @@ -261,5 +261,5 @@ namespace Umbraco.Web.Trees } } - + } diff --git a/src/Umbraco.Web/Trees/ContentTreeController.cs b/src/Umbraco.Web/Trees/ContentTreeController.cs index 133b257713..5330fcf9b1 100644 --- a/src/Umbraco.Web/Trees/ContentTreeController.cs +++ b/src/Umbraco.Web/Trees/ContentTreeController.cs @@ -243,4 +243,4 @@ namespace Umbraco.Web.Trees if (convert) menuItem.ConvertLegacyMenuItem(item, "content", "content"); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Trees/ContentTreeControllerBase.cs b/src/Umbraco.Web/Trees/ContentTreeControllerBase.cs index 6d2a85a1a5..f198f481fa 100644 --- a/src/Umbraco.Web/Trees/ContentTreeControllerBase.cs +++ b/src/Umbraco.Web/Trees/ContentTreeControllerBase.cs @@ -215,7 +215,7 @@ namespace Umbraco.Web.Trees { IUmbracoEntity current = GetEntityFromId(id); - //before we get the children we need to see if this is a container node + //before we get the children we need to see if this is a container node //test if the parent is a listview / container if (current != null && current.IsContainer()) @@ -323,4 +323,4 @@ namespace Umbraco.Web.Trees return entity; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Trees/ContentTypeTreeController.cs b/src/Umbraco.Web/Trees/ContentTypeTreeController.cs index ad9f064608..08624f0412 100644 --- a/src/Umbraco.Web/Trees/ContentTypeTreeController.cs +++ b/src/Umbraco.Web/Trees/ContentTypeTreeController.cs @@ -45,7 +45,7 @@ namespace Umbraco.Web.Trees .OrderBy(entity => entity.Name) .Select(dt => { - // since 7.4+ child type creation is enabled by a config option. It defaults to on, but can be disabled if we decide to. + // since 7.4+ child type creation is enabled by a config option. It defaults to on, but can be disabled if we decide to. // need this check to keep supporting sites where childs have already been created. var hasChildren = dt.HasChildren(); var node = CreateTreeNode(dt, Constants.ObjectTypes.DocumentTypeGuid, id, queryStrings, "icon-item-arrangement", hasChildren); diff --git a/src/Umbraco.Web/Trees/CoreTreeAttribute.cs b/src/Umbraco.Web/Trees/CoreTreeAttribute.cs index 70aa87fb5e..3b317a547a 100644 --- a/src/Umbraco.Web/Trees/CoreTreeAttribute.cs +++ b/src/Umbraco.Web/Trees/CoreTreeAttribute.cs @@ -11,6 +11,6 @@ namespace Umbraco.Web.Trees [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] internal class CoreTreeAttribute : Attribute { - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Trees/DataTypeTreeController.cs b/src/Umbraco.Web/Trees/DataTypeTreeController.cs index 789f79bed3..771722778f 100644 --- a/src/Umbraco.Web/Trees/DataTypeTreeController.cs +++ b/src/Umbraco.Web/Trees/DataTypeTreeController.cs @@ -119,4 +119,4 @@ namespace Umbraco.Web.Trees return menu; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Trees/ISearchableTree.cs b/src/Umbraco.Web/Trees/ISearchableTree.cs index 680256f304..4851d9bed5 100644 --- a/src/Umbraco.Web/Trees/ISearchableTree.cs +++ b/src/Umbraco.Web/Trees/ISearchableTree.cs @@ -7,4 +7,4 @@ namespace Umbraco.Web.Trees { IEnumerable Search(string searchText); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Trees/LegacyBaseTreeAttribute.cs b/src/Umbraco.Web/Trees/LegacyBaseTreeAttribute.cs index 919f8aa038..10b1f56059 100644 --- a/src/Umbraco.Web/Trees/LegacyBaseTreeAttribute.cs +++ b/src/Umbraco.Web/Trees/LegacyBaseTreeAttribute.cs @@ -9,7 +9,7 @@ namespace Umbraco.Web.Trees /// This attribute is used purely to maintain some compatibility with legacy webform tree pickers /// /// - /// This allows us to attribute new trees with their legacy counterparts and when a legacy tree is loaded this will indicate + /// This allows us to attribute new trees with their legacy counterparts and when a legacy tree is loaded this will indicate /// on the new tree which legacy tree to load (it won't actually render using the new tree) /// [AttributeUsage(AttributeTargets.Class)] @@ -28,4 +28,4 @@ namespace Umbraco.Web.Trees BaseTreeType = baseTreeType; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Trees/LegacyTreeController.cs b/src/Umbraco.Web/Trees/LegacyTreeController.cs index 5bfe20c4ab..eafd3ed83b 100644 --- a/src/Umbraco.Web/Trees/LegacyTreeController.cs +++ b/src/Umbraco.Web/Trees/LegacyTreeController.cs @@ -109,4 +109,4 @@ namespace Umbraco.Web.Trees } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Trees/LegacyTreeDataConverter.cs b/src/Umbraco.Web/Trees/LegacyTreeDataConverter.cs index f487f792a6..7a06ac88c0 100644 --- a/src/Umbraco.Web/Trees/LegacyTreeDataConverter.cs +++ b/src/Umbraco.Web/Trees/LegacyTreeDataConverter.cs @@ -52,7 +52,7 @@ namespace Umbraco.Web.Trees } else { - //get the tree that we need to render + //get the tree that we need to render var treeDef = TreeDefinitionCollection.Instance.FindTree(appTree.Alias); if (treeDef == null) { @@ -152,7 +152,7 @@ namespace Umbraco.Web.Trees menuItem.ExecuteLegacyJs(menuItem.Action.JsFunctionName); } } - + numAdded++; } } @@ -168,7 +168,7 @@ namespace Umbraco.Web.Trees return collection; } - + /// /// This will look at the legacy IAction's JsFunctionName and convert it to a confirmation dialog view if possible @@ -269,7 +269,7 @@ namespace Umbraco.Web.Trees return Attempt.Succeed( new LegacyUrlAction( "dialogs/assignDomain2.aspx?id=" + nodeId + "&rnd=" + DateTime.UtcNow.Ticks, - Current.Services.TextService.Localize("actions/assignDomain"))); + Current.Services.TextService.Localize("actions/assignDomain"))); case "UmbClientMgr.appActions().actionSendToTranslate()": return Attempt.Succeed( new LegacyUrlAction( @@ -337,7 +337,7 @@ namespace Umbraco.Web.Trees childNodesSource = childNodesSource.AppendQueryStringToUrl(childQuery); //for the menu source we need to detect if this is a root node since we'll need to set the parentId and id to -1 - // for which we'll handle correctly on the server side. + // for which we'll handle correctly on the server side. //if there are no menu items, then this will be empty var menuSource = ""; if (xmlTreeNode.Menu != null && xmlTreeNode.Menu.Any()) @@ -356,10 +356,10 @@ namespace Umbraco.Web.Trees { menuQueryStrings.Add(i.Key, i.Value); } - - menuSource = menuSource.AppendQueryStringToUrl(menuQueryStrings.ToQueryString()); + + menuSource = menuSource.AppendQueryStringToUrl(menuQueryStrings.ToQueryString()); } - + //TODO: Might need to add stuff to additional attributes @@ -393,7 +393,7 @@ namespace Umbraco.Web.Trees internal static TreeNodeCollection ConvertFromLegacy(string parentId, XmlTree xmlTree, UrlHelper urlHelper, string currentSection, FormDataCollection currentQueryStrings) { - //TODO: Once we get the editor URL stuff working we'll need to figure out how to convert + //TODO: Once we get the editor URL stuff working we'll need to figure out how to convert // that over to use the old school ui.xml stuff for these old trees and however the old menu items worked. var collection = new TreeNodeCollection(); diff --git a/src/Umbraco.Web/Trees/LegacyTreeJavascript.cs b/src/Umbraco.Web/Trees/LegacyTreeJavascript.cs index 12310aea09..3d0c754683 100644 --- a/src/Umbraco.Web/Trees/LegacyTreeJavascript.cs +++ b/src/Umbraco.Web/Trees/LegacyTreeJavascript.cs @@ -85,4 +85,4 @@ namespace Umbraco.Web.Trees return js; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Trees/LegacyTreeParams.cs b/src/Umbraco.Web/Trees/LegacyTreeParams.cs index bf905a6f4c..d012551ad1 100644 --- a/src/Umbraco.Web/Trees/LegacyTreeParams.cs +++ b/src/Umbraco.Web/Trees/LegacyTreeParams.cs @@ -31,4 +31,4 @@ namespace Umbraco.Web.Trees public TreeDialogModes DialogMode { get; set; } public string FunctionToCall { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Trees/MacrosTreeController.cs b/src/Umbraco.Web/Trees/MacrosTreeController.cs index f7026d9580..3e80966500 100644 --- a/src/Umbraco.Web/Trees/MacrosTreeController.cs +++ b/src/Umbraco.Web/Trees/MacrosTreeController.cs @@ -78,4 +78,4 @@ namespace Umbraco.Web.Trees return menu; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Trees/MediaTreeController.cs b/src/Umbraco.Web/Trees/MediaTreeController.cs index 76face6fa0..229bf29e17 100644 --- a/src/Umbraco.Web/Trees/MediaTreeController.cs +++ b/src/Umbraco.Web/Trees/MediaTreeController.cs @@ -147,4 +147,4 @@ namespace Umbraco.Web.Trees return Security.CurrentUser.HasPathAccess(media); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Trees/MemberTreeController.cs b/src/Umbraco.Web/Trees/MemberTreeController.cs index 2eaf322411..67c2023865 100644 --- a/src/Umbraco.Web/Trees/MemberTreeController.cs +++ b/src/Umbraco.Web/Trees/MemberTreeController.cs @@ -175,4 +175,4 @@ namespace Umbraco.Web.Trees return menu; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Trees/MenuRenderingEventArgs.cs b/src/Umbraco.Web/Trees/MenuRenderingEventArgs.cs index fa40d60f91..e07850857f 100644 --- a/src/Umbraco.Web/Trees/MenuRenderingEventArgs.cs +++ b/src/Umbraco.Web/Trees/MenuRenderingEventArgs.cs @@ -22,4 +22,4 @@ namespace Umbraco.Web.Trees Menu = menu; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Trees/PackagesTreeController.cs b/src/Umbraco.Web/Trees/PackagesTreeController.cs index d52dad2142..3e7ccc8dbd 100644 --- a/src/Umbraco.Web/Trees/PackagesTreeController.cs +++ b/src/Umbraco.Web/Trees/PackagesTreeController.cs @@ -108,4 +108,4 @@ namespace Umbraco.Web.Trees return menu; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Trees/PartialViewMacrosTreeController.cs b/src/Umbraco.Web/Trees/PartialViewMacrosTreeController.cs index abefd5154d..1f785b2382 100644 --- a/src/Umbraco.Web/Trees/PartialViewMacrosTreeController.cs +++ b/src/Umbraco.Web/Trees/PartialViewMacrosTreeController.cs @@ -5,24 +5,24 @@ using Umbraco.Web.Models.Trees; namespace Umbraco.Web.Trees { - /// - /// Tree for displaying partial view macros in the developer app - /// - [Tree(Constants.Applications.Developer, Constants.Trees.PartialViewMacros, "Partial View Macro Files", sortOrder: 6)] - public class PartialViewMacrosTreeController : PartialViewsTreeController - { - protected override IFileSystem FileSystem => Current.FileSystems.MacroPartialsFileSystem; + /// + /// Tree for displaying partial view macros in the developer app + /// + [Tree(Constants.Applications.Developer, Constants.Trees.PartialViewMacros, "Partial View Macro Files", sortOrder: 6)] + public class PartialViewMacrosTreeController : PartialViewsTreeController + { + protected override IFileSystem FileSystem => Current.FileSystems.MacroPartialsFileSystem; - private static readonly string[] ExtensionsStatic = { "cshtml" }; + private static readonly string[] ExtensionsStatic = { "cshtml" }; - protected override string[] Extensions => ExtensionsStatic; + protected override string[] Extensions => ExtensionsStatic; - protected override string FileIcon => "icon-article"; + protected override string FileIcon => "icon-article"; - protected override void OnRenderFolderNode(ref TreeNode treeNode) - { - //TODO: This isn't the best way to ensure a noop process for clicking a node but it works for now. - treeNode.AdditionalData["jsClickCallback"] = "javascript:void(0);"; - } - } -} \ No newline at end of file + protected override void OnRenderFolderNode(ref TreeNode treeNode) + { + //TODO: This isn't the best way to ensure a noop process for clicking a node but it works for now. + treeNode.AdditionalData["jsClickCallback"] = "javascript:void(0);"; + } + } +} diff --git a/src/Umbraco.Web/Trees/TreeControllerBase.cs b/src/Umbraco.Web/Trees/TreeControllerBase.cs index f0bd746dbf..ff67dce4ed 100644 --- a/src/Umbraco.Web/Trees/TreeControllerBase.cs +++ b/src/Umbraco.Web/Trees/TreeControllerBase.cs @@ -450,4 +450,4 @@ namespace Umbraco.Web.Trees return queryStrings.GetValue(TreeQueryStringParameters.IsDialog); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Trees/TreeNodeRenderingEventArgs.cs b/src/Umbraco.Web/Trees/TreeNodeRenderingEventArgs.cs index f978619156..287e6030e3 100644 --- a/src/Umbraco.Web/Trees/TreeNodeRenderingEventArgs.cs +++ b/src/Umbraco.Web/Trees/TreeNodeRenderingEventArgs.cs @@ -13,4 +13,4 @@ namespace Umbraco.Web.Trees Node = node; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Trees/TreeNodesRenderingEventArgs.cs b/src/Umbraco.Web/Trees/TreeNodesRenderingEventArgs.cs index cb7f1fdbde..d05ff6a93f 100644 --- a/src/Umbraco.Web/Trees/TreeNodesRenderingEventArgs.cs +++ b/src/Umbraco.Web/Trees/TreeNodesRenderingEventArgs.cs @@ -13,4 +13,4 @@ namespace Umbraco.Web.Trees Nodes = nodes; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Trees/TreeQueryStringParameters.cs b/src/Umbraco.Web/Trees/TreeQueryStringParameters.cs index 7f6fa28187..a8774bfdb5 100644 --- a/src/Umbraco.Web/Trees/TreeQueryStringParameters.cs +++ b/src/Umbraco.Web/Trees/TreeQueryStringParameters.cs @@ -11,4 +11,4 @@ //public const string OnNodeClick = "OnNodeClick"; //public const string RenderParent = "RenderParent"; } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Trees/TreeRenderingEventArgs.cs b/src/Umbraco.Web/Trees/TreeRenderingEventArgs.cs index a7abb1a01b..140a576b6c 100644 --- a/src/Umbraco.Web/Trees/TreeRenderingEventArgs.cs +++ b/src/Umbraco.Web/Trees/TreeRenderingEventArgs.cs @@ -12,4 +12,4 @@ namespace Umbraco.Web.Trees QueryStrings = queryStrings; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Trees/UrlHelperExtensions.cs b/src/Umbraco.Web/Trees/UrlHelperExtensions.cs index accf97753d..38cd618ae1 100644 --- a/src/Umbraco.Web/Trees/UrlHelperExtensions.cs +++ b/src/Umbraco.Web/Trees/UrlHelperExtensions.cs @@ -63,4 +63,4 @@ namespace Umbraco.Web.Trees return sb.ToString().TrimEnd(","); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Trees/UserPermissionsTreeController.cs b/src/Umbraco.Web/Trees/UserPermissionsTreeController.cs index fd56989fe6..26b500d540 100644 --- a/src/Umbraco.Web/Trees/UserPermissionsTreeController.cs +++ b/src/Umbraco.Web/Trees/UserPermissionsTreeController.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using System.Net.Http.Formatting; using Umbraco.Core; @@ -50,4 +50,4 @@ namespace Umbraco.Web.Trees return menu; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Trees/UserTypesTreeController.cs b/src/Umbraco.Web/Trees/UserTypesTreeController.cs index fb19796425..f909c91685 100644 --- a/src/Umbraco.Web/Trees/UserTypesTreeController.cs +++ b/src/Umbraco.Web/Trees/UserTypesTreeController.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Globalization; using System.Linq; using System.Net.Http.Formatting; @@ -63,4 +63,4 @@ namespace Umbraco.Web.Trees return menu; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Trees/UsersTreeController.cs b/src/Umbraco.Web/Trees/UsersTreeController.cs index 60eb2cfbc8..45436aa661 100644 --- a/src/Umbraco.Web/Trees/UsersTreeController.cs +++ b/src/Umbraco.Web/Trees/UsersTreeController.cs @@ -95,4 +95,4 @@ namespace Umbraco.Web.Trees return menu; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/UI/Bundles/JsJQueryCore.cs b/src/Umbraco.Web/UI/Bundles/JsJQueryCore.cs index 9bd6509ae7..15e85af2cb 100644 --- a/src/Umbraco.Web/UI/Bundles/JsJQueryCore.cs +++ b/src/Umbraco.Web/UI/Bundles/JsJQueryCore.cs @@ -12,4 +12,4 @@ namespace Umbraco.Web.UI.Bundles public class JsJQueryCore : Control { } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/UI/Bundles/JsJQueryPlugins.cs b/src/Umbraco.Web/UI/Bundles/JsJQueryPlugins.cs index 7f2c2417da..245abc2420 100644 --- a/src/Umbraco.Web/UI/Bundles/JsJQueryPlugins.cs +++ b/src/Umbraco.Web/UI/Bundles/JsJQueryPlugins.cs @@ -13,4 +13,4 @@ namespace Umbraco.Web.UI.Bundles public class JsJQueryPlugins : Control { } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/UI/Bundles/JsUmbracoApplicationCore.cs b/src/Umbraco.Web/UI/Bundles/JsUmbracoApplicationCore.cs index 888b764a75..505f9efdc3 100644 --- a/src/Umbraco.Web/UI/Bundles/JsUmbracoApplicationCore.cs +++ b/src/Umbraco.Web/UI/Bundles/JsUmbracoApplicationCore.cs @@ -12,4 +12,4 @@ namespace Umbraco.Web.UI.Bundles public class JsUmbracoApplicationCore : Control { } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/UI/Bundles/JsUmbracoApplicationUI.cs b/src/Umbraco.Web/UI/Bundles/JsUmbracoApplicationUI.cs index c8bce7694a..b0354235c8 100644 --- a/src/Umbraco.Web/UI/Bundles/JsUmbracoApplicationUI.cs +++ b/src/Umbraco.Web/UI/Bundles/JsUmbracoApplicationUI.cs @@ -4,7 +4,7 @@ using ClientDependency.Core; namespace Umbraco.Web.UI.Bundles { /// - /// The UI Umbraco libs + /// The UI Umbraco libs /// [ClientDependency(ClientDependencyType.Javascript, "ui/default.js", "UmbracoClient", Priority = 0, Group = 5)] [ClientDependency(ClientDependencyType.Javascript, "js/guiFunctions.js", "UmbracoRoot", Priority = 1, Group = 5)] @@ -14,4 +14,4 @@ namespace Umbraco.Web.UI.Bundles public class JsUmbracoApplicationUI : Control { } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/UI/Bundles/JsUmbracoTree.cs b/src/Umbraco.Web/UI/Bundles/JsUmbracoTree.cs index 7af2046991..5f393376cf 100644 --- a/src/Umbraco.Web/UI/Bundles/JsUmbracoTree.cs +++ b/src/Umbraco.Web/UI/Bundles/JsUmbracoTree.cs @@ -3,7 +3,7 @@ using ClientDependency.Core; namespace Umbraco.Web.UI.Bundles { - /// + /// /// The umb tree libs /// [ClientDependency(ClientDependencyType.Javascript, "Tree/jquery.tree.js", "UmbracoClient", Priority = 0, Group = 10)] @@ -15,4 +15,4 @@ namespace Umbraco.Web.UI.Bundles public class JsUmbracoTree : Control { } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/UI/Controls/InsertMacroSplitButton.cs b/src/Umbraco.Web/UI/Controls/InsertMacroSplitButton.cs index bf44fa1944..59b0b5bdf9 100644 --- a/src/Umbraco.Web/UI/Controls/InsertMacroSplitButton.cs +++ b/src/Umbraco.Web/UI/Controls/InsertMacroSplitButton.cs @@ -8,137 +8,137 @@ using Umbraco.Web.Composing; namespace Umbraco.Web.UI.Controls { - /// - /// Represents the 'insert macro' button when editing a template which includes the drop down list selector - /// - /// - /// Though this would be nicer to do in a UserControl, unfortunatley the way that the ScrollingMenu control is designed it seems that - /// we have to insert all items via code and loading a UserControl in dynamically is equally ugly. - /// - [ClientDependency(ClientDependencyType.Css, "splitbutton/splitbutton.css", "UmbracoClient")] - [ClientDependency(ClientDependencyType.Javascript, "splitbutton/jquery.splitbutton.js", "UmbracoClient", Priority = 100)] - [ClientDependency(ClientDependencyType.Javascript, "splitbutton/InsertMacroSplitButton.js", "UmbracoClient", Priority = 101)] - internal class InsertMacroSplitButton : UmbracoControl - { - protected LiteralControl ListContainer; + /// + /// Represents the 'insert macro' button when editing a template which includes the drop down list selector + /// + /// + /// Though this would be nicer to do in a UserControl, unfortunatley the way that the ScrollingMenu control is designed it seems that + /// we have to insert all items via code and loading a UserControl in dynamically is equally ugly. + /// + [ClientDependency(ClientDependencyType.Css, "splitbutton/splitbutton.css", "UmbracoClient")] + [ClientDependency(ClientDependencyType.Javascript, "splitbutton/jquery.splitbutton.js", "UmbracoClient", Priority = 100)] + [ClientDependency(ClientDependencyType.Javascript, "splitbutton/InsertMacroSplitButton.js", "UmbracoClient", Priority = 101)] + internal class InsertMacroSplitButton : UmbracoControl + { + protected LiteralControl ListContainer; - protected override void OnInit(EventArgs e) - { - base.OnInit(e); - EnsureChildControls(); - } + protected override void OnInit(EventArgs e) + { + base.OnInit(e); + EnsureChildControls(); + } - /// - /// The JS callback to display the dialog modal screen to customize the macro to be inserted into the editor if the - /// macro has parameters. - /// - public string ClientCallbackOpenMacroModel { get; set; } + /// + /// The JS callback to display the dialog modal screen to customize the macro to be inserted into the editor if the + /// macro has parameters. + /// + public string ClientCallbackOpenMacroModel { get; set; } - /// - /// The JS callback method which accepts an 'alias' parameter that is invoked when clicking the macro button - /// to insert a macro that has no parameters. - /// - public string ClientCallbackInsertMacroMarkup { get; set; } + /// + /// The JS callback method which accepts an 'alias' parameter that is invoked when clicking the macro button + /// to insert a macro that has no parameters. + /// + public string ClientCallbackInsertMacroMarkup { get; set; } - protected override void CreateChildControls() - { - base.CreateChildControls(); + protected override void CreateChildControls() + { + base.CreateChildControls(); - //var menuItemsId = ClientID + "menuitems"; - //var placeHolderId = ClientID + "sbPlaceholder"; + //var menuItemsId = ClientID + "menuitems"; + //var placeHolderId = ClientID + "sbPlaceholder"; - /*create the list, similar to this, but swap the repeater for real html: - -
- - -
" - data-has-params="<%# DoesMacroHaveSettings(DataBinder.Eval(Container, "DataItem.id").ToString()) %>"> - <%# DataBinder.Eval(Container, "DataItem.macroName")%> -
-
-
-
- */ + /*create the list, similar to this, but swap the repeater for real html: - //Create the drop down menu list first (it is hidden) - var divMacroItemContainer = new TagBuilder("div"); - divMacroItemContainer.Attributes.Add("style", "width: 285px;display:none;"); - divMacroItemContainer.Attributes.Add("class", "sbMenu"); +
+ + +
" + data-has-params="<%# DoesMacroHaveSettings(DataBinder.Eval(Container, "DataItem.id").ToString()) %>"> + <%# DataBinder.Eval(Container, "DataItem.macroName")%> +
+
+
+
+ */ - var macros = Services.MacroService.GetAll().OrderBy(x => x.Name); - foreach (var macro in macros) - { - var divMacro = new TagBuilder("div"); - divMacro.AddCssClass("macro-item"); - divMacro.Attributes.Add("rel", macro.Alias); - divMacro.Attributes.Add("data-has-params", DoesMacroHaveParameters(macro.Id).ToString().ToLower()); - divMacro.SetInnerText(macro.Name); - divMacroItemContainer.InnerHtml += divMacro.ToString(); - } - - /*create the button itself, similar to this: - -
- - Insert Macro - -
- - */ + //Create the drop down menu list first (it is hidden) + var divMacroItemContainer = new TagBuilder("div"); + divMacroItemContainer.Attributes.Add("style", "width: 285px;display:none;"); + divMacroItemContainer.Attributes.Add("class", "sbMenu"); - var divSplitButtonWrapper = new TagBuilder("div"); - divSplitButtonWrapper.AddCssClass("sbPlaceHolder"); - divSplitButtonWrapper.Attributes.Add("id", ClientID + "sbPlaceholder"); - var divButton = new TagBuilder("div"); - divButton.Attributes.Add("style", "display: inline; height: 23px; vertical-align: top;"); - var aButton = new TagBuilder("a"); - aButton.Attributes.Add("href", "#"); //will be bound with jquery - aButton.AddCssClass("sbLink"); - var imgButton = new TagBuilder("img"); - imgButton.Attributes.Add("alt", "Insert Macro"); - imgButton.Attributes.Add("src", this.ResolveUrl(SystemDirectories.Umbraco + "/images/editor/insMacroSB.png")); - imgButton.Attributes.Add("title", "Insert Macro"); - imgButton.Attributes.Add("style", "vertical-align: top;"); - aButton.InnerHtml = imgButton.ToString(); - divButton.InnerHtml = aButton.ToString(); - divSplitButtonWrapper.InnerHtml = divButton.ToString(); + var macros = Services.MacroService.GetAll().OrderBy(x => x.Name); + foreach (var macro in macros) + { + var divMacro = new TagBuilder("div"); + divMacro.AddCssClass("macro-item"); + divMacro.Attributes.Add("rel", macro.Alias); + divMacro.Attributes.Add("data-has-params", DoesMacroHaveParameters(macro.Id).ToString().ToLower()); + divMacro.SetInnerText(macro.Name); + divMacroItemContainer.InnerHtml += divMacro.ToString(); + } - ListContainer = new LiteralControl(divMacroItemContainer.ToString() + divSplitButtonWrapper.ToString()); - Controls.Add(ListContainer); + /*create the button itself, similar to this: -// Page.ClientScript.RegisterStartupScript( -// typeof(InsertMacroSplitButton), -// ClientID, -// @"jQuery(document).ready(function() { -// jQuery('#" + placeHolderId + " a.sbLink').splitbutton({menu:'#" + menuItemsId + "'}); " + -// "});", -// true); +
+ + Insert Macro + +
- Page.ClientScript.RegisterStartupScript( - typeof(InsertMacroSplitButton), - typeof(InsertMacroSplitButton).Name, //same key for all instancees, we should only render once - @"jQuery(document).ready(function() { - var splitButton = new Umbraco.Controls.InsertMacroSplitButton({ - openMacroModel: " + ClientCallbackOpenMacroModel + @", - insertMacroMarkup: " + ClientCallbackInsertMacroMarkup + @" - }); - splitButton.init(); - });", - true); - } + */ + + var divSplitButtonWrapper = new TagBuilder("div"); + divSplitButtonWrapper.AddCssClass("sbPlaceHolder"); + divSplitButtonWrapper.Attributes.Add("id", ClientID + "sbPlaceholder"); + var divButton = new TagBuilder("div"); + divButton.Attributes.Add("style", "display: inline; height: 23px; vertical-align: top;"); + var aButton = new TagBuilder("a"); + aButton.Attributes.Add("href", "#"); //will be bound with jquery + aButton.AddCssClass("sbLink"); + var imgButton = new TagBuilder("img"); + imgButton.Attributes.Add("alt", "Insert Macro"); + imgButton.Attributes.Add("src", this.ResolveUrl(SystemDirectories.Umbraco + "/images/editor/insMacroSB.png")); + imgButton.Attributes.Add("title", "Insert Macro"); + imgButton.Attributes.Add("style", "vertical-align: top;"); + aButton.InnerHtml = imgButton.ToString(); + divButton.InnerHtml = aButton.ToString(); + divSplitButtonWrapper.InnerHtml = divButton.ToString(); + + ListContainer = new LiteralControl(divMacroItemContainer.ToString() + divSplitButtonWrapper.ToString()); + Controls.Add(ListContainer); + +// Page.ClientScript.RegisterStartupScript( +// typeof(InsertMacroSplitButton), +// ClientID, +// @"jQuery(document).ready(function() { +// jQuery('#" + placeHolderId + " a.sbLink').splitbutton({menu:'#" + menuItemsId + "'}); " + +// "});", +// true); + + Page.ClientScript.RegisterStartupScript( + typeof(InsertMacroSplitButton), + typeof(InsertMacroSplitButton).Name, //same key for all instancees, we should only render once + @"jQuery(document).ready(function() { + var splitButton = new Umbraco.Controls.InsertMacroSplitButton({ + openMacroModel: " + ClientCallbackOpenMacroModel + @", + insertMacroMarkup: " + ClientCallbackInsertMacroMarkup + @" + }); + splitButton.init(); + });", + true); + } - private bool DoesMacroHaveParameters(int macroId) - { - bool hasParameters; - using (var scope = Current.ScopeProvider.CreateScope()) - { + private bool DoesMacroHaveParameters(int macroId) + { + bool hasParameters; + using (var scope = Current.ScopeProvider.CreateScope()) + { hasParameters = scope.Database.ExecuteScalar("SELECT COUNT(*) from cmsMacroProperty where macro=@macroId", new { macroId }) > 0; scope.Complete(); - } - return hasParameters; - } - } + } + return hasParameters; + } + } } diff --git a/src/Umbraco.Web/UI/Controls/ProgressBar.cs b/src/Umbraco.Web/UI/Controls/ProgressBar.cs index b4cfa55555..698066688a 100644 --- a/src/Umbraco.Web/UI/Controls/ProgressBar.cs +++ b/src/Umbraco.Web/UI/Controls/ProgressBar.cs @@ -3,7 +3,7 @@ namespace Umbraco.Web.UI.Controls { public class ProgressBar : System.Web.UI.WebControls.Image - { + { public string Title { get; set; } protected override void Render(System.Web.UI.HtmlTextWriter writer) diff --git a/src/Umbraco.Web/UI/Controls/UmbracoControl.cs b/src/Umbraco.Web/UI/Controls/UmbracoControl.cs index 6ef6f70291..2329e85703 100644 --- a/src/Umbraco.Web/UI/Controls/UmbracoControl.cs +++ b/src/Umbraco.Web/UI/Controls/UmbracoControl.cs @@ -10,10 +10,10 @@ using Umbraco.Web.Composing; namespace Umbraco.Web.UI.Controls { /// - /// A control that exposes the helpful Umbraco context objects - /// - public abstract class UmbracoControl : Control - { + /// A control that exposes the helpful Umbraco context objects + ///
+ public abstract class UmbracoControl : Control + { private UrlHelper _url; protected UmbracoControl(UmbracoContext umbracoContext, ServiceContext services, CacheHelper appCache) @@ -44,7 +44,7 @@ namespace Umbraco.Web.UI.Controls ///
public ILogger Logger { get; } - /// + /// /// Gets the profiling logger. /// public ProfilingLogger ProfilingLogger { get; } @@ -54,15 +54,15 @@ namespace Umbraco.Web.UI.Controls /// public UmbracoContext UmbracoContext { get; } - /// - /// Gets the services context. - /// - protected ServiceContext Services { get; } + /// + /// Gets the services context. + /// + protected ServiceContext Services { get; } /// /// Gets a Url helper. /// /// This URL helper is created without any route data and an empty request context. public UrlHelper Url => _url ?? (_url = new UrlHelper(Context.Request.RequestContext)); - } -} \ No newline at end of file + } +} diff --git a/src/Umbraco.Web/UI/Controls/UmbracoUserControl.cs b/src/Umbraco.Web/UI/Controls/UmbracoUserControl.cs index 1872b4a4ff..2875cb82bd 100644 --- a/src/Umbraco.Web/UI/Controls/UmbracoUserControl.cs +++ b/src/Umbraco.Web/UI/Controls/UmbracoUserControl.cs @@ -104,4 +104,4 @@ namespace Umbraco.Web.UI.Controls /// This URL helper is created without any route data and an empty request context. public UrlHelper Url => _url ?? (_url = new UrlHelper(Context.Request.RequestContext)); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/UI/IAssignedApp.cs b/src/Umbraco.Web/UI/IAssignedApp.cs index 3be16f138f..1184c1ffa2 100644 --- a/src/Umbraco.Web/UI/IAssignedApp.cs +++ b/src/Umbraco.Web/UI/IAssignedApp.cs @@ -14,4 +14,4 @@ ///
string AssignedApp { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/UI/JavaScript/AssetInitialization.cs b/src/Umbraco.Web/UI/JavaScript/AssetInitialization.cs index 73d2f46c41..2f7d2b6b5e 100644 --- a/src/Umbraco.Web/UI/JavaScript/AssetInitialization.cs +++ b/src/Umbraco.Web/UI/JavaScript/AssetInitialization.cs @@ -99,4 +99,4 @@ namespace Umbraco.Web.UI.JavaScript } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/UI/JavaScript/CssInitialization.cs b/src/Umbraco.Web/UI/JavaScript/CssInitialization.cs index 19f932e83d..15ec5bb4f6 100644 --- a/src/Umbraco.Web/UI/JavaScript/CssInitialization.cs +++ b/src/Umbraco.Web/UI/JavaScript/CssInitialization.cs @@ -31,7 +31,7 @@ namespace Umbraco.Web.UI.JavaScript public JArray GetStylesheetInitializationArray(HttpContextBase httpContext) { - var merged = new JArray(); + var merged = new JArray(); foreach (var m in _parser.GetManifests()) { ManifestParser.MergeJArrays(merged, m.StylesheetInitialize); @@ -46,7 +46,7 @@ namespace Umbraco.Web.UI.JavaScript return merged; } - + /// /// Parses the CssResources.Main and returns a yepnop.injectCss format /// diff --git a/src/Umbraco.Web/UI/JavaScript/DependencyPathRenderer.cs b/src/Umbraco.Web/UI/JavaScript/DependencyPathRenderer.cs index 221f5f8f29..d0d8f99497 100644 --- a/src/Umbraco.Web/UI/JavaScript/DependencyPathRenderer.cs +++ b/src/Umbraco.Web/UI/JavaScript/DependencyPathRenderer.cs @@ -35,7 +35,7 @@ namespace Umbraco.Web.UI.JavaScript jsOutput = jsOutput.Replace("&", "&"); cssOutput = cssOutput.Replace("&", "&"); } - + protected override string RenderSingleJsFile(string js, IDictionary htmlAttributes) { return js + Delimiter; @@ -47,4 +47,4 @@ namespace Umbraco.Web.UI.JavaScript } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/UI/JavaScript/JsInitialization.cs b/src/Umbraco.Web/UI/JavaScript/JsInitialization.cs index 34d297a86f..26b554eda5 100644 --- a/src/Umbraco.Web/UI/JavaScript/JsInitialization.cs +++ b/src/Umbraco.Web/UI/JavaScript/JsInitialization.cs @@ -20,7 +20,7 @@ namespace Umbraco.Web.UI.JavaScript /// main Umbraco initialization output. /// internal class JsInitialization : AssetInitialization - { + { private readonly ManifestParser _parser; public JsInitialization(ManifestParser parser) @@ -45,7 +45,7 @@ namespace Umbraco.Web.UI.JavaScript public string GetJavascriptInitialization(HttpContextBase httpContext, JArray umbracoInit, JArray additionalJsFiles = null) { var result = GetJavascriptInitializationArray(httpContext, umbracoInit, additionalJsFiles); - + return ParseMain( result.ToString(), IOHelper.ResolveUrl(SystemDirectories.Umbraco)); diff --git a/src/Umbraco.Web/UI/JavaScript/Resources.Designer.cs b/src/Umbraco.Web/UI/JavaScript/Resources.Designer.cs index 72068f364f..26de94898d 100644 --- a/src/Umbraco.Web/UI/JavaScript/Resources.Designer.cs +++ b/src/Umbraco.Web/UI/JavaScript/Resources.Designer.cs @@ -10,8 +10,8 @@ namespace Umbraco.Web.UI.JavaScript { using System; - - + + /// /// A strongly-typed resource class, for looking up localized strings, etc. /// @@ -23,15 +23,15 @@ namespace Umbraco.Web.UI.JavaScript { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { - + private static global::System.Resources.ResourceManager resourceMan; - + private static global::System.Globalization.CultureInfo resourceCulture; - + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Resources() { } - + /// /// Returns the cached ResourceManager instance used by this class. /// @@ -45,7 +45,7 @@ namespace Umbraco.Web.UI.JavaScript { return resourceMan; } } - + /// /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. @@ -59,7 +59,7 @@ namespace Umbraco.Web.UI.JavaScript { resourceCulture = value; } } - + /// /// Looks up a localized string similar to [ /// 'lib/jquery/jquery.min.js', @@ -72,7 +72,7 @@ namespace Umbraco.Web.UI.JavaScript { /// 'lib/angular/1.1.5/angular-cookies.min.js', /// 'lib/angular/1.1.5/angular-mobile.js', /// 'lib/angular/1.1.5/angular-sanitize.min.js', - /// + /// /// 'lib/angular/angular-ui-sortable.js', /// /// 'lib/angular-dynamic-locale/tmhDynamicLocale.min.js', @@ -83,7 +83,7 @@ namespace Umbraco.Web.UI.JavaScript { return ResourceManager.GetString("JsInitialize", resourceCulture); } } - + /// /// Looks up a localized string similar to LazyLoad.js("##JsInitialize##", function () { /// //we need to set the legacy UmbClientMgr path @@ -101,7 +101,7 @@ namespace Umbraco.Web.UI.JavaScript { return ResourceManager.GetString("Main", resourceCulture); } } - + /// /// Looks up a localized string similar to //TODO: This would be nicer as an angular module so it can be injected into stuff... that'd be heaps nicer, but ///// how to do that when this is not a regular JS file, it is a server side JS file and RequireJS seems to only want diff --git a/src/Umbraco.Web/UI/JavaScript/ServerVariablesParser.cs b/src/Umbraco.Web/UI/JavaScript/ServerVariablesParser.cs index ac47becb33..76f1dae9e2 100644 --- a/src/Umbraco.Web/UI/JavaScript/ServerVariablesParser.cs +++ b/src/Umbraco.Web/UI/JavaScript/ServerVariablesParser.cs @@ -25,9 +25,9 @@ namespace Umbraco.Web.UI.JavaScript } var json = JObject.FromObject(items); - return vars.Replace(Token, json.ToString()); - + return vars.Replace(Token, json.ToString()); + } - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/UI/JavaScript/UmbracoClientDependencyLoader.cs b/src/Umbraco.Web/UI/JavaScript/UmbracoClientDependencyLoader.cs index e4eaaefc14..7b8397d047 100644 --- a/src/Umbraco.Web/UI/JavaScript/UmbracoClientDependencyLoader.cs +++ b/src/Umbraco.Web/UI/JavaScript/UmbracoClientDependencyLoader.cs @@ -1,4 +1,4 @@ -using System.Web.UI; +using System.Web.UI; using ClientDependency.Core.Controls; using ClientDependency.Core.FileRegistration.Providers; using Umbraco.Core.IO; @@ -41,4 +41,4 @@ namespace Umbraco.Web.UI.JavaScript } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/UI/Pages/ClientTools.cs b/src/Umbraco.Web/UI/Pages/ClientTools.cs index ad5c591038..0cd59591be 100644 --- a/src/Umbraco.Web/UI/Pages/ClientTools.cs +++ b/src/Umbraco.Web/UI/Pages/ClientTools.cs @@ -5,55 +5,55 @@ using Umbraco.Core; namespace Umbraco.Web.UI.Pages { - /// - /// Renders the client side code necessary to interact with the Umbraco client side API. - /// Each method returns an instance of this class so you can chain calls together. - /// - public sealed class ClientTools - { + /// + /// Renders the client side code necessary to interact with the Umbraco client side API. + /// Each method returns an instance of this class so you can chain calls together. + /// + public sealed class ClientTools + { - public ClientTools(Page page) - { - _page = page; - } + public ClientTools(Page page) + { + _page = page; + } - /// - /// Returns the string markup for the JavaScript that is rendered. - /// If referencing JavaScript scripts in the backend, this class should be used - /// in case future changes to the client code is change, this will remain intact. - /// - public static class Scripts - { - internal const string ClientMgrScript = "UmbClientMgr"; - public static string GetAppActions { get { return string.Format("{0}.appActions()", ClientMgrScript); } } - public static string GetMainWindow { get { return string.Format("{0}.mainWindow()", ClientMgrScript); } } - public static string GetMainTree { get { return string.Format("{0}.mainTree()", ClientMgrScript); } } - public static string GetContentFrame() { return string.Format("{0}.contentFrame()", ClientMgrScript); } - public static string ShiftApp(string appAlias) - { + /// + /// Returns the string markup for the JavaScript that is rendered. + /// If referencing JavaScript scripts in the backend, this class should be used + /// in case future changes to the client code is change, this will remain intact. + /// + public static class Scripts + { + internal const string ClientMgrScript = "UmbClientMgr"; + public static string GetAppActions { get { return string.Format("{0}.appActions()", ClientMgrScript); } } + public static string GetMainWindow { get { return string.Format("{0}.mainWindow()", ClientMgrScript); } } + public static string GetMainTree { get { return string.Format("{0}.mainTree()", ClientMgrScript); } } + public static string GetContentFrame() { return string.Format("{0}.contentFrame()", ClientMgrScript); } + public static string ShiftApp(string appAlias) + { return string.Format(ClientMgrScript + ".historyManager().addHistory('{0}')", appAlias); - } - public static string OpenDashboard(string app) - { - return string.Format(GetAppActions + ".openDashboard('{0}');", app); - } - public static string RefreshAdmin { get { return "setTimeout('" + GetMainWindow + ".location.reload()', {0});"; } } - public static string ShowSpeechBubble { get { return GetMainWindow + ".UmbSpeechBubble.ShowMessage('{0}','{1}', '{2}');"; } } - public static string ChangeContentFrameUrl(string url) { - return string.Format(ClientMgrScript + ".contentFrame('{0}');", url); - } + } + public static string OpenDashboard(string app) + { + return string.Format(GetAppActions + ".openDashboard('{0}');", app); + } + public static string RefreshAdmin { get { return "setTimeout('" + GetMainWindow + ".location.reload()', {0});"; } } + public static string ShowSpeechBubble { get { return GetMainWindow + ".UmbSpeechBubble.ShowMessage('{0}','{1}', '{2}');"; } } + public static string ChangeContentFrameUrl(string url) { + return string.Format(ClientMgrScript + ".contentFrame('{0}');", url); + } public static string ReloadContentFrameUrlIfPathLoaded(string url) { return string.Format(ClientMgrScript + ".reloadContentFrameUrlIfPathLoaded('{0}');", url); } public static string ReloadLocation { get { return string.Format(ClientMgrScript + ".reloadLocation();"); } } public static string ChildNodeCreated = GetMainTree + ".childNodeCreated();"; - public static string SyncTree { get { return GetMainTree + ".syncTree('{0}', {1});"; } } - public static string ClearTreeCache { get { return GetMainTree + ".clearTreeCache();"; } } - public static string CopyNode { get { return GetMainTree + ".copyNode('{0}', '{1}');"; } } - public static string MoveNode { get { return GetMainTree + ".moveNode('{0}', '{1}');"; } } - public static string ReloadActionNode { get { return GetMainTree + ".reloadActionNode({0}, {1}, null);"; } } - public static string SetActiveTreeType { get { return GetMainTree + ".setActiveTreeType('{0}');"; } } + public static string SyncTree { get { return GetMainTree + ".syncTree('{0}', {1});"; } } + public static string ClearTreeCache { get { return GetMainTree + ".clearTreeCache();"; } } + public static string CopyNode { get { return GetMainTree + ".copyNode('{0}', '{1}');"; } } + public static string MoveNode { get { return GetMainTree + ".moveNode('{0}', '{1}');"; } } + public static string ReloadActionNode { get { return GetMainTree + ".reloadActionNode({0}, {1}, null);"; } } + public static string SetActiveTreeType { get { return GetMainTree + ".setActiveTreeType('{0}');"; } } public static string RefreshTree { get { return GetMainTree + ".refreshTree();"; } } public static string RefreshTreeType { get { return GetMainTree + ".refreshTree('{0}');"; } } public static string CloseModalWindow() @@ -73,41 +73,41 @@ namespace Umbraco.Web.UI.Pages return string.Format("{0}.openModalWindow('{1}', '{2}', {3}, {4}, {5}, {6}, {7}, '{8}', '{9}');", new object[] { ClientMgrScript, url, name, showHeader.ToString().ToLower(), width, height, top, leftOffset, closeTriggers, onCloseCallback }); } - } + } - private readonly Page _page; + private readonly Page _page; - /// - /// This removes all tree JSON data cached in the client browser. - /// Useful when you want to ensure that the tree is reloaded from live data. - /// - /// - public ClientTools ClearClientTreeCache() - { - RegisterClientScript(Scripts.ClearTreeCache); - return this; - } + /// + /// This removes all tree JSON data cached in the client browser. + /// Useful when you want to ensure that the tree is reloaded from live data. + /// + /// + public ClientTools ClearClientTreeCache() + { + RegisterClientScript(Scripts.ClearTreeCache); + return this; + } - /// - /// Change applications - /// - /// - public ClientTools ShiftApp(string appAlias) - { - RegisterClientScript(Scripts.ShiftApp(appAlias)); - return this; - } - - /// - /// Refresh the entire administration console after a specified amount of time. - /// - /// - /// - public ClientTools RefreshAdmin(int seconds) - { - RegisterClientScript(string.Format(Scripts.RefreshAdmin, seconds * 1000)); - return this; - } + /// + /// Change applications + /// + /// + public ClientTools ShiftApp(string appAlias) + { + RegisterClientScript(Scripts.ShiftApp(appAlias)); + return this; + } + + /// + /// Refresh the entire administration console after a specified amount of time. + /// + /// + /// + public ClientTools RefreshAdmin(int seconds) + { + RegisterClientScript(string.Format(Scripts.RefreshAdmin, seconds * 1000)); + return this; + } /// /// Refreshes the entire current tree @@ -124,34 +124,34 @@ namespace Umbraco.Web.UI.Pages RegisterClientScript(string.Format(Scripts.RefreshTreeType, treeType)); return this; } - - /// - /// A reference to the umbraco UI component "speechbubble". The speechbubble appears in the lower right corner of the screen, notifying users of events - /// - /// The speechbubble icon. - /// The speechbubble header. - /// The body text - public ClientTools ShowSpeechBubble(SpeechBubbleIcon i, string header, string body) - { - RegisterClientScript(string.Format(Scripts.ShowSpeechBubble, i.ToString(), header.Replace("'", "\\'"), body.Replace("'", "\\'"))); - return this; - } - - /// - /// Changes the content in the content frame to the specified URL - /// - /// - public ClientTools ChangeContentFrameUrl(string url) - { + + /// + /// A reference to the umbraco UI component "speechbubble". The speechbubble appears in the lower right corner of the screen, notifying users of events + /// + /// The speechbubble icon. + /// The speechbubble header. + /// The body text + public ClientTools ShowSpeechBubble(SpeechBubbleIcon i, string header, string body) + { + RegisterClientScript(string.Format(Scripts.ShowSpeechBubble, i.ToString(), header.Replace("'", "\\'"), body.Replace("'", "\\'"))); + return this; + } + + /// + /// Changes the content in the content frame to the specified URL + /// + /// + public ClientTools ChangeContentFrameUrl(string url) + { //don't load if there is no url - if (string.IsNullOrEmpty(url)) return this; + if (string.IsNullOrEmpty(url)) return this; url = EnsureUmbracoUrl(url); RegisterClientScript(Scripts.ChangeContentFrameUrl(url)); - + return this; - } + } /// /// Reloads the content in the content frame if the specified URL is currently loaded @@ -197,117 +197,117 @@ namespace Umbraco.Web.UI.Pages /// /// public ClientTools ShowDashboard(string app) - { + { return ChangeContentFrameUrl(SystemDirectories.Umbraco + string.Format("/dashboard.aspx?app={0}", app)); - } - - /// - /// Reloads the children of the current action node and selects the node that didn't exist there before. - /// If the client side system cannot determine which node is new, then no node is selected. - /// - /// - /// This is used by many create dialogs, however the sync method should be used based on the full path of the - /// node but because the current Umbraco implementation of ITask only returns a url to load, there's no way - /// to determine what the full path of the new child is. - /// - /// - public ClientTools ChildNodeCreated() - { - RegisterClientScript(Scripts.ChildNodeCreated); - return this; - } + } - /// - /// Synchronizes the tree to the path specified. - /// - /// - /// - /// If set to true, will ensure that the node to be synced has it's data - /// reloaded from the server. Otherwise, if the node already exists, the tree will simply sync to the node - /// that is already there. - /// - /// - /// This will work for any tree, however you would need to know the path of the node. Currently, media and content - /// are the only trees that store a path, however, if you were working in the template tree for example, a path to a - /// node could be "init,1090" and this method would still work. - /// - /// Sync tree will works by syncing the active tree type. This can be specified explicitly by calling SetActiveTreeType. - /// This will allow developers to sync many trees in one application at one time if needed. - /// - /// - /// - /// - public ClientTools SyncTree(string path, bool forceReload) - { - RegisterClientScript(string.Format(Scripts.SyncTree, path, forceReload.ToString().ToLower())); - return this; - } + /// + /// Reloads the children of the current action node and selects the node that didn't exist there before. + /// If the client side system cannot determine which node is new, then no node is selected. + /// + /// + /// This is used by many create dialogs, however the sync method should be used based on the full path of the + /// node but because the current Umbraco implementation of ITask only returns a url to load, there's no way + /// to determine what the full path of the new child is. + /// + /// + public ClientTools ChildNodeCreated() + { + RegisterClientScript(Scripts.ChildNodeCreated); + return this; + } - public ClientTools CopyNode(string currNodeId, string newParentPath) - { - RegisterClientScript(string.Format(Scripts.CopyNode, currNodeId, newParentPath)); - return this; - } + /// + /// Synchronizes the tree to the path specified. + /// + /// + /// + /// If set to true, will ensure that the node to be synced has it's data + /// reloaded from the server. Otherwise, if the node already exists, the tree will simply sync to the node + /// that is already there. + /// + /// + /// This will work for any tree, however you would need to know the path of the node. Currently, media and content + /// are the only trees that store a path, however, if you were working in the template tree for example, a path to a + /// node could be "init,1090" and this method would still work. + /// + /// Sync tree will works by syncing the active tree type. This can be specified explicitly by calling SetActiveTreeType. + /// This will allow developers to sync many trees in one application at one time if needed. + /// + /// + /// + /// + public ClientTools SyncTree(string path, bool forceReload) + { + RegisterClientScript(string.Format(Scripts.SyncTree, path, forceReload.ToString().ToLower())); + return this; + } + + public ClientTools CopyNode(string currNodeId, string newParentPath) + { + RegisterClientScript(string.Format(Scripts.CopyNode, currNodeId, newParentPath)); + return this; + } + + public ClientTools MoveNode(string currNodeId, string newParentPath) + { + RegisterClientScript(string.Format(Scripts.MoveNode, currNodeId, newParentPath)); + return this; + } - public ClientTools MoveNode(string currNodeId, string newParentPath) - { - RegisterClientScript(string.Format(Scripts.MoveNode, currNodeId, newParentPath)); - return this; - } - /// /// Reloads only the last node that the user interacted with via the context menu. To reload a specify node, use SyncTree. /// /// /// /// - /// If for whatever reason the client side system cannot just refresh the one node, the system will use jsTree's built in + /// If for whatever reason the client side system cannot just refresh the one node, the system will use jsTree's built in /// refresh tool, this however won't allow for reselect or reloadChildren. Most trees will work with the single node /// refresh but 3rd party tools may have poorly built tree data models. /// public ClientTools ReloadActionNode(bool reselect, bool reloadChildren) - { - RegisterClientScript(string.Format(Scripts.ReloadActionNode, (!reselect).ToString().ToLower(), (!reloadChildren).ToString().ToLower())); - return this; - } - - /// - /// When the application searches for a node, it searches for nodes in specific tree types. - /// If SyncTree is used, it will sync the tree nodes with the active tree type, therefore if - /// a developer wants to sync a specific tree, they can call this method to set the type to sync. - /// - /// - /// Each branch of a particular tree should theoretically be the same type, however, developers can - /// override the type of each branch in their BaseTree's but this is not standard practice. If there - /// are multiple types of branches in one tree, then only those branches that have the Active tree type - /// will be searched for syncing. - /// - /// - /// - public ClientTools SetActiveTreeType(string treeType) - { - RegisterClientScript(string.Format(Scripts.SetActiveTreeType, treeType)); - return this; - } + { + RegisterClientScript(string.Format(Scripts.ReloadActionNode, (!reselect).ToString().ToLower(), (!reloadChildren).ToString().ToLower())); + return this; + } - /// + /// + /// When the application searches for a node, it searches for nodes in specific tree types. + /// If SyncTree is used, it will sync the tree nodes with the active tree type, therefore if + /// a developer wants to sync a specific tree, they can call this method to set the type to sync. + /// + /// + /// Each branch of a particular tree should theoretically be the same type, however, developers can + /// override the type of each branch in their BaseTree's but this is not standard practice. If there + /// are multiple types of branches in one tree, then only those branches that have the Active tree type + /// will be searched for syncing. + /// + /// + /// + public ClientTools SetActiveTreeType(string treeType) + { + RegisterClientScript(string.Format(Scripts.SetActiveTreeType, treeType)); + return this; + } + + /// /// Closes the Umbraco dialog window if it is open - /// - /// specify a value to return to add to the onCloseCallback method if one was specified in the OpenModalWindow method - /// - public ClientTools CloseModalWindow(string returnVal) - { - RegisterClientScript(Scripts.CloseModalWindow(returnVal)); - return this; - } + /// + /// specify a value to return to add to the onCloseCallback method if one was specified in the OpenModalWindow method + /// + public ClientTools CloseModalWindow(string returnVal) + { + RegisterClientScript(Scripts.CloseModalWindow(returnVal)); + return this; + } /// /// Closes the umbraco dialog window if it is open /// @@ -318,24 +318,24 @@ namespace Umbraco.Web.UI.Pages } - /// - /// Opens a modal window - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - public ClientTools OpenModalWindow(string url, string name, bool showHeader, int width, int height, int top, int leftOffset, string closeTriggers, string onCloseCallback) - { - RegisterClientScript(Scripts.OpenModalWindow(url, name, showHeader, width, height, top, leftOffset, closeTriggers, onCloseCallback)); - return this; - } + /// + /// Opens a modal window + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public ClientTools OpenModalWindow(string url, string name, bool showHeader, int width, int height, int top, int leftOffset, string closeTriggers, string onCloseCallback) + { + RegisterClientScript(Scripts.OpenModalWindow(url, name, showHeader, width, height, top, leftOffset, closeTriggers, onCloseCallback)); + return this; + } /// /// This will use the ScriptManager to register the script if one is available, otherwise will default to the ClientScript @@ -343,9 +343,9 @@ namespace Umbraco.Web.UI.Pages /// /// private void RegisterClientScript(string script) - { - //use the hash code of the script to generate the key, this way, the exact same script won't be - //inserted more than once. + { + //use the hash code of the script to generate the key, this way, the exact same script won't be + //inserted more than once. if (ScriptManager.GetCurrent(_page) != null) { ScriptManager.RegisterStartupScript(_page, _page.GetType(), script.GetHashCode().ToString(), script, true); @@ -354,10 +354,10 @@ namespace Umbraco.Web.UI.Pages { _page.ClientScript.RegisterStartupScript(_page.GetType(), script.GetHashCode().ToString(), script, true); } - } + } - } + } } diff --git a/src/Umbraco.Web/UI/Pages/UmbracoEnsuredPage.cs b/src/Umbraco.Web/UI/Pages/UmbracoEnsuredPage.cs index dfc7986620..5b0b60cb65 100644 --- a/src/Umbraco.Web/UI/Pages/UmbracoEnsuredPage.cs +++ b/src/Umbraco.Web/UI/Pages/UmbracoEnsuredPage.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Security; using System.Web; using Umbraco.Core.IO; @@ -36,7 +36,7 @@ namespace Umbraco.Web.UI.Pages /// /// /// - /// Checks if the page exists outside of the /umbraco route, in which case the request will not have been authenticated for the back office + /// Checks if the page exists outside of the /umbraco route, in which case the request will not have been authenticated for the back office /// so we'll force authentication. /// protected override void OnPreInit(EventArgs e) @@ -88,7 +88,7 @@ namespace Umbraco.Web.UI.Pages /// If true then umbraco will force any window/frame to reload umbraco in the main window /// protected bool RedirectToUmbraco { get; set; } - + /// /// Used to assign a webforms page's security to a specific tree which will in turn check to see /// if the current user has access to the specified tree's registered section @@ -104,4 +104,4 @@ namespace Umbraco.Web.UI.Pages } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/UmbracoApplication.cs b/src/Umbraco.Web/UmbracoApplication.cs index dc0dc238eb..caf6879fba 100644 --- a/src/Umbraco.Web/UmbracoApplication.cs +++ b/src/Umbraco.Web/UmbracoApplication.cs @@ -2,14 +2,14 @@ namespace Umbraco.Web { - /// - /// Represents the Umbraco global.asax class. - /// + /// + /// Represents the Umbraco global.asax class. + /// public class UmbracoApplication : UmbracoApplicationBase - { - protected override IRuntime GetRuntime() - { + { + protected override IRuntime GetRuntime() + { return new WebRuntime(this); - } - } + } + } } diff --git a/src/Umbraco.Web/UmbracoComponentRenderer.cs b/src/Umbraco.Web/UmbracoComponentRenderer.cs index af37b2f066..28892cf551 100644 --- a/src/Umbraco.Web/UmbracoComponentRenderer.cs +++ b/src/Umbraco.Web/UmbracoComponentRenderer.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.Globalization; using System.IO; @@ -224,25 +224,25 @@ namespace Umbraco.Web //TODO: This is real nasty and we should re-write the 'item' and 'ItemRenderer' class but si fine for now var attributes = new Dictionary - { - {"field", fieldAlias}, - {"recursive", recursive.ToString().ToLowerInvariant()}, - {"useifempty", altFieldAlias}, - {"textifempty", altText}, - {"stripparagraph", removeParagraphTags.ToString().ToLowerInvariant()}, - { - "case", casing == RenderFieldCaseType.Lower ? "lower" - : casing == RenderFieldCaseType.Upper ? "upper" - : casing == RenderFieldCaseType.Title ? "title" - : string.Empty - }, - {"inserttextbefore", insertBefore}, - {"inserttextafter", insertAfter}, - {"convertlinebreaks", convertLineBreaks.ToString().ToLowerInvariant()}, + { + {"field", fieldAlias}, + {"recursive", recursive.ToString().ToLowerInvariant()}, + {"useifempty", altFieldAlias}, + {"textifempty", altText}, + {"stripparagraph", removeParagraphTags.ToString().ToLowerInvariant()}, + { + "case", casing == RenderFieldCaseType.Lower ? "lower" + : casing == RenderFieldCaseType.Upper ? "upper" + : casing == RenderFieldCaseType.Title ? "title" + : string.Empty + }, + {"inserttextbefore", insertBefore}, + {"inserttextafter", insertAfter}, + {"convertlinebreaks", convertLineBreaks.ToString().ToLowerInvariant()}, {"formatasdate", formatAsDate.ToString().ToLowerInvariant()}, {"formatasdatewithtime", formatAsDateWithTime.ToString().ToLowerInvariant()}, {"formatasdatewithtimeseparator", formatAsDateWithTimeSeparator} - }; + }; switch (encoding) { case RenderFieldEncodingType.Url: @@ -303,4 +303,4 @@ namespace Umbraco.Web } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/UmbracoContext.cs b/src/Umbraco.Web/UmbracoContext.cs index 2bc796d5c8..f0df622e38 100644 --- a/src/Umbraco.Web/UmbracoContext.cs +++ b/src/Umbraco.Web/UmbracoContext.cs @@ -86,7 +86,7 @@ namespace Umbraco.Web // otherwise it's used by EnsureContext above // warn: does *not* manage setting any IUmbracoContextAccessor internal UmbracoContext( - HttpContextBase httpContext, + HttpContextBase httpContext, IFacadeService facadeService, WebSecurity webSecurity, IUmbracoSettingsSection umbracoSettings, @@ -137,32 +137,32 @@ namespace Umbraco.Web public static UmbracoContext Current => Composing.Current.UmbracoContext; /// - /// This is used internally for performance calculations, the ObjectCreated DateTime is set as soon as this - /// object is instantiated which in the web site is created during the BeginRequest phase. - /// We can then determine complete rendering time from that. - /// - internal DateTime ObjectCreated { get; private set; } + /// This is used internally for performance calculations, the ObjectCreated DateTime is set as soon as this + /// object is instantiated which in the web site is created during the BeginRequest phase. + /// We can then determine complete rendering time from that. + /// + internal DateTime ObjectCreated { get; private set; } - /// - /// This is used internally for debugging and also used to define anything required to distinguish this request from another. - /// - internal Guid UmbracoRequestId { get; private set; } + /// + /// This is used internally for debugging and also used to define anything required to distinguish this request from another. + /// + internal Guid UmbracoRequestId { get; private set; } /// /// Gets the WebSecurity class /// public WebSecurity Security { get; } - /// - /// Gets the uri that is handled by ASP.NET after server-side rewriting took place. - /// - internal Uri OriginalRequestUrl { get; } + /// + /// Gets the uri that is handled by ASP.NET after server-side rewriting took place. + /// + internal Uri OriginalRequestUrl { get; } - /// - /// Gets the cleaned up url that is handled by Umbraco. - /// - /// That is, lowercase, no trailing slash after path, no .aspx... - internal Uri CleanedUmbracoUrl { get; private set; } + /// + /// Gets the cleaned up url that is handled by Umbraco. + /// + /// That is, lowercase, no trailing slash after path, no .aspx... + internal Uri CleanedUmbracoUrl { get; private set; } /// /// Gets the facade. @@ -188,14 +188,14 @@ namespace Umbraco.Web public bool IsFrontEndUmbracoRequest => PublishedContentRequest != null; /// - /// Gets the url provider. - /// - public UrlProvider UrlProvider { get; } + /// Gets the url provider. + /// + public UrlProvider UrlProvider { get; } - /// - /// Gets/sets the PublishedContentRequest object - /// - public PublishedContentRequest PublishedContentRequest { get; set; } + /// + /// Gets/sets the PublishedContentRequest object + /// + public PublishedContentRequest PublishedContentRequest { get; set; } /// /// Exposes the HttpContext for the current request @@ -317,4 +317,4 @@ namespace Umbraco.Web _facade.Value.DisposeIfDisposable(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/UmbracoHelper.cs b/src/Umbraco.Web/UmbracoHelper.cs index 0e0fa4d93d..964270319d 100644 --- a/src/Umbraco.Web/UmbracoHelper.cs +++ b/src/Umbraco.Web/UmbracoHelper.cs @@ -23,14 +23,14 @@ using Umbraco.Web.Composing; namespace Umbraco.Web { /// - /// A helper class that provides many useful methods and functionality for using Umbraco in templates - /// - public class UmbracoHelper : IUmbracoComponentRenderer + /// A helper class that provides many useful methods and functionality for using Umbraco in templates + /// + public class UmbracoHelper : IUmbracoComponentRenderer { private static readonly HtmlStringUtilities StringUtilities = new HtmlStringUtilities(); private readonly UmbracoContext _umbracoContext; - private readonly IPublishedContent _currentPage; + private readonly IPublishedContent _currentPage; private readonly IPublishedContentQuery _iQuery; private readonly ServiceContext _services; private readonly CacheHelper _appCache; @@ -157,7 +157,7 @@ namespace Umbraco.Web /// /// Gets the membership helper. /// - public MembershipHelper MembershipHelper => _membershipHelper + public MembershipHelper MembershipHelper => _membershipHelper ?? (_membershipHelper = new MembershipHelper(UmbracoContext)); /// @@ -168,13 +168,13 @@ namespace Umbraco.Web /// /// Gets the datatype service. /// - private IDataTypeService DataTypeService => _dataTypeService + private IDataTypeService DataTypeService => _dataTypeService ?? (_dataTypeService = _services.DataTypeService); /// /// Gets the component renderer. /// - public IUmbracoComponentRenderer UmbracoComponentRenderer => _componentRenderer + public IUmbracoComponentRenderer UmbracoComponentRenderer => _componentRenderer ?? (_componentRenderer = new UmbracoComponentRenderer(UmbracoContext)); /// @@ -188,75 +188,75 @@ namespace Umbraco.Web /// this will only ever happen if the Helper is constructed with an UmbracoContext and it is not a front-end request /// /// Thrown if the UmbracoHelper is constructed with an UmbracoContext and it is not a front-end request - public IPublishedContent AssignedContentItem - { - get - { - if (_currentPage == null) + public IPublishedContent AssignedContentItem + { + get + { + if (_currentPage == null) throw new InvalidOperationException("Cannot return the " + typeof(IPublishedContent).Name + " because the " + typeof(UmbracoHelper).Name + " was constructed with an " + typeof(UmbracoContext).Name + " and the current request is not a front-end request."); return _currentPage; - } - } + } + } - /// - /// Renders the template for the specified pageId and an optional altTemplateId. - /// - /// - /// If not specified, will use the template assigned to the node - /// - public IHtmlString RenderTemplate(int pageId, int? altTemplateId = null) - { + /// + /// Renders the template for the specified pageId and an optional altTemplateId. + /// + /// + /// If not specified, will use the template assigned to the node + /// + public IHtmlString RenderTemplate(int pageId, int? altTemplateId = null) + { return UmbracoComponentRenderer.RenderTemplate(pageId, altTemplateId); - } + } - #region RenderMacro + #region RenderMacro - /// - /// Renders the macro with the specified alias. - /// - /// The alias. - /// - public IHtmlString RenderMacro(string alias) - { + /// + /// Renders the macro with the specified alias. + /// + /// The alias. + /// + public IHtmlString RenderMacro(string alias) + { return UmbracoComponentRenderer.RenderMacro(alias, new { }); - } + } - /// - /// Renders the macro with the specified alias, passing in the specified parameters. - /// - /// The alias. - /// The parameters. - /// - public IHtmlString RenderMacro(string alias, object parameters) - { + /// + /// Renders the macro with the specified alias, passing in the specified parameters. + /// + /// The alias. + /// The parameters. + /// + public IHtmlString RenderMacro(string alias, object parameters) + { return UmbracoComponentRenderer.RenderMacro(alias, parameters.ToDictionary()); - } + } - /// - /// Renders the macro with the specified alias, passing in the specified parameters. - /// - /// The alias. - /// The parameters. - /// - public IHtmlString RenderMacro(string alias, IDictionary parameters) - { + /// + /// Renders the macro with the specified alias, passing in the specified parameters. + /// + /// The alias. + /// The parameters. + /// + public IHtmlString RenderMacro(string alias, IDictionary parameters) + { return UmbracoComponentRenderer.RenderMacro(alias, parameters); - } + } - #endregion + #endregion - #region Dictionary + #region Dictionary - /// - /// Returns the dictionary value for the key specified - /// - /// - /// - public string GetDictionaryValue(string key) - { + /// + /// Returns the dictionary value for the key specified + /// + /// + /// + public string GetDictionaryValue(string key) + { return CultureDictionary[key]; - } + } /// /// Returns the dictionary value for the key specified, and if empty returns the specified default fall back value @@ -277,19 +277,19 @@ namespace Umbraco.Web /// /// Returns the ICultureDictionary for access to dictionary items /// - public ICultureDictionary CultureDictionary => _cultureDictionary + public ICultureDictionary CultureDictionary => _cultureDictionary ?? (_cultureDictionary = Current.CultureDictionaryFactory.CreateDictionary()); #endregion - #region Membership + #region Membership - [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete("Use the IsProtected method that only specifies path")] + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Use the IsProtected method that only specifies path")] public bool IsProtected(int documentId, string path) - { + { return IsProtected(path.EnsureEndsWith("," + documentId)); - } + } /// /// Check if a document object is protected by the "Protect Pages" functionality in umbraco @@ -335,30 +335,30 @@ namespace Umbraco.Web }); } - /// - /// Whether or not the current member is logged in (based on the membership provider) - /// - /// True is the current user is logged in - public bool MemberIsLoggedOn() - { + /// + /// Whether or not the current member is logged in (based on the membership provider) + /// + /// True is the current user is logged in + public bool MemberIsLoggedOn() + { return MembershipHelper.IsLoggedIn(); - } + } - #endregion + #endregion - #region NiceUrls + #region NiceUrls - /// - /// Returns a string with a friendly url from a node. - /// IE.: Instead of having /482 (id) as an url, you can have - /// /screenshots/developer/macros (spoken url) - /// - /// Identifier for the node that should be returned - /// String with a friendly url from a node - public string NiceUrl(int nodeId) - { - return Url(nodeId); - } + /// + /// Returns a string with a friendly url from a node. + /// IE.: Instead of having /482 (id) as an url, you can have + /// /screenshots/developer/macros (spoken url) + /// + /// Identifier for the node that should be returned + /// String with a friendly url from a node + public string NiceUrl(int nodeId) + { + return Url(nodeId); + } /// /// Gets the url of a content identified by its identifier. @@ -376,20 +376,20 @@ namespace Umbraco.Web /// The content identifier. /// The mode. /// The url for the content. - public string Url(int contentId, UrlProviderMode mode) - { + public string Url(int contentId, UrlProviderMode mode) + { return UrlProvider.GetUrl(contentId, mode); - } + } - /// - /// This method will always add the domain to the path if the hostnames are set up correctly. - /// - /// Identifier for the node that should be returned - /// String with a friendly url with full domain from a node - public string NiceUrlWithDomain(int nodeId) - { - return UrlAbsolute(nodeId); - } + /// + /// This method will always add the domain to the path if the hostnames are set up correctly. + /// + /// Identifier for the node that should be returned + /// String with a friendly url with full domain from a node + public string NiceUrlWithDomain(int nodeId) + { + return UrlAbsolute(nodeId); + } /// /// Gets the absolute url of a content identified by its identifier. @@ -467,7 +467,7 @@ namespace Umbraco.Web public IPublishedContent Content(object id) { return ContentForObject(id); - } + } private IPublishedContent ContentForObject(object id) { @@ -485,10 +485,10 @@ namespace Umbraco.Web /// /// The unique identifier of the content item. /// The content, or null of the content item is not in the cache. - public IPublishedContent Content(int id) - { + public IPublishedContent Content(int id) + { return ContentQuery.Content(id); - } + } /// /// Gets a content item from the cache. @@ -505,8 +505,8 @@ namespace Umbraco.Web /// /// The unique identifier, or the key, of the content item. /// The content, or null of the content item is not in the cache. - public IPublishedContent Content(string id) - { + public IPublishedContent Content(string id) + { return ContentForObject(id); } @@ -521,10 +521,10 @@ namespace Umbraco.Web /// The unique identifiers, or the keys, of the content items. /// The content items that were found in the cache. /// Does not support mixing identifiers and keys. - public IEnumerable Content(params object[] ids) - { - return ContentForObjects(ids); - } + public IEnumerable Content(params object[] ids) + { + return ContentForObjects(ids); + } private IEnumerable ContentForObjects(IEnumerable ids) { @@ -543,10 +543,10 @@ namespace Umbraco.Web /// /// The unique identifiers of the content items. /// The content items that were found in the cache. - public IEnumerable Content(params int[] ids) - { + public IEnumerable Content(params int[] ids) + { return ContentQuery.Content(ids); - } + } /// /// Gets content items from the cache. @@ -567,7 +567,7 @@ namespace Umbraco.Web public IEnumerable Content(params string[] ids) { return ContentForObjects(ids); - } + } /// /// Gets the contents corresponding to the identifiers. @@ -578,7 +578,7 @@ namespace Umbraco.Web public IEnumerable Content(IEnumerable ids) { return ContentForObjects(ids); - } + } /// /// Gets the contents corresponding to the identifiers. @@ -587,9 +587,9 @@ namespace Umbraco.Web /// The existing contents corresponding to the identifiers. /// If an identifier does not match an existing content, it will be missing in the returned value. public IEnumerable Content(IEnumerable ids) - { + { return ContentForObjects(ids); - } + } /// /// Gets the contents corresponding to the identifiers. @@ -598,9 +598,9 @@ namespace Umbraco.Web /// The existing contents corresponding to the identifiers. /// If an identifier does not match an existing content, it will be missing in the returned value. public IEnumerable Content(IEnumerable ids) - { + { return ContentQuery.Content(ids); - } + } public IEnumerable ContentAtXPath(string xpath, params XPathVariable[] vars) { @@ -682,24 +682,24 @@ namespace Umbraco.Web return true; } - #endregion + #endregion - #region Media + #region Media - /// - /// Overloaded method accepting an 'object' type - /// - /// - /// - /// - /// We accept an object type because GetPropertyValue now returns an 'object', we still want to allow people to pass - /// this result in to this method. - /// This method will throw an exception if the value is not of type int or string. - /// - public IPublishedContent Media(object id) - { - return MediaForObject(id); - } + /// + /// Overloaded method accepting an 'object' type + /// + /// + /// + /// + /// We accept an object type because GetPropertyValue now returns an 'object', we still want to allow people to pass + /// this result in to this method. + /// This method will throw an exception if the value is not of type int or string. + /// + public IPublishedContent Media(object id) + { + return MediaForObject(id); + } private IPublishedContent MediaForObject(object id) { @@ -713,14 +713,14 @@ namespace Umbraco.Web } public IPublishedContent Media(int id) - { + { return ContentQuery.Media(id); - } + } - public IPublishedContent Media(string id) - { - return MediaForObject(id); - } + public IPublishedContent Media(string id) + { + return MediaForObject(id); + } /// /// Gets the medias corresponding to the identifiers. @@ -752,9 +752,9 @@ namespace Umbraco.Web /// The existing medias corresponding to the identifiers. /// If an identifier does not match an existing media, it will be missing in the returned value. public IEnumerable Media(params int[] ids) - { + { return ContentQuery.Media(ids); - } + } /// /// Gets the medias corresponding to the identifiers. @@ -765,7 +765,7 @@ namespace Umbraco.Web public IEnumerable Media(params string[] ids) { return MediaForObjects(ids); - } + } /// /// Gets the medias corresponding to the identifiers. @@ -774,7 +774,7 @@ namespace Umbraco.Web /// The existing medias corresponding to the identifiers. /// If an identifier does not match an existing media, it will be missing in the returned value. public IEnumerable Media(IEnumerable ids) - { + { return MediaForObjects(ids); } @@ -785,9 +785,9 @@ namespace Umbraco.Web /// The existing medias corresponding to the identifiers. /// If an identifier does not match an existing media, it will be missing in the returned value. public IEnumerable Media(IEnumerable ids) - { + { return ContentQuery.Media(ids); - } + } /// /// Gets the medias corresponding to the identifiers. @@ -796,7 +796,7 @@ namespace Umbraco.Web /// The existing medias corresponding to the identifiers. /// If an identifier does not match an existing media, it will be missing in the returned value. public IEnumerable Media(IEnumerable ids) - { + { return MediaForObjects(ids); } @@ -805,167 +805,167 @@ namespace Umbraco.Web return ContentQuery.MediaAtRoot(); } - #endregion + #endregion - #region Search + #region Search - /// - /// Searches content - /// - /// - /// - /// - /// - public IEnumerable Search(string term, bool useWildCards = true, string searchProvider = null) - { + /// + /// Searches content + /// + /// + /// + /// + /// + public IEnumerable Search(string term, bool useWildCards = true, string searchProvider = null) + { return ContentQuery.Search(term, useWildCards, searchProvider); - } + } - /// - /// Searhes content - /// - /// - /// - /// - public IEnumerable Search(Examine.SearchCriteria.ISearchCriteria criteria, Examine.Providers.BaseSearchProvider searchProvider = null) - { + /// + /// Searhes content + /// + /// + /// + /// + public IEnumerable Search(Examine.SearchCriteria.ISearchCriteria criteria, Examine.Providers.BaseSearchProvider searchProvider = null) + { return ContentQuery.Search(criteria, searchProvider); - } + } - #endregion + #endregion - #region Strings + #region Strings - /// - /// Replaces text line breaks with html line breaks - /// - /// The text. - /// The text with text line breaks replaced with html linebreaks (
)
- public string ReplaceLineBreaksForHtml(string text) - { + /// + /// Replaces text line breaks with html line breaks + /// + /// The text. + /// The text with text line breaks replaced with html linebreaks (
)
+ public string ReplaceLineBreaksForHtml(string text) + { return StringUtilities.ReplaceLineBreaksForHtml(text); - } + } - /// - /// Returns an MD5 hash of the string specified - /// - /// The text to create a hash from - /// Md5 has of the string - public string CreateMd5Hash(string text) - { - return text.ToMd5(); - } + /// + /// Returns an MD5 hash of the string specified + /// + /// The text to create a hash from + /// Md5 has of the string + public string CreateMd5Hash(string text) + { + return text.ToMd5(); + } - /// - /// Strips all html tags from a given string, all contents of the tags will remain. - /// - public HtmlString StripHtml(IHtmlString html, params string[] tags) - { - return StripHtml(html.ToHtmlString(), tags); - } + /// + /// Strips all html tags from a given string, all contents of the tags will remain. + /// + public HtmlString StripHtml(IHtmlString html, params string[] tags) + { + return StripHtml(html.ToHtmlString(), tags); + } - /// - /// Strips all html tags from a given string, all contents of the tags will remain. - /// - public HtmlString StripHtml(string html, params string[] tags) - { + /// + /// Strips all html tags from a given string, all contents of the tags will remain. + /// + public HtmlString StripHtml(string html, params string[] tags) + { return StringUtilities.StripHtmlTags(html, tags); - } + } - /// - /// Will take the first non-null value in the collection and return the value of it. - /// - public string Coalesce(params object[] args) - { + /// + /// Will take the first non-null value in the collection and return the value of it. + /// + public string Coalesce(params object[] args) + { return StringUtilities.Coalesce(args); - } + } - /// - /// Will take the first non-null value in the collection and return the value of it. - /// - public string Concatenate(params object[] args) - { + /// + /// Will take the first non-null value in the collection and return the value of it. + /// + public string Concatenate(params object[] args) + { return StringUtilities.Concatenate(args); - } + } - /// - /// Joins any number of int/string/objects into one string and seperates them with the string seperator parameter. - /// - public string Join(string separator, params object[] args) - { + /// + /// Joins any number of int/string/objects into one string and seperates them with the string seperator parameter. + /// + public string Join(string separator, params object[] args) + { return StringUtilities.Join(separator, args); - } + } - /// - /// Truncates a string to a given length, can add a elipsis at the end (...). Method checks for open html tags, and makes sure to close them - /// - public IHtmlString Truncate(IHtmlString html, int length) - { - return Truncate(html.ToHtmlString(), length, true, false); - } + /// + /// Truncates a string to a given length, can add a elipsis at the end (...). Method checks for open html tags, and makes sure to close them + /// + public IHtmlString Truncate(IHtmlString html, int length) + { + return Truncate(html.ToHtmlString(), length, true, false); + } - /// - /// Truncates a string to a given length, can add a elipsis at the end (...). Method checks for open html tags, and makes sure to close them - /// - public IHtmlString Truncate(IHtmlString html, int length, bool addElipsis) - { - return Truncate(html.ToHtmlString(), length, addElipsis, false); - } + /// + /// Truncates a string to a given length, can add a elipsis at the end (...). Method checks for open html tags, and makes sure to close them + /// + public IHtmlString Truncate(IHtmlString html, int length, bool addElipsis) + { + return Truncate(html.ToHtmlString(), length, addElipsis, false); + } - /// - /// Truncates a string to a given length, can add a elipsis at the end (...). Method checks for open html tags, and makes sure to close them - /// - public IHtmlString Truncate(IHtmlString html, int length, bool addElipsis, bool treatTagsAsContent) - { - return Truncate(html.ToHtmlString(), length, addElipsis, treatTagsAsContent); - } + /// + /// Truncates a string to a given length, can add a elipsis at the end (...). Method checks for open html tags, and makes sure to close them + /// + public IHtmlString Truncate(IHtmlString html, int length, bool addElipsis, bool treatTagsAsContent) + { + return Truncate(html.ToHtmlString(), length, addElipsis, treatTagsAsContent); + } - /// - /// Truncates a string to a given length, can add a elipsis at the end (...). Method checks for open html tags, and makes sure to close them - /// - public IHtmlString Truncate(string html, int length) - { - return Truncate(html, length, true, false); - } + /// + /// Truncates a string to a given length, can add a elipsis at the end (...). Method checks for open html tags, and makes sure to close them + /// + public IHtmlString Truncate(string html, int length) + { + return Truncate(html, length, true, false); + } - /// - /// Truncates a string to a given length, can add a elipsis at the end (...). Method checks for open html tags, and makes sure to close them - /// - public IHtmlString Truncate(string html, int length, bool addElipsis) - { - return Truncate(html, length, addElipsis, false); - } + /// + /// Truncates a string to a given length, can add a elipsis at the end (...). Method checks for open html tags, and makes sure to close them + /// + public IHtmlString Truncate(string html, int length, bool addElipsis) + { + return Truncate(html, length, addElipsis, false); + } - /// - /// Truncates a string to a given length, can add a elipsis at the end (...). Method checks for open html tags, and makes sure to close them - /// - public IHtmlString Truncate(string html, int length, bool addElipsis, bool treatTagsAsContent) - { + /// + /// Truncates a string to a given length, can add a elipsis at the end (...). Method checks for open html tags, and makes sure to close them + /// + public IHtmlString Truncate(string html, int length, bool addElipsis, bool treatTagsAsContent) + { return StringUtilities.Truncate(html, length, addElipsis, treatTagsAsContent); - } + } - #endregion + #endregion - #region If + #region If - /// - /// If the test is true, the string valueIfTrue will be returned, otherwise the valueIfFalse will be returned. - /// - public HtmlString If(bool test, string valueIfTrue, string valueIfFalse) - { - return test ? new HtmlString(valueIfTrue) : new HtmlString(valueIfFalse); - } + /// + /// If the test is true, the string valueIfTrue will be returned, otherwise the valueIfFalse will be returned. + /// + public HtmlString If(bool test, string valueIfTrue, string valueIfFalse) + { + return test ? new HtmlString(valueIfTrue) : new HtmlString(valueIfFalse); + } - /// - /// If the test is true, the string valueIfTrue will be returned, otherwise the valueIfFalse will be returned. - /// - public HtmlString If(bool test, string valueIfTrue) - { - return test ? new HtmlString(valueIfTrue) : new HtmlString(string.Empty); - } + /// + /// If the test is true, the string valueIfTrue will be returned, otherwise the valueIfFalse will be returned. + /// + public HtmlString If(bool test, string valueIfTrue) + { + return test ? new HtmlString(valueIfTrue) : new HtmlString(string.Empty); + } - #endregion + #endregion #region Prevalues @@ -1056,5 +1056,5 @@ namespace Umbraco.Web return surfaceRouteParams.EncryptWithMachineKey(); } - } + } } diff --git a/src/Umbraco.Web/UmbracoModule.cs b/src/Umbraco.Web/UmbracoModule.cs index 47816c53c1..d81c7ef32d 100644 --- a/src/Umbraco.Web/UmbracoModule.cs +++ b/src/Umbraco.Web/UmbracoModule.cs @@ -22,14 +22,14 @@ using GlobalSettings = Umbraco.Core.Configuration.GlobalSettings; namespace Umbraco.Web { - // also look at IOHelper.ResolveUrlsFromTextString - nightmarish?! + // also look at IOHelper.ResolveUrlsFromTextString - nightmarish?! - // context.RewritePath supports ~/ or else must begin with /vdir - // Request.RawUrl is still there - // response.Redirect does?! always remap to /vdir?! + // context.RewritePath supports ~/ or else must begin with /vdir + // Request.RawUrl is still there + // response.Redirect does?! always remap to /vdir?! - public class UmbracoModule : IHttpModule - { + public class UmbracoModule : IHttpModule + { #region Dependencies // modules are *not* instanciated by the container so we have to @@ -63,7 +63,7 @@ namespace Umbraco.Web #endregion public UmbracoModule() - { + { _combinedRouteCollection = new Lazy(CreateRouteCollection); } @@ -74,16 +74,16 @@ namespace Umbraco.Web ///
/// private void BeginRequest(HttpContextBase httpContext) - { + { // ensure application url is initialized ((RuntimeState) Current.RuntimeState).EnsureApplicationUrl(httpContext.Request); // do not process if client-side request - if (httpContext.Request.Url.IsClientSideRequest()) - return; + if (httpContext.Request.Url.IsClientSideRequest()) + return; - // write the trace output for diagnostics at the end of the request - httpContext.Trace.Write("UmbracoModule", "Umbraco request begins"); + // write the trace output for diagnostics at the end of the request + httpContext.Trace.Write("UmbracoModule", "Umbraco request begins"); // ok, process @@ -94,38 +94,38 @@ namespace Umbraco.Web // create the UmbracoContext singleton, one per request, and assign // replace existing if any (eg during app startup, a temp one is created) - UmbracoContext.EnsureContext( + UmbracoContext.EnsureContext( UmbracoContextAccessor, httpContext, FacadeService, - new WebSecurity(httpContext, UserService), - UmbracoConfig.For.UmbracoSettings(), - UrlProviders, - true); - } + new WebSecurity(httpContext, UserService), + UmbracoConfig.For.UmbracoSettings(), + UrlProviders, + true); + } - /// - /// Processses the Umbraco Request - /// - /// - /// - /// - /// This will check if we are trying to route to the default back office page (i.e. ~/Umbraco/ or ~/Umbraco or ~/Umbraco/Default ) - /// and ensure that the MVC handler executes for that. This is required because the route for /Umbraco will never execute because + /// + /// Processses the Umbraco Request + /// + /// + /// + /// + /// This will check if we are trying to route to the default back office page (i.e. ~/Umbraco/ or ~/Umbraco or ~/Umbraco/Default ) + /// and ensure that the MVC handler executes for that. This is required because the route for /Umbraco will never execute because /// files/folders exist there and we cannot set the RouteCollection.RouteExistingFiles = true since that will muck a lot of other things up. /// So we handle it here and explicitly execute the MVC controller. - /// - /// - void ProcessRequest(HttpContextBase httpContext) - { - // do not process if client-side request - if (httpContext.Request.Url.IsClientSideRequest()) - return; + /// + /// + void ProcessRequest(HttpContextBase httpContext) + { + // do not process if client-side request + if (httpContext.Request.Url.IsClientSideRequest()) + return; - if (UmbracoContext.Current == null) - throw new InvalidOperationException("The UmbracoContext.Current is null, ProcessRequest cannot proceed unless there is a current UmbracoContext"); + if (UmbracoContext.Current == null) + throw new InvalidOperationException("The UmbracoContext.Current is null, ProcessRequest cannot proceed unless there is a current UmbracoContext"); - var umbracoContext = UmbracoContext.Current; + var umbracoContext = UmbracoContext.Current; // re-write for the default back office path if (httpContext.Request.Url.IsDefaultBackOfficeRequest()) @@ -135,65 +135,65 @@ namespace Umbraco.Web return; } - // do not process if this request is not a front-end routable page - var isRoutableAttempt = EnsureUmbracoRoutablePage(umbracoContext, httpContext); + // do not process if this request is not a front-end routable page + var isRoutableAttempt = EnsureUmbracoRoutablePage(umbracoContext, httpContext); // raise event here OnRouteAttempt(new RoutableAttemptEventArgs(isRoutableAttempt.Result, umbracoContext, httpContext)); - if (isRoutableAttempt.Success == false) return; + if (isRoutableAttempt.Success == false) return; - httpContext.Trace.Write("UmbracoModule", "Umbraco request confirmed"); + httpContext.Trace.Write("UmbracoModule", "Umbraco request confirmed"); - // ok, process + // ok, process - // note: requestModule.UmbracoRewrite also did some stripping of &umbPage - // from the querystring... that was in v3.x to fix some issues with pre-forms - // auth. Paul Sterling confirmed in jan. 2013 that we can get rid of it. + // note: requestModule.UmbracoRewrite also did some stripping of &umbPage + // from the querystring... that was in v3.x to fix some issues with pre-forms + // auth. Paul Sterling confirmed in jan. 2013 that we can get rid of it. - // instanciate, prepare and process the published content request - // important to use CleanedUmbracoUrl - lowercase path-only version of the current url - var request = FacadeRouter.CreateRequest(umbracoContext); - umbracoContext.PublishedContentRequest = request; + // instanciate, prepare and process the published content request + // important to use CleanedUmbracoUrl - lowercase path-only version of the current url + var request = FacadeRouter.CreateRequest(umbracoContext); + umbracoContext.PublishedContentRequest = request; FacadeRouter.PrepareRequest(request); // HandleHttpResponseStatus returns a value indicating that the request should // not be processed any further, eg because it has been redirect. then, exit. if (HandleHttpResponseStatus(httpContext, request, Logger)) - return; + return; if (request.HasPublishedContent == false) - httpContext.RemapHandler(new PublishedContentNotFoundHandler()); - else - RewriteToUmbracoHandler(httpContext, request); - } + httpContext.RemapHandler(new PublishedContentNotFoundHandler()); + else + RewriteToUmbracoHandler(httpContext, request); + } - #endregion + #endregion - #region Methods + #region Methods - /// - /// Checks the current request and ensures that it is routable based on the structure of the request and URI - /// - /// - /// - /// + /// + /// Checks the current request and ensures that it is routable based on the structure of the request and URI + /// + /// + /// + /// internal Attempt EnsureUmbracoRoutablePage(UmbracoContext context, HttpContextBase httpContext) - { - var uri = context.OriginalRequestUrl; + { + var uri = context.OriginalRequestUrl; - var reason = EnsureRoutableOutcome.IsRoutable; + var reason = EnsureRoutableOutcome.IsRoutable; - // ensure this is a document request - if (EnsureDocumentRequest(httpContext, uri) == false) - { - reason = EnsureRoutableOutcome.NotDocumentRequest; - } + // ensure this is a document request + if (EnsureDocumentRequest(httpContext, uri) == false) + { + reason = EnsureRoutableOutcome.NotDocumentRequest; + } // ensure the runtime is in the proper state // and deal with needed redirects, etc else if (EnsureRuntime(httpContext, uri) == false) - { - reason = EnsureRoutableOutcome.NotReady; - } + { + reason = EnsureRoutableOutcome.NotReady; + } // ensure Umbraco has documents to serve else if (EnsureHasContent(context, httpContext) == false) { @@ -201,65 +201,65 @@ namespace Umbraco.Web } return Attempt.If(reason == EnsureRoutableOutcome.IsRoutable, reason); - } + } - /// - /// Ensures that the request is a document request (i.e. one that the module should handle) - /// - /// - /// - /// - private bool EnsureDocumentRequest(HttpContextBase httpContext, Uri uri) - { - var maybeDoc = true; - var lpath = uri.AbsolutePath.ToLowerInvariant(); + /// + /// Ensures that the request is a document request (i.e. one that the module should handle) + /// + /// + /// + /// + private bool EnsureDocumentRequest(HttpContextBase httpContext, Uri uri) + { + var maybeDoc = true; + var lpath = uri.AbsolutePath.ToLowerInvariant(); - // handle directory-urls used for asmx - // legacy - what's the point really? - if (/*maybeDoc &&*/ GlobalSettings.UseDirectoryUrls) - { - var asmxPos = lpath.IndexOf(".asmx/", StringComparison.OrdinalIgnoreCase); - if (asmxPos >= 0) - { - // use uri.AbsolutePath, not path, 'cos path has been lowercased - httpContext.RewritePath(uri.AbsolutePath.Substring(0, asmxPos + 5), // filePath - uri.AbsolutePath.Substring(asmxPos + 5), // pathInfo - uri.Query.TrimStart('?')); - maybeDoc = false; - } - } + // handle directory-urls used for asmx + // legacy - what's the point really? + if (/*maybeDoc &&*/ GlobalSettings.UseDirectoryUrls) + { + var asmxPos = lpath.IndexOf(".asmx/", StringComparison.OrdinalIgnoreCase); + if (asmxPos >= 0) + { + // use uri.AbsolutePath, not path, 'cos path has been lowercased + httpContext.RewritePath(uri.AbsolutePath.Substring(0, asmxPos + 5), // filePath + uri.AbsolutePath.Substring(asmxPos + 5), // pathInfo + uri.Query.TrimStart('?')); + maybeDoc = false; + } + } - // a document request should be - // /foo/bar/nil - // /foo/bar/nil/ - // /foo/bar/nil.aspx - // where /foo is not a reserved path + // a document request should be + // /foo/bar/nil + // /foo/bar/nil/ + // /foo/bar/nil.aspx + // where /foo is not a reserved path - // if the path contains an extension that is not .aspx - // then it cannot be a document request - var extension = Path.GetExtension(lpath); + // if the path contains an extension that is not .aspx + // then it cannot be a document request + var extension = Path.GetExtension(lpath); if (maybeDoc && extension.IsNullOrWhiteSpace() == false && extension != ".aspx") - maybeDoc = false; + maybeDoc = false; - // at that point, either we have no extension, or it is .aspx + // at that point, either we have no extension, or it is .aspx - // if the path is reserved then it cannot be a document request + // if the path is reserved then it cannot be a document request if (maybeDoc && GlobalSettings.IsReservedPathOrUrl(lpath, httpContext, _combinedRouteCollection.Value)) - maybeDoc = false; + maybeDoc = false; - //NOTE: No need to warn, plus if we do we should log the document, as this message doesn't really tell us anything :) - //if (!maybeDoc) - //{ - // Logger.Warn("Not a document"); - //} + //NOTE: No need to warn, plus if we do we should log the document, as this message doesn't really tell us anything :) + //if (!maybeDoc) + //{ + // Logger.Warn("Not a document"); + //} - return maybeDoc; - } + return maybeDoc; + } - private bool EnsureRuntime(HttpContextBase httpContext, Uri uri) - { - var debug = Runtime.Debug; - var level = Runtime.Level; + private bool EnsureRuntime(HttpContextBase httpContext, Uri uri) + { + var debug = Runtime.Debug; + var level = Runtime.Level; switch (level) { case RuntimeLevel.Unknown: @@ -307,31 +307,31 @@ namespace Umbraco.Web } private static bool _reported; - private static RuntimeLevel _reportedLevel; + private static RuntimeLevel _reportedLevel; private void ReportRuntime(RuntimeLevel level, string message) - { - if (_reported && _reportedLevel == level) return; + { + if (_reported && _reportedLevel == level) return; _reported = true; - _reportedLevel = level; + _reportedLevel = level; Logger.Warn(message); - } + } - // ensures Umbraco has at least one published node - // if not, rewrites to splash and return false - // if yes, return true - private bool EnsureHasContent(UmbracoContext context, HttpContextBase httpContext) - { + // ensures Umbraco has at least one published node + // if not, rewrites to splash and return false + // if yes, return true + private bool EnsureHasContent(UmbracoContext context, HttpContextBase httpContext) + { if (context.ContentCache.HasContent()) - return true; + return true; Logger.Warn("Umbraco has no content"); - const string noContentUrl = "~/config/splashes/noNodes.aspx"; - httpContext.RewritePath(UriUtility.ToAbsolute(noContentUrl)); + const string noContentUrl = "~/config/splashes/noNodes.aspx"; + httpContext.RewritePath(UriUtility.ToAbsolute(noContentUrl)); - return false; - } + return false; + } // returns a value indicating whether redirection took place and the request has // been completed - because we don't want to Response.End() here to terminate @@ -417,8 +417,8 @@ namespace Umbraco.Web } /// - /// Rewrites to the Umbraco handler - we always send the request via our MVC rendering engine, this will deal with - /// requests destined for webforms. + /// Rewrites to the Umbraco handler - we always send the request via our MVC rendering engine, this will deal with + /// requests destined for webforms. /// /// /// @@ -429,7 +429,7 @@ namespace Umbraco.Web // rewritten url, but this is not what we want! // read: http://forums.iis.net/t/1146511.aspx - var query = pcr.Uri.Query.TrimStart('?'); + var query = pcr.Uri.Query.TrimStart('?'); // GlobalSettings.Path has already been through IOHelper.ResolveUrl() so it begins with / and vdir (if any) var rewritePath = GlobalSettings.Path.TrimEnd('/') + "/RenderMvc"; @@ -450,7 +450,7 @@ namespace Umbraco.Web } - /// + /// /// Any object that is in the HttpContext.Items collection that is IDisposable will get disposed on the end of the request /// /// @@ -491,17 +491,17 @@ namespace Umbraco.Web } } - #endregion + #endregion - #region IHttpModule + #region IHttpModule - /// - /// Initialize the module, this will trigger for each new application - /// and there may be more than 1 application per application domain - /// - /// - public void Init(HttpApplication app) - { + /// + /// Initialize the module, this will trigger for each new application + /// and there may be more than 1 application per application domain + /// + /// + public void Init(HttpApplication app) + { if (Core.Composing.Current.RuntimeState.Level == RuntimeLevel.BootFailed) { // there's nothing we can do really @@ -533,60 +533,60 @@ namespace Umbraco.Web return; } - // modules are *not* instanciated by the container so we have to - // get our dependencies injected manually, through properties. - Core.Composing.Current.Container.InjectProperties(this); + // modules are *not* instanciated by the container so we have to + // get our dependencies injected manually, through properties. + Core.Composing.Current.Container.InjectProperties(this); - app.BeginRequest += (sender, e) => - { - var httpContext = ((HttpApplication) sender).Context; - Logger.Debug("Begin request: {0}.", () => httpContext.Request.Url); - BeginRequest(new HttpContextWrapper(httpContext)); - }; + app.BeginRequest += (sender, e) => + { + var httpContext = ((HttpApplication) sender).Context; + Logger.Debug("Begin request: {0}.", () => httpContext.Request.Url); + BeginRequest(new HttpContextWrapper(httpContext)); + }; - //disable asp.net headers (security) - // This is the correct place to modify headers according to MS: - // https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/65241-Heap-error-from-header-manipulation?p=0#comment220889 - app.PostReleaseRequestState += (sender, args) => - { - var httpContext = ((HttpApplication) sender).Context; - try - { - httpContext.Response.Headers.Remove("Server"); - //this doesn't normally work since IIS sets it but we'll keep it here anyways. - httpContext.Response.Headers.Remove("X-Powered-By"); - httpContext.Response.Headers.Remove("X-AspNet-Version"); - httpContext.Response.Headers.Remove("X-AspNetMvc-Version"); - } - catch (PlatformNotSupportedException) - { - // can't remove headers this way on IIS6 or cassini. - } - }; + //disable asp.net headers (security) + // This is the correct place to modify headers according to MS: + // https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/65241-Heap-error-from-header-manipulation?p=0#comment220889 + app.PostReleaseRequestState += (sender, args) => + { + var httpContext = ((HttpApplication) sender).Context; + try + { + httpContext.Response.Headers.Remove("Server"); + //this doesn't normally work since IIS sets it but we'll keep it here anyways. + httpContext.Response.Headers.Remove("X-Powered-By"); + httpContext.Response.Headers.Remove("X-AspNet-Version"); + httpContext.Response.Headers.Remove("X-AspNetMvc-Version"); + } + catch (PlatformNotSupportedException) + { + // can't remove headers this way on IIS6 or cassini. + } + }; - app.PostResolveRequestCache += (sender, e) => - { - var httpContext = ((HttpApplication) sender).Context; - ProcessRequest(new HttpContextWrapper(httpContext)); - }; + app.PostResolveRequestCache += (sender, e) => + { + var httpContext = ((HttpApplication) sender).Context; + ProcessRequest(new HttpContextWrapper(httpContext)); + }; - app.EndRequest += (sender, args) => - { - var httpContext = ((HttpApplication) sender).Context; + app.EndRequest += (sender, args) => + { + var httpContext = ((HttpApplication) sender).Context; - if (UmbracoContext.Current != null && UmbracoContext.Current.IsFrontEndUmbracoRequest) - { - Logger.Debug($"End Request. ({DateTime.Now.Subtract(UmbracoContext.Current.ObjectCreated).TotalMilliseconds}ms)"); - } + if (UmbracoContext.Current != null && UmbracoContext.Current.IsFrontEndUmbracoRequest) + { + Logger.Debug($"End Request. ({DateTime.Now.Subtract(UmbracoContext.Current.ObjectCreated).TotalMilliseconds}ms)"); + } OnEndRequest(new UmbracoRequestEventArgs(UmbracoContext.Current, new HttpContextWrapper(httpContext))); DisposeHttpContextItems(httpContext); - }; - } + }; + } - public void Dispose() - { } + public void Dispose() + { } #endregion @@ -617,8 +617,8 @@ namespace Umbraco.Web /// private readonly Lazy _combinedRouteCollection; - private RouteCollection CreateRouteCollection() - { + private RouteCollection CreateRouteCollection() + { var routes = new RouteCollection(); foreach (var route in RouteTable.Routes) @@ -645,5 +645,5 @@ namespace Umbraco.Web /// any of the registered paths, then the module will let the request keep executing /// internal static readonly ConcurrentHashSet ReservedPaths = new ConcurrentHashSet(); - } + } } diff --git a/src/Umbraco.Web/UriUtility.cs b/src/Umbraco.Web/UriUtility.cs index a9a30da41b..d5ad7d3854 100644 --- a/src/Umbraco.Web/UriUtility.cs +++ b/src/Umbraco.Web/UriUtility.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Text; using System.Web; using Umbraco.Core; @@ -13,17 +13,17 @@ namespace Umbraco.Web static UriUtility() { - ResetAppDomainAppVirtualPath(); + ResetAppDomainAppVirtualPath(); } - // internal for unit testing only - internal static void SetAppDomainAppVirtualPath(string appPath) - { - _appPath = appPath ?? "/"; - _appPathPrefix = _appPath; - if (_appPathPrefix == "/") - _appPathPrefix = String.Empty; - } + // internal for unit testing only + internal static void SetAppDomainAppVirtualPath(string appPath) + { + _appPath = appPath ?? "/"; + _appPathPrefix = _appPath; + if (_appPathPrefix == "/") + _appPathPrefix = String.Empty; + } internal static void ResetAppDomainAppVirtualPath() { @@ -37,81 +37,81 @@ namespace Umbraco.Web public static string AppPathPrefix => _appPathPrefix; // adds the virtual directory if any - // see also VirtualPathUtility.ToAbsolute - public static string ToAbsolute(string url) + // see also VirtualPathUtility.ToAbsolute + public static string ToAbsolute(string url) { - //return ResolveUrl(url); - url = url.TrimStart('~'); - return _appPathPrefix + url; + //return ResolveUrl(url); + url = url.TrimStart('~'); + return _appPathPrefix + url; } - // strips the virtual directory if any - // see also VirtualPathUtility.ToAppRelative + // strips the virtual directory if any + // see also VirtualPathUtility.ToAppRelative public static string ToAppRelative(string virtualPath) { if (virtualPath.InvariantStartsWith(_appPathPrefix) && (virtualPath.Length == _appPathPrefix.Length || virtualPath[_appPathPrefix.Length] == '/')) virtualPath = virtualPath.Substring(_appPathPrefix.Length); - if (virtualPath.Length == 0) - virtualPath = "/"; + if (virtualPath.Length == 0) + virtualPath = "/"; return virtualPath; } - // maps an internal umbraco uri to a public uri - // ie with virtual directory, .aspx if required... - public static Uri UriFromUmbraco(Uri uri) - { - var path = uri.GetSafeAbsolutePath(); + // maps an internal umbraco uri to a public uri + // ie with virtual directory, .aspx if required... + public static Uri UriFromUmbraco(Uri uri) + { + var path = uri.GetSafeAbsolutePath(); - if (path != "/") - { - if (!GlobalSettings.UseDirectoryUrls) - path += ".aspx"; + if (path != "/") + { + if (!GlobalSettings.UseDirectoryUrls) + path += ".aspx"; else if (UmbracoConfig.For.UmbracoSettings().RequestHandler.AddTrailingSlash) - path += "/"; - } + path += "/"; + } - path = ToAbsolute(path); + path = ToAbsolute(path); - return uri.Rewrite(path); - } + return uri.Rewrite(path); + } - // maps a public uri to an internal umbraco uri - // ie no virtual directory, no .aspx, lowercase... - public static Uri UriToUmbraco(Uri uri) - { - // note: no need to decode uri here because we're returning a uri - // so it will be re-encoded anyway - var path = uri.GetSafeAbsolutePath(); + // maps a public uri to an internal umbraco uri + // ie no virtual directory, no .aspx, lowercase... + public static Uri UriToUmbraco(Uri uri) + { + // note: no need to decode uri here because we're returning a uri + // so it will be re-encoded anyway + var path = uri.GetSafeAbsolutePath(); - path = path.ToLower(); - path = ToAppRelative(path); // strip vdir if any + path = path.ToLower(); + path = ToAppRelative(path); // strip vdir if any - //we need to check if the path is /default.aspx because this will occur when using a - //web server pre IIS 7 when requesting the root document - //if this is the case we need to change it to '/' - if (path.StartsWith("/default.aspx", StringComparison.InvariantCultureIgnoreCase)) - { - string rempath = path.Substring("/default.aspx".Length, path.Length - "/default.aspx".Length); - path = rempath.StartsWith("/") ? rempath : "/" + rempath; - } - if (path != "/") - { - path = path.TrimEnd('/'); - } + //we need to check if the path is /default.aspx because this will occur when using a + //web server pre IIS 7 when requesting the root document + //if this is the case we need to change it to '/' + if (path.StartsWith("/default.aspx", StringComparison.InvariantCultureIgnoreCase)) + { + string rempath = path.Substring("/default.aspx".Length, path.Length - "/default.aspx".Length); + path = rempath.StartsWith("/") ? rempath : "/" + rempath; + } + if (path != "/") + { + path = path.TrimEnd('/'); + } - //if any part of the path contains .aspx, replace it with nothing. - //sometimes .aspx is not at the end since we might have /home/sub1.aspx/customtemplate - path = path.Replace(".aspx", ""); + //if any part of the path contains .aspx, replace it with nothing. + //sometimes .aspx is not at the end since we might have /home/sub1.aspx/customtemplate + path = path.Replace(".aspx", ""); - return uri.Rewrite(path); - } + return uri.Rewrite(path); + } - #region ResolveUrl + #region ResolveUrl // http://www.codeproject.com/Articles/53460/ResolveUrl-in-ASP-NET-The-Perfect-Solution // note - // if browsing http://example.com/sub/page1.aspx then + // if browsing http://example.com/sub/page1.aspx then // ResolveUrl("page2.aspx") returns "/page2.aspx" // Page.ResolveUrl("page2.aspx") returns "/sub/page2.aspx" (relative...) // @@ -172,74 +172,74 @@ namespace Umbraco.Web #endregion - #region Uri string utilities + #region Uri string utilities - public static bool HasScheme(string uri) - { - return uri.IndexOf("://") > 0; - } + public static bool HasScheme(string uri) + { + return uri.IndexOf("://") > 0; + } - public static string StartWithScheme(string uri) - { - return StartWithScheme(uri, null); - } + public static string StartWithScheme(string uri) + { + return StartWithScheme(uri, null); + } - public static string StartWithScheme(string uri, string scheme) - { - return HasScheme(uri) ? uri : String.Format("{0}://{1}", scheme ?? Uri.UriSchemeHttp, uri); - } + public static string StartWithScheme(string uri, string scheme) + { + return HasScheme(uri) ? uri : String.Format("{0}://{1}", scheme ?? Uri.UriSchemeHttp, uri); + } - public static string EndPathWithSlash(string uri) - { - var pos1 = Math.Max(0, uri.IndexOf('?')); - var pos2 = Math.Max(0, uri.IndexOf('#')); - var pos = Math.Min(pos1, pos2); + public static string EndPathWithSlash(string uri) + { + var pos1 = Math.Max(0, uri.IndexOf('?')); + var pos2 = Math.Max(0, uri.IndexOf('#')); + var pos = Math.Min(pos1, pos2); - var path = pos > 0 ? uri.Substring(0, pos) : uri; - path = path.EnsureEndsWith('/'); + var path = pos > 0 ? uri.Substring(0, pos) : uri; + path = path.EnsureEndsWith('/'); - if (pos > 0) - path += uri.Substring(pos); + if (pos > 0) + path += uri.Substring(pos); - return path; - } + return path; + } - public static string TrimPathEndSlash(string uri) - { - var pos1 = Math.Max(0, uri.IndexOf('?')); - var pos2 = Math.Max(0, uri.IndexOf('#')); - var pos = Math.Min(pos1, pos2); + public static string TrimPathEndSlash(string uri) + { + var pos1 = Math.Max(0, uri.IndexOf('?')); + var pos2 = Math.Max(0, uri.IndexOf('#')); + var pos = Math.Min(pos1, pos2); - var path = pos > 0 ? uri.Substring(0, pos) : uri; - path = path.TrimEnd('/'); + var path = pos > 0 ? uri.Substring(0, pos) : uri; + path = path.TrimEnd('/'); - if (pos > 0) - path += uri.Substring(pos); + if (pos > 0) + path += uri.Substring(pos); - return path; - } + return path; + } - #endregion + #endregion - /// - /// Returns an faull url with the host, port, etc... - /// - /// An absolute path (i.e. starts with a '/' ) - /// - /// - /// - /// Based on http://stackoverflow.com/questions/3681052/get-absolute-url-from-relative-path-refactored-method - /// - internal static Uri ToFullUrl(string absolutePath, HttpContextBase httpContext) - { - if (httpContext == null) throw new ArgumentNullException("httpContext"); - if (string.IsNullOrEmpty(absolutePath)) - throw new ArgumentNullException("absolutePath"); - - if (!absolutePath.StartsWith("/")) - throw new FormatException("The absolutePath specified does not start with a '/'"); + /// + /// Returns an faull url with the host, port, etc... + /// + /// An absolute path (i.e. starts with a '/' ) + /// + /// + /// + /// Based on http://stackoverflow.com/questions/3681052/get-absolute-url-from-relative-path-refactored-method + /// + internal static Uri ToFullUrl(string absolutePath, HttpContextBase httpContext) + { + if (httpContext == null) throw new ArgumentNullException("httpContext"); + if (string.IsNullOrEmpty(absolutePath)) + throw new ArgumentNullException("absolutePath"); - return new Uri(absolutePath, UriKind.Relative).MakeAbsolute(httpContext.Request.Url); - } + if (!absolutePath.StartsWith("/")) + throw new FormatException("The absolutePath specified does not start with a '/'"); + + return new Uri(absolutePath, UriKind.Relative).MakeAbsolute(httpContext.Request.Url); + } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/UrlHelperExtensions.cs b/src/Umbraco.Web/UrlHelperExtensions.cs index 706b8359ae..20961a3897 100644 --- a/src/Umbraco.Web/UrlHelperExtensions.cs +++ b/src/Umbraco.Web/UrlHelperExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Globalization; using System.Linq; using System.Linq.Expressions; @@ -164,20 +164,20 @@ namespace Umbraco.Web /// public static string GetUrlWithCacheBust(this UrlHelper url, string actionName, string controllerName, RouteValueDictionary routeVals = null) { - var applicationJs = url.Action(actionName, controllerName, routeVals); + var applicationJs = url.Action(actionName, controllerName, routeVals); applicationJs = applicationJs + "?umb__rnd=" + GetCacheBustHash(); return applicationJs; } /// - /// + /// /// /// public static string GetCacheBustHash() { //make a hash of umbraco and client dependency version //in case the user bypasses the installer and just bumps the web.config or clientdep config - + var versionHash = new HashCodeCombiner(); //if in debug mode, always burst the cache @@ -188,12 +188,12 @@ namespace Umbraco.Web else { //create a unique hash code of the current umb version and the current cdf version - + versionHash.AddCaseInsensitiveString(UmbracoVersion.Current.ToString()); - versionHash.AddCaseInsensitiveString(ClientDependencySettings.Instance.Version.ToString(CultureInfo.InvariantCulture)); + versionHash.AddCaseInsensitiveString(ClientDependencySettings.Instance.Version.ToString(CultureInfo.InvariantCulture)); } return versionHash.GetCombinedHashCode(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/UrlHelperRenderExtensions.cs b/src/Umbraco.Web/UrlHelperRenderExtensions.cs index 04e86fce79..802ef51422 100644 --- a/src/Umbraco.Web/UrlHelperRenderExtensions.cs +++ b/src/Umbraco.Web/UrlHelperRenderExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using System.Web; using System.Web.Mvc; @@ -31,7 +31,7 @@ namespace Umbraco.Web /// The crop alias e.g. thumbnail /// /// - /// Whether to HTML encode this URL - default is true - w3c standards require html attributes to be html encoded but this can be + /// Whether to HTML encode this URL - default is true - w3c standards require html attributes to be html encoded but this can be /// set to false if using the result of this method for CSS. /// /// @@ -55,7 +55,7 @@ namespace Umbraco.Web /// The crop alias e.g. thumbnail /// /// - /// Whether to HTML encode this URL - default is true - w3c standards require html attributes to be html encoded but this can be + /// Whether to HTML encode this URL - default is true - w3c standards require html attributes to be html encoded but this can be /// set to false if using the result of this method for CSS. /// /// @@ -119,9 +119,9 @@ namespace Umbraco.Web /// /// /// - /// Whether to HTML encode this URL - default is true - w3c standards require html attributes to be html encoded but this can be + /// Whether to HTML encode this URL - default is true - w3c standards require html attributes to be html encoded but this can be /// set to false if using the result of this method for CSS. - /// + /// /// /// The . /// @@ -200,9 +200,9 @@ namespace Umbraco.Web /// /// /// - /// Whether to HTML encode this URL - default is true - w3c standards require html attributes to be html encoded but this can be + /// Whether to HTML encode this URL - default is true - w3c standards require html attributes to be html encoded but this can be /// set to false if using the result of this method for CSS. - /// + /// /// /// The . /// @@ -226,7 +226,7 @@ namespace Umbraco.Web var url = imageUrl.GetCropUrl(width, height, imageCropperValue, cropAlias, quality, imageCropMode, imageCropAnchor, preferFocalPoint, useCropDimensions, cacheBusterValue, furtherOptions, ratioMode, upScale); - return htmlEncode ? new HtmlString(HttpUtility.HtmlEncode(url)) : new HtmlString(url); + return htmlEncode ? new HtmlString(HttpUtility.HtmlEncode(url)) : new HtmlString(url); } #endregion @@ -346,4 +346,4 @@ namespace Umbraco.Web return url.SurfaceAction(action, typeof (T), additionalRouteVals); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/Web References/org.umbraco.our/Reference.cs b/src/Umbraco.Web/Web References/org.umbraco.our/Reference.cs index 0f4636c8bc..2075ab641d 100644 --- a/src/Umbraco.Web/Web References/org.umbraco.our/Reference.cs +++ b/src/Umbraco.Web/Web References/org.umbraco.our/Reference.cs @@ -8,9 +8,9 @@ // //------------------------------------------------------------------------------ -// +// // This source code was auto-generated by Microsoft.VSDesigner, Version 4.0.30319.42000. -// +// #pragma warning disable 1591 namespace Umbraco.Web.org.umbraco.our { @@ -20,39 +20,39 @@ namespace Umbraco.Web.org.umbraco.our { using System.Web.Services.Protocols; using System.Xml.Serialization; using System.ComponentModel; - - + + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1038.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Web.Services.WebServiceBindingAttribute(Name="RepositorySoap", Namespace="http://packages.umbraco.org/webservices/")] public partial class Repository : System.Web.Services.Protocols.SoapHttpClientProtocol { - + private System.Threading.SendOrPostCallback CategoriesOperationCompleted; - + private System.Threading.SendOrPostCallback ModulesOperationCompleted; - + private System.Threading.SendOrPostCallback ModulesCategorizedOperationCompleted; - + private System.Threading.SendOrPostCallback NitrosOperationCompleted; - + private System.Threading.SendOrPostCallback NitrosCategorizedOperationCompleted; - + private System.Threading.SendOrPostCallback authenticateOperationCompleted; - + private System.Threading.SendOrPostCallback fetchPackageOperationCompleted; - + private System.Threading.SendOrPostCallback fetchPackageByVersionOperationCompleted; - + private System.Threading.SendOrPostCallback fetchProtectedPackageOperationCompleted; - + private System.Threading.SendOrPostCallback SubmitPackageOperationCompleted; - + private System.Threading.SendOrPostCallback PackageByGuidOperationCompleted; - + private bool useDefaultCredentialsSetExplicitly; - + /// public Repository() { this.Url = global::Umbraco.Web.Properties.Settings.Default.umbraco_org_umbraco_our_Repository; @@ -64,21 +64,21 @@ namespace Umbraco.Web.org.umbraco.our { this.useDefaultCredentialsSetExplicitly = true; } } - + public new string Url { get { return base.Url; } set { - if ((((this.IsLocalFileSystemWebService(base.Url) == true) - && (this.useDefaultCredentialsSetExplicitly == false)) + if ((((this.IsLocalFileSystemWebService(base.Url) == true) + && (this.useDefaultCredentialsSetExplicitly == false)) && (this.IsLocalFileSystemWebService(value) == false))) { base.UseDefaultCredentials = false; } base.Url = value; } } - + public new bool UseDefaultCredentials { get { return base.UseDefaultCredentials; @@ -88,40 +88,40 @@ namespace Umbraco.Web.org.umbraco.our { this.useDefaultCredentialsSetExplicitly = true; } } - + /// public event CategoriesCompletedEventHandler CategoriesCompleted; - + /// public event ModulesCompletedEventHandler ModulesCompleted; - + /// public event ModulesCategorizedCompletedEventHandler ModulesCategorizedCompleted; - + /// public event NitrosCompletedEventHandler NitrosCompleted; - + /// public event NitrosCategorizedCompletedEventHandler NitrosCategorizedCompleted; - + /// public event authenticateCompletedEventHandler authenticateCompleted; - + /// public event fetchPackageCompletedEventHandler fetchPackageCompleted; - + /// public event fetchPackageByVersionCompletedEventHandler fetchPackageByVersionCompleted; - + /// public event fetchProtectedPackageCompletedEventHandler fetchProtectedPackageCompleted; - + /// public event SubmitPackageCompletedEventHandler SubmitPackageCompleted; - + /// public event PackageByGuidCompletedEventHandler PackageByGuidCompleted; - + /// [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://packages.umbraco.org/webservices/Categories", RequestNamespace="http://packages.umbraco.org/webservices/", ResponseNamespace="http://packages.umbraco.org/webservices/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] public Category[] Categories(string repositoryGuid) { @@ -129,12 +129,12 @@ namespace Umbraco.Web.org.umbraco.our { repositoryGuid}); return ((Category[])(results[0])); } - + /// public void CategoriesAsync(string repositoryGuid) { this.CategoriesAsync(repositoryGuid, null); } - + /// public void CategoriesAsync(string repositoryGuid, object userState) { if ((this.CategoriesOperationCompleted == null)) { @@ -143,26 +143,26 @@ namespace Umbraco.Web.org.umbraco.our { this.InvokeAsync("Categories", new object[] { repositoryGuid}, this.CategoriesOperationCompleted, userState); } - + private void OnCategoriesOperationCompleted(object arg) { if ((this.CategoriesCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.CategoriesCompleted(this, new CategoriesCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://packages.umbraco.org/webservices/Modules", RequestNamespace="http://packages.umbraco.org/webservices/", ResponseNamespace="http://packages.umbraco.org/webservices/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] public Package[] Modules() { object[] results = this.Invoke("Modules", new object[0]); return ((Package[])(results[0])); } - + /// public void ModulesAsync() { this.ModulesAsync(null); } - + /// public void ModulesAsync(object userState) { if ((this.ModulesOperationCompleted == null)) { @@ -170,26 +170,26 @@ namespace Umbraco.Web.org.umbraco.our { } this.InvokeAsync("Modules", new object[0], this.ModulesOperationCompleted, userState); } - + private void OnModulesOperationCompleted(object arg) { if ((this.ModulesCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.ModulesCompleted(this, new ModulesCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://packages.umbraco.org/webservices/ModulesCategorized", RequestNamespace="http://packages.umbraco.org/webservices/", ResponseNamespace="http://packages.umbraco.org/webservices/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] public Category[] ModulesCategorized() { object[] results = this.Invoke("ModulesCategorized", new object[0]); return ((Category[])(results[0])); } - + /// public void ModulesCategorizedAsync() { this.ModulesCategorizedAsync(null); } - + /// public void ModulesCategorizedAsync(object userState) { if ((this.ModulesCategorizedOperationCompleted == null)) { @@ -197,26 +197,26 @@ namespace Umbraco.Web.org.umbraco.our { } this.InvokeAsync("ModulesCategorized", new object[0], this.ModulesCategorizedOperationCompleted, userState); } - + private void OnModulesCategorizedOperationCompleted(object arg) { if ((this.ModulesCategorizedCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.ModulesCategorizedCompleted(this, new ModulesCategorizedCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://packages.umbraco.org/webservices/Nitros", RequestNamespace="http://packages.umbraco.org/webservices/", ResponseNamespace="http://packages.umbraco.org/webservices/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] public Package[] Nitros() { object[] results = this.Invoke("Nitros", new object[0]); return ((Package[])(results[0])); } - + /// public void NitrosAsync() { this.NitrosAsync(null); } - + /// public void NitrosAsync(object userState) { if ((this.NitrosOperationCompleted == null)) { @@ -224,26 +224,26 @@ namespace Umbraco.Web.org.umbraco.our { } this.InvokeAsync("Nitros", new object[0], this.NitrosOperationCompleted, userState); } - + private void OnNitrosOperationCompleted(object arg) { if ((this.NitrosCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.NitrosCompleted(this, new NitrosCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://packages.umbraco.org/webservices/NitrosCategorized", RequestNamespace="http://packages.umbraco.org/webservices/", ResponseNamespace="http://packages.umbraco.org/webservices/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] public Category[] NitrosCategorized() { object[] results = this.Invoke("NitrosCategorized", new object[0]); return ((Category[])(results[0])); } - + /// public void NitrosCategorizedAsync() { this.NitrosCategorizedAsync(null); } - + /// public void NitrosCategorizedAsync(object userState) { if ((this.NitrosCategorizedOperationCompleted == null)) { @@ -251,14 +251,14 @@ namespace Umbraco.Web.org.umbraco.our { } this.InvokeAsync("NitrosCategorized", new object[0], this.NitrosCategorizedOperationCompleted, userState); } - + private void OnNitrosCategorizedOperationCompleted(object arg) { if ((this.NitrosCategorizedCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.NitrosCategorizedCompleted(this, new NitrosCategorizedCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://packages.umbraco.org/webservices/authenticate", RequestNamespace="http://packages.umbraco.org/webservices/", ResponseNamespace="http://packages.umbraco.org/webservices/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] public string authenticate(string email, string md5Password) { @@ -267,12 +267,12 @@ namespace Umbraco.Web.org.umbraco.our { md5Password}); return ((string)(results[0])); } - + /// public void authenticateAsync(string email, string md5Password) { this.authenticateAsync(email, md5Password, null); } - + /// public void authenticateAsync(string email, string md5Password, object userState) { if ((this.authenticateOperationCompleted == null)) { @@ -282,14 +282,14 @@ namespace Umbraco.Web.org.umbraco.our { email, md5Password}, this.authenticateOperationCompleted, userState); } - + private void OnauthenticateOperationCompleted(object arg) { if ((this.authenticateCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.authenticateCompleted(this, new authenticateCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://packages.umbraco.org/webservices/fetchPackage", RequestNamespace="http://packages.umbraco.org/webservices/", ResponseNamespace="http://packages.umbraco.org/webservices/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] [return: System.Xml.Serialization.XmlElementAttribute(DataType="base64Binary")] @@ -298,12 +298,12 @@ namespace Umbraco.Web.org.umbraco.our { packageGuid}); return ((byte[])(results[0])); } - + /// public void fetchPackageAsync(string packageGuid) { this.fetchPackageAsync(packageGuid, null); } - + /// public void fetchPackageAsync(string packageGuid, object userState) { if ((this.fetchPackageOperationCompleted == null)) { @@ -312,14 +312,14 @@ namespace Umbraco.Web.org.umbraco.our { this.InvokeAsync("fetchPackage", new object[] { packageGuid}, this.fetchPackageOperationCompleted, userState); } - + private void OnfetchPackageOperationCompleted(object arg) { if ((this.fetchPackageCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.fetchPackageCompleted(this, new fetchPackageCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://packages.umbraco.org/webservices/fetchPackageByVersion", RequestNamespace="http://packages.umbraco.org/webservices/", ResponseNamespace="http://packages.umbraco.org/webservices/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] [return: System.Xml.Serialization.XmlElementAttribute(DataType="base64Binary")] @@ -329,12 +329,12 @@ namespace Umbraco.Web.org.umbraco.our { repoVersion}); return ((byte[])(results[0])); } - + /// public void fetchPackageByVersionAsync(string packageGuid, string repoVersion) { this.fetchPackageByVersionAsync(packageGuid, repoVersion, null); } - + /// public void fetchPackageByVersionAsync(string packageGuid, string repoVersion, object userState) { if ((this.fetchPackageByVersionOperationCompleted == null)) { @@ -344,14 +344,14 @@ namespace Umbraco.Web.org.umbraco.our { packageGuid, repoVersion}, this.fetchPackageByVersionOperationCompleted, userState); } - + private void OnfetchPackageByVersionOperationCompleted(object arg) { if ((this.fetchPackageByVersionCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.fetchPackageByVersionCompleted(this, new fetchPackageByVersionCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://packages.umbraco.org/webservices/fetchProtectedPackage", RequestNamespace="http://packages.umbraco.org/webservices/", ResponseNamespace="http://packages.umbraco.org/webservices/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] [return: System.Xml.Serialization.XmlElementAttribute(DataType="base64Binary")] @@ -361,12 +361,12 @@ namespace Umbraco.Web.org.umbraco.our { memberKey}); return ((byte[])(results[0])); } - + /// public void fetchProtectedPackageAsync(string packageGuid, string memberKey) { this.fetchProtectedPackageAsync(packageGuid, memberKey, null); } - + /// public void fetchProtectedPackageAsync(string packageGuid, string memberKey, object userState) { if ((this.fetchProtectedPackageOperationCompleted == null)) { @@ -376,14 +376,14 @@ namespace Umbraco.Web.org.umbraco.our { packageGuid, memberKey}, this.fetchProtectedPackageOperationCompleted, userState); } - + private void OnfetchProtectedPackageOperationCompleted(object arg) { if ((this.fetchProtectedPackageCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.fetchProtectedPackageCompleted(this, new fetchProtectedPackageCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://packages.umbraco.org/webservices/SubmitPackage", RequestNamespace="http://packages.umbraco.org/webservices/", ResponseNamespace="http://packages.umbraco.org/webservices/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] public SubmitStatus SubmitPackage(string repositoryGuid, string authorGuid, string packageGuid, [System.Xml.Serialization.XmlElementAttribute(DataType="base64Binary")] byte[] packageFile, [System.Xml.Serialization.XmlElementAttribute(DataType="base64Binary")] byte[] packageDoc, [System.Xml.Serialization.XmlElementAttribute(DataType="base64Binary")] byte[] packageThumbnail, string name, string author, string authorUrl, string description) { @@ -400,12 +400,12 @@ namespace Umbraco.Web.org.umbraco.our { description}); return ((SubmitStatus)(results[0])); } - + /// public void SubmitPackageAsync(string repositoryGuid, string authorGuid, string packageGuid, byte[] packageFile, byte[] packageDoc, byte[] packageThumbnail, string name, string author, string authorUrl, string description) { this.SubmitPackageAsync(repositoryGuid, authorGuid, packageGuid, packageFile, packageDoc, packageThumbnail, name, author, authorUrl, description, null); } - + /// public void SubmitPackageAsync(string repositoryGuid, string authorGuid, string packageGuid, byte[] packageFile, byte[] packageDoc, byte[] packageThumbnail, string name, string author, string authorUrl, string description, object userState) { if ((this.SubmitPackageOperationCompleted == null)) { @@ -423,14 +423,14 @@ namespace Umbraco.Web.org.umbraco.our { authorUrl, description}, this.SubmitPackageOperationCompleted, userState); } - + private void OnSubmitPackageOperationCompleted(object arg) { if ((this.SubmitPackageCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.SubmitPackageCompleted(this, new SubmitPackageCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://packages.umbraco.org/webservices/PackageByGuid", RequestNamespace="http://packages.umbraco.org/webservices/", ResponseNamespace="http://packages.umbraco.org/webservices/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] public Package PackageByGuid(string packageGuid) { @@ -438,12 +438,12 @@ namespace Umbraco.Web.org.umbraco.our { packageGuid}); return ((Package)(results[0])); } - + /// public void PackageByGuidAsync(string packageGuid) { this.PackageByGuidAsync(packageGuid, null); } - + /// public void PackageByGuidAsync(string packageGuid, object userState) { if ((this.PackageByGuidOperationCompleted == null)) { @@ -452,33 +452,33 @@ namespace Umbraco.Web.org.umbraco.our { this.InvokeAsync("PackageByGuid", new object[] { packageGuid}, this.PackageByGuidOperationCompleted, userState); } - + private void OnPackageByGuidOperationCompleted(object arg) { if ((this.PackageByGuidCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.PackageByGuidCompleted(this, new PackageByGuidCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// public new void CancelAsync(object userState) { base.CancelAsync(userState); } - + private bool IsLocalFileSystemWebService(string url) { - if (((url == null) + if (((url == null) || (url == string.Empty))) { return false; } System.Uri wsUri = new System.Uri(url); - if (((wsUri.Port >= 1024) + if (((wsUri.Port >= 1024) && (string.Compare(wsUri.Host, "localHost", System.StringComparison.OrdinalIgnoreCase) == 0))) { return true; } return false; } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1038.0")] [System.SerializableAttribute()] @@ -486,17 +486,17 @@ namespace Umbraco.Web.org.umbraco.our { [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://packages.umbraco.org/webservices/")] public partial class Category { - + private string textField; - + private string descriptionField; - + private string urlField; - + private int idField; - + private Package[] packagesField; - + /// public string Text { get { @@ -506,7 +506,7 @@ namespace Umbraco.Web.org.umbraco.our { this.textField = value; } } - + /// public string Description { get { @@ -516,7 +516,7 @@ namespace Umbraco.Web.org.umbraco.our { this.descriptionField = value; } } - + /// public string Url { get { @@ -526,7 +526,7 @@ namespace Umbraco.Web.org.umbraco.our { this.urlField = value; } } - + /// public int Id { get { @@ -536,7 +536,7 @@ namespace Umbraco.Web.org.umbraco.our { this.idField = value; } } - + /// public Package[] Packages { get { @@ -547,7 +547,7 @@ namespace Umbraco.Web.org.umbraco.our { } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1038.0")] [System.SerializableAttribute()] @@ -555,37 +555,37 @@ namespace Umbraco.Web.org.umbraco.our { [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://packages.umbraco.org/webservices/")] public partial class Package { - + private System.Guid repoGuidField; - + private string textField; - + private string descriptionField; - + private string iconField; - + private string thumbnailField; - + private string documentationField; - + private string demoField; - + private bool acceptedField; - + private bool isModuleField; - + private bool editorsPickField; - + private bool protectedField; - + private bool hasUpgradeField; - + private string upgradeVersionField; - + private string upgradeReadMeField; - + private string urlField; - + /// public System.Guid RepoGuid { get { @@ -595,7 +595,7 @@ namespace Umbraco.Web.org.umbraco.our { this.repoGuidField = value; } } - + /// public string Text { get { @@ -605,7 +605,7 @@ namespace Umbraco.Web.org.umbraco.our { this.textField = value; } } - + /// public string Description { get { @@ -615,7 +615,7 @@ namespace Umbraco.Web.org.umbraco.our { this.descriptionField = value; } } - + /// public string Icon { get { @@ -625,7 +625,7 @@ namespace Umbraco.Web.org.umbraco.our { this.iconField = value; } } - + /// public string Thumbnail { get { @@ -635,7 +635,7 @@ namespace Umbraco.Web.org.umbraco.our { this.thumbnailField = value; } } - + /// public string Documentation { get { @@ -645,7 +645,7 @@ namespace Umbraco.Web.org.umbraco.our { this.documentationField = value; } } - + /// public string Demo { get { @@ -655,7 +655,7 @@ namespace Umbraco.Web.org.umbraco.our { this.demoField = value; } } - + /// public bool Accepted { get { @@ -665,7 +665,7 @@ namespace Umbraco.Web.org.umbraco.our { this.acceptedField = value; } } - + /// public bool IsModule { get { @@ -675,7 +675,7 @@ namespace Umbraco.Web.org.umbraco.our { this.isModuleField = value; } } - + /// public bool EditorsPick { get { @@ -685,7 +685,7 @@ namespace Umbraco.Web.org.umbraco.our { this.editorsPickField = value; } } - + /// public bool Protected { get { @@ -695,7 +695,7 @@ namespace Umbraco.Web.org.umbraco.our { this.protectedField = value; } } - + /// public bool HasUpgrade { get { @@ -705,7 +705,7 @@ namespace Umbraco.Web.org.umbraco.our { this.hasUpgradeField = value; } } - + /// public string UpgradeVersion { get { @@ -715,7 +715,7 @@ namespace Umbraco.Web.org.umbraco.our { this.upgradeVersionField = value; } } - + /// public string UpgradeReadMe { get { @@ -725,7 +725,7 @@ namespace Umbraco.Web.org.umbraco.our { this.upgradeReadMeField = value; } } - + /// public string Url { get { @@ -736,43 +736,43 @@ namespace Umbraco.Web.org.umbraco.our { } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1038.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://packages.umbraco.org/webservices/")] public enum SubmitStatus { - + /// Complete, - + /// Exists, - + /// NoAccess, - + /// Error, } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1038.0")] public delegate void CategoriesCompletedEventHandler(object sender, CategoriesCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1038.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class CategoriesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + private object[] results; - - internal CategoriesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + + internal CategoriesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } - + /// public Category[] Result { get { @@ -781,24 +781,24 @@ namespace Umbraco.Web.org.umbraco.our { } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1038.0")] public delegate void ModulesCompletedEventHandler(object sender, ModulesCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1038.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class ModulesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + private object[] results; - - internal ModulesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + + internal ModulesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } - + /// public Package[] Result { get { @@ -807,24 +807,24 @@ namespace Umbraco.Web.org.umbraco.our { } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1038.0")] public delegate void ModulesCategorizedCompletedEventHandler(object sender, ModulesCategorizedCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1038.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class ModulesCategorizedCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + private object[] results; - - internal ModulesCategorizedCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + + internal ModulesCategorizedCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } - + /// public Category[] Result { get { @@ -833,24 +833,24 @@ namespace Umbraco.Web.org.umbraco.our { } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1038.0")] public delegate void NitrosCompletedEventHandler(object sender, NitrosCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1038.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class NitrosCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + private object[] results; - - internal NitrosCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + + internal NitrosCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } - + /// public Package[] Result { get { @@ -859,24 +859,24 @@ namespace Umbraco.Web.org.umbraco.our { } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1038.0")] public delegate void NitrosCategorizedCompletedEventHandler(object sender, NitrosCategorizedCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1038.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class NitrosCategorizedCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + private object[] results; - - internal NitrosCategorizedCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + + internal NitrosCategorizedCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } - + /// public Category[] Result { get { @@ -885,24 +885,24 @@ namespace Umbraco.Web.org.umbraco.our { } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1038.0")] public delegate void authenticateCompletedEventHandler(object sender, authenticateCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1038.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class authenticateCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + private object[] results; - - internal authenticateCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + + internal authenticateCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } - + /// public string Result { get { @@ -911,24 +911,24 @@ namespace Umbraco.Web.org.umbraco.our { } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1038.0")] public delegate void fetchPackageCompletedEventHandler(object sender, fetchPackageCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1038.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class fetchPackageCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + private object[] results; - - internal fetchPackageCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + + internal fetchPackageCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } - + /// public byte[] Result { get { @@ -937,24 +937,24 @@ namespace Umbraco.Web.org.umbraco.our { } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1038.0")] public delegate void fetchPackageByVersionCompletedEventHandler(object sender, fetchPackageByVersionCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1038.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class fetchPackageByVersionCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + private object[] results; - - internal fetchPackageByVersionCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + + internal fetchPackageByVersionCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } - + /// public byte[] Result { get { @@ -963,24 +963,24 @@ namespace Umbraco.Web.org.umbraco.our { } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1038.0")] public delegate void fetchProtectedPackageCompletedEventHandler(object sender, fetchProtectedPackageCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1038.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class fetchProtectedPackageCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + private object[] results; - - internal fetchProtectedPackageCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + + internal fetchProtectedPackageCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } - + /// public byte[] Result { get { @@ -989,24 +989,24 @@ namespace Umbraco.Web.org.umbraco.our { } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1038.0")] public delegate void SubmitPackageCompletedEventHandler(object sender, SubmitPackageCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1038.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class SubmitPackageCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + private object[] results; - - internal SubmitPackageCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + + internal SubmitPackageCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } - + /// public SubmitStatus Result { get { @@ -1015,24 +1015,24 @@ namespace Umbraco.Web.org.umbraco.our { } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1038.0")] public delegate void PackageByGuidCompletedEventHandler(object sender, PackageByGuidCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1038.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class PackageByGuidCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + private object[] results; - - internal PackageByGuidCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + + internal PackageByGuidCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } - + /// public Package Result { get { @@ -1043,4 +1043,4 @@ namespace Umbraco.Web.org.umbraco.our { } } -#pragma warning restore 1591 \ No newline at end of file +#pragma warning restore 1591 diff --git a/src/Umbraco.Web/Web References/org.umbraco.update/Reference.cs b/src/Umbraco.Web/Web References/org.umbraco.update/Reference.cs index cdf06124b6..2818eff1e2 100644 --- a/src/Umbraco.Web/Web References/org.umbraco.update/Reference.cs +++ b/src/Umbraco.Web/Web References/org.umbraco.update/Reference.cs @@ -8,9 +8,9 @@ // //------------------------------------------------------------------------------ -// +// // This source code was auto-generated by Microsoft.VSDesigner, Version 4.0.30319.42000. -// +// #pragma warning disable 1591 namespace Umbraco.Web.org.umbraco.update { @@ -20,21 +20,21 @@ namespace Umbraco.Web.org.umbraco.update { using System.Web.Services.Protocols; using System.Xml.Serialization; using System.ComponentModel; - - + + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1038.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Web.Services.WebServiceBindingAttribute(Name="CheckForUpgradeSoap", Namespace="http://update.umbraco.org/")] public partial class CheckForUpgrade : System.Web.Services.Protocols.SoapHttpClientProtocol { - + private System.Threading.SendOrPostCallback InstallOperationCompleted; - + private System.Threading.SendOrPostCallback CheckUpgradeOperationCompleted; - + private bool useDefaultCredentialsSetExplicitly; - + /// public CheckForUpgrade() { this.Url = global::Umbraco.Web.Properties.Settings.Default.umbraco_org_umbraco_update_CheckForUpgrade; @@ -46,21 +46,21 @@ namespace Umbraco.Web.org.umbraco.update { this.useDefaultCredentialsSetExplicitly = true; } } - + public new string Url { get { return base.Url; } set { - if ((((this.IsLocalFileSystemWebService(base.Url) == true) - && (this.useDefaultCredentialsSetExplicitly == false)) + if ((((this.IsLocalFileSystemWebService(base.Url) == true) + && (this.useDefaultCredentialsSetExplicitly == false)) && (this.IsLocalFileSystemWebService(value) == false))) { base.UseDefaultCredentials = false; } base.Url = value; } } - + public new bool UseDefaultCredentials { get { return base.UseDefaultCredentials; @@ -70,13 +70,13 @@ namespace Umbraco.Web.org.umbraco.update { this.useDefaultCredentialsSetExplicitly = true; } } - + /// public event InstallCompletedEventHandler InstallCompleted; - + /// public event CheckUpgradeCompletedEventHandler CheckUpgradeCompleted; - + /// [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://update.umbraco.org/Install", RequestNamespace="http://update.umbraco.org/", ResponseNamespace="http://update.umbraco.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] public void Install(System.Guid installId, bool isUpgrade, bool installCompleted, System.DateTime timestamp, int versionMajor, int versionMinor, int versionPatch, string versionComment, string error, string userAgent, string dbProvider) { @@ -93,12 +93,12 @@ namespace Umbraco.Web.org.umbraco.update { userAgent, dbProvider}); } - + /// public void InstallAsync(System.Guid installId, bool isUpgrade, bool installCompleted, System.DateTime timestamp, int versionMajor, int versionMinor, int versionPatch, string versionComment, string error, string userAgent, string dbProvider) { this.InstallAsync(installId, isUpgrade, installCompleted, timestamp, versionMajor, versionMinor, versionPatch, versionComment, error, userAgent, dbProvider, null); } - + /// public void InstallAsync(System.Guid installId, bool isUpgrade, bool installCompleted, System.DateTime timestamp, int versionMajor, int versionMinor, int versionPatch, string versionComment, string error, string userAgent, string dbProvider, object userState) { if ((this.InstallOperationCompleted == null)) { @@ -117,14 +117,14 @@ namespace Umbraco.Web.org.umbraco.update { userAgent, dbProvider}, this.InstallOperationCompleted, userState); } - + private void OnInstallOperationCompleted(object arg) { if ((this.InstallCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.InstallCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://update.umbraco.org/CheckUpgrade", RequestNamespace="http://update.umbraco.org/", ResponseNamespace="http://update.umbraco.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] public UpgradeResult CheckUpgrade(int versionMajor, int versionMinor, int versionPatch, string versionComment) { @@ -135,12 +135,12 @@ namespace Umbraco.Web.org.umbraco.update { versionComment}); return ((UpgradeResult)(results[0])); } - + /// public void CheckUpgradeAsync(int versionMajor, int versionMinor, int versionPatch, string versionComment) { this.CheckUpgradeAsync(versionMajor, versionMinor, versionPatch, versionComment, null); } - + /// public void CheckUpgradeAsync(int versionMajor, int versionMinor, int versionPatch, string versionComment, object userState) { if ((this.CheckUpgradeOperationCompleted == null)) { @@ -152,33 +152,33 @@ namespace Umbraco.Web.org.umbraco.update { versionPatch, versionComment}, this.CheckUpgradeOperationCompleted, userState); } - + private void OnCheckUpgradeOperationCompleted(object arg) { if ((this.CheckUpgradeCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.CheckUpgradeCompleted(this, new CheckUpgradeCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// public new void CancelAsync(object userState) { base.CancelAsync(userState); } - + private bool IsLocalFileSystemWebService(string url) { - if (((url == null) + if (((url == null) || (url == string.Empty))) { return false; } System.Uri wsUri = new System.Uri(url); - if (((wsUri.Port >= 1024) + if (((wsUri.Port >= 1024) && (string.Compare(wsUri.Host, "localHost", System.StringComparison.OrdinalIgnoreCase) == 0))) { return true; } return false; } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1038.0")] [System.SerializableAttribute()] @@ -186,13 +186,13 @@ namespace Umbraco.Web.org.umbraco.update { [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://update.umbraco.org/")] public partial class UpgradeResult { - + private string commentField; - + private UpgradeType upgradeTypeField; - + private string upgradeUrlField; - + /// public string Comment { get { @@ -202,7 +202,7 @@ namespace Umbraco.Web.org.umbraco.update { this.commentField = value; } } - + /// public UpgradeType UpgradeType { get { @@ -212,7 +212,7 @@ namespace Umbraco.Web.org.umbraco.update { this.upgradeTypeField = value; } } - + /// public string UpgradeUrl { get { @@ -223,56 +223,56 @@ namespace Umbraco.Web.org.umbraco.update { } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1038.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://update.umbraco.org/")] public enum UpgradeType { - + /// None, - + /// Patch, - + /// Minor, - + /// Major, - + /// Critical, - + /// Error, - + /// OutOfSync, } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1038.0")] public delegate void InstallCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1038.0")] public delegate void CheckUpgradeCompletedEventHandler(object sender, CheckUpgradeCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1038.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class CheckUpgradeCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + private object[] results; - - internal CheckUpgradeCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + + internal CheckUpgradeCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } - + /// public UpgradeResult Result { get { @@ -283,4 +283,4 @@ namespace Umbraco.Web.org.umbraco.update { } } -#pragma warning restore 1591 \ No newline at end of file +#pragma warning restore 1591 diff --git a/src/Umbraco.Web/WebApi/AngularJsonMediaTypeFormatter.cs b/src/Umbraco.Web/WebApi/AngularJsonMediaTypeFormatter.cs index 66a79376aa..053887cafc 100644 --- a/src/Umbraco.Web/WebApi/AngularJsonMediaTypeFormatter.cs +++ b/src/Umbraco.Web/WebApi/AngularJsonMediaTypeFormatter.cs @@ -47,7 +47,7 @@ namespace Umbraco.Web.WebApi return base.WriteToStreamAsync(type, value, writeStream, content, transportContext); } - + } } diff --git a/src/Umbraco.Web/WebApi/AngularJsonOnlyConfigurationAttribute.cs b/src/Umbraco.Web/WebApi/AngularJsonOnlyConfigurationAttribute.cs index b7e14ced54..6a6e63f335 100644 --- a/src/Umbraco.Web/WebApi/AngularJsonOnlyConfigurationAttribute.cs +++ b/src/Umbraco.Web/WebApi/AngularJsonOnlyConfigurationAttribute.cs @@ -11,7 +11,7 @@ namespace Umbraco.Web.WebApi public class AngularJsonOnlyConfigurationAttribute : Attribute, IControllerConfiguration { public virtual void Initialize(HttpControllerSettings controllerSettings, HttpControllerDescriptor controllerDescriptor) - { + { //remove all json/xml formatters then add our custom one var toRemove = controllerSettings.Formatters.Where(t => (t is JsonMediaTypeFormatter) || (t is XmlMediaTypeFormatter)).ToList(); foreach (var r in toRemove) @@ -21,4 +21,4 @@ namespace Umbraco.Web.WebApi controllerSettings.Formatters.Add(new AngularJsonMediaTypeFormatter()); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/WebApi/Binders/ContentItemBaseBinder.cs b/src/Umbraco.Web/WebApi/Binders/ContentItemBaseBinder.cs index 57db9bb43b..72c26d2caf 100644 --- a/src/Umbraco.Web/WebApi/Binders/ContentItemBaseBinder.cs +++ b/src/Umbraco.Web/WebApi/Binders/ContentItemBaseBinder.cs @@ -215,4 +215,4 @@ namespace Umbraco.Web.WebApi.Binders protected abstract TPersisted CreateNew(TModelSave model); protected abstract ContentItemDto MapFromPersisted(TModelSave model); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/WebApi/Binders/ContentItemBinder.cs b/src/Umbraco.Web/WebApi/Binders/ContentItemBinder.cs index 45404fb8a9..16fbf9b9db 100644 --- a/src/Umbraco.Web/WebApi/Binders/ContentItemBinder.cs +++ b/src/Umbraco.Web/WebApi/Binders/ContentItemBinder.cs @@ -29,4 +29,4 @@ namespace Umbraco.Web.WebApi.Binders return Mapper.Map>(model.PersistedContent); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/WebApi/Binders/MediaItemBinder.cs b/src/Umbraco.Web/WebApi/Binders/MediaItemBinder.cs index 64473031df..3a82bb7328 100644 --- a/src/Umbraco.Web/WebApi/Binders/MediaItemBinder.cs +++ b/src/Umbraco.Web/WebApi/Binders/MediaItemBinder.cs @@ -29,4 +29,4 @@ namespace Umbraco.Web.WebApi.Binders return Mapper.Map>(model.PersistedContent); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/WebApi/Binders/MemberBinder.cs b/src/Umbraco.Web/WebApi/Binders/MemberBinder.cs index a96c2f9eb8..c91cf8de04 100644 --- a/src/Umbraco.Web/WebApi/Binders/MemberBinder.cs +++ b/src/Umbraco.Web/WebApi/Binders/MemberBinder.cs @@ -329,4 +329,4 @@ namespace Umbraco.Web.WebApi.Binders } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/WebApi/CustomDateTimeConvertor.cs b/src/Umbraco.Web/WebApi/CustomDateTimeConvertor.cs index 94ba3047ed..f7199646b3 100644 --- a/src/Umbraco.Web/WebApi/CustomDateTimeConvertor.cs +++ b/src/Umbraco.Web/WebApi/CustomDateTimeConvertor.cs @@ -12,7 +12,7 @@ namespace Umbraco.Web.WebApi internal class CustomDateTimeConvertor : IsoDateTimeConverter { private readonly string _dateTimeFormat; - + public CustomDateTimeConvertor(string dateTimeFormat) { if (string.IsNullOrEmpty(dateTimeFormat)) throw new ArgumentNullOrEmptyException(nameof(dateTimeFormat)); @@ -24,4 +24,4 @@ namespace Umbraco.Web.WebApi writer.WriteValue(((DateTime)value).ToString(_dateTimeFormat)); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/WebApi/Filters/AngularAntiForgeryHelper.cs b/src/Umbraco.Web/WebApi/Filters/AngularAntiForgeryHelper.cs index 684aaee5c0..a39e16c687 100644 --- a/src/Umbraco.Web/WebApi/Filters/AngularAntiForgeryHelper.cs +++ b/src/Umbraco.Web/WebApi/Filters/AngularAntiForgeryHelper.cs @@ -31,7 +31,7 @@ namespace Umbraco.Web.WebApi.Filters /// public const string AngularHeadername = "X-XSRF-TOKEN"; - + /// /// Returns 2 tokens - one for the cookie value and one that angular should set as the header value @@ -39,7 +39,7 @@ namespace Umbraco.Web.WebApi.Filters /// /// /// - /// .Net provides us a way to validate one token with another for added security. With the way angular works, this + /// .Net provides us a way to validate one token with another for added security. With the way angular works, this /// means that we need to set 2 cookies since angular uses one cookie value to create the header value, then we want to validate /// this header value against our original cookie value. /// @@ -69,8 +69,8 @@ namespace Umbraco.Web.WebApi.Filters return true; } - internal static bool ValidateHeaders( - KeyValuePair>[] requestHeaders, + internal static bool ValidateHeaders( + KeyValuePair>[] requestHeaders, string cookieToken, out string failedReason) { @@ -87,7 +87,7 @@ namespace Umbraco.Web.WebApi.Filters .Select(z => z.Value) .SelectMany(z => z) .FirstOrDefault(); - + // both header and cookie must be there if (cookieToken == null || headerToken == null) { @@ -123,4 +123,4 @@ namespace Umbraco.Web.WebApi.Filters out failedReason); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/WebApi/Filters/AppendCurrentEventMessagesAttribute.cs b/src/Umbraco.Web/WebApi/Filters/AppendCurrentEventMessagesAttribute.cs index 08ad0e3005..911fff3e3c 100644 --- a/src/Umbraco.Web/WebApi/Filters/AppendCurrentEventMessagesAttribute.cs +++ b/src/Umbraco.Web/WebApi/Filters/AppendCurrentEventMessagesAttribute.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Net.Http; using System.Web.Http.Filters; using Umbraco.Core.Events; @@ -9,7 +9,7 @@ using Umbraco.Web.UI; namespace Umbraco.Web.WebApi.Filters { /// - /// Automatically checks if any request is a non-GET and if the + /// Automatically checks if any request is a non-GET and if the /// resulting message is INotificationModel in which case it will append any Event Messages /// currently in the request. /// @@ -63,4 +63,4 @@ namespace Umbraco.Web.WebApi.Filters } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/WebApi/Filters/ClearAngularAntiForgeryTokenAttribute.cs b/src/Umbraco.Web/WebApi/Filters/ClearAngularAntiForgeryTokenAttribute.cs index 76cacc53b7..613cc36af3 100644 --- a/src/Umbraco.Web/WebApi/Filters/ClearAngularAntiForgeryTokenAttribute.cs +++ b/src/Umbraco.Web/WebApi/Filters/ClearAngularAntiForgeryTokenAttribute.cs @@ -32,4 +32,4 @@ namespace Umbraco.Web.WebApi.Filters context.Response.Headers.AddCookies(new[] { angularCookie, validationCookie }); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/WebApi/Filters/ContentItemValidationHelper.cs b/src/Umbraco.Web/WebApi/Filters/ContentItemValidationHelper.cs index 47846a32d4..13983fd1c1 100644 --- a/src/Umbraco.Web/WebApi/Filters/ContentItemValidationHelper.cs +++ b/src/Umbraco.Web/WebApi/Filters/ContentItemValidationHelper.cs @@ -27,7 +27,7 @@ namespace Umbraco.Web.WebApi.Filters where TPersisted : class, IContentBase where TModelSave : ContentBaseItemSave { - + public void ValidateItem(HttpActionContext actionContext, string argumentName) { var contentItem = actionContext.ActionArguments[argumentName] as TModelSave; @@ -101,7 +101,7 @@ namespace Umbraco.Web.WebApi.Filters } return true; - } + } /// /// Validates the data for each property @@ -172,13 +172,13 @@ namespace Umbraco.Web.WebApi.Filters actionContext.ModelState.AddPropertyError(result, p.Alias); } } - + } } return actionContext.ModelState.IsValid; } - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/WebApi/Filters/EnableOverrideAuthorizationAttribute.cs b/src/Umbraco.Web/WebApi/Filters/EnableOverrideAuthorizationAttribute.cs index a8c26fc167..f7d2b4f929 100644 --- a/src/Umbraco.Web/WebApi/Filters/EnableOverrideAuthorizationAttribute.cs +++ b/src/Umbraco.Web/WebApi/Filters/EnableOverrideAuthorizationAttribute.cs @@ -11,6 +11,6 @@ namespace Umbraco.Web.WebApi.Filters [AttributeUsage(AttributeTargets.Class, Inherited = true, AllowMultiple = true)] public sealed class EnableOverrideAuthorizationAttribute : Attribute { - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/WebApi/Filters/EnsureUserPermissionForContentAttribute.cs b/src/Umbraco.Web/WebApi/Filters/EnsureUserPermissionForContentAttribute.cs index a0ab720e64..ec4c4d0f08 100644 --- a/src/Umbraco.Web/WebApi/Filters/EnsureUserPermissionForContentAttribute.cs +++ b/src/Umbraco.Web/WebApi/Filters/EnsureUserPermissionForContentAttribute.cs @@ -104,4 +104,4 @@ namespace Umbraco.Web.WebApi.Filters } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/WebApi/Filters/EnsureUserPermissionForMediaAttribute.cs b/src/Umbraco.Web/WebApi/Filters/EnsureUserPermissionForMediaAttribute.cs index 95af3f89e3..d79167eb53 100644 --- a/src/Umbraco.Web/WebApi/Filters/EnsureUserPermissionForMediaAttribute.cs +++ b/src/Umbraco.Web/WebApi/Filters/EnsureUserPermissionForMediaAttribute.cs @@ -127,6 +127,6 @@ namespace Umbraco.Web.WebApi.Filters { throw new HttpResponseException(System.Net.HttpStatusCode.Unauthorized); } - } + } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/WebApi/Filters/FileUploadCleanupFilterAttribute.cs b/src/Umbraco.Web/WebApi/Filters/FileUploadCleanupFilterAttribute.cs index b454fd1fa1..911533e389 100644 --- a/src/Umbraco.Web/WebApi/Filters/FileUploadCleanupFilterAttribute.cs +++ b/src/Umbraco.Web/WebApi/Filters/FileUploadCleanupFilterAttribute.cs @@ -91,7 +91,7 @@ namespace Umbraco.Web.WebApi.Filters } ObjectContent objectContent; - + try { objectContent = actionExecutedContext.Response.Content as ObjectContent; @@ -137,14 +137,14 @@ namespace Umbraco.Web.WebApi.Filters } else { - Current.Logger.Warn("The f.TempFilePath is null or whitespace!!??"); + Current.Logger.Warn("The f.TempFilePath is null or whitespace!!??"); } } } else { - Current.Logger.Warn("The uploadedFiles.UploadedFiles is null!!??"); - } + Current.Logger.Warn("The uploadedFiles.UploadedFiles is null!!??"); + } } else { @@ -177,7 +177,7 @@ namespace Umbraco.Web.WebApi.Filters } } - + } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/WebApi/Filters/FilterAllowedOutgoingContentAttribute.cs b/src/Umbraco.Web/WebApi/Filters/FilterAllowedOutgoingContentAttribute.cs index 84489e972a..500b28eb67 100644 --- a/src/Umbraco.Web/WebApi/Filters/FilterAllowedOutgoingContentAttribute.cs +++ b/src/Umbraco.Web/WebApi/Filters/FilterAllowedOutgoingContentAttribute.cs @@ -100,4 +100,4 @@ namespace Umbraco.Web.WebApi.Filters } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/WebApi/Filters/FilterAllowedOutgoingMediaAttribute.cs b/src/Umbraco.Web/WebApi/Filters/FilterAllowedOutgoingMediaAttribute.cs index 4fbc619370..3c2e108ba1 100644 --- a/src/Umbraco.Web/WebApi/Filters/FilterAllowedOutgoingMediaAttribute.cs +++ b/src/Umbraco.Web/WebApi/Filters/FilterAllowedOutgoingMediaAttribute.cs @@ -13,7 +13,7 @@ using Umbraco.Web.Models.ContentEditing; namespace Umbraco.Web.WebApi.Filters { /// - /// This inspects the result of the action that returns a collection of content and removes + /// This inspects the result of the action that returns a collection of content and removes /// any item that the current user doesn't have access to /// internal class FilterAllowedOutgoingMediaAttribute : ActionFilterAttribute diff --git a/src/Umbraco.Web/WebApi/Filters/FilterGrouping.cs b/src/Umbraco.Web/WebApi/Filters/FilterGrouping.cs index 581579a8d1..fc3dc65675 100644 --- a/src/Umbraco.Web/WebApi/Filters/FilterGrouping.cs +++ b/src/Umbraco.Web/WebApi/Filters/FilterGrouping.cs @@ -8,7 +8,7 @@ using System.Web.Http.Filters; namespace Umbraco.Web.WebApi.Filters { /// - /// Quickly split filters into different types + /// Quickly split filters into different types /// internal class FilterGrouping { diff --git a/src/Umbraco.Web/WebApi/Filters/HttpQueryStringFilterAttribute.cs b/src/Umbraco.Web/WebApi/Filters/HttpQueryStringFilterAttribute.cs index 5cdf7a7e94..1e6338cc70 100644 --- a/src/Umbraco.Web/WebApi/Filters/HttpQueryStringFilterAttribute.cs +++ b/src/Umbraco.Web/WebApi/Filters/HttpQueryStringFilterAttribute.cs @@ -34,10 +34,10 @@ namespace Umbraco.Web.WebApi.Filters var formData = new FormDataCollection(queryStrings); - actionContext.ActionArguments[ParameterName] = formData; + actionContext.ActionArguments[ParameterName] = formData; } - + base.OnActionExecuting(actionContext); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/WebApi/Filters/LegacyTreeAuthorizeAttribute.cs b/src/Umbraco.Web/WebApi/Filters/LegacyTreeAuthorizeAttribute.cs index f8f4fbbe9b..46bfe73517 100644 --- a/src/Umbraco.Web/WebApi/Filters/LegacyTreeAuthorizeAttribute.cs +++ b/src/Umbraco.Web/WebApi/Filters/LegacyTreeAuthorizeAttribute.cs @@ -26,4 +26,4 @@ namespace Umbraco.Web.WebApi.Filters } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/WebApi/Filters/OutgoingDateTimeFormatAttribute.cs b/src/Umbraco.Web/WebApi/Filters/OutgoingDateTimeFormatAttribute.cs index 73532dd67b..82661c9023 100644 --- a/src/Umbraco.Web/WebApi/Filters/OutgoingDateTimeFormatAttribute.cs +++ b/src/Umbraco.Web/WebApi/Filters/OutgoingDateTimeFormatAttribute.cs @@ -42,4 +42,4 @@ namespace Umbraco.Web.WebApi.Filters } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/WebApi/Filters/OutgoingEditorModelEventAttribute.cs b/src/Umbraco.Web/WebApi/Filters/OutgoingEditorModelEventAttribute.cs index ae10d073cd..ec32b61bca 100644 --- a/src/Umbraco.Web/WebApi/Filters/OutgoingEditorModelEventAttribute.cs +++ b/src/Umbraco.Web/WebApi/Filters/OutgoingEditorModelEventAttribute.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Net.Http; using System.Web.Http.Filters; using Umbraco.Core; @@ -33,6 +33,6 @@ namespace Umbraco.Web.WebApi.Filters } base.OnActionExecuted(actionExecutedContext); - } + } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/WebApi/Filters/OutgoingNoHyphenGuidFormatAttribute.cs b/src/Umbraco.Web/WebApi/Filters/OutgoingNoHyphenGuidFormatAttribute.cs index 897213a142..1685171cbb 100644 --- a/src/Umbraco.Web/WebApi/Filters/OutgoingNoHyphenGuidFormatAttribute.cs +++ b/src/Umbraco.Web/WebApi/Filters/OutgoingNoHyphenGuidFormatAttribute.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using System.Net.Http.Formatting; using System.Web.Http.Controllers; @@ -21,4 +21,4 @@ namespace Umbraco.Web.WebApi.Filters } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/WebApi/Filters/OverridableAuthorizationAttribute.cs b/src/Umbraco.Web/WebApi/Filters/OverridableAuthorizationAttribute.cs index f5c536420b..2d110d9a8b 100644 --- a/src/Umbraco.Web/WebApi/Filters/OverridableAuthorizationAttribute.cs +++ b/src/Umbraco.Web/WebApi/Filters/OverridableAuthorizationAttribute.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using System.Web.Http; using System.Web.Http.Controllers; @@ -9,7 +9,7 @@ namespace Umbraco.Web.WebApi.Filters /// Abstract auth filter class that can be used to enable overriding class auth filters at the action level /// /// - /// To enable a class auth filter to be overridden by an action auth filter the EnableOverrideAuthorizationAttribute can be applied + /// To enable a class auth filter to be overridden by an action auth filter the EnableOverrideAuthorizationAttribute can be applied /// to the class. /// public abstract class OverridableAuthorizationAttribute : AuthorizeAttribute @@ -47,4 +47,4 @@ namespace Umbraco.Web.WebApi.Filters base.OnAuthorization(actionContext); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/WebApi/Filters/SetAngularAntiForgeryTokensAttribute.cs b/src/Umbraco.Web/WebApi/Filters/SetAngularAntiForgeryTokensAttribute.cs index a0ed584ef8..d0ef104add 100644 --- a/src/Umbraco.Web/WebApi/Filters/SetAngularAntiForgeryTokensAttribute.cs +++ b/src/Umbraco.Web/WebApi/Filters/SetAngularAntiForgeryTokensAttribute.cs @@ -27,7 +27,7 @@ namespace Umbraco.Web.WebApi.Filters //if they are not valid for some strange reason - we need to continue setting valid ones string failedReason; if (AngularAntiForgeryHelper.ValidateHeaders(context.Request.Headers, out failedReason)) - { + { return; } } @@ -56,4 +56,4 @@ namespace Umbraco.Web.WebApi.Filters context.Response.Headers.AddCookies(new[] { angularCookie, validationCookie }); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/WebApi/Filters/UmbracoApplicationAuthorizeAttribute.cs b/src/Umbraco.Web/WebApi/Filters/UmbracoApplicationAuthorizeAttribute.cs index 0bf6306a52..fc691e736a 100644 --- a/src/Umbraco.Web/WebApi/Filters/UmbracoApplicationAuthorizeAttribute.cs +++ b/src/Umbraco.Web/WebApi/Filters/UmbracoApplicationAuthorizeAttribute.cs @@ -40,4 +40,4 @@ namespace Umbraco.Web.WebApi.Filters app, Current.UmbracoContext.Security.CurrentUser)); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/WebApi/Filters/UmbracoBackOfficeLogoutAttribute.cs b/src/Umbraco.Web/WebApi/Filters/UmbracoBackOfficeLogoutAttribute.cs index c42881f52a..c8dd64c83c 100644 --- a/src/Umbraco.Web/WebApi/Filters/UmbracoBackOfficeLogoutAttribute.cs +++ b/src/Umbraco.Web/WebApi/Filters/UmbracoBackOfficeLogoutAttribute.cs @@ -14,4 +14,4 @@ namespace Umbraco.Web.WebApi.Filters throw new NotSupportedException("This method is not supported and should not be used, it has been removed in Umbraco 7.4"); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/WebApi/Filters/UmbracoTreeAuthorizeAttribute.cs b/src/Umbraco.Web/WebApi/Filters/UmbracoTreeAuthorizeAttribute.cs index 4904dc7a1b..a36b2a14f6 100644 --- a/src/Umbraco.Web/WebApi/Filters/UmbracoTreeAuthorizeAttribute.cs +++ b/src/Umbraco.Web/WebApi/Filters/UmbracoTreeAuthorizeAttribute.cs @@ -52,4 +52,4 @@ namespace Umbraco.Web.WebApi.Filters app, Current.UmbracoContext.Security.CurrentUser)); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/WebApi/Filters/UmbracoUserTimeoutFilterAttribute.cs b/src/Umbraco.Web/WebApi/Filters/UmbracoUserTimeoutFilterAttribute.cs index 4dac187a4a..2d938eb6e8 100644 --- a/src/Umbraco.Web/WebApi/Filters/UmbracoUserTimeoutFilterAttribute.cs +++ b/src/Umbraco.Web/WebApi/Filters/UmbracoUserTimeoutFilterAttribute.cs @@ -5,8 +5,8 @@ using Umbraco.Core.Security; namespace Umbraco.Web.WebApi.Filters { /// - /// This will check if the request is authenticated and if there's an auth ticket present we will - /// add a custom header to the response indicating how many seconds are remaining for the current + /// This will check if the request is authenticated and if there's an auth ticket present we will + /// add a custom header to the response indicating how many seconds are remaining for the current /// user's session. This allows us to keep track of a user's session effectively in the back office. /// public sealed class UmbracoUserTimeoutFilterAttribute : ActionFilterAttribute @@ -30,4 +30,4 @@ namespace Umbraco.Web.WebApi.Filters } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/WebApi/Filters/UmbracoWebApiRequireHttpsAttribute.cs b/src/Umbraco.Web/WebApi/Filters/UmbracoWebApiRequireHttpsAttribute.cs index f292a63a20..507cef6acf 100644 --- a/src/Umbraco.Web/WebApi/Filters/UmbracoWebApiRequireHttpsAttribute.cs +++ b/src/Umbraco.Web/WebApi/Filters/UmbracoWebApiRequireHttpsAttribute.cs @@ -13,8 +13,8 @@ namespace Umbraco.Web.WebApi.Filters /// /// /// This will only redirect Head/Get requests, otherwise will respond with text - /// - /// References: + /// + /// References: /// http://issues.umbraco.org/issue/U4-8542 /// https://blogs.msdn.microsoft.com/carlosfigueira/2012/03/09/implementing-requirehttps-with-asp-net-web-api/ /// @@ -52,4 +52,4 @@ namespace Umbraco.Web.WebApi.Filters } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/WebApi/Filters/ValidateAngularAntiForgeryTokenAttribute.cs b/src/Umbraco.Web/WebApi/Filters/ValidateAngularAntiForgeryTokenAttribute.cs index 82ea6d2d0a..0abdfb5d2f 100644 --- a/src/Umbraco.Web/WebApi/Filters/ValidateAngularAntiForgeryTokenAttribute.cs +++ b/src/Umbraco.Web/WebApi/Filters/ValidateAngularAntiForgeryTokenAttribute.cs @@ -11,7 +11,7 @@ namespace Umbraco.Web.WebApi.Filters /// /// /// Code derived from http://ericpanorel.net/2013/07/28/spa-authentication-and-csrf-mvc4-antiforgery-implementation/ - /// + /// /// If the authentication type is cookie based, then this filter will execute, otherwise it will be disabled /// public sealed class ValidateAngularAntiForgeryTokenAttribute : ActionFilterAttribute @@ -40,4 +40,4 @@ namespace Umbraco.Web.WebApi.Filters base.OnActionExecuting(actionContext); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/WebApi/Filters/ValidationFilterAttribute.cs b/src/Umbraco.Web/WebApi/Filters/ValidationFilterAttribute.cs index 556f890516..18a099b9b0 100644 --- a/src/Umbraco.Web/WebApi/Filters/ValidationFilterAttribute.cs +++ b/src/Umbraco.Web/WebApi/Filters/ValidationFilterAttribute.cs @@ -23,4 +23,4 @@ namespace Umbraco.Web.WebApi.Filters } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/WebApi/GuidNoHyphenConverter.cs b/src/Umbraco.Web/WebApi/GuidNoHyphenConverter.cs index 8a2172c538..dd5465732f 100644 --- a/src/Umbraco.Web/WebApi/GuidNoHyphenConverter.cs +++ b/src/Umbraco.Web/WebApi/GuidNoHyphenConverter.cs @@ -37,4 +37,4 @@ namespace Umbraco.Web.WebApi return typeof(Guid) == objectType; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/WebApi/HttpControllerContextExtensions.cs b/src/Umbraco.Web/WebApi/HttpControllerContextExtensions.cs index a3cb3b9d22..fee1f25ada 100644 --- a/src/Umbraco.Web/WebApi/HttpControllerContextExtensions.cs +++ b/src/Umbraco.Web/WebApi/HttpControllerContextExtensions.cs @@ -34,13 +34,13 @@ namespace Umbraco.Web.WebApi if (authorizationFilters.Any()) { - var cancelToken = new CancellationToken(); + var cancelToken = new CancellationToken(); var filterResult = await FilterContinuation(actionContext, cancelToken, authorizationFilters, 0); if (filterResult != null) { //this means that the authorization filter has returned a result - unauthorized so we cannot continue return filterResult; - } + } } return null; } @@ -60,7 +60,7 @@ namespace Umbraco.Web.WebApi ? Task.FromResult(null) : FilterContinuation(actionContext, token, filters, ++index)); } - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/WebApi/HttpRequestMessageExtensions.cs b/src/Umbraco.Web/WebApi/HttpRequestMessageExtensions.cs index 00b66094e8..dabad3bca5 100644 --- a/src/Umbraco.Web/WebApi/HttpRequestMessageExtensions.cs +++ b/src/Umbraco.Web/WebApi/HttpRequestMessageExtensions.cs @@ -16,7 +16,7 @@ using Umbraco.Web.Models.ContentEditing; namespace Umbraco.Web.WebApi { - + public static class HttpRequestMessageExtensions { @@ -28,8 +28,8 @@ namespace Umbraco.Web.WebApi internal static Attempt TryGetOwinContext(this HttpRequestMessage request) { var httpContext = request.TryGetHttpContext(); - return httpContext - ? Attempt.Succeed(httpContext.Result.GetOwinContext()) + return httpContext + ? Attempt.Succeed(httpContext.Result.GetOwinContext()) : Attempt.Fail(); } diff --git a/src/Umbraco.Web/WebApi/IsBackOfficeAttribute.cs b/src/Umbraco.Web/WebApi/IsBackOfficeAttribute.cs index 219be51d48..2d0b194022 100644 --- a/src/Umbraco.Web/WebApi/IsBackOfficeAttribute.cs +++ b/src/Umbraco.Web/WebApi/IsBackOfficeAttribute.cs @@ -10,4 +10,4 @@ namespace Umbraco.Web.WebApi public sealed class IsBackOfficeAttribute : Attribute { } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/WebApi/JsonCamelCaseFormatter.cs b/src/Umbraco.Web/WebApi/JsonCamelCaseFormatter.cs index de1383706e..19683f7f86 100644 --- a/src/Umbraco.Web/WebApi/JsonCamelCaseFormatter.cs +++ b/src/Umbraco.Web/WebApi/JsonCamelCaseFormatter.cs @@ -29,6 +29,6 @@ namespace Umbraco.Web.WebApi } }; controllerSettings.Formatters.Add(jsonFormatter); - } + } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/WebApi/MemberAuthorizeAttribute.cs b/src/Umbraco.Web/WebApi/MemberAuthorizeAttribute.cs index b8ec7e6a34..83c4a91781 100644 --- a/src/Umbraco.Web/WebApi/MemberAuthorizeAttribute.cs +++ b/src/Umbraco.Web/WebApi/MemberAuthorizeAttribute.cs @@ -10,7 +10,7 @@ namespace Umbraco.Web.WebApi /// to just authenticated members, and optionally of a particular type and/or group /// public sealed class MemberAuthorizeAttribute : AuthorizeAttribute - { + { private readonly UmbracoContext _umbracoContext; private UmbracoContext GetUmbracoContext() diff --git a/src/Umbraco.Web/WebApi/MvcVersionCheck.cs b/src/Umbraco.Web/WebApi/MvcVersionCheck.cs index c2f2580c95..3c84fa91ce 100644 --- a/src/Umbraco.Web/WebApi/MvcVersionCheck.cs +++ b/src/Umbraco.Web/WebApi/MvcVersionCheck.cs @@ -1,4 +1,4 @@ -namespace Umbraco.Web.WebApi +namespace Umbraco.Web.WebApi { internal class WebApiVersionCheck { @@ -7,4 +7,4 @@ namespace Umbraco.Web.WebApi get { return typeof(System.Web.Http.ApiController).Assembly.GetName().Version; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/WebApi/NamespaceHttpControllerSelector.cs b/src/Umbraco.Web/WebApi/NamespaceHttpControllerSelector.cs index 0a6ce9f841..d27ec6e91f 100644 --- a/src/Umbraco.Web/WebApi/NamespaceHttpControllerSelector.cs +++ b/src/Umbraco.Web/WebApi/NamespaceHttpControllerSelector.cs @@ -25,27 +25,27 @@ namespace Umbraco.Web.WebApi public override HttpControllerDescriptor SelectController(HttpRequestMessage request) { var routeData = request.GetRouteData(); - if (routeData == null + if (routeData == null || routeData.Route == null || routeData.Route.DataTokens == null || routeData.Route.DataTokens.ContainsKey("Namespaces") == false || routeData.Route.DataTokens["Namespaces"] == null) return base.SelectController(request); - + // Look up controller in route data object controllerName; routeData.Values.TryGetValue(ControllerKey, out controllerName); var controllerNameAsString = controllerName as string; - if (controllerNameAsString == null) + if (controllerNameAsString == null) return base.SelectController(request); - + //get the currently cached default controllers - this will not contain duplicate controllers found so if // this controller is found in the underlying cache we don't need to do anything var map = base.GetControllerMapping(); - if (map.ContainsKey(controllerNameAsString)) + if (map.ContainsKey(controllerNameAsString)) return base.SelectController(request); - - //the cache does not contain this controller because it's most likely a duplicate, + + //the cache does not contain this controller because it's most likely a duplicate, // so we need to sort this out ourselves and we can only do that if the namespace token // is formatted correctly. var namespaces = routeData.Route.DataTokens["Namespaces"] as IEnumerable; @@ -95,4 +95,4 @@ namespace Umbraco.Web.WebApi } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/WebApi/PrefixlessBodyModelValidator.cs b/src/Umbraco.Web/WebApi/PrefixlessBodyModelValidator.cs index c5563e6509..a9838f3413 100644 --- a/src/Umbraco.Web/WebApi/PrefixlessBodyModelValidator.cs +++ b/src/Umbraco.Web/WebApi/PrefixlessBodyModelValidator.cs @@ -34,4 +34,4 @@ namespace Umbraco.Web.WebApi return _innerValidator.Validate(model, type, metadataProvider, actionContext, string.Empty); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/WebApi/PrefixlessBodyModelValidatorAttribute.cs b/src/Umbraco.Web/WebApi/PrefixlessBodyModelValidatorAttribute.cs index 2593acfbe0..b13cf983a5 100644 --- a/src/Umbraco.Web/WebApi/PrefixlessBodyModelValidatorAttribute.cs +++ b/src/Umbraco.Web/WebApi/PrefixlessBodyModelValidatorAttribute.cs @@ -13,8 +13,8 @@ namespace Umbraco.Web.WebApi public virtual void Initialize(HttpControllerSettings controllerSettings, HttpControllerDescriptor controllerDescriptor) { //replace the normal validator with our custom one for this controller - controllerSettings.Services.Replace(typeof(IBodyModelValidator), - new PrefixlessBodyModelValidator(controllerSettings.Services.GetBodyModelValidator())); + controllerSettings.Services.Replace(typeof(IBodyModelValidator), + new PrefixlessBodyModelValidator(controllerSettings.Services.GetBodyModelValidator())); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/WebApi/SessionHttpControllerRouteHandler.cs b/src/Umbraco.Web/WebApi/SessionHttpControllerRouteHandler.cs index d4d462c5f8..5dd641b25c 100644 --- a/src/Umbraco.Web/WebApi/SessionHttpControllerRouteHandler.cs +++ b/src/Umbraco.Web/WebApi/SessionHttpControllerRouteHandler.cs @@ -6,11 +6,11 @@ using System.Web.SessionState; namespace Umbraco.Web.WebApi { /// - /// A custom WebApi route handler that enables session on the HttpContext - use with caution! + /// A custom WebApi route handler that enables session on the HttpContext - use with caution! /// /// /// WebApi controllers (and REST in general) shouldn't have session state enabled since it's stateless, - /// enabling session state puts additional locks on requests so only use this when absolutley needed + /// enabling session state puts additional locks on requests so only use this when absolutley needed /// internal class SessionHttpControllerRouteHandler : HttpControllerRouteHandler { @@ -21,11 +21,11 @@ namespace Umbraco.Web.WebApi /// /// A custom WebApi handler that enables session on the HttpContext - /// + /// private class SessionHttpControllerHandler : HttpControllerHandler, IRequiresSessionState { public SessionHttpControllerHandler(RouteData routeData) : base(routeData) { } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/WebApi/UmbracoApiControllerBase.cs b/src/Umbraco.Web/WebApi/UmbracoApiControllerBase.cs index 98b38e5f47..d2c99ce497 100644 --- a/src/Umbraco.Web/WebApi/UmbracoApiControllerBase.cs +++ b/src/Umbraco.Web/WebApi/UmbracoApiControllerBase.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Web; using System.Web.Http; using LightInject; @@ -107,6 +107,6 @@ namespace Umbraco.Web.WebApi protected Attempt TryGetOwinContext() { return Request.TryGetOwinContext(); - } + } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/WebApi/UmbracoAuthorizeAttribute.cs b/src/Umbraco.Web/WebApi/UmbracoAuthorizeAttribute.cs index 46e6f084b2..c18c89b7e8 100644 --- a/src/Umbraco.Web/WebApi/UmbracoAuthorizeAttribute.cs +++ b/src/Umbraco.Web/WebApi/UmbracoAuthorizeAttribute.cs @@ -61,4 +61,4 @@ namespace Umbraco.Web.WebApi } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/WebApi/UmbracoAuthorizedApiController.cs b/src/Umbraco.Web/WebApi/UmbracoAuthorizedApiController.cs index c396b6ab55..03c69640ea 100644 --- a/src/Umbraco.Web/WebApi/UmbracoAuthorizedApiController.cs +++ b/src/Umbraco.Web/WebApi/UmbracoAuthorizedApiController.cs @@ -16,4 +16,4 @@ namespace Umbraco.Web.WebApi [UmbracoWebApiRequireHttps] public abstract class UmbracoAuthorizedApiController : UmbracoApiController { } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/WebServices/BulkPublishController.cs b/src/Umbraco.Web/WebServices/BulkPublishController.cs index e3e1b25896..5dba6c3438 100644 --- a/src/Umbraco.Web/WebServices/BulkPublishController.cs +++ b/src/Umbraco.Web/WebServices/BulkPublishController.cs @@ -78,9 +78,9 @@ namespace Umbraco.Web.WebServices case PublishStatusType.SuccessAlreadyPublished: return Services.TextService.Localize("publish/nodePublish", new[] { status.ContentItem.Name}); case PublishStatusType.FailedPathNotPublished: - return Services.TextService.Localize("publish/contentPublishedFailedByParent", + return Services.TextService.Localize("publish/contentPublishedFailedByParent", new [] { string.Format("{0} ({1})", status.ContentItem.Name, status.ContentItem.Id) }); - case PublishStatusType.FailedHasExpired: + case PublishStatusType.FailedHasExpired: case PublishStatusType.FailedAwaitingRelease: case PublishStatusType.FailedIsTrashed: return "Cannot publish document with a status of " + status.StatusType; @@ -90,12 +90,12 @@ namespace Umbraco.Web.WebServices case PublishStatusType.FailedContentInvalid: return Services.TextService.Localize("publish/contentPublishedFailedInvalid", new []{ - string.Format("'{0}' ({1})", status.ContentItem.Name, status.ContentItem.Id), + string.Format("'{0}' ({1})", status.ContentItem.Name, status.ContentItem.Id), string.Format("'{0}'", string.Join(", ", status.InvalidProperties.Select(x => x.Alias))) - }); + }); default: return status.StatusType.ToString(); } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/WebServices/CoreStringsController.cs b/src/Umbraco.Web/WebServices/CoreStringsController.cs index 9fb27a0bc1..2f84e10d54 100644 --- a/src/Umbraco.Web/WebServices/CoreStringsController.cs +++ b/src/Umbraco.Web/WebServices/CoreStringsController.cs @@ -17,7 +17,7 @@ namespace Umbraco.Web.WebServices { // always return a proper camel-cased alias // when checking... javascript does a case-unsensitive comparison - return value == null + return value == null ? Json(new {error = "no value."}, JsonRequestBehavior.AllowGet) : Json(new { alias = value.ToCleanString(CleanStringType.Alias | CleanStringType.CamelCase) }, JsonRequestBehavior.AllowGet); } @@ -30,4 +30,4 @@ namespace Umbraco.Web.WebServices return JavaScript(js); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/WebServices/EmbedMediaService.cs b/src/Umbraco.Web/WebServices/EmbedMediaService.cs index 0dca449881..58bae33711 100644 --- a/src/Umbraco.Web/WebServices/EmbedMediaService.cs +++ b/src/Umbraco.Web/WebServices/EmbedMediaService.cs @@ -20,7 +20,7 @@ namespace Umbraco.Web.WebServices if (currentUser == null) throw new UnauthorizedAccessException("You must be logged in to use this service"); - + var url = HttpContext.Current.Request.Form["url"]; var width = int.Parse(HttpContext.Current.Request.Form["width"]); var height = int.Parse(HttpContext.Current.Request.Form["height"]); diff --git a/src/Umbraco.Web/WebServices/ExamineManagementApiController.cs b/src/Umbraco.Web/WebServices/ExamineManagementApiController.cs index 673e864e4b..ab07429223 100644 --- a/src/Umbraco.Web/WebServices/ExamineManagementApiController.cs +++ b/src/Umbraco.Web/WebServices/ExamineManagementApiController.cs @@ -274,7 +274,7 @@ namespace Umbraco.Web.WebServices FieldDefinitions = indexer.Value.FieldDefinitions, Name = indexer.Key }; - + var props = TypeHelper.CachedDiscoverableProperties(indexer.GetType(), mustWrite: false) //ignore these properties .Where(x => new[] {"IndexerData", "Description", "WorkingFolder"}.InvariantContains(x.Name) == false) diff --git a/src/Umbraco.Web/WebServices/SaveFileController.cs b/src/Umbraco.Web/WebServices/SaveFileController.cs index 3eab6c67b1..99245c343e 100644 --- a/src/Umbraco.Web/WebServices/SaveFileController.cs +++ b/src/Umbraco.Web/WebServices/SaveFileController.cs @@ -14,7 +14,7 @@ namespace Umbraco.Web.WebServices /// /// Represents REST controller used to save files such as templates, partial views, macro files, etc. /// - /// This isn't fully implemented yet but we should migrate all of the logic + /// This isn't fully implemented yet but we should migrate all of the logic /// in the umbraco.presentation.webservices.codeEditorSave over to this controller. [ValidateMvcAngularAntiForgeryToken] public class SaveFileController : UmbracoAuthorizedController @@ -88,7 +88,7 @@ namespace Umbraco.Web.WebServices oldname = oldname.TrimStart(pathPrefix); } - var currentView = oldname.IsNullOrWhiteSpace() + var currentView = oldname.IsNullOrWhiteSpace() ? get(svce, filename) : get(svce, oldname); @@ -98,7 +98,7 @@ namespace Umbraco.Web.WebServices currentView.Path = filename; currentView.Content = contents; - + Attempt attempt; @@ -157,7 +157,7 @@ namespace Umbraco.Web.WebServices // if (Math.Max(t.MasterTemplate, 0) != Math.Max(masterTemplateId, 0)) // { // t.MasterTemplate = Math.Max(masterTemplateId, 0); - // pathChanged = true; + // pathChanged = true; // } // } // catch (ArgumentException ex) @@ -171,7 +171,7 @@ namespace Umbraco.Web.WebServices // t.Save(); // //ensure the correct path is synced as the parent might have been changed - // // http://issues.umbraco.org/issue/U4-2300 + // // http://issues.umbraco.org/issue/U4-2300 // if (pathChanged) // { // //need to re-look it up @@ -220,7 +220,7 @@ namespace Umbraco.Web.WebServices if (svce.ValidateScript(script) == false) return Failed(Services.TextService.Localize("speechBubbles/scriptErrorText"), Services.TextService.Localize("speechBubbles/scriptErrorHeader"), new FileSecurityException("File '" + filename + "' is not a valid script file.")); - + svce.SaveScript(script); } catch (Exception e) diff --git a/src/Umbraco.Web/WebServices/ScheduledPublishController.cs b/src/Umbraco.Web/WebServices/ScheduledPublishController.cs index 9488fbcbe1..01e044dd4f 100644 --- a/src/Umbraco.Web/WebServices/ScheduledPublishController.cs +++ b/src/Umbraco.Web/WebServices/ScheduledPublishController.cs @@ -53,11 +53,11 @@ namespace Umbraco.Web.WebServices if (HttpContext.Request.UserHostAddress != null) errorMessage = string.Format("{0} | Coming from {1}", errorMessage, HttpContext.Request.UserHostAddress); if (HttpContext.Request.UrlReferrer != null) - errorMessage = string.Format("{0} | Referrer {1}", errorMessage, HttpContext.Request.UrlReferrer); + errorMessage = string.Format("{0} | Referrer {1}", errorMessage, HttpContext.Request.UrlReferrer); } Logger.Error(errorMessage, ee); - Response.StatusCode = 400; + Response.StatusCode = 400; return Json(new { @@ -74,4 +74,4 @@ namespace Umbraco.Web.WebServices } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/WebServices/UmbracoAuthorizedHttpHandler.cs b/src/Umbraco.Web/WebServices/UmbracoAuthorizedHttpHandler.cs index 54b3f1f6df..d88ec06dd1 100644 --- a/src/Umbraco.Web/WebServices/UmbracoAuthorizedHttpHandler.cs +++ b/src/Umbraco.Web/WebServices/UmbracoAuthorizedHttpHandler.cs @@ -98,4 +98,4 @@ namespace Umbraco.Web.WebServices } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/WebServices/UmbracoHttpHandler.cs b/src/Umbraco.Web/WebServices/UmbracoHttpHandler.cs index 86b6bf49db..200f482cac 100644 --- a/src/Umbraco.Web/WebServices/UmbracoHttpHandler.cs +++ b/src/Umbraco.Web/WebServices/UmbracoHttpHandler.cs @@ -72,4 +72,4 @@ namespace Umbraco.Web.WebServices /// This URL helper is created without any route data and an empty request context. public UrlHelper Url => _url ?? (_url = new UrlHelper(HttpContext.Current.Request.RequestContext)); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/WebServices/UmbracoWebService.cs b/src/Umbraco.Web/WebServices/UmbracoWebService.cs index 08d33845dc..5dcb9eb7d5 100644 --- a/src/Umbraco.Web/WebServices/UmbracoWebService.cs +++ b/src/Umbraco.Web/WebServices/UmbracoWebService.cs @@ -71,4 +71,4 @@ namespace Umbraco.Web.WebServices /// This URL helper is created without any route data and an empty request context. public UrlHelper Url => _url ?? (_url = new UrlHelper(Context.Request.RequestContext)); } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/WebServices/XmlDataIntegrityController.cs b/src/Umbraco.Web/WebServices/XmlDataIntegrityController.cs index ebe0dfff47..56f1e27d34 100644 --- a/src/Umbraco.Web/WebServices/XmlDataIntegrityController.cs +++ b/src/Umbraco.Web/WebServices/XmlDataIntegrityController.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Web.Http; using Umbraco.Web.PublishedCache; using Umbraco.Web.PublishedCache.XmlPublishedCache; @@ -58,4 +58,4 @@ namespace Umbraco.Web.WebServices return _facadeService.VerifyMemberXml(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionAssignDomain.cs b/src/Umbraco.Web/_Legacy/Actions/ActionAssignDomain.cs index 6450a44ffa..1936cf3f61 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionAssignDomain.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionAssignDomain.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Reflection; @@ -99,80 +99,80 @@ namespace Umbraco.Web._Legacy.Actions /// /// A path to a supporting JavaScript file for the IAction. A script tag will be rendered out with the reference to the JavaScript file. /// - string JsSource { get; } + string JsSource { get; } } /// /// This action is invoked when a domain is being assigned to a document /// public class ActionAssignDomain : IAction - { - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance) - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionAssignDomain() { } + { + /// + /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. + /// All Umbraco assemblies should use the singleton instantiation (this.Instance) + /// When this applicatio is refactored, this constuctor should be made private. + /// + [Obsolete("Use the singleton instantiation instead of a constructor")] + public ActionAssignDomain() { } public static ActionAssignDomain Instance { get; } = new ActionAssignDomain(); #region IAction Members - public char Letter - { - get - { - return 'I'; - } - } + public char Letter + { + get + { + return 'I'; + } + } - public string JsFunctionName - { - get - { - return string.Format("{0}.actionAssignDomain()", ClientTools.Scripts.GetAppActions); - } - } + public string JsFunctionName + { + get + { + return string.Format("{0}.actionAssignDomain()", ClientTools.Scripts.GetAppActions); + } + } - public string JsSource - { - get - { - return null; - } - } + public string JsSource + { + get + { + return null; + } + } - public string Alias - { - get - { - return "assignDomain"; - } - } + public string Alias + { + get + { + return "assignDomain"; + } + } - public string Icon - { - get - { + public string Icon + { + get + { return "home"; - } - } + } + } - public bool ShowInNotifier - { - get - { - return false; - } - } - public bool CanBePermissionAssigned - { - get - { - return true; - } - } - #endregion - } + public bool ShowInNotifier + { + get + { + return false; + } + } + public bool CanBePermissionAssigned + { + get + { + return true; + } + } + #endregion + } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionAudit.cs b/src/Umbraco.Web/_Legacy/Actions/ActionAudit.cs index 06a66e8e73..5b1508c0db 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionAudit.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionAudit.cs @@ -1,80 +1,80 @@ -using System; +using System; using Umbraco.Web.UI.Pages; namespace Umbraco.Web._Legacy.Actions { - /// - /// This action is invoked upon viewing audittrailing on a document - /// - public class ActionAudit : IAction - { - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance) - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionAudit() { } + /// + /// This action is invoked upon viewing audittrailing on a document + /// + public class ActionAudit : IAction + { + /// + /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. + /// All Umbraco assemblies should use the singleton instantiation (this.Instance) + /// When this applicatio is refactored, this constuctor should be made private. + /// + [Obsolete("Use the singleton instantiation instead of a constructor")] + public ActionAudit() { } - public static ActionAudit Instance { get; } = new ActionAudit(); + public static ActionAudit Instance { get; } = new ActionAudit(); - #region IAction Members + #region IAction Members - public char Letter - { - get - { - return 'Z'; - } - } + public char Letter + { + get + { + return 'Z'; + } + } - public string JsFunctionName - { - get - { - return string.Format("{0}.actionAudit()", ClientTools.Scripts.GetAppActions); - } - } + public string JsFunctionName + { + get + { + return string.Format("{0}.actionAudit()", ClientTools.Scripts.GetAppActions); + } + } - public string JsSource - { - get - { - return null; - } - } + public string JsSource + { + get + { + return null; + } + } - public string Alias - { - get - { - return "auditTrail"; - } - } + public string Alias + { + get + { + return "auditTrail"; + } + } - public string Icon - { - get - { + public string Icon + { + get + { return "time"; - } - } + } + } - public bool ShowInNotifier - { - get - { - return false; - } - } - public bool CanBePermissionAssigned - { - get - { - return true; - } - } + public bool ShowInNotifier + { + get + { + return false; + } + } + public bool CanBePermissionAssigned + { + get + { + return true; + } + } - #endregion - } + #endregion + } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionBrowse.cs b/src/Umbraco.Web/_Legacy/Actions/ActionBrowse.cs index c5aa0cfb91..e8e8046092 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionBrowse.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionBrowse.cs @@ -1,61 +1,61 @@ -namespace Umbraco.Web._Legacy.Actions +namespace Umbraco.Web._Legacy.Actions { - /// - /// This action is used as a security constraint that grants a user the ability to view nodes in a tree - /// that has permissions applied to it. - /// - /// - /// This action should not be invoked. It is used as the minimum required permission to view nodes in the content tree. By - /// granting a user this permission, the user is able to see the node in the tree but not edit the document. This may be used by other trees - /// that support permissions in the future. - /// - public class ActionBrowse : IAction - { - //create singleton - private static readonly ActionBrowse instance = new ActionBrowse(); - private ActionBrowse() { } - public static ActionBrowse Instance - { - get { return instance; } - } + /// + /// This action is used as a security constraint that grants a user the ability to view nodes in a tree + /// that has permissions applied to it. + /// + /// + /// This action should not be invoked. It is used as the minimum required permission to view nodes in the content tree. By + /// granting a user this permission, the user is able to see the node in the tree but not edit the document. This may be used by other trees + /// that support permissions in the future. + /// + public class ActionBrowse : IAction + { + //create singleton + private static readonly ActionBrowse instance = new ActionBrowse(); + private ActionBrowse() { } + public static ActionBrowse Instance + { + get { return instance; } + } - #region IAction Members + #region IAction Members - public char Letter - { - get { return 'F'; } - } + public char Letter + { + get { return 'F'; } + } - public bool ShowInNotifier - { - get { return false; } - } + public bool ShowInNotifier + { + get { return false; } + } - public bool CanBePermissionAssigned - { - get { return true; } - } + public bool CanBePermissionAssigned + { + get { return true; } + } - public string Icon - { - get { return ""; } - } + public string Icon + { + get { return ""; } + } - public string Alias - { - get { return "browse"; } - } + public string Alias + { + get { return "browse"; } + } - public string JsFunctionName - { - get { return ""; } - } + public string JsFunctionName + { + get { return ""; } + } - public string JsSource - { - get { return ""; } - } + public string JsSource + { + get { return ""; } + } - #endregion - } + #endregion + } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionCopy.cs b/src/Umbraco.Web/_Legacy/Actions/ActionCopy.cs index a9a5794456..7b167b9d52 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionCopy.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionCopy.cs @@ -1,93 +1,93 @@ -using System; +using System; using Umbraco.Web.UI.Pages; namespace Umbraco.Web._Legacy.Actions { - /// - /// This action is invoked when copying a document, media, member - /// - public class ActionCopy : IAction - { - //create singleton + /// + /// This action is invoked when copying a document, media, member + /// + public class ActionCopy : IAction + { + //create singleton #pragma warning disable 612,618 - private static readonly ActionCopy m_instance = new ActionCopy(); + private static readonly ActionCopy m_instance = new ActionCopy(); #pragma warning restore 612,618 - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance) - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionCopy() { } + /// + /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. + /// All Umbraco assemblies should use the singleton instantiation (this.Instance) + /// When this applicatio is refactored, this constuctor should be made private. + /// + [Obsolete("Use the singleton instantiation instead of a constructor")] + public ActionCopy() { } - public static ActionCopy Instance - { - get { return m_instance; } - } + public static ActionCopy Instance + { + get { return m_instance; } + } - #region IAction Members + #region IAction Members - public char Letter - { - get - { + public char Letter + { + get + { - return 'O'; - } - } + return 'O'; + } + } - public string JsFunctionName - { - get - { - return string.Format("{0}.actionCopy()", ClientTools.Scripts.GetAppActions); - } - } + public string JsFunctionName + { + get + { + return string.Format("{0}.actionCopy()", ClientTools.Scripts.GetAppActions); + } + } - public string JsSource - { - get - { + public string JsSource + { + get + { - return null; - } - } + return null; + } + } - public string Alias - { - get - { + public string Alias + { + get + { - return "copy"; - } - } + return "copy"; + } + } - public string Icon - { - get - { + public string Icon + { + get + { return "documents"; - } - } + } + } - public bool ShowInNotifier - { - get - { + public bool ShowInNotifier + { + get + { - return true; - } - } - public bool CanBePermissionAssigned - { - get - { + return true; + } + } + public bool CanBePermissionAssigned + { + get + { - return true; - } - } - #endregion - } + return true; + } + } + #endregion + } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionDelete.cs b/src/Umbraco.Web/_Legacy/Actions/ActionDelete.cs index b3eff46d5c..c073090cf0 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionDelete.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionDelete.cs @@ -1,87 +1,87 @@ -using System; +using System; using Umbraco.Web.UI.Pages; namespace Umbraco.Web._Legacy.Actions { - /// - /// This action is invoked when a document, media, member is deleted - /// - public class ActionDelete : IAction - { - //create singleton + /// + /// This action is invoked when a document, media, member is deleted + /// + public class ActionDelete : IAction + { + //create singleton #pragma warning disable 612,618 - private static readonly ActionDelete m_instance = new ActionDelete(); + private static readonly ActionDelete m_instance = new ActionDelete(); #pragma warning restore 612,618 - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance) - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionDelete() { } + /// + /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. + /// All Umbraco assemblies should use the singleton instantiation (this.Instance) + /// When this applicatio is refactored, this constuctor should be made private. + /// + [Obsolete("Use the singleton instantiation instead of a constructor")] + public ActionDelete() { } - public static ActionDelete Instance - { - get { return m_instance; } - } + public static ActionDelete Instance + { + get { return m_instance; } + } - #region IAction Members + #region IAction Members - public char Letter - { - get - { - return 'D'; - } - } + public char Letter + { + get + { + return 'D'; + } + } - public string JsFunctionName - { - get - { - return string.Format("{0}.actionDelete()", ClientTools.Scripts.GetAppActions); - } - } + public string JsFunctionName + { + get + { + return string.Format("{0}.actionDelete()", ClientTools.Scripts.GetAppActions); + } + } - public string JsSource - { - get - { - return null; - } - } + public string JsSource + { + get + { + return null; + } + } - public string Alias - { - get - { - return "delete"; - } - } - - public string Icon - { - get - { + public string Alias + { + get + { return "delete"; - } - } + } + } - public bool ShowInNotifier - { - get - { - return true; - } - } - public bool CanBePermissionAssigned - { - get - { - return true; - } - } - #endregion - } + public string Icon + { + get + { + return "delete"; + } + } + + public bool ShowInNotifier + { + get + { + return true; + } + } + public bool CanBePermissionAssigned + { + get + { + return true; + } + } + #endregion + } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionEmptyTranscan.cs b/src/Umbraco.Web/_Legacy/Actions/ActionEmptyTranscan.cs index ef9512ccaf..0aa36ee85e 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionEmptyTranscan.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionEmptyTranscan.cs @@ -1,86 +1,86 @@ -using System; +using System; using Umbraco.Web.UI.Pages; namespace Umbraco.Web._Legacy.Actions { - /// - /// This action is invoked when the trash can is emptied - /// - public class ActionEmptyTranscan : IAction - { - //create singleton - private static readonly ActionEmptyTranscan InnerInstance = new ActionEmptyTranscan(); + /// + /// This action is invoked when the trash can is emptied + /// + public class ActionEmptyTranscan : IAction + { + //create singleton + private static readonly ActionEmptyTranscan InnerInstance = new ActionEmptyTranscan(); - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance) - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionEmptyTranscan() { } + /// + /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. + /// All Umbraco assemblies should use the singleton instantiation (this.Instance) + /// When this applicatio is refactored, this constuctor should be made private. + /// + [Obsolete("Use the singleton instantiation instead of a constructor")] + public ActionEmptyTranscan() { } - public static ActionEmptyTranscan Instance - { - get { return InnerInstance; } - } + public static ActionEmptyTranscan Instance + { + get { return InnerInstance; } + } - #region IAction Members + #region IAction Members - public char Letter - { - get - { - return 'N'; - } - } + public char Letter + { + get + { + return 'N'; + } + } - public string JsFunctionName - { - get - { - return string.Format("{0}.actionEmptyTranscan()", ClientTools.Scripts.GetAppActions); - } - } + public string JsFunctionName + { + get + { + return string.Format("{0}.actionEmptyTranscan()", ClientTools.Scripts.GetAppActions); + } + } - public string JsSource - { - get - { - return null; - } - } + public string JsSource + { + get + { + return null; + } + } - public string Alias - { - get - { - return "emptyRecycleBin"; - } - } + public string Alias + { + get + { + return "emptyRecycleBin"; + } + } - public string Icon - { - get - { - return "trash"; - } - } + public string Icon + { + get + { + return "trash"; + } + } - public bool ShowInNotifier - { - get - { - return false; - } - } - public bool CanBePermissionAssigned - { - get - { - return false; - } - } + public bool ShowInNotifier + { + get + { + return false; + } + } + public bool CanBePermissionAssigned + { + get + { + return false; + } + } - #endregion - } + #endregion + } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionExport.cs b/src/Umbraco.Web/_Legacy/Actions/ActionExport.cs index d7624d7e98..3dc35073fe 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionExport.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionExport.cs @@ -1,88 +1,88 @@ -using System; +using System; using Umbraco.Web.UI.Pages; namespace Umbraco.Web._Legacy.Actions { - /// - /// This action is invoked when exporting a document type - /// - public class ActionExport : IAction - { - //create singleton + /// + /// This action is invoked when exporting a document type + /// + public class ActionExport : IAction + { + //create singleton #pragma warning disable 612,618 - private static readonly ActionExport m_instance = new ActionExport(); + private static readonly ActionExport m_instance = new ActionExport(); #pragma warning restore 612,618 - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance) - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionExport() { } + /// + /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. + /// All Umbraco assemblies should use the singleton instantiation (this.Instance) + /// When this applicatio is refactored, this constuctor should be made private. + /// + [Obsolete("Use the singleton instantiation instead of a constructor")] + public ActionExport() { } - public static ActionExport Instance - { - get { return m_instance; } - } + public static ActionExport Instance + { + get { return m_instance; } + } - #region IAction Members + #region IAction Members - public char Letter - { - get - { - return '9'; - } - } + public char Letter + { + get + { + return '9'; + } + } - public string JsFunctionName - { - get - { - return string.Format("{0}.actionExport()", ClientTools.Scripts.GetAppActions); - } - } + public string JsFunctionName + { + get + { + return string.Format("{0}.actionExport()", ClientTools.Scripts.GetAppActions); + } + } - public string JsSource - { - get - { - return null; - } - } + public string JsSource + { + get + { + return null; + } + } - public string Alias - { - get - { - return "exportDocumentType"; - } - } + public string Alias + { + get + { + return "exportDocumentType"; + } + } - public string Icon - { - get - { + public string Icon + { + get + { return "download-alt"; - } - } + } + } - public bool ShowInNotifier - { - get - { - return false; - } - } - public bool CanBePermissionAssigned - { - get - { - return false; - } - } + public bool ShowInNotifier + { + get + { + return false; + } + } + public bool CanBePermissionAssigned + { + get + { + return false; + } + } - #endregion - } + #endregion + } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionImport.cs b/src/Umbraco.Web/_Legacy/Actions/ActionImport.cs index ab803d883d..e29f5e3d5c 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionImport.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionImport.cs @@ -1,88 +1,88 @@ -using System; +using System; using Umbraco.Web.UI.Pages; namespace Umbraco.Web._Legacy.Actions { - /// - /// This action is invoked when importing a document type - /// - public class ActionImport : IAction - { - //create singleton + /// + /// This action is invoked when importing a document type + /// + public class ActionImport : IAction + { + //create singleton #pragma warning disable 612,618 - private static readonly ActionImport m_instance = new ActionImport(); + private static readonly ActionImport m_instance = new ActionImport(); #pragma warning restore 612,618 - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance) - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionImport() { } + /// + /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. + /// All Umbraco assemblies should use the singleton instantiation (this.Instance) + /// When this applicatio is refactored, this constuctor should be made private. + /// + [Obsolete("Use the singleton instantiation instead of a constructor")] + public ActionImport() { } - public static ActionImport Instance - { - get { return m_instance; } - } + public static ActionImport Instance + { + get { return m_instance; } + } - #region IAction Members + #region IAction Members - public char Letter - { - get - { - return '8'; - } - } + public char Letter + { + get + { + return '8'; + } + } - public string JsFunctionName - { - get - { - return string.Format("{0}.actionImport()", ClientTools.Scripts.GetAppActions); - } - } + public string JsFunctionName + { + get + { + return string.Format("{0}.actionImport()", ClientTools.Scripts.GetAppActions); + } + } - public string JsSource - { - get - { - return null; - } - } + public string JsSource + { + get + { + return null; + } + } - public string Alias - { - get - { - return "importDocumentType"; - } - } + public string Alias + { + get + { + return "importDocumentType"; + } + } - public string Icon - { - get - { + public string Icon + { + get + { return "page-up"; - } - } + } + } - public bool ShowInNotifier - { - get - { - return false; - } - } - public bool CanBePermissionAssigned - { - get - { - return false; - } - } + public bool ShowInNotifier + { + get + { + return false; + } + } + public bool CanBePermissionAssigned + { + get + { + return false; + } + } - #endregion - } + #endregion + } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionMove.cs b/src/Umbraco.Web/_Legacy/Actions/ActionMove.cs index 0a422137f2..780048106d 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionMove.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionMove.cs @@ -1,93 +1,93 @@ -using System; +using System; using Umbraco.Web.UI.Pages; namespace Umbraco.Web._Legacy.Actions { - /// - /// This action is invoked upon creation of a document, media, member - /// - public class ActionMove : IAction - { - //create singleton + /// + /// This action is invoked upon creation of a document, media, member + /// + public class ActionMove : IAction + { + //create singleton #pragma warning disable 612,618 - private static readonly ActionMove m_instance = new ActionMove(); + private static readonly ActionMove m_instance = new ActionMove(); #pragma warning restore 612,618 - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance) - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionMove() { } + /// + /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. + /// All Umbraco assemblies should use the singleton instantiation (this.Instance) + /// When this applicatio is refactored, this constuctor should be made private. + /// + [Obsolete("Use the singleton instantiation instead of a constructor")] + public ActionMove() { } - public static ActionMove Instance - { - get { return m_instance; } - } + public static ActionMove Instance + { + get { return m_instance; } + } - #region IAction Members + #region IAction Members - public char Letter - { - get - { + public char Letter + { + get + { - return 'M'; - } - } + return 'M'; + } + } - public string JsFunctionName - { - get - { - return string.Format("{0}.actionMove()", ClientTools.Scripts.GetAppActions); - } - } + public string JsFunctionName + { + get + { + return string.Format("{0}.actionMove()", ClientTools.Scripts.GetAppActions); + } + } - public string JsSource - { - get - { + public string JsSource + { + get + { - return null; - } - } + return null; + } + } - public string Alias - { - get - { + public string Alias + { + get + { - return "move"; - } - } + return "move"; + } + } - public string Icon - { - get - { + public string Icon + { + get + { return "enter"; - } - } + } + } - public bool ShowInNotifier - { - get - { + public bool ShowInNotifier + { + get + { - return true; - } - } - public bool CanBePermissionAssigned - { - get - { + return true; + } + } + public bool CanBePermissionAssigned + { + get + { - return true; - } - } - #endregion - } + return true; + } + } + #endregion + } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionNew.cs b/src/Umbraco.Web/_Legacy/Actions/ActionNew.cs index 16d89a3035..25089217d8 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionNew.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionNew.cs @@ -1,80 +1,80 @@ -using System; +using System; using Umbraco.Web.UI.Pages; namespace Umbraco.Web._Legacy.Actions { - /// - /// This action is invoked upon creation of a document - /// - public class ActionNew : IAction - { - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance) - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionNew() { } + /// + /// This action is invoked upon creation of a document + /// + public class ActionNew : IAction + { + /// + /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. + /// All Umbraco assemblies should use the singleton instantiation (this.Instance) + /// When this applicatio is refactored, this constuctor should be made private. + /// + [Obsolete("Use the singleton instantiation instead of a constructor")] + public ActionNew() { } - public static ActionNew Instance { get; } = new ActionNew(); + public static ActionNew Instance { get; } = new ActionNew(); - #region IAction Members + #region IAction Members - public char Letter - { - get - { - return 'C'; - } - } + public char Letter + { + get + { + return 'C'; + } + } - public string JsFunctionName - { - get - { - return string.Format("{0}.actionNew()", ClientTools.Scripts.GetAppActions); - } - } + public string JsFunctionName + { + get + { + return string.Format("{0}.actionNew()", ClientTools.Scripts.GetAppActions); + } + } - public string JsSource - { - get - { - return null; - } - } + public string JsSource + { + get + { + return null; + } + } - public string Alias - { - get - { - return "create"; - } - } + public string Alias + { + get + { + return "create"; + } + } - public string Icon - { - get - { + public string Icon + { + get + { return "add"; - } - } + } + } - public bool ShowInNotifier - { - get - { - return true; - } - } - public bool CanBePermissionAssigned - { - get - { - return true; - } - } + public bool ShowInNotifier + { + get + { + return true; + } + } + public bool CanBePermissionAssigned + { + get + { + return true; + } + } - #endregion - } + #endregion + } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionNewFolder.cs b/src/Umbraco.Web/_Legacy/Actions/ActionNewFolder.cs index 7768113a7e..b4f16b3dd0 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionNewFolder.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionNewFolder.cs @@ -1,89 +1,89 @@ -using System; +using System; using Umbraco.Web.UI.Pages; namespace Umbraco.Web._Legacy.Actions { - /// - /// This action is invoked upon creation of a document - /// - [Obsolete("This class is no longer used and will be removed in future versions")] - public class ActionNewFolder : IAction - { - //create singleton + /// + /// This action is invoked upon creation of a document + /// + [Obsolete("This class is no longer used and will be removed in future versions")] + public class ActionNewFolder : IAction + { + //create singleton #pragma warning disable 612,618 - private static readonly ActionNewFolder m_instance = new ActionNewFolder(); + private static readonly ActionNewFolder m_instance = new ActionNewFolder(); #pragma warning restore 612,618 - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance) - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionNewFolder() { } + /// + /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. + /// All Umbraco assemblies should use the singleton instantiation (this.Instance) + /// When this applicatio is refactored, this constuctor should be made private. + /// + [Obsolete("Use the singleton instantiation instead of a constructor")] + public ActionNewFolder() { } - public static ActionNewFolder Instance - { - get { return m_instance; } - } + public static ActionNewFolder Instance + { + get { return m_instance; } + } - #region IAction Members + #region IAction Members - public char Letter - { - get - { - return '!'; - } - } + public char Letter + { + get + { + return '!'; + } + } - public string JsFunctionName - { - get - { - return string.Format("{0}.actionNewFolder()", ClientTools.Scripts.GetAppActions); - } - } + public string JsFunctionName + { + get + { + return string.Format("{0}.actionNewFolder()", ClientTools.Scripts.GetAppActions); + } + } - public string JsSource - { - get - { - return null; - } - } + public string JsSource + { + get + { + return null; + } + } - public string Alias - { - get - { - return "createFolder"; - } - } + public string Alias + { + get + { + return "createFolder"; + } + } - public string Icon - { - get - { + public string Icon + { + get + { return "plus-sign-alt"; - } - } + } + } - public bool ShowInNotifier - { - get - { - return false; - } - } - public bool CanBePermissionAssigned - { - get - { - return false; - } - } + public bool ShowInNotifier + { + get + { + return false; + } + } + public bool CanBePermissionAssigned + { + get + { + return false; + } + } - #endregion - } + #endregion + } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionNotify.cs b/src/Umbraco.Web/_Legacy/Actions/ActionNotify.cs index 9870ec53f8..fadcaa7a22 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionNotify.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionNotify.cs @@ -1,89 +1,89 @@ -using System; +using System; using Umbraco.Web.UI.Pages; namespace Umbraco.Web._Legacy.Actions { - /// - /// This action is invoked when a notification is sent - /// - public class ActionNotify : IAction - { - //create singleton + /// + /// This action is invoked when a notification is sent + /// + public class ActionNotify : IAction + { + //create singleton #pragma warning disable 612,618 - private static readonly ActionNotify m_instance = new ActionNotify(); + private static readonly ActionNotify m_instance = new ActionNotify(); #pragma warning restore 612,618 - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance) - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionNotify() { } + /// + /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. + /// All Umbraco assemblies should use the singleton instantiation (this.Instance) + /// When this applicatio is refactored, this constuctor should be made private. + /// + [Obsolete("Use the singleton instantiation instead of a constructor")] + public ActionNotify() { } - public static ActionNotify Instance - { - get { return m_instance; } - } + public static ActionNotify Instance + { + get { return m_instance; } + } - #region IAction Members + #region IAction Members - public char Letter - { - get - { + public char Letter + { + get + { - return 'T'; - } - } + return 'T'; + } + } - public string JsFunctionName - { - get - { - return string.Format("{0}.actionNotify()", ClientTools.Scripts.GetAppActions); - } - } + public string JsFunctionName + { + get + { + return string.Format("{0}.actionNotify()", ClientTools.Scripts.GetAppActions); + } + } - public string JsSource - { - get - { + public string JsSource + { + get + { - return null; - } - } + return null; + } + } - public string Alias - { - get - { - return "notify"; - } - } + public string Alias + { + get + { + return "notify"; + } + } - public string Icon - { - get - { + public string Icon + { + get + { return "megaphone"; - } - } + } + } - public bool ShowInNotifier - { - get - { - return false; - } - } - public bool CanBePermissionAssigned - { - get - { - return false; - } - } - #endregion - } + public bool ShowInNotifier + { + get + { + return false; + } + } + public bool CanBePermissionAssigned + { + get + { + return false; + } + } + #endregion + } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionNull.cs b/src/Umbraco.Web/_Legacy/Actions/ActionNull.cs index dc3128cc62..78c5175fb6 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionNull.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionNull.cs @@ -1,56 +1,56 @@ -namespace Umbraco.Web._Legacy.Actions +namespace Umbraco.Web._Legacy.Actions { - /// - /// This permission is assigned to a node when there are no permissions assigned to the node. - /// This is used internally to assign no permissions to a node for a user and shouldn't be used in code. - /// - public class ActionNull : IAction - { - //create singleton - private static readonly ActionNull instance = new ActionNull(); - private ActionNull() { } - public static ActionNull Instance - { - get { return instance; } - } + /// + /// This permission is assigned to a node when there are no permissions assigned to the node. + /// This is used internally to assign no permissions to a node for a user and shouldn't be used in code. + /// + public class ActionNull : IAction + { + //create singleton + private static readonly ActionNull instance = new ActionNull(); + private ActionNull() { } + public static ActionNull Instance + { + get { return instance; } + } - #region IAction Members + #region IAction Members - public char Letter - { - get { return '-'; } - } + public char Letter + { + get { return '-'; } + } - public bool ShowInNotifier - { - get { return false; } - } + public bool ShowInNotifier + { + get { return false; } + } - public bool CanBePermissionAssigned - { - get { return false; } - } + public bool CanBePermissionAssigned + { + get { return false; } + } - public string Icon - { - get { return string.Empty; } - } + public string Icon + { + get { return string.Empty; } + } - public string Alias - { - get { return string.Empty; } - } + public string Alias + { + get { return string.Empty; } + } - public string JsFunctionName - { - get { return string.Empty; } - } + public string JsFunctionName + { + get { return string.Empty; } + } - public string JsSource - { - get { return string.Empty; } - } + public string JsSource + { + get { return string.Empty; } + } - #endregion - } + #endregion + } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionPackage.cs b/src/Umbraco.Web/_Legacy/Actions/ActionPackage.cs index 7a1b44af1d..c713b0e212 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionPackage.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionPackage.cs @@ -1,88 +1,88 @@ -using System; +using System; using Umbraco.Web.UI.Pages; namespace Umbraco.Web._Legacy.Actions { - /// - /// This action is invoked upon creation of a document, media, member - /// - public class ActionPackage : IAction - { - //create singleton + /// + /// This action is invoked upon creation of a document, media, member + /// + public class ActionPackage : IAction + { + //create singleton #pragma warning disable 612,618 - private static readonly ActionPackage m_instance = new ActionPackage(); + private static readonly ActionPackage m_instance = new ActionPackage(); #pragma warning restore 612,618 - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance) - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionPackage() { } + /// + /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. + /// All Umbraco assemblies should use the singleton instantiation (this.Instance) + /// When this applicatio is refactored, this constuctor should be made private. + /// + [Obsolete("Use the singleton instantiation instead of a constructor")] + public ActionPackage() { } - public static ActionPackage Instance - { - get { return m_instance; } - } + public static ActionPackage Instance + { + get { return m_instance; } + } - #region IAction Members + #region IAction Members - public char Letter - { - get - { - return 'X'; - } - } + public char Letter + { + get + { + return 'X'; + } + } - public string JsFunctionName - { - get - { - return string.Format("{0}.actionPackage()", ClientTools.Scripts.GetAppActions); - } - } + public string JsFunctionName + { + get + { + return string.Format("{0}.actionPackage()", ClientTools.Scripts.GetAppActions); + } + } - public string JsSource - { - get - { - return ""; - } - } + public string JsSource + { + get + { + return ""; + } + } - public string Alias - { - get - { - return "importPackage"; - } - } + public string Alias + { + get + { + return "importPackage"; + } + } - public string Icon - { - get - { + public string Icon + { + get + { return "gift"; - } - } + } + } - public bool ShowInNotifier - { - get - { - return false; - } - } - public bool CanBePermissionAssigned - { - get - { - return false; - } - } + public bool ShowInNotifier + { + get + { + return false; + } + } + public bool CanBePermissionAssigned + { + get + { + return false; + } + } - #endregion - } + #endregion + } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionPackageCreate.cs b/src/Umbraco.Web/_Legacy/Actions/ActionPackageCreate.cs index 3ae0705727..ab036a17b6 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionPackageCreate.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionPackageCreate.cs @@ -1,88 +1,88 @@ -using System; +using System; using Umbraco.Web.UI.Pages; namespace Umbraco.Web._Legacy.Actions { - /// - /// This action is invoked upon creation of a document, media, member - /// - public class ActionPackageCreate : IAction - { - //create singleton + /// + /// This action is invoked upon creation of a document, media, member + /// + public class ActionPackageCreate : IAction + { + //create singleton #pragma warning disable 612,618 - private static readonly ActionPackageCreate m_instance = new ActionPackageCreate(); + private static readonly ActionPackageCreate m_instance = new ActionPackageCreate(); #pragma warning restore 612,618 - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance) - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionPackageCreate() { } + /// + /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. + /// All Umbraco assemblies should use the singleton instantiation (this.Instance) + /// When this applicatio is refactored, this constuctor should be made private. + /// + [Obsolete("Use the singleton instantiation instead of a constructor")] + public ActionPackageCreate() { } - public static ActionPackageCreate Instance - { - get { return m_instance; } - } + public static ActionPackageCreate Instance + { + get { return m_instance; } + } - #region IAction Members + #region IAction Members - public char Letter - { - get - { - return 'Y'; - } - } + public char Letter + { + get + { + return 'Y'; + } + } - public string JsFunctionName - { - get - { - return string.Format("{0}.actionPackageCreate()", ClientTools.Scripts.GetAppActions); - } - } + public string JsFunctionName + { + get + { + return string.Format("{0}.actionPackageCreate()", ClientTools.Scripts.GetAppActions); + } + } - public string JsSource - { - get - { - return null; - } - } + public string JsSource + { + get + { + return null; + } + } - public string Alias - { - get - { - return "createPackage"; - } - } + public string Alias + { + get + { + return "createPackage"; + } + } - public string Icon - { - get - { + public string Icon + { + get + { return "gift"; - } - } + } + } - public bool ShowInNotifier - { - get - { - return false; - } - } - public bool CanBePermissionAssigned - { - get - { - return false; - } - } + public bool ShowInNotifier + { + get + { + return false; + } + } + public bool CanBePermissionAssigned + { + get + { + return false; + } + } - #endregion - } + #endregion + } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionProtect.cs b/src/Umbraco.Web/_Legacy/Actions/ActionProtect.cs index 98ce80c165..9a0ddc7299 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionProtect.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionProtect.cs @@ -1,93 +1,93 @@ -using System; +using System; using Umbraco.Web.UI.Pages; namespace Umbraco.Web._Legacy.Actions { - /// - /// This action is invoked when a document is protected or unprotected - /// - public class ActionProtect : IAction - { - //create singleton + /// + /// This action is invoked when a document is protected or unprotected + /// + public class ActionProtect : IAction + { + //create singleton #pragma warning disable 612,618 - private static readonly ActionProtect m_instance = new ActionProtect(); + private static readonly ActionProtect m_instance = new ActionProtect(); #pragma warning restore 612,618 - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance) - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionProtect() { } + /// + /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. + /// All Umbraco assemblies should use the singleton instantiation (this.Instance) + /// When this applicatio is refactored, this constuctor should be made private. + /// + [Obsolete("Use the singleton instantiation instead of a constructor")] + public ActionProtect() { } - public static ActionProtect Instance - { - get { return m_instance; } - } + public static ActionProtect Instance + { + get { return m_instance; } + } - #region IAction Members + #region IAction Members - public char Letter - { - get - { + public char Letter + { + get + { - return 'P'; - } - } + return 'P'; + } + } - public string JsFunctionName - { - get - { - return string.Format("{0}.actionProtect()", ClientTools.Scripts.GetAppActions); - } - } + public string JsFunctionName + { + get + { + return string.Format("{0}.actionProtect()", ClientTools.Scripts.GetAppActions); + } + } - public string JsSource - { - get - { + public string JsSource + { + get + { - return null; - } - } + return null; + } + } - public string Alias - { - get - { + public string Alias + { + get + { - return "protect"; - } - } + return "protect"; + } + } - public string Icon - { - get - { + public string Icon + { + get + { return "lock"; - } - } + } + } - public bool ShowInNotifier - { - get - { + public bool ShowInNotifier + { + get + { - return true; - } - } - public bool CanBePermissionAssigned - { - get - { + return true; + } + } + public bool CanBePermissionAssigned + { + get + { - return true; - } - } - #endregion - } + return true; + } + } + #endregion + } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionPublish.cs b/src/Umbraco.Web/_Legacy/Actions/ActionPublish.cs index b16802f35c..f029bb72bb 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionPublish.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionPublish.cs @@ -1,87 +1,87 @@ -using System; +using System; using Umbraco.Web.UI.Pages; namespace Umbraco.Web._Legacy.Actions { - /// - /// This action is invoked when a document is being published - /// - public class ActionPublish : IAction - { - //create singleton + /// + /// This action is invoked when a document is being published + /// + public class ActionPublish : IAction + { + //create singleton #pragma warning disable 612,618 - private static readonly ActionPublish m_instance = new ActionPublish(); + private static readonly ActionPublish m_instance = new ActionPublish(); #pragma warning restore 612,618 - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance) - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionPublish() { } + /// + /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. + /// All Umbraco assemblies should use the singleton instantiation (this.Instance) + /// When this applicatio is refactored, this constuctor should be made private. + /// + [Obsolete("Use the singleton instantiation instead of a constructor")] + public ActionPublish() { } - public static ActionPublish Instance - { - get { return m_instance; } - } + public static ActionPublish Instance + { + get { return m_instance; } + } - #region IAction Members + #region IAction Members - public char Letter - { - get - { - return 'U'; - } - } + public char Letter + { + get + { + return 'U'; + } + } - public string JsFunctionName - { - get - { - return string.Format("{0}.actionPublish()", ClientTools.Scripts.GetAppActions); - } - } + public string JsFunctionName + { + get + { + return string.Format("{0}.actionPublish()", ClientTools.Scripts.GetAppActions); + } + } - public string JsSource - { - get - { - return null; - } - } + public string JsSource + { + get + { + return null; + } + } - public string Alias - { - get - { - return "publish"; - } - } + public string Alias + { + get + { + return "publish"; + } + } - public string Icon - { - get - { + public string Icon + { + get + { return "globe"; - } - } + } + } - public bool ShowInNotifier - { - get - { - return true; - } - } - public bool CanBePermissionAssigned - { - get - { - return true; - } - } - #endregion - } + public bool ShowInNotifier + { + get + { + return true; + } + } + public bool CanBePermissionAssigned + { + get + { + return true; + } + } + #endregion + } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionQuit.cs b/src/Umbraco.Web/_Legacy/Actions/ActionQuit.cs index b7ec141d3d..6e8fe64c4b 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionQuit.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionQuit.cs @@ -1,88 +1,88 @@ -using System; +using System; using Umbraco.Web.UI.Pages; namespace Umbraco.Web._Legacy.Actions { - /// - /// This action is invoked when a user logs out - /// - [Obsolete("This should not be used and will be removed from the codebase in future versions")] - public class ActionQuit : IAction - { - //create singleton + /// + /// This action is invoked when a user logs out + /// + [Obsolete("This should not be used and will be removed from the codebase in future versions")] + public class ActionQuit : IAction + { + //create singleton #pragma warning disable 612,618 - private static readonly ActionQuit m_instance = new ActionQuit(); + private static readonly ActionQuit m_instance = new ActionQuit(); #pragma warning restore 612,618 - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance) - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionQuit() { } + /// + /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. + /// All Umbraco assemblies should use the singleton instantiation (this.Instance) + /// When this applicatio is refactored, this constuctor should be made private. + /// + [Obsolete("Use the singleton instantiation instead of a constructor")] + public ActionQuit() { } - public static ActionQuit Instance - { - get { return m_instance; } - } + public static ActionQuit Instance + { + get { return m_instance; } + } - #region IAction Members + #region IAction Members - public char Letter - { - get - { - return 'Q'; - } - } + public char Letter + { + get + { + return 'Q'; + } + } - public string JsFunctionName - { - get - { - return string.Format("{0}.actionQuit()", ClientTools.Scripts.GetAppActions); - } - } + public string JsFunctionName + { + get + { + return string.Format("{0}.actionQuit()", ClientTools.Scripts.GetAppActions); + } + } - public string JsSource - { - get - { - return null; - } - } + public string JsSource + { + get + { + return null; + } + } - public string Alias - { - get - { - return "logout"; - } - } + public string Alias + { + get + { + return "logout"; + } + } - public string Icon - { - get - { + public string Icon + { + get + { return "signout"; - } - } + } + } - public bool ShowInNotifier - { - get - { - return false; - } - } - public bool CanBePermissionAssigned - { - get - { - return false; - } - } - #endregion - } + public bool ShowInNotifier + { + get + { + return false; + } + } + public bool CanBePermissionAssigned + { + get + { + return false; + } + } + #endregion + } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionRePublish.cs b/src/Umbraco.Web/_Legacy/Actions/ActionRePublish.cs index 9ebbce1dec..8f3036daad 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionRePublish.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionRePublish.cs @@ -1,87 +1,87 @@ -using System; +using System; using Umbraco.Web.UI.Pages; namespace Umbraco.Web._Legacy.Actions { - /// - /// This action is invoked when all documents are being republished - /// - public class ActionRePublish : IAction - { - //create singleton + /// + /// This action is invoked when all documents are being republished + /// + public class ActionRePublish : IAction + { + //create singleton #pragma warning disable 612,618 - private static readonly ActionRePublish m_instance = new ActionRePublish(); + private static readonly ActionRePublish m_instance = new ActionRePublish(); #pragma warning restore 612,618 - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance) - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionRePublish() { } + /// + /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. + /// All Umbraco assemblies should use the singleton instantiation (this.Instance) + /// When this applicatio is refactored, this constuctor should be made private. + /// + [Obsolete("Use the singleton instantiation instead of a constructor")] + public ActionRePublish() { } - public static ActionRePublish Instance - { - get { return m_instance; } - } + public static ActionRePublish Instance + { + get { return m_instance; } + } - #region IAction Members + #region IAction Members - public char Letter - { - get - { - return 'B'; - } - } + public char Letter + { + get + { + return 'B'; + } + } - public string JsFunctionName - { - get - { - return string.Format("{0}.actionRePublish()", ClientTools.Scripts.GetAppActions); - } - } + public string JsFunctionName + { + get + { + return string.Format("{0}.actionRePublish()", ClientTools.Scripts.GetAppActions); + } + } - public string JsSource - { - get - { - return null; - } - } + public string JsSource + { + get + { + return null; + } + } - public string Alias - { - get - { - return "republish"; - } - } + public string Alias + { + get + { + return "republish"; + } + } - public string Icon - { - get - { + public string Icon + { + get + { return "globe"; - } - } + } + } - public bool ShowInNotifier - { - get - { - return false; - } - } - public bool CanBePermissionAssigned - { - get - { - return false; - } - } - #endregion - } + public bool ShowInNotifier + { + get + { + return false; + } + } + public bool CanBePermissionAssigned + { + get + { + return false; + } + } + #endregion + } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionRefresh.cs b/src/Umbraco.Web/_Legacy/Actions/ActionRefresh.cs index 729fe131dc..178a05698b 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionRefresh.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionRefresh.cs @@ -1,94 +1,94 @@ -using System; +using System; using Umbraco.Web.UI.Pages; namespace Umbraco.Web._Legacy.Actions { /// - /// This action is invoked when a node reloads its children - /// Concerns only the tree itself and thus you should not handle - /// this action from without umbraco. - /// + /// This action is invoked when a node reloads its children + /// Concerns only the tree itself and thus you should not handle + /// this action from without umbraco. + /// [LegacyActionMenuItem("umbracoMenuActions", "RefreshNode")] - public class ActionRefresh : IAction - { - //create singleton - private static readonly ActionRefresh InnerInstance = new ActionRefresh(); + public class ActionRefresh : IAction + { + //create singleton + private static readonly ActionRefresh InnerInstance = new ActionRefresh(); - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance) - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionRefresh() { } + /// + /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. + /// All Umbraco assemblies should use the singleton instantiation (this.Instance) + /// When this applicatio is refactored, this constuctor should be made private. + /// + [Obsolete("Use the singleton instantiation instead of a constructor")] + public ActionRefresh() { } - public static ActionRefresh Instance - { - get { return InnerInstance; } - } + public static ActionRefresh Instance + { + get { return InnerInstance; } + } - #region IAction Members + #region IAction Members - public char Letter - { - get - { + public char Letter + { + get + { - return 'L'; - } - } + return 'L'; + } + } - public string JsFunctionName - { - get - { - return string.Format("{0}.actionRefresh()", ClientTools.Scripts.GetAppActions); - } - } + public string JsFunctionName + { + get + { + return string.Format("{0}.actionRefresh()", ClientTools.Scripts.GetAppActions); + } + } - public string JsSource - { - get - { + public string JsSource + { + get + { - return null; - } - } + return null; + } + } - public string Alias - { - get - { + public string Alias + { + get + { - return "refreshNode"; - } - } + return "refreshNode"; + } + } - public string Icon - { - get - { + public string Icon + { + get + { return "refresh"; - } - } + } + } - public bool ShowInNotifier - { - get - { + public bool ShowInNotifier + { + get + { - return false; - } - } - public bool CanBePermissionAssigned - { - get - { + return false; + } + } + public bool CanBePermissionAssigned + { + get + { - return false; - } - } - #endregion - } + return false; + } + } + #endregion + } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionRestore.cs b/src/Umbraco.Web/_Legacy/Actions/ActionRestore.cs index 30d4957ee4..60cfd3443f 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionRestore.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionRestore.cs @@ -80,4 +80,4 @@ #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionRights.cs b/src/Umbraco.Web/_Legacy/Actions/ActionRights.cs index c87a4a6910..8614df0650 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionRights.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionRights.cs @@ -1,93 +1,93 @@ -using System; +using System; using Umbraco.Web.UI.Pages; namespace Umbraco.Web._Legacy.Actions { - /// - /// This action is invoked when rights are changed on a document - /// - public class ActionRights : IAction - { - //create singleton + /// + /// This action is invoked when rights are changed on a document + /// + public class ActionRights : IAction + { + //create singleton #pragma warning disable 612,618 - private static readonly ActionRights m_instance = new ActionRights(); + private static readonly ActionRights m_instance = new ActionRights(); #pragma warning restore 612,618 - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance) - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionRights() { } + /// + /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. + /// All Umbraco assemblies should use the singleton instantiation (this.Instance) + /// When this applicatio is refactored, this constuctor should be made private. + /// + [Obsolete("Use the singleton instantiation instead of a constructor")] + public ActionRights() { } - public static ActionRights Instance - { - get { return m_instance; } - } + public static ActionRights Instance + { + get { return m_instance; } + } - #region IAction Members + #region IAction Members - public char Letter - { - get - { + public char Letter + { + get + { - return 'R'; - } - } + return 'R'; + } + } - public string JsFunctionName - { - get - { - return string.Format("{0}.actionRights()", ClientTools.Scripts.GetAppActions); - } - } + public string JsFunctionName + { + get + { + return string.Format("{0}.actionRights()", ClientTools.Scripts.GetAppActions); + } + } - public string JsSource - { - get - { + public string JsSource + { + get + { - return null; - } - } + return null; + } + } - public string Alias - { - get - { + public string Alias + { + get + { - return "rights"; - } - } + return "rights"; + } + } - public string Icon - { - get - { + public string Icon + { + get + { return "vcard"; - } - } + } + } - public bool ShowInNotifier - { - get - { + public bool ShowInNotifier + { + get + { - return true; - } - } - public bool CanBePermissionAssigned - { - get - { + return true; + } + } + public bool CanBePermissionAssigned + { + get + { - return true; - } - } - #endregion - } + return true; + } + } + #endregion + } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionRollback.cs b/src/Umbraco.Web/_Legacy/Actions/ActionRollback.cs index e3a602a66e..fa6159fa31 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionRollback.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionRollback.cs @@ -1,92 +1,92 @@ -using System; +using System; using Umbraco.Web.UI.Pages; namespace Umbraco.Web._Legacy.Actions { - /// - /// This action is invoked when copying a document is being rolled back - /// - public class ActionRollback : IAction - { - //create singleton + /// + /// This action is invoked when copying a document is being rolled back + /// + public class ActionRollback : IAction + { + //create singleton #pragma warning disable 612,618 - private static readonly ActionRollback m_instance = new ActionRollback(); + private static readonly ActionRollback m_instance = new ActionRollback(); #pragma warning restore 612,618 - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance) - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionRollback() { } + /// + /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. + /// All Umbraco assemblies should use the singleton instantiation (this.Instance) + /// When this applicatio is refactored, this constuctor should be made private. + /// + [Obsolete("Use the singleton instantiation instead of a constructor")] + public ActionRollback() { } - public static ActionRollback Instance - { - get { return m_instance; } - } + public static ActionRollback Instance + { + get { return m_instance; } + } - #region IAction Members + #region IAction Members - public char Letter - { - get - { + public char Letter + { + get + { - return 'K'; - } - } + return 'K'; + } + } - public string JsFunctionName - { - get - { - return string.Format("{0}.actionRollback()", ClientTools.Scripts.GetAppActions); - } - } + public string JsFunctionName + { + get + { + return string.Format("{0}.actionRollback()", ClientTools.Scripts.GetAppActions); + } + } - public string JsSource - { - get - { - return ""; - } - } + public string JsSource + { + get + { + return ""; + } + } - public string Alias - { - get - { + public string Alias + { + get + { - return "rollback"; - } - } + return "rollback"; + } + } - public string Icon - { - get - { + public string Icon + { + get + { return "undo"; - } - } + } + } - public bool ShowInNotifier - { - get - { + public bool ShowInNotifier + { + get + { - return true; - } - } - public bool CanBePermissionAssigned - { - get - { + return true; + } + } + public bool CanBePermissionAssigned + { + get + { - return true; - } - } - #endregion - } + return true; + } + } + #endregion + } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionSendToTranslate.cs b/src/Umbraco.Web/_Legacy/Actions/ActionSendToTranslate.cs index e68a119462..faa224ba58 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionSendToTranslate.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionSendToTranslate.cs @@ -1,88 +1,88 @@ -using System; +using System; using Umbraco.Web.UI.Pages; namespace Umbraco.Web._Legacy.Actions { - /// - /// This action is invoked when a send to translate request occurs - /// - public class ActionSendToTranslate : IAction - { - //create singleton + /// + /// This action is invoked when a send to translate request occurs + /// + public class ActionSendToTranslate : IAction + { + //create singleton #pragma warning disable 612,618 - private static readonly ActionSendToTranslate m_instance = new ActionSendToTranslate(); + private static readonly ActionSendToTranslate m_instance = new ActionSendToTranslate(); #pragma warning restore 612,618 - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance) - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionSendToTranslate() { } + /// + /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. + /// All Umbraco assemblies should use the singleton instantiation (this.Instance) + /// When this applicatio is refactored, this constuctor should be made private. + /// + [Obsolete("Use the singleton instantiation instead of a constructor")] + public ActionSendToTranslate() { } - public static ActionSendToTranslate Instance - { - get { return m_instance; } - } + public static ActionSendToTranslate Instance + { + get { return m_instance; } + } - #region IAction Members + #region IAction Members - public char Letter - { - get - { - return '5'; - } - } + public char Letter + { + get + { + return '5'; + } + } - public string JsFunctionName - { - get - { - return string.Format("{0}.actionSendToTranslate()", ClientTools.Scripts.GetAppActions); - } - } + public string JsFunctionName + { + get + { + return string.Format("{0}.actionSendToTranslate()", ClientTools.Scripts.GetAppActions); + } + } - public string JsSource - { - get - { - return null; - } - } + public string JsSource + { + get + { + return null; + } + } - public string Alias - { - get - { - return "sendToTranslate"; - } - } + public string Alias + { + get + { + return "sendToTranslate"; + } + } - public string Icon - { - get - { + public string Icon + { + get + { return "chat"; - } - } + } + } - public bool ShowInNotifier - { - get - { - return true; - } - } - public bool CanBePermissionAssigned - { - get - { - return true; - } - } + public bool ShowInNotifier + { + get + { + return true; + } + } + public bool CanBePermissionAssigned + { + get + { + return true; + } + } - #endregion - } + #endregion + } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionSort.cs b/src/Umbraco.Web/_Legacy/Actions/ActionSort.cs index ff7cc90ebf..f3ac8da000 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionSort.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionSort.cs @@ -1,93 +1,93 @@ -using System; +using System; using Umbraco.Web.UI.Pages; namespace Umbraco.Web._Legacy.Actions { - /// - /// This action is invoked when children to a document, media, member is being sorted - /// - public class ActionSort : IAction - { - //create singleton + /// + /// This action is invoked when children to a document, media, member is being sorted + /// + public class ActionSort : IAction + { + //create singleton #pragma warning disable 612,618 - private static readonly ActionSort m_instance = new ActionSort(); + private static readonly ActionSort m_instance = new ActionSort(); #pragma warning restore 612,618 - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance) - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionSort() { } + /// + /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. + /// All Umbraco assemblies should use the singleton instantiation (this.Instance) + /// When this applicatio is refactored, this constuctor should be made private. + /// + [Obsolete("Use the singleton instantiation instead of a constructor")] + public ActionSort() { } - public static ActionSort Instance - { - get { return m_instance; } - } + public static ActionSort Instance + { + get { return m_instance; } + } - #region IAction Members + #region IAction Members - public char Letter - { - get - { + public char Letter + { + get + { - return 'S'; - } - } + return 'S'; + } + } - public string JsFunctionName - { - get - { - return string.Format("{0}.actionSort()", ClientTools.Scripts.GetAppActions); - } - } + public string JsFunctionName + { + get + { + return string.Format("{0}.actionSort()", ClientTools.Scripts.GetAppActions); + } + } - public string JsSource - { - get - { + public string JsSource + { + get + { - return null; - } - } + return null; + } + } - public string Alias - { - get - { + public string Alias + { + get + { - return "sort"; - } - } + return "sort"; + } + } - public string Icon - { - get - { + public string Icon + { + get + { return "navigation-vertical"; - } - } + } + } - public bool ShowInNotifier - { - get - { + public bool ShowInNotifier + { + get + { - return true; - } - } - public bool CanBePermissionAssigned - { - get - { + return true; + } + } + public bool CanBePermissionAssigned + { + get + { - return true; - } - } - #endregion - } + return true; + } + } + #endregion + } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionToPublish.cs b/src/Umbraco.Web/_Legacy/Actions/ActionToPublish.cs index 63246df475..1a0a14dd03 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionToPublish.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionToPublish.cs @@ -1,88 +1,88 @@ -using System; +using System; using Umbraco.Web.UI.Pages; namespace Umbraco.Web._Legacy.Actions { - /// - /// This action is invoked when children to a document is being sent to published (by an editor without publishrights) - /// - public class ActionToPublish : IAction - { - //create singleton + /// + /// This action is invoked when children to a document is being sent to published (by an editor without publishrights) + /// + public class ActionToPublish : IAction + { + //create singleton #pragma warning disable 612,618 - private static readonly ActionToPublish m_instance = new ActionToPublish(); + private static readonly ActionToPublish m_instance = new ActionToPublish(); #pragma warning restore 612,618 - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance) - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionToPublish() { } + /// + /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. + /// All Umbraco assemblies should use the singleton instantiation (this.Instance) + /// When this applicatio is refactored, this constuctor should be made private. + /// + [Obsolete("Use the singleton instantiation instead of a constructor")] + public ActionToPublish() { } - public static ActionToPublish Instance - { - get { return m_instance; } - } + public static ActionToPublish Instance + { + get { return m_instance; } + } - #region IAction Members + #region IAction Members - public char Letter - { - get - { - return 'H'; - } - } + public char Letter + { + get + { + return 'H'; + } + } - public string JsFunctionName - { - get - { - return string.Format("{0}.actionToPublish()", ClientTools.Scripts.GetAppActions); - } - } + public string JsFunctionName + { + get + { + return string.Format("{0}.actionToPublish()", ClientTools.Scripts.GetAppActions); + } + } - public string JsSource - { - get - { - return null; - } - } + public string JsSource + { + get + { + return null; + } + } - public string Alias - { - get - { - return "sendtopublish"; - } - } + public string Alias + { + get + { + return "sendtopublish"; + } + } - public string Icon - { - get - { + public string Icon + { + get + { return "outbox"; - } - } + } + } - public bool ShowInNotifier - { - get - { - return true; - } - } - public bool CanBePermissionAssigned - { - get - { - //SD: Changed this to true so that any user may be able to perform this action, not just a writer - return true; - } - } - #endregion - } + public bool ShowInNotifier + { + get + { + return true; + } + } + public bool CanBePermissionAssigned + { + get + { + //SD: Changed this to true so that any user may be able to perform this action, not just a writer + return true; + } + } + #endregion + } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionTranslate.cs b/src/Umbraco.Web/_Legacy/Actions/ActionTranslate.cs index 6bb7cd2fb5..a29cf1124f 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionTranslate.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionTranslate.cs @@ -1,87 +1,87 @@ -using System; +using System; namespace Umbraco.Web._Legacy.Actions { - /// - /// This action is invoked when a translation occurs - /// - public class ActionTranslate : IAction - { - //create singleton + /// + /// This action is invoked when a translation occurs + /// + public class ActionTranslate : IAction + { + //create singleton #pragma warning disable 612,618 - private static readonly ActionTranslate m_instance = new ActionTranslate(); + private static readonly ActionTranslate m_instance = new ActionTranslate(); #pragma warning restore 612,618 - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance) - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionTranslate() { } + /// + /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. + /// All Umbraco assemblies should use the singleton instantiation (this.Instance) + /// When this applicatio is refactored, this constuctor should be made private. + /// + [Obsolete("Use the singleton instantiation instead of a constructor")] + public ActionTranslate() { } - public static ActionTranslate Instance - { - get { return m_instance; } - } + public static ActionTranslate Instance + { + get { return m_instance; } + } - #region IAction Members + #region IAction Members - public char Letter - { - get - { - return '4'; - } - } + public char Letter + { + get + { + return '4'; + } + } - public string JsFunctionName - { - get - { - return ""; - } - } + public string JsFunctionName + { + get + { + return ""; + } + } - public string JsSource - { - get - { - return null; - } - } + public string JsSource + { + get + { + return null; + } + } - public string Alias - { - get - { - return "translate"; - } - } + public string Alias + { + get + { + return "translate"; + } + } - public string Icon - { - get - { + public string Icon + { + get + { return "comments"; - } - } + } + } - public bool ShowInNotifier - { - get - { - return true; - } - } - public bool CanBePermissionAssigned - { - get - { - return true; - } - } + public bool ShowInNotifier + { + get + { + return true; + } + } + public bool CanBePermissionAssigned + { + get + { + return true; + } + } - #endregion - } + #endregion + } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionUnPublish.cs b/src/Umbraco.Web/_Legacy/Actions/ActionUnPublish.cs index 18510b90e8..7ab09e0b1d 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionUnPublish.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionUnPublish.cs @@ -1,15 +1,15 @@ -using System; +using System; namespace Umbraco.Web._Legacy.Actions { - /// - /// This action is invoked when a document is being unpublished - /// - public class ActionUnPublish : IAction - { + /// + /// This action is invoked when a document is being unpublished + /// + public class ActionUnPublish : IAction + { //create singleton #pragma warning disable 612,618 private static readonly ActionUnPublish m_instance = new ActionUnPublish(); @@ -28,63 +28,63 @@ namespace Umbraco.Web._Legacy.Actions get { return m_instance; } } - #region IAction Members + #region IAction Members - public char Letter - { - get - { - return 'Z'; - } - } + public char Letter + { + get + { + return 'Z'; + } + } - public string JsFunctionName - { - get - { - return ""; - } - } + public string JsFunctionName + { + get + { + return ""; + } + } - public string JsSource - { - get - { - return null; - } - } + public string JsSource + { + get + { + return null; + } + } - public string Alias - { - get - { - return "unpublish"; - } - } + public string Alias + { + get + { + return "unpublish"; + } + } - public string Icon - { - get - { + public string Icon + { + get + { return "circle-dotted"; - } - } + } + } - public bool ShowInNotifier - { - get - { - return false; - } - } - public bool CanBePermissionAssigned - { - get - { - return false; - } - } - #endregion - } + public bool ShowInNotifier + { + get + { + return false; + } + } + public bool CanBePermissionAssigned + { + get + { + return false; + } + } + #endregion + } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionUpdate.cs b/src/Umbraco.Web/_Legacy/Actions/ActionUpdate.cs index 344a550922..87962bfe53 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionUpdate.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionUpdate.cs @@ -1,87 +1,87 @@ -using System; +using System; using Umbraco.Web.UI.Pages; namespace Umbraco.Web._Legacy.Actions { - /// - /// This action is invoked when copying a document or media - /// - public class ActionUpdate : IAction - { - //create singleton + /// + /// This action is invoked when copying a document or media + /// + public class ActionUpdate : IAction + { + //create singleton #pragma warning disable 612,618 - private static readonly ActionUpdate m_instance = new ActionUpdate(); + private static readonly ActionUpdate m_instance = new ActionUpdate(); #pragma warning restore 612,618 - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance) - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionUpdate() { } + /// + /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. + /// All Umbraco assemblies should use the singleton instantiation (this.Instance) + /// When this applicatio is refactored, this constuctor should be made private. + /// + [Obsolete("Use the singleton instantiation instead of a constructor")] + public ActionUpdate() { } - public static ActionUpdate Instance - { - get { return m_instance; } - } + public static ActionUpdate Instance + { + get { return m_instance; } + } - #region IAction Members + #region IAction Members - public char Letter - { - get - { - return 'A'; - } - } + public char Letter + { + get + { + return 'A'; + } + } - public string JsFunctionName - { - get - { - return string.Format("{0}.actionUpdate()", ClientTools.Scripts.GetAppActions); - } - } + public string JsFunctionName + { + get + { + return string.Format("{0}.actionUpdate()", ClientTools.Scripts.GetAppActions); + } + } - public string JsSource - { - get - { - return null; - } - } + public string JsSource + { + get + { + return null; + } + } - public string Alias - { - get - { - return "update"; - } - } + public string Alias + { + get + { + return "update"; + } + } - public string Icon - { - get - { - return "save"; - } - } + public string Icon + { + get + { + return "save"; + } + } - public bool ShowInNotifier - { - get - { - return true; - } - } - public bool CanBePermissionAssigned - { - get - { - return true; - } - } - #endregion - } + public bool ShowInNotifier + { + get + { + return true; + } + } + public bool CanBePermissionAssigned + { + get + { + return true; + } + } + #endregion + } } diff --git a/src/Umbraco.Web/_Legacy/Actions/ContextMenuSeperator.cs b/src/Umbraco.Web/_Legacy/Actions/ContextMenuSeperator.cs index b88f81a316..2c66932a04 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ContextMenuSeperator.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ContextMenuSeperator.cs @@ -1,51 +1,51 @@ -namespace Umbraco.Web._Legacy.Actions +namespace Umbraco.Web._Legacy.Actions { - /// - /// Used simply to define context menu seperator items. - /// This should not be used directly in any code except for creating menus. - /// - public class ContextMenuSeperator : IAction - { - //create singleton - private static readonly ContextMenuSeperator instance = new ContextMenuSeperator(); - private ContextMenuSeperator() { } - public static ContextMenuSeperator Instance - { - get { return instance; } - } + /// + /// Used simply to define context menu seperator items. + /// This should not be used directly in any code except for creating menus. + /// + public class ContextMenuSeperator : IAction + { + //create singleton + private static readonly ContextMenuSeperator instance = new ContextMenuSeperator(); + private ContextMenuSeperator() { } + public static ContextMenuSeperator Instance + { + get { return instance; } + } - #region IAction Members + #region IAction Members - public char Letter - { - get { return ','; } - } + public char Letter + { + get { return ','; } + } - public string JsFunctionName - { - get { return string.Empty; } - } - public string JsSource - { - get { return string.Empty; } - } - public string Alias - { - get { return string.Empty; } - } - public string Icon - { - get { return string.Empty; } - } - public bool ShowInNotifier - { - get { return false; } - } - public bool CanBePermissionAssigned - { - get { return false; } - } + public string JsFunctionName + { + get { return string.Empty; } + } + public string JsSource + { + get { return string.Empty; } + } + public string Alias + { + get { return string.Empty; } + } + public string Icon + { + get { return string.Empty; } + } + public bool ShowInNotifier + { + get { return false; } + } + public bool CanBePermissionAssigned + { + get { return false; } + } - #endregion - } + #endregion + } } diff --git a/src/Umbraco.Web/_Legacy/Actions/LegacyActionMenuItemAttribute.cs b/src/Umbraco.Web/_Legacy/Actions/LegacyActionMenuItemAttribute.cs index 173cf9088d..ca9ace9630 100644 --- a/src/Umbraco.Web/_Legacy/Actions/LegacyActionMenuItemAttribute.cs +++ b/src/Umbraco.Web/_Legacy/Actions/LegacyActionMenuItemAttribute.cs @@ -1,4 +1,4 @@ -using System; +using System; using Umbraco.Core; using Umbraco.Core.Exceptions; @@ -8,7 +8,7 @@ namespace Umbraco.Web._Legacy.Actions /// The attribute to assign to any IAction objects. /// /// - /// This is purely used for compatibility reasons for old IActions used in v7 that haven't been upgraded to + /// This is purely used for compatibility reasons for old IActions used in v7 that haven't been upgraded to /// the new format. /// [AttributeUsage(AttributeTargets.Class)] @@ -43,4 +43,4 @@ namespace Umbraco.Web._Legacy.Actions public string MethodName { get; } public string ServiceName { get; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/_Legacy/Controls/CodeArea.cs b/src/Umbraco.Web/_Legacy/Controls/CodeArea.cs index 361fe4b3ca..db4a8a9bda 100644 --- a/src/Umbraco.Web/_Legacy/Controls/CodeArea.cs +++ b/src/Umbraco.Web/_Legacy/Controls/CodeArea.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.ComponentModel; using System.Data; @@ -84,7 +84,7 @@ namespace Umbraco.Web._Legacy.Controls ClientDependencyLoader.Instance.RegisterDependency(1, "lib/CodeMirror/mode/javascript/javascript.js", "UmbracoRoot", ClientDependencyType.Javascript); ClientDependencyLoader.Instance.RegisterDependency(1, "lib/CodeMirror/mode/css/css.js", "UmbracoRoot", ClientDependencyType.Javascript); ClientDependencyLoader.Instance.RegisterDependency(1, "lib/CodeMirror/mode/htmlmixed/htmlmixed.js", "UmbracoRoot", ClientDependencyType.Javascript); - + } ClientDependencyLoader.Instance.RegisterDependency(1, "lib/CodeMirror/addon/edit/matchbrackets.js", "UmbracoRoot", ClientDependencyType.Javascript); @@ -165,10 +165,10 @@ namespace Umbraco.Web._Legacy.Controls jsEventCode.Append(RenderCodeEditor()); } - jsEventCode.Append(@" - //TODO: for now this is a global var, need to refactor all this so that is using proper js standards - //with correct objects, and proper accessors to these objects. - var UmbEditor; + jsEventCode.Append(@" + //TODO: for now this is a global var, need to refactor all this so that is using proper js standards + //with correct objects, and proper accessors to these objects. + var UmbEditor; $(document).ready(function () { //create the editor UmbEditor = new Umbraco.Controls.CodeEditor.UmbracoEditor(" + (CodeMirrorEnabled == false).ToString().ToLower() + @", '" + ClientID + @"');"); @@ -185,16 +185,16 @@ namespace Umbraco.Web._Legacy.Controls //add the resize code jsEventCode.Append(@" var m_textEditor = jQuery('#" + ClientID + @"'); - + //with codemirror adding divs for line numbers, we need to target a different element m_textEditor = m_textEditor.find('iframe').length > 0 ? m_textEditor.children('div').get(0) : m_textEditor.get(0); - + jQuery(window).resize(function(){ resizeTextArea(m_textEditor, " + OffSetX + "," + OffSetY + @"); }); - jQuery(document).ready(function(){ resizeTextArea(m_textEditor, " + OffSetX + "," + OffSetY + @"); });"); + jQuery(document).ready(function(){ resizeTextArea(m_textEditor, " + OffSetX + "," + OffSetY + @"); });"); } - jsEventCode.Append(@" + jsEventCode.Append(@" });"); writer.WriteLine(@"", jsEventCode); @@ -203,8 +203,8 @@ namespace Umbraco.Web._Legacy.Controls protected string RenderBasicEditor() { - string jsEventCode = @" - var m_textEditor = document.getElementById('" + this.ClientID + @"'); + string jsEventCode = @" + var m_textEditor = document.getElementById('" + this.ClientID + @"'); tab.watch('" + this.ClientID + @"'); "; return jsEventCode; @@ -216,7 +216,7 @@ namespace Umbraco.Web._Legacy.Controls var editorMimetype = ""; if (string.IsNullOrEmpty(EditorMimeType) == false) - editorMimetype = @", + editorMimetype = @", mode: """ + EditorMimeType + "\""; @@ -233,7 +233,7 @@ namespace Umbraco.Web._Legacy.Controls editorMimetype + @", lineNumbers: true" + extraKeys + @" - }); + }); "; return jsEventCode; diff --git a/src/Umbraco.Web/_Legacy/Controls/FieldDropDownList.cs b/src/Umbraco.Web/_Legacy/Controls/FieldDropDownList.cs index a5e07b074b..cf85b107e0 100644 --- a/src/Umbraco.Web/_Legacy/Controls/FieldDropDownList.cs +++ b/src/Umbraco.Web/_Legacy/Controls/FieldDropDownList.cs @@ -69,4 +69,4 @@ namespace Umbraco.Web._Legacy.Controls writer.WriteLine(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/_Legacy/Controls/MenuButton.cs b/src/Umbraco.Web/_Legacy/Controls/MenuButton.cs index 77200efba5..bf44f3a379 100644 --- a/src/Umbraco.Web/_Legacy/Controls/MenuButton.cs +++ b/src/Umbraco.Web/_Legacy/Controls/MenuButton.cs @@ -10,7 +10,7 @@ namespace Umbraco.Web._Legacy.Controls public string Hotkey { get; set; } public string Icon { get; set; } - + public MenuButton() { Data = new DataAttributes(); @@ -29,7 +29,7 @@ namespace Umbraco.Web._Legacy.Controls Data.AppendTo(this); string cssClass = "btn"; - + if (Icon != null) { cssClass = "btn editorIcon"; diff --git a/src/Umbraco.Web/_Legacy/Controls/MenuButtonI.cs b/src/Umbraco.Web/_Legacy/Controls/MenuButtonI.cs index 9f0435a9d1..28ae95557a 100644 --- a/src/Umbraco.Web/_Legacy/Controls/MenuButtonI.cs +++ b/src/Umbraco.Web/_Legacy/Controls/MenuButtonI.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.ComponentModel; using System.Data; @@ -58,4 +58,4 @@ namespace Umbraco.Web._Legacy.Controls base.CreateChildControls(); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/_Legacy/Controls/MenuIcon.cs b/src/Umbraco.Web/_Legacy/Controls/MenuIcon.cs index 0a144546d9..fe8b654b8a 100644 --- a/src/Umbraco.Web/_Legacy/Controls/MenuIcon.cs +++ b/src/Umbraco.Web/_Legacy/Controls/MenuIcon.cs @@ -1,16 +1,16 @@ -using System.ComponentModel; +using System.ComponentModel; using System.Web.UI; using ClientDependency.Core; namespace Umbraco.Web._Legacy.Controls { - [ClientDependency(ClientDependencyType.Css, "menuicon/style.css", "UmbracoClient")] - internal class MenuIcon : System.Web.UI.WebControls.Image, MenuIconI - { + [ClientDependency(ClientDependencyType.Css, "menuicon/style.css", "UmbracoClient")] + internal class MenuIcon : System.Web.UI.WebControls.Image, MenuIconI + { private string _OnClickCommand = ""; private string _AltText = "init"; - + public string AltText { get { return this.AlternateText; } set { @@ -41,7 +41,7 @@ namespace Umbraco.Web._Legacy.Controls protected override void OnLoad(System.EventArgs EventArguments) { - // NH 17-01-2007. Trying to avoid inline styling soup + // NH 17-01-2007. Trying to avoid inline styling soup // Me.Width = WebControls.Unit.Pixel(22) // Me.Height = WebControls.Unit.Pixel(23) //Me.Style.Add("border", "0px") @@ -67,4 +67,4 @@ namespace Umbraco.Web._Legacy.Controls } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/_Legacy/Controls/Panel.cs b/src/Umbraco.Web/_Legacy/Controls/Panel.cs index dd0655b100..00dc679b31 100644 --- a/src/Umbraco.Web/_Legacy/Controls/Panel.cs +++ b/src/Umbraco.Web/_Legacy/Controls/Panel.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; @@ -7,7 +7,7 @@ namespace Umbraco.Web._Legacy.Controls public class UmbracoPanel : Panel { private ScrollingMenu _menu = new ScrollingMenu(); - + private bool _hasMenu = false; private string _StatusBarText = ""; private string _text; @@ -54,7 +54,7 @@ namespace Umbraco.Web._Legacy.Controls EnsureChildControls(); } - + internal HtmlGenericControl header = new HtmlGenericControl(); internal HtmlGenericControl row = new HtmlGenericControl(); internal HtmlGenericControl leftcol = new HtmlGenericControl(); @@ -72,7 +72,7 @@ namespace Umbraco.Web._Legacy.Controls header.TagName = "div"; header.ID = base.ClientID + "_header"; header.Attributes.Add("class","umb-panel-header"); - + row.TagName = "div"; row.Attributes.Add("class", "row-fluid"); header.Controls.Add(row); @@ -83,7 +83,7 @@ namespace Umbraco.Web._Legacy.Controls title.TagName = "h1"; title.Attributes.Add("class", "headline"); leftcol.Controls.Add(title); - + row.Controls.Add(leftcol); rightcol.TagName = "span"; @@ -98,17 +98,17 @@ namespace Umbraco.Web._Legacy.Controls Height = Unit.Empty; Controls.AddAt(0,header); - + base.CreateChildControls(); } - + protected override void OnLoad(EventArgs e) { base.OnLoad(e); title.InnerHtml = Text; } - + } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/_Legacy/Controls/PropertyPanel.cs b/src/Umbraco.Web/_Legacy/Controls/PropertyPanel.cs index b33cabc6a5..6ce9c40b46 100644 --- a/src/Umbraco.Web/_Legacy/Controls/PropertyPanel.cs +++ b/src/Umbraco.Web/_Legacy/Controls/PropertyPanel.cs @@ -16,7 +16,7 @@ namespace Umbraco.Web._Legacy.Controls get { return _text; } set { _text = value; } } - + protected override void OnLoad(EventArgs eventArguments) { } @@ -30,7 +30,7 @@ namespace Umbraco.Web._Legacy.Controls if (string.IsNullOrEmpty(_text)) CssClass += " hidelabel"; - + writer.WriteLine("
"); @@ -70,4 +70,4 @@ namespace Umbraco.Web._Legacy.Controls } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/_Legacy/Controls/ScrollingMenu.cs b/src/Umbraco.Web/_Legacy/Controls/ScrollingMenu.cs index 739a3c0f3e..0db40c484f 100644 --- a/src/Umbraco.Web/_Legacy/Controls/ScrollingMenu.cs +++ b/src/Umbraco.Web/_Legacy/Controls/ScrollingMenu.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.Web.UI; using System.Web.UI.WebControls; @@ -120,7 +120,7 @@ namespace Umbraco.Web._Legacy.Controls private HtmlGenericControl group; protected override void CreateChildControls() - { + { toolbar = new HtmlGenericControl { TagName = "div" }; toolbar.Attributes.Add("class", "btn-toolbar umb-btn-toolbar"); this.Controls.Add(toolbar); @@ -140,15 +140,15 @@ namespace Umbraco.Web._Legacy.Controls } base.OnLoad(e); } - - + + protected override void OnInit(EventArgs e) { - + EnsureChildControls(); base.OnInit(e); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/_Legacy/Controls/Splitter.cs b/src/Umbraco.Web/_Legacy/Controls/Splitter.cs index f33ba2a3bf..6e418bbf01 100644 --- a/src/Umbraco.Web/_Legacy/Controls/Splitter.cs +++ b/src/Umbraco.Web/_Legacy/Controls/Splitter.cs @@ -1,4 +1,4 @@ -using System.ComponentModel; +using System.ComponentModel; using System.Web.UI; using Umbraco.Core.IO; @@ -13,4 +13,4 @@ namespace Umbraco.Web._Legacy.Controls this.ImageUrl = SystemDirectories.UmbracoClient + "/menuicon/images/split.gif"; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/_Legacy/Controls/TabPage.cs b/src/Umbraco.Web/_Legacy/Controls/TabPage.cs index 9ca0ca0eec..282cec36e5 100644 --- a/src/Umbraco.Web/_Legacy/Controls/TabPage.cs +++ b/src/Umbraco.Web/_Legacy/Controls/TabPage.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.ComponentModel; using System.Data; @@ -14,7 +14,7 @@ namespace Umbraco.Web._Legacy.Controls public class TabPage : WebControl { - // Ensure that a TabPage cannot be instatiated outside + // Ensure that a TabPage cannot be instatiated outside // this assembly -> New instances of a tabpage can only be retrieved through the tabview private bool _hasMenu = true; protected LiteralControl ErrorHeaderControl = new LiteralControl(); @@ -48,7 +48,7 @@ namespace Umbraco.Web._Legacy.Controls protected override void OnInit(EventArgs e) { base.OnInit(e); - + _vs.ShowSummary = true; _vs.Attributes.Remove("style"); _vs.Style.Clear(); @@ -82,7 +82,7 @@ namespace Umbraco.Web._Legacy.Controls { _closeButtonControl.Text = "

"; ErrorHeaderControl.Text = ErrorHeader; - + var activeClass = string.Empty; if (this.ID == parent.ActiveTabId) diff --git a/src/Umbraco.Web/_Legacy/Controls/TabView.cs b/src/Umbraco.Web/_Legacy/Controls/TabView.cs index 03124c0124..4c3779076e 100644 --- a/src/Umbraco.Web/_Legacy/Controls/TabView.cs +++ b/src/Umbraco.Web/_Legacy/Controls/TabView.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; @@ -15,13 +15,13 @@ using System.Web.UI.HtmlControls; namespace Umbraco.Web._Legacy.Controls { - public class TabView : Umbraco.Web._Legacy.Controls.UmbracoPanel - { - public readonly ArrayList Tabs = new ArrayList(); - protected ArrayList Panels = new ArrayList(); + public class TabView : Umbraco.Web._Legacy.Controls.UmbracoPanel + { + public readonly ArrayList Tabs = new ArrayList(); + protected ArrayList Panels = new ArrayList(); protected Dictionary TabPages = new Dictionary(); - private string _status = ""; + private string _status = ""; private HtmlGenericControl _tabList = new HtmlGenericControl(); private HtmlGenericControl _body = new HtmlGenericControl(); @@ -45,7 +45,7 @@ namespace Umbraco.Web._Legacy.Controls _tabsHolder.Attributes.Add("class", "tab-content form-horizontal"); _tabsHolder.ID = this.ID + "_content"; _body.Controls.Add(_tabsHolder); - + for (int i = 0; i < Tabs.Count; i++) { var tabPage = TabPages.ElementAt(i).Value; @@ -60,7 +60,7 @@ namespace Umbraco.Web._Legacy.Controls } protected override void OnInit(EventArgs e) - { + { base.OnInit(e); base.CssClass = "umb-panel tabbable"; } @@ -72,13 +72,13 @@ namespace Umbraco.Web._Legacy.Controls if (string.IsNullOrEmpty(Text)) Text = " "; - + for (int i = 0; i < Tabs.Count; i++) { var tabPage = TabPages.ElementAt(i).Value; string tabPageCaption = tabPage.Text; string tabId = tabPage.ID; - + HtmlGenericControl li = new HtmlGenericControl(); li.TagName = "li"; if (tabId == ActiveTabId) @@ -95,10 +95,10 @@ namespace Umbraco.Web._Legacy.Controls } } - public ArrayList GetPanels() - { - return Panels; - } + public ArrayList GetPanels() + { + return Panels; + } public TabPage NewTabPage(string text) { @@ -117,13 +117,13 @@ namespace Umbraco.Web._Legacy.Controls } - public string Status - { - get { return _status; } - set { _status = value; } - } + public string Status + { + get { return _status; } + set { _status = value; } + } + - public string ActiveTabId { @@ -136,10 +136,10 @@ namespace Umbraco.Web._Legacy.Controls if (TabPages.Count > 0) return TabPages.ElementAt(0).Value.ID; - + return "tab01"; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/_Legacy/Controls/feedback.cs b/src/Umbraco.Web/_Legacy/Controls/feedback.cs index 11b5cb74f0..4c4b5bf143 100644 --- a/src/Umbraco.Web/_Legacy/Controls/feedback.cs +++ b/src/Umbraco.Web/_Legacy/Controls/feedback.cs @@ -5,9 +5,9 @@ using ClientDependency.Core; namespace Umbraco.Web._Legacy.Controls { - + [ClientDependency(ClientDependencyType.Css, "ui/default.css", "UmbracoClient")] - public class Feedback : System.Web.UI.WebControls.Panel + public class Feedback : System.Web.UI.WebControls.Panel { public Feedback() { @@ -25,7 +25,7 @@ namespace Umbraco.Web._Legacy.Controls private string _text = string.Empty; public string Text { get { - + return _text; } @@ -37,7 +37,7 @@ namespace Umbraco.Web._Legacy.Controls error, success } - + protected override void Render(System.Web.UI.HtmlTextWriter writer) { if (_text != string.Empty) { base.CreateChildControls(); @@ -50,7 +50,7 @@ namespace Umbraco.Web._Legacy.Controls writer.WriteLine("

"); writer.WriteLine(_text); writer.WriteLine("

"); - } + } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/_Legacy/Controls/pane.cs b/src/Umbraco.Web/_Legacy/Controls/pane.cs index 987f2df84c..2d37a2c099 100644 --- a/src/Umbraco.Web/_Legacy/Controls/pane.cs +++ b/src/Umbraco.Web/_Legacy/Controls/pane.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.ComponentModel; using System.Data; @@ -88,7 +88,7 @@ namespace Umbraco.Web._Legacy.Controls styleString += key + ":" + this.Style[key] + ";"; } - + writer.WriteLine("
"); if (!string.IsNullOrEmpty(m_title)) writer.WriteLine("
" + m_title + "
"); @@ -114,4 +114,4 @@ namespace Umbraco.Web._Legacy.Controls } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/_Legacy/PackageActions/PackageHelper.cs b/src/Umbraco.Web/_Legacy/PackageActions/PackageHelper.cs index a0cd612d94..c479b720da 100644 --- a/src/Umbraco.Web/_Legacy/PackageActions/PackageHelper.cs +++ b/src/Umbraco.Web/_Legacy/PackageActions/PackageHelper.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Xml; using Umbraco.Core; using Umbraco.Core.IO; @@ -7,78 +7,78 @@ using Umbraco.Core.Xml; namespace Umbraco.Web._Legacy.PackageActions { - public class PackageHelper - { - //Helper method to replace umbraco tags that breaks the xml format.. - public static string ParseToValidXml(ITemplate templateObj, ref bool hasAspNetContentBeginning, string template, bool toValid) - { - string retVal = template; - if (toValid) - { - // test for asp:content as the first part of the design - if (retVal.StartsWith("") + 1); - retVal = retVal.Substring(0, retVal.Length - 14); - } - //shorten empty macro tags.. - retVal = retVal.Replace(">", " />"); - retVal = retVal.Replace(">", " />"); + public class PackageHelper + { + //Helper method to replace umbraco tags that breaks the xml format.. + public static string ParseToValidXml(ITemplate templateObj, ref bool hasAspNetContentBeginning, string template, bool toValid) + { + string retVal = template; + if (toValid) + { + // test for asp:content as the first part of the design + if (retVal.StartsWith("") + 1); + retVal = retVal.Substring(0, retVal.Length - 14); + } + //shorten empty macro tags.. + retVal = retVal.Replace(">", " />"); + retVal = retVal.Replace(">", " />"); - retVal = retVal.Replace("", ""); - retVal = retVal.Replace("", ""); - retVal = retVal.Replace("", ""); + } + else + { + retVal = retVal.Replace("", ""); + retVal = retVal.Replace("", ""); + retVal = retVal.Replace("", ""); - // add asp content element - if (hasAspNetContentBeginning) - { - retVal = MasterPageHelper.GetMasterContentElement(templateObj/*templateObj.MasterTemplate*/) + retVal + ""; - } - } + // add asp content element + if (hasAspNetContentBeginning) + { + retVal = MasterPageHelper.GetMasterContentElement(templateObj/*templateObj.MasterTemplate*/) + retVal + ""; + } + } - return retVal; - } + return retVal; + } - public static XmlNode ParseStringToXmlNode(string value) - { - XmlDocument doc = new XmlDocument(); - XmlNode node = XmlHelper.AddTextNode(doc, "error", ""); + public static XmlNode ParseStringToXmlNode(string value) + { + XmlDocument doc = new XmlDocument(); + XmlNode node = XmlHelper.AddTextNode(doc, "error", ""); - try - { - doc.LoadXml(value); - return doc.SelectSingleNode("."); - } - catch - { - return node; - } + try + { + doc.LoadXml(value); + return doc.SelectSingleNode("."); + } + catch + { + return node; + } - } - } -} \ No newline at end of file + } + } +} diff --git a/src/Umbraco.Web/_Legacy/PackageActions/addApplication.cs b/src/Umbraco.Web/_Legacy/PackageActions/addApplication.cs index f99552a5ca..09c6df23c4 100644 --- a/src/Umbraco.Web/_Legacy/PackageActions/addApplication.cs +++ b/src/Umbraco.Web/_Legacy/PackageActions/addApplication.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Xml; using Umbraco.Core; using Umbraco.Core._Legacy.PackageActions; @@ -6,60 +6,60 @@ using Umbraco.Web.Composing; namespace Umbraco.Web._Legacy.PackageActions { - /// - /// This class implements the IPackageAction Interface, used to execute code when packages are installed. - /// All IPackageActions only takes a PackageName and a XmlNode as input, and executes based on the data in the xmlnode. - /// - public class addApplication : IPackageAction - { + /// + /// This class implements the IPackageAction Interface, used to execute code when packages are installed. + /// All IPackageActions only takes a PackageName and a XmlNode as input, and executes based on the data in the xmlnode. + /// + public class addApplication : IPackageAction + { - #region IPackageAction Members + #region IPackageAction Members - /// - /// Installs a new application in umbraco. - /// - /// Name of the package. - /// The XML data. - /// - /// - /// - /// true if successfull - public bool Execute(string packageName, XmlNode xmlData) - { - string name = xmlData.Attributes["appName"].Value; - string alias = xmlData.Attributes["appAlias"].Value; - string icon = xmlData.Attributes["appIcon"].Value; + /// + /// Installs a new application in umbraco. + /// + /// Name of the package. + /// The XML data. + /// + /// + /// + /// true if successfull + public bool Execute(string packageName, XmlNode xmlData) + { + string name = xmlData.Attributes["appName"].Value; + string alias = xmlData.Attributes["appAlias"].Value; + string icon = xmlData.Attributes["appIcon"].Value; - Current.Services.SectionService.MakeNew(name, alias, icon); + Current.Services.SectionService.MakeNew(name, alias, icon); - return true; - } + return true; + } - public bool Undo(string packageName, XmlNode xmlData) - { - string alias = xmlData.Attributes["appAlias"].Value; - var section = Current.Services.SectionService.GetByAlias(alias); - if (section != null) - { - Current.Services.SectionService.DeleteSection(section); - } - return true; - } - /// - /// Action alias. - /// - /// - public string Alias() - { - return "addApplication"; - } + public bool Undo(string packageName, XmlNode xmlData) + { + string alias = xmlData.Attributes["appAlias"].Value; + var section = Current.Services.SectionService.GetByAlias(alias); + if (section != null) + { + Current.Services.SectionService.DeleteSection(section); + } + return true; + } + /// + /// Action alias. + /// + /// + public string Alias() + { + return "addApplication"; + } - #endregion + #endregion - public XmlNode SampleXml() - { - throw new NotImplementedException(); - } + public XmlNode SampleXml() + { + throw new NotImplementedException(); + } - } -} \ No newline at end of file + } +} diff --git a/src/Umbraco.Web/_Legacy/PackageActions/addDashboardSection.cs b/src/Umbraco.Web/_Legacy/PackageActions/addDashboardSection.cs index 9512d81e91..9b3bc5829b 100644 --- a/src/Umbraco.Web/_Legacy/PackageActions/addDashboardSection.cs +++ b/src/Umbraco.Web/_Legacy/PackageActions/addDashboardSection.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Xml; using Umbraco.Core; using Umbraco.Core.IO; @@ -7,102 +7,102 @@ using Umbraco.Core._Legacy.PackageActions; namespace Umbraco.Web._Legacy.PackageActions { - /// - /// - /// - public class addDashboardSection : IPackageAction - { - #region IPackageAction Members + /// + /// + /// + public class addDashboardSection : IPackageAction + { + #region IPackageAction Members - /// - /// Installs a dashboard section. This action reuses the action XML, so it has to be valid dashboard markup. - /// - /// Name of the package. - /// The XML data. - /// true if successfull - /// - /// - /// - ///
- /// - /// default - /// content - /// - /// - /// /usercontrols/dashboard/latestEdits.ascx - /// /usercontrols/umbracoBlog/dashboardBlogPostCreate.ascx - /// - /// - /// /usercontrols/umbracoBlog/dashboardBlogPostCreate.ascx - /// - ///
- ///
- ///
- ///
- public bool Execute(string packageName, XmlNode xmlData) - { - //this will need a complete section node to work... + /// + /// Installs a dashboard section. This action reuses the action XML, so it has to be valid dashboard markup. + /// + /// Name of the package. + /// The XML data. + /// true if successfull + /// + /// + /// + ///
+ /// + /// default + /// content + /// + /// + /// /usercontrols/dashboard/latestEdits.ascx + /// /usercontrols/umbracoBlog/dashboardBlogPostCreate.ascx + /// + /// + /// /usercontrols/umbracoBlog/dashboardBlogPostCreate.ascx + /// + ///
+ ///
+ ///
+ ///
+ public bool Execute(string packageName, XmlNode xmlData) + { + //this will need a complete section node to work... - if (xmlData.HasChildNodes) - { - string sectionAlias = xmlData.Attributes["dashboardAlias"].Value; - string dbConfig = SystemFiles.DashboardConfig; + if (xmlData.HasChildNodes) + { + string sectionAlias = xmlData.Attributes["dashboardAlias"].Value; + string dbConfig = SystemFiles.DashboardConfig; - XmlNode section = xmlData.SelectSingleNode("./section"); - XmlDocument dashboardFile = XmlHelper.OpenAsXmlDocument(dbConfig); + XmlNode section = xmlData.SelectSingleNode("./section"); + XmlDocument dashboardFile = XmlHelper.OpenAsXmlDocument(dbConfig); - //don't continue if it already exists - var found = dashboardFile.SelectNodes("//section[@alias='" + sectionAlias + "']"); - if (found == null || found.Count <= 0) - { + //don't continue if it already exists + var found = dashboardFile.SelectNodes("//section[@alias='" + sectionAlias + "']"); + if (found == null || found.Count <= 0) + { - XmlNode importedSection = dashboardFile.ImportNode(section, true); + XmlNode importedSection = dashboardFile.ImportNode(section, true); - XmlAttribute alias = XmlHelper.AddAttribute(dashboardFile, "alias", sectionAlias); - importedSection.Attributes.Append(alias); + XmlAttribute alias = XmlHelper.AddAttribute(dashboardFile, "alias", sectionAlias); + importedSection.Attributes.Append(alias); - dashboardFile.DocumentElement.AppendChild(importedSection); + dashboardFile.DocumentElement.AppendChild(importedSection); - dashboardFile.Save(IOHelper.MapPath(dbConfig)); - } + dashboardFile.Save(IOHelper.MapPath(dbConfig)); + } - return true; - } + return true; + } - return false; - } + return false; + } - public string Alias() - { - return "addDashboardSection"; - } + public string Alias() + { + return "addDashboardSection"; + } - public bool Undo(string packageName, XmlNode xmlData) - { + public bool Undo(string packageName, XmlNode xmlData) + { - string sectionAlias = xmlData.Attributes["dashboardAlias"].Value; - string dbConfig = SystemFiles.DashboardConfig; + string sectionAlias = xmlData.Attributes["dashboardAlias"].Value; + string dbConfig = SystemFiles.DashboardConfig; XmlDocument dashboardFile = XmlHelper.OpenAsXmlDocument(dbConfig); - XmlNode section = dashboardFile.SelectSingleNode("//section [@alias = '" + sectionAlias + "']"); + XmlNode section = dashboardFile.SelectSingleNode("//section [@alias = '" + sectionAlias + "']"); - if (section != null) - { + if (section != null) + { - dashboardFile.SelectSingleNode("/dashBoard").RemoveChild(section); - dashboardFile.Save(IOHelper.MapPath(dbConfig)); - } + dashboardFile.SelectSingleNode("/dashBoard").RemoveChild(section); + dashboardFile.Save(IOHelper.MapPath(dbConfig)); + } - return true; - } + return true; + } - #endregion + #endregion - public XmlNode SampleXml() - { - throw new NotImplementedException(); - } + public XmlNode SampleXml() + { + throw new NotImplementedException(); + } - } -} \ No newline at end of file + } +} diff --git a/src/Umbraco.Web/_Legacy/PackageActions/addProxyFeedHost.cs b/src/Umbraco.Web/_Legacy/PackageActions/addProxyFeedHost.cs index fabf637166..ac02bc0c33 100644 --- a/src/Umbraco.Web/_Legacy/PackageActions/addProxyFeedHost.cs +++ b/src/Umbraco.Web/_Legacy/PackageActions/addProxyFeedHost.cs @@ -1,4 +1,4 @@ -using System.Xml; +using System.Xml; using Umbraco.Core; using Umbraco.Core.IO; using Umbraco.Core.Xml; @@ -6,95 +6,95 @@ using Umbraco.Core._Legacy.PackageActions; namespace Umbraco.Web._Legacy.PackageActions { - public class addProxyFeedHost : IPackageAction - { - #region IPackageAction Members + public class addProxyFeedHost : IPackageAction + { + #region IPackageAction Members - public bool Execute(string packageName, XmlNode xmlData) - { - var hostname = xmlData.Attributes["host"].Value; - if (string.IsNullOrEmpty(hostname)) - return false; + public bool Execute(string packageName, XmlNode xmlData) + { + var hostname = xmlData.Attributes["host"].Value; + if (string.IsNullOrEmpty(hostname)) + return false; - var xdoc = XmlHelper.OpenAsXmlDocument(SystemFiles.FeedProxyConfig); + var xdoc = XmlHelper.OpenAsXmlDocument(SystemFiles.FeedProxyConfig); - xdoc.PreserveWhitespace = true; + xdoc.PreserveWhitespace = true; - var xn = xdoc.SelectSingleNode("//feedProxy"); - if (xn != null) - { - var insert = true; + var xn = xdoc.SelectSingleNode("//feedProxy"); + if (xn != null) + { + var insert = true; - if (xn.HasChildNodes) - { - foreach (XmlNode node in xn.SelectNodes("//allow")) - { - if (node.Attributes["host"] != null && node.Attributes["host"].Value == hostname) - insert = false; - } - } + if (xn.HasChildNodes) + { + foreach (XmlNode node in xn.SelectNodes("//allow")) + { + if (node.Attributes["host"] != null && node.Attributes["host"].Value == hostname) + insert = false; + } + } - if (insert) - { - var newHostname = XmlHelper.AddTextNode(xdoc, "allow", string.Empty); - newHostname.Attributes.Append(XmlHelper.AddAttribute(xdoc, "host", hostname)); - xn.AppendChild(newHostname); + if (insert) + { + var newHostname = XmlHelper.AddTextNode(xdoc, "allow", string.Empty); + newHostname.Attributes.Append(XmlHelper.AddAttribute(xdoc, "host", hostname)); + xn.AppendChild(newHostname); - xdoc.Save(IOHelper.MapPath(SystemFiles.FeedProxyConfig)); + xdoc.Save(IOHelper.MapPath(SystemFiles.FeedProxyConfig)); - return true; - } - } + return true; + } + } - return false; - } + return false; + } - public string Alias() - { - return "addProxyFeedHost"; - } + public string Alias() + { + return "addProxyFeedHost"; + } - public bool Undo(string packageName, XmlNode xmlData) - { - var hostname = xmlData.Attributes["host"].Value; - if (string.IsNullOrEmpty(hostname)) - return false; + public bool Undo(string packageName, XmlNode xmlData) + { + var hostname = xmlData.Attributes["host"].Value; + if (string.IsNullOrEmpty(hostname)) + return false; - var xdoc = XmlHelper.OpenAsXmlDocument(SystemFiles.FeedProxyConfig); - xdoc.PreserveWhitespace = true; + var xdoc = XmlHelper.OpenAsXmlDocument(SystemFiles.FeedProxyConfig); + xdoc.PreserveWhitespace = true; - var xn = xdoc.SelectSingleNode("//feedProxy"); - if (xn != null) - { - bool inserted = false; - if (xn.HasChildNodes) - { - foreach (XmlNode node in xn.SelectNodes("//allow")) - { - if (node.Attributes["host"] != null && node.Attributes["host"].Value == hostname) - { - xn.RemoveChild(node); - inserted = true; - } - } - } + var xn = xdoc.SelectSingleNode("//feedProxy"); + if (xn != null) + { + bool inserted = false; + if (xn.HasChildNodes) + { + foreach (XmlNode node in xn.SelectNodes("//allow")) + { + if (node.Attributes["host"] != null && node.Attributes["host"].Value == hostname) + { + xn.RemoveChild(node); + inserted = true; + } + } + } - if (inserted) - { - xdoc.Save(IOHelper.MapPath(SystemFiles.FeedProxyConfig)); - return true; - } - } + if (inserted) + { + xdoc.Save(IOHelper.MapPath(SystemFiles.FeedProxyConfig)); + return true; + } + } - return false; - } + return false; + } - #endregion + #endregion - public XmlNode SampleXml() - { - string sample = ""; - return PackageHelper.ParseStringToXmlNode(sample); - } - } -} \ No newline at end of file + public XmlNode SampleXml() + { + string sample = ""; + return PackageHelper.ParseStringToXmlNode(sample); + } + } +} diff --git a/src/Umbraco.Web/_Legacy/PackageActions/addStringToHtmlElement.cs b/src/Umbraco.Web/_Legacy/PackageActions/addStringToHtmlElement.cs index d1ffcaed87..bf8ca00619 100644 --- a/src/Umbraco.Web/_Legacy/PackageActions/addStringToHtmlElement.cs +++ b/src/Umbraco.Web/_Legacy/PackageActions/addStringToHtmlElement.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Xml; using Umbraco.Core; using Umbraco.Core.Configuration; @@ -11,196 +11,196 @@ using Umbraco.Web.Composing; namespace Umbraco.Web._Legacy.PackageActions { - /// - /// This class implements the IPackageAction Interface, used to execute code when packages are installed. - /// All IPackageActions only takes a PackageName and a XmlNode as input, and executes based on the data in the xmlnode. - /// addStringToHtmlElement adds a string to specific HTML element in a specific template, and can either append or prepend it. - /// It uses the action xml node to do this, exemple action xml node: - /// - /// The above will add the string "hello world!" to the first html element with the id "newsSection" in the template "news" - /// - public class addStringToHtmlElement : IPackageAction - { - #region IPackageAction Members + /// + /// This class implements the IPackageAction Interface, used to execute code when packages are installed. + /// All IPackageActions only takes a PackageName and a XmlNode as input, and executes based on the data in the xmlnode. + /// addStringToHtmlElement adds a string to specific HTML element in a specific template, and can either append or prepend it. + /// It uses the action xml node to do this, exemple action xml node: + /// + /// The above will add the string "hello world!" to the first html element with the id "newsSection" in the template "news" + /// + public class addStringToHtmlElement : IPackageAction + { + #region IPackageAction Members - /// - /// Executes the specified package action. - /// - /// Name of the package. - /// The XML data. - /// - /// - /// - /// True if executed successfully - public bool Execute(string packageName, XmlNode xmlData) - { + /// + /// Executes the specified package action. + /// + /// Name of the package. + /// The XML data. + /// + /// + /// + /// True if executed successfully + public bool Execute(string packageName, XmlNode xmlData) + { - string templateAlias = xmlData.Attributes["templateAlias"].Value; - string htmlElementId = xmlData.Attributes["htmlElementId"].Value; - string position = xmlData.Attributes["position"].Value; - string value = XmlHelper.GetNodeValue(xmlData); - var tmp = Current.Services.FileService.GetTemplate(templateAlias); + string templateAlias = xmlData.Attributes["templateAlias"].Value; + string htmlElementId = xmlData.Attributes["htmlElementId"].Value; + string position = xmlData.Attributes["position"].Value; + string value = XmlHelper.GetNodeValue(xmlData); + var tmp = Current.Services.FileService.GetTemplate(templateAlias); - if (UmbracoConfig.For.UmbracoSettings().Templates.UseAspNetMasterPages) - //value = tmp.EnsureMasterPageSyntax(value); - value = MasterPageHelper.EnsureMasterPageSyntax(templateAlias, value); + if (UmbracoConfig.For.UmbracoSettings().Templates.UseAspNetMasterPages) + //value = tmp.EnsureMasterPageSyntax(value); + value = MasterPageHelper.EnsureMasterPageSyntax(templateAlias, value); - _addStringToHtmlElement(tmp, value, htmlElementId, position); + _addStringToHtmlElement(tmp, value, htmlElementId, position); - return true; - } + return true; + } - /// - /// Undoes the addStringToHtml Execute() method, by removing the same string from the same template. - /// - /// Name of the package. - /// The XML data. - /// - public bool Undo(string packageName, XmlNode xmlData) - { - string templateAlias = xmlData.Attributes["templateAlias"].Value; - string htmlElementId = xmlData.Attributes["htmlElementId"].Value; - string value = XmlHelper.GetNodeValue(xmlData); - var tmp = Current.Services.FileService.GetTemplate(templateAlias); + /// + /// Undoes the addStringToHtml Execute() method, by removing the same string from the same template. + /// + /// Name of the package. + /// The XML data. + /// + public bool Undo(string packageName, XmlNode xmlData) + { + string templateAlias = xmlData.Attributes["templateAlias"].Value; + string htmlElementId = xmlData.Attributes["htmlElementId"].Value; + string value = XmlHelper.GetNodeValue(xmlData); + var tmp = Current.Services.FileService.GetTemplate(templateAlias); if (UmbracoConfig.For.UmbracoSettings().Templates.UseAspNetMasterPages) //value = tmp.EnsureMasterPageSyntax(value); value = MasterPageHelper.EnsureMasterPageSyntax(templateAlias, value); _removeStringFromHtmlElement(tmp, value, htmlElementId); - return true; - } + return true; + } - /// - /// Action alias. - /// - /// - public string Alias() - { - return "addStringToHtmlElement"; - } + /// + /// Action alias. + /// + /// + public string Alias() + { + return "addStringToHtmlElement"; + } - private void _addStringToHtmlElement(ITemplate tmp, string value, string htmlElementId, string position) - { - bool hasAspNetContentBeginning = false; - string design = ""; - string directive = ""; + private void _addStringToHtmlElement(ITemplate tmp, string value, string htmlElementId, string position) + { + bool hasAspNetContentBeginning = false; + string design = ""; + string directive = ""; - if (tmp != null) - { - try - { - XmlDocument templateXml = new XmlDocument(); - templateXml.PreserveWhitespace = true; + if (tmp != null) + { + try + { + XmlDocument templateXml = new XmlDocument(); + templateXml.PreserveWhitespace = true; - //Make sure that directive is remove before hacked non html4 compatiple replacement action... - design = tmp.Content; + //Make sure that directive is remove before hacked non html4 compatiple replacement action... + design = tmp.Content; - splitDesignAndDirective(ref design, ref directive); + splitDesignAndDirective(ref design, ref directive); //making sure that the template xml has a root node... - if (string.IsNullOrWhiteSpace(tmp.MasterTemplateAlias) == false) - templateXml.LoadXml(PackageHelper.ParseToValidXml(tmp, ref hasAspNetContentBeginning, "" + design + "", true)); - else - templateXml.LoadXml(PackageHelper.ParseToValidXml(tmp, ref hasAspNetContentBeginning, design, true)); - - XmlNode xmlElement = templateXml.SelectSingleNode("//* [@id = '" + htmlElementId + "']"); - - if (xmlElement != null) - { - - if (position == "beginning") - { - xmlElement.InnerXml = "\n" + PackageHelper.ParseToValidXml(tmp, ref hasAspNetContentBeginning, value, true) + "\n" + xmlElement.InnerXml; - } - else - { - xmlElement.InnerXml = xmlElement.InnerXml + "\n" + PackageHelper.ParseToValidXml(tmp, ref hasAspNetContentBeginning, value, true) + "\n"; - } - } - - tmp.Content = directive + "\n" + PackageHelper.ParseToValidXml(tmp, ref hasAspNetContentBeginning, templateXml.OuterXml, false); - Current.Services.FileService.SaveTemplate(tmp); - } - catch (Exception ex) - { - Current.Logger.Error("An error occurred", ex); - } - } - else - { - Current.Logger.Debug("template not found"); - } - } - - private void _removeStringFromHtmlElement(ITemplate tmp, string value, string htmlElementId) - { - bool hasAspNetContentBeginning = false; - string design = ""; - string directive = ""; - - - if (tmp != null) - { - try - { - XmlDocument templateXml = new XmlDocument(); - templateXml.PreserveWhitespace = true; - - //Make sure that directive is remove before hacked non html4 compatiple replacement action... - design = tmp.Content; - splitDesignAndDirective(ref design, ref directive); - - //making sure that the template xml has a root node... if (string.IsNullOrWhiteSpace(tmp.MasterTemplateAlias) == false) - templateXml.LoadXml(PackageHelper.ParseToValidXml(tmp, ref hasAspNetContentBeginning, "" + design + "", true)); - else - templateXml.LoadXml(PackageHelper.ParseToValidXml(tmp, ref hasAspNetContentBeginning, design, true)); + templateXml.LoadXml(PackageHelper.ParseToValidXml(tmp, ref hasAspNetContentBeginning, "" + design + "", true)); + else + templateXml.LoadXml(PackageHelper.ParseToValidXml(tmp, ref hasAspNetContentBeginning, design, true)); - XmlNode xmlElement = templateXml.SelectSingleNode("//* [@id = '" + htmlElementId + "']"); + XmlNode xmlElement = templateXml.SelectSingleNode("//* [@id = '" + htmlElementId + "']"); + + if (xmlElement != null) + { + + if (position == "beginning") + { + xmlElement.InnerXml = "\n" + PackageHelper.ParseToValidXml(tmp, ref hasAspNetContentBeginning, value, true) + "\n" + xmlElement.InnerXml; + } + else + { + xmlElement.InnerXml = xmlElement.InnerXml + "\n" + PackageHelper.ParseToValidXml(tmp, ref hasAspNetContentBeginning, value, true) + "\n"; + } + } + + tmp.Content = directive + "\n" + PackageHelper.ParseToValidXml(tmp, ref hasAspNetContentBeginning, templateXml.OuterXml, false); + Current.Services.FileService.SaveTemplate(tmp); + } + catch (Exception ex) + { + Current.Logger.Error("An error occurred", ex); + } + } + else + { + Current.Logger.Debug("template not found"); + } + } + + private void _removeStringFromHtmlElement(ITemplate tmp, string value, string htmlElementId) + { + bool hasAspNetContentBeginning = false; + string design = ""; + string directive = ""; + + + if (tmp != null) + { + try + { + XmlDocument templateXml = new XmlDocument(); + templateXml.PreserveWhitespace = true; + + //Make sure that directive is remove before hacked non html4 compatiple replacement action... + design = tmp.Content; + splitDesignAndDirective(ref design, ref directive); + + //making sure that the template xml has a root node... + if (string.IsNullOrWhiteSpace(tmp.MasterTemplateAlias) == false) + templateXml.LoadXml(PackageHelper.ParseToValidXml(tmp, ref hasAspNetContentBeginning, "" + design + "", true)); + else + templateXml.LoadXml(PackageHelper.ParseToValidXml(tmp, ref hasAspNetContentBeginning, design, true)); + + XmlNode xmlElement = templateXml.SelectSingleNode("//* [@id = '" + htmlElementId + "']"); - if (xmlElement != null) - { - string repValue = PackageHelper.ParseToValidXml(tmp, ref hasAspNetContentBeginning, value, true); - xmlElement.InnerXml = xmlElement.InnerXml.Replace(repValue, ""); - } + if (xmlElement != null) + { + string repValue = PackageHelper.ParseToValidXml(tmp, ref hasAspNetContentBeginning, value, true); + xmlElement.InnerXml = xmlElement.InnerXml.Replace(repValue, ""); + } - tmp.Content = directive + "\n" + PackageHelper.ParseToValidXml(tmp, ref hasAspNetContentBeginning, templateXml.OuterXml, false); - Current.Services.FileService.SaveTemplate(tmp); - } - catch (Exception ex) - { - Current.Logger.Error("An error occurred", ex); - } - } - else - { - Current.Logger.Debug("template not found"); - } - } + tmp.Content = directive + "\n" + PackageHelper.ParseToValidXml(tmp, ref hasAspNetContentBeginning, templateXml.OuterXml, false); + Current.Services.FileService.SaveTemplate(tmp); + } + catch (Exception ex) + { + Current.Logger.Error("An error occurred", ex); + } + } + else + { + Current.Logger.Debug("template not found"); + } + } - private void splitDesignAndDirective(ref string design, ref string directive) - { - if (design.StartsWith("<%@")) - { - directive = design.Substring(0, design.IndexOf("%>") + 2).Trim(Environment.NewLine.ToCharArray()); - design = design.Substring(design.IndexOf("%>") + 3).Trim(Environment.NewLine.ToCharArray()); - } - } + private void splitDesignAndDirective(ref string design, ref string directive) + { + if (design.StartsWith("<%@")) + { + directive = design.Substring(0, design.IndexOf("%>") + 2).Trim(Environment.NewLine.ToCharArray()); + design = design.Substring(design.IndexOf("%>") + 3).Trim(Environment.NewLine.ToCharArray()); + } + } - #endregion + #endregion - public XmlNode SampleXml() - { - throw new NotImplementedException(); - } + public XmlNode SampleXml() + { + throw new NotImplementedException(); + } - } -} \ No newline at end of file + } +} diff --git a/src/Umbraco.Web/_Legacy/PackageActions/allowDoctype.cs b/src/Umbraco.Web/_Legacy/PackageActions/allowDoctype.cs index 841d651c43..146925b85f 100644 --- a/src/Umbraco.Web/_Legacy/PackageActions/allowDoctype.cs +++ b/src/Umbraco.Web/_Legacy/PackageActions/allowDoctype.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.Linq; using System.Xml; @@ -8,91 +8,91 @@ using Umbraco.Web.Composing; namespace Umbraco.Web._Legacy.PackageActions { - /// - /// This class implements the IPackageAction Interface, used to execute code when packages are installed. - /// All IPackageActions only takes a PackageName and a XmlNode as input, and executes based on the data in the xmlnode. - /// - public class allowDoctype : IPackageAction - { + /// + /// This class implements the IPackageAction Interface, used to execute code when packages are installed. + /// All IPackageActions only takes a PackageName and a XmlNode as input, and executes based on the data in the xmlnode. + /// + public class allowDoctype : IPackageAction + { - #region IPackageAction Members + #region IPackageAction Members - /// - /// Allows a documentType to be created below another documentType. - /// - /// Name of the package. - /// The XML data. - /// - /// - /// - /// Returns true on success - public bool Execute(string packageName, XmlNode xmlData) - { - string doctypeName = xmlData.Attributes["documentTypeAlias"].Value; - string parentDoctypeName = xmlData.Attributes["parentDocumentTypeAlias"].Value; + /// + /// Allows a documentType to be created below another documentType. + /// + /// Name of the package. + /// The XML data. + /// + /// + /// + /// Returns true on success + public bool Execute(string packageName, XmlNode xmlData) + { + string doctypeName = xmlData.Attributes["documentTypeAlias"].Value; + string parentDoctypeName = xmlData.Attributes["parentDocumentTypeAlias"].Value; - //global::umbraco.cms.businesslogic.ContentType ct = global::umbraco.cms.businesslogic.ContentType.GetByAlias(doctypeName); - //global::umbraco.cms.businesslogic.ContentType parentct = global::umbraco.cms.businesslogic.ContentType.GetByAlias(parentDoctypeName); - var ct = Current.Services.ContentTypeService.Get(doctypeName); + //global::umbraco.cms.businesslogic.ContentType ct = global::umbraco.cms.businesslogic.ContentType.GetByAlias(doctypeName); + //global::umbraco.cms.businesslogic.ContentType parentct = global::umbraco.cms.businesslogic.ContentType.GetByAlias(parentDoctypeName); + var ct = Current.Services.ContentTypeService.Get(doctypeName); var parentct = Current.Services.ContentTypeService.Get(parentDoctypeName); if (ct != null && parentct != null) - { - bool containsId = false; - ArrayList tmp = new ArrayList(); + { + bool containsId = false; + ArrayList tmp = new ArrayList(); - foreach (int i in parentct.AllowedContentTypes.Select(x => x.Id.Value).ToList()) - { - tmp.Add(i); - if (i == ct.Id) - containsId = true; - } + foreach (int i in parentct.AllowedContentTypes.Select(x => x.Id.Value).ToList()) + { + tmp.Add(i); + if (i == ct.Id) + containsId = true; + } - if (!containsId) - { + if (!containsId) + { - int[] ids = new int[tmp.Count + 1]; - for (int i = 0; i < tmp.Count; i++) ids[i] = (int)tmp[i]; - ids[ids.Length - 1] = ct.Id; + int[] ids = new int[tmp.Count + 1]; + for (int i = 0; i < tmp.Count; i++) ids[i] = (int)tmp[i]; + ids[ids.Length - 1] = ct.Id; - //parentct.AllowedChildContentTypeIDs = ids; - var so = 0; - parentct.AllowedContentTypes = ids.Select(x => new ContentTypeSort(x, so++)); - //parentct.Save(); + //parentct.AllowedChildContentTypeIDs = ids; + var so = 0; + parentct.AllowedContentTypes = ids.Select(x => new ContentTypeSort(x, so++)); + //parentct.Save(); Current.Services.ContentTypeService.Save(parentct); - return true; - } - } - return false; - } + return true; + } + } + return false; + } - //this has no undo. - /// - /// This action has no undo. - /// - /// Name of the package. - /// The XML data. - /// - public bool Undo(string packageName, XmlNode xmlData) - { - return true; - } + //this has no undo. + /// + /// This action has no undo. + /// + /// Name of the package. + /// The XML data. + /// + public bool Undo(string packageName, XmlNode xmlData) + { + return true; + } - /// - /// Action Alias. - /// - /// - public string Alias() - { - return "allowDocumenttype"; - } + /// + /// Action Alias. + /// + /// + public string Alias() + { + return "allowDocumenttype"; + } - #endregion + #endregion - public XmlNode SampleXml() - { - throw new NotImplementedException(); - } + public XmlNode SampleXml() + { + throw new NotImplementedException(); + } - } -} \ No newline at end of file + } +} diff --git a/src/Umbraco.Web/_Legacy/PackageActions/moveRootDocument.cs b/src/Umbraco.Web/_Legacy/PackageActions/moveRootDocument.cs index 3d8dcf1b2a..83d9387352 100644 --- a/src/Umbraco.Web/_Legacy/PackageActions/moveRootDocument.cs +++ b/src/Umbraco.Web/_Legacy/PackageActions/moveRootDocument.cs @@ -1,4 +1,4 @@ - + //TODO: MIgrate this to core: http://issues.umbraco.org/issue/U4-5857 //using System; @@ -99,4 +99,4 @@ // } // } -//} \ No newline at end of file +//} diff --git a/src/Umbraco.Web/_Legacy/PackageActions/publishRootDocument.cs b/src/Umbraco.Web/_Legacy/PackageActions/publishRootDocument.cs index ef28b3db8c..e29a6f8cb8 100644 --- a/src/Umbraco.Web/_Legacy/PackageActions/publishRootDocument.cs +++ b/src/Umbraco.Web/_Legacy/PackageActions/publishRootDocument.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Xml; using Umbraco.Core; using Umbraco.Core._Legacy.PackageActions; @@ -6,70 +6,70 @@ using Umbraco.Web.Composing; namespace Umbraco.Web._Legacy.PackageActions { - /// - /// This class implements the IPackageAction Interface, used to execute code when packages are installed. - /// All IPackageActions only takes a PackageName and a XmlNode as input, and executes based on the data in the xmlnode. - /// - public class publishRootDocument : IPackageAction - { - #region IPackageAction Members + /// + /// This class implements the IPackageAction Interface, used to execute code when packages are installed. + /// All IPackageActions only takes a PackageName and a XmlNode as input, and executes based on the data in the xmlnode. + /// + public class publishRootDocument : IPackageAction + { + #region IPackageAction Members - /// - /// Executes the specified package action. - /// - /// Name of the package. - /// The XML data. - /// - /// - /// - /// True if executed succesfully - public bool Execute(string packageName, XmlNode xmlData) - { + /// + /// Executes the specified package action. + /// + /// Name of the package. + /// The XML data. + /// + /// + /// + /// True if executed succesfully + public bool Execute(string packageName, XmlNode xmlData) + { - string documentName = xmlData.Attributes["documentName"].Value; + string documentName = xmlData.Attributes["documentName"].Value; - int parentDocid = 0; + int parentDocid = 0; - //global::umbraco.cms.businesslogic.web.Document[] rootDocs = global::umbraco.cms.businesslogic.web.Document.GetRootDocuments(); - var rootDocs = Current.Services.ContentService.GetRootContent(); + //global::umbraco.cms.businesslogic.web.Document[] rootDocs = global::umbraco.cms.businesslogic.web.Document.GetRootDocuments(); + var rootDocs = Current.Services.ContentService.GetRootContent(); - foreach (var rootDoc in rootDocs) - { - if (rootDoc.Name.Trim() == documentName.Trim() && rootDoc != null && rootDoc.ContentType != null) - { - Current.Services.ContentService.PublishWithChildrenWithStatus(rootDoc, 0, true); - break; - } - } - return true; - } + foreach (var rootDoc in rootDocs) + { + if (rootDoc.Name.Trim() == documentName.Trim() && rootDoc != null && rootDoc.ContentType != null) + { + Current.Services.ContentService.PublishWithChildrenWithStatus(rootDoc, 0, true); + break; + } + } + return true; + } - //this has no undo. - /// - /// This action has no undo. - /// - /// Name of the package. - /// The XML data. - /// - public bool Undo(string packageName, XmlNode xmlData) - { - return true; - } + //this has no undo. + /// + /// This action has no undo. + /// + /// Name of the package. + /// The XML data. + /// + public bool Undo(string packageName, XmlNode xmlData) + { + return true; + } - /// - /// Action alias - /// - /// - public string Alias() - { - return "publishRootDocument"; - } - #endregion + /// + /// Action alias + /// + /// + public string Alias() + { + return "publishRootDocument"; + } + #endregion - public XmlNode SampleXml() - { - throw new NotImplementedException(); - } + public XmlNode SampleXml() + { + throw new NotImplementedException(); + } - } -} \ No newline at end of file + } +} diff --git a/src/Umbraco.Web/_Legacy/PackageActions/removeStringFromTemplate.cs b/src/Umbraco.Web/_Legacy/PackageActions/removeStringFromTemplate.cs index e052624f77..fd2f40178b 100644 --- a/src/Umbraco.Web/_Legacy/PackageActions/removeStringFromTemplate.cs +++ b/src/Umbraco.Web/_Legacy/PackageActions/removeStringFromTemplate.cs @@ -1,34 +1,34 @@ -using System; +using System; using System.Xml; using Umbraco.Core._Legacy.PackageActions; namespace Umbraco.Web._Legacy.PackageActions { - public class removeStringFromTemplate : IPackageAction - { - #region IPackageAction Members + public class removeStringFromTemplate : IPackageAction + { + #region IPackageAction Members - public bool Execute(string packageName, XmlNode xmlData) - { - addStringToHtmlElement ast = new addStringToHtmlElement(); - return ast.Undo(packageName, xmlData); - } + public bool Execute(string packageName, XmlNode xmlData) + { + addStringToHtmlElement ast = new addStringToHtmlElement(); + return ast.Undo(packageName, xmlData); + } - public string Alias() - { - return "removeStringFromHtmlElement"; - } + public string Alias() + { + return "removeStringFromHtmlElement"; + } - public bool Undo(string packageName, XmlNode xmlData) - { - return true; - } + public bool Undo(string packageName, XmlNode xmlData) + { + return true; + } - public XmlNode SampleXml() - { - throw new NotImplementedException(); - } + public XmlNode SampleXml() + { + throw new NotImplementedException(); + } - #endregion - } -} \ No newline at end of file + #endregion + } +} diff --git a/src/Umbraco.Web/_Legacy/Packager/FileResources/PackageFiles.Designer.cs b/src/Umbraco.Web/_Legacy/Packager/FileResources/PackageFiles.Designer.cs index b6f9c4ae4e..0666ea77f2 100644 --- a/src/Umbraco.Web/_Legacy/Packager/FileResources/PackageFiles.Designer.cs +++ b/src/Umbraco.Web/_Legacy/Packager/FileResources/PackageFiles.Designer.cs @@ -10,8 +10,8 @@ namespace umbraco.cms.businesslogic.Packager.FileResources { using System; - - + + /// /// A strongly-typed resource class, for looking up localized strings, etc. /// @@ -23,15 +23,15 @@ namespace umbraco.cms.businesslogic.Packager.FileResources { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class PackageFiles { - + private static global::System.Resources.ResourceManager resourceMan; - + private static global::System.Globalization.CultureInfo resourceCulture; - + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal PackageFiles() { } - + /// /// Returns the cached ResourceManager instance used by this class. /// @@ -45,7 +45,7 @@ namespace umbraco.cms.businesslogic.Packager.FileResources { return resourceMan; } } - + /// /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. @@ -59,7 +59,7 @@ namespace umbraco.cms.businesslogic.Packager.FileResources { resourceCulture = value; } } - + /// /// Looks up a localized string similar to <?xml version="1.0" encoding="utf-8"?> ///<packages></packages>. diff --git a/src/Umbraco.Web/_Legacy/Packager/Installer.cs b/src/Umbraco.Web/_Legacy/Packager/Installer.cs index aefacc06c8..946ef4b841 100644 --- a/src/Umbraco.Web/_Legacy/Packager/Installer.cs +++ b/src/Umbraco.Web/_Legacy/Packager/Installer.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel; using System.Globalization; @@ -22,10 +22,10 @@ namespace umbraco.cms.businesslogic.packager { /// /// The packager is a component which enables sharing of both data and functionality components between different umbraco installations. - /// + /// /// The output is a .umb (a zip compressed file) which contains the exported documents/medias/macroes/documenttypes (etc.) /// in a Xml document, along with the physical files used (images/usercontrols/xsl documents etc.) - /// + /// /// Partly implemented, import of packages is done, the export is *under construction*. /// /// @@ -296,12 +296,12 @@ namespace umbraco.cms.businesslogic.packager // my-icon.png // /umbraco/Images/ // my-icon.png - // + // // // my-icon.png // /App_Plugins/MyPlugin/Images // my-icon.png - // + // // // Since this file unzips as a flat list of files, moving the file the first time means // that when you try to do that a second time, it would result in a FileNotFoundException @@ -312,7 +312,7 @@ namespace umbraco.cms.businesslogic.packager } - // Once we're done copying, remove all the files + // Once we're done copying, remove all the files foreach (XmlNode n in Config.DocumentElement.SelectNodes("//file")) { var sourceFile = GetFileName(tempDir, XmlHelper.GetNodeValue(n.SelectSingleNode("guid"))); @@ -331,7 +331,7 @@ namespace umbraco.cms.businesslogic.packager { Current.Services.AuditService.Add(AuditType.PackagerInstall, string.Format("Package '{0}' installed. Package guid: {1}", insPack.Data.Name, insPack.Data.PackageGuid), - _currentUserId, -1); + _currentUserId, -1); } insPack.Save(); @@ -522,7 +522,7 @@ namespace umbraco.cms.businesslogic.packager } } #endregion - + insPack.Save(); } catch (Exception exception) @@ -614,7 +614,7 @@ namespace umbraco.cms.businesslogic.packager } } - + //this will check for existing macros with the same alias //since we will not overwrite on import it's a good idea to inform the user what will be overwritten @@ -728,7 +728,7 @@ namespace umbraco.cms.businesslogic.packager path = path.Replace("[$DATA]", SystemDirectories.Data); } - //to support virtual dirs we try to lookup the file... + //to support virtual dirs we try to lookup the file... path = IOHelper.FindFile(path); diff --git a/src/Umbraco.Web/_Legacy/Packager/Package.cs b/src/Umbraco.Web/_Legacy/Packager/Package.cs index 826675d009..2116e64ea1 100644 --- a/src/Umbraco.Web/_Legacy/Packager/Package.cs +++ b/src/Umbraco.Web/_Legacy/Packager/Package.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.ComponentModel; using System.Linq; using System.Runtime.CompilerServices; @@ -16,8 +16,8 @@ namespace umbraco.cms.businesslogic.packager } /// - /// Initialize package install status object by specifying the internal id of the installation. - /// The id is specific to the local umbraco installation and cannot be used to identify the package in general. + /// Initialize package install status object by specifying the internal id of the installation. + /// The id is specific to the local umbraco installation and cannot be used to identify the package in general. /// Use the Package(Guid) constructor to check whether a package has been installed /// /// The internal id. @@ -75,7 +75,7 @@ namespace umbraco.cms.businesslogic.packager if (Id == 0) { // The method is synchronized - scope.Database.Execute("INSERT INTO umbracoInstalledPackages (uninstalled, upgradeId, installDate, userId, versionMajor, versionMinor, versionPatch) VALUES (@uninstalled, @upgradeId, @installDate, @userId, @versionMajor, @versionMinor, @versionPatch)", + scope.Database.Execute("INSERT INTO umbracoInstalledPackages (uninstalled, upgradeId, installDate, userId, versionMajor, versionMinor, versionPatch) VALUES (@uninstalled, @upgradeId, @installDate, @userId, @versionMajor, @versionMinor, @versionPatch)", new { uninstalled = Uninstalled, @@ -142,4 +142,4 @@ namespace umbraco.cms.businesslogic.packager public int VersionMajor { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/_Legacy/Packager/PackageInstance/InstalledPackage.cs b/src/Umbraco.Web/_Legacy/Packager/PackageInstance/InstalledPackage.cs index b95e7318b9..1c7e833cb5 100644 --- a/src/Umbraco.Web/_Legacy/Packager/PackageInstance/InstalledPackage.cs +++ b/src/Umbraco.Web/_Legacy/Packager/PackageInstance/InstalledPackage.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using Umbraco.Core; @@ -67,7 +67,7 @@ namespace umbraco.cms.businesslogic.packager { public void Delete(int userId) { - Current.Services.AuditService.Add(AuditType.PackagerUninstall, string.Format("Package '{0}' uninstalled. Package guid: {1}", Data.Name, Data.PackageGuid), userId, -1); + Current.Services.AuditService.Add(AuditType.PackagerUninstall, string.Format("Package '{0}' uninstalled. Package guid: {1}", Data.Name, Data.PackageGuid), userId, -1); Delete(); } @@ -78,18 +78,18 @@ namespace umbraco.cms.businesslogic.packager { } public static bool isPackageInstalled(string packageGuid) { - try - { - if (data.GetFromGuid(packageGuid, IOHelper.MapPath(Settings.InstalledPackagesSettings), true) == null) - return false; - else - return true; - } - catch (Exception ex) - { + try + { + if (data.GetFromGuid(packageGuid, IOHelper.MapPath(Settings.InstalledPackagesSettings), true) == null) + return false; + else + return true; + } + catch (Exception ex) + { Current.Logger.Error("An error occured in isPackagedInstalled", ex); - return false; - } + return false; + } } //EVENTS diff --git a/src/Umbraco.Web/_Legacy/Packager/PackageInstance/PackageActions.cs b/src/Umbraco.Web/_Legacy/Packager/PackageInstance/PackageActions.cs index ff7a610f00..90645fa121 100644 --- a/src/Umbraco.Web/_Legacy/Packager/PackageInstance/PackageActions.cs +++ b/src/Umbraco.Web/_Legacy/Packager/PackageInstance/PackageActions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Xml; using Umbraco.Core; using Umbraco.Core.Composing; @@ -9,63 +9,63 @@ using Umbraco.Core._Legacy.PackageActions; namespace umbraco.cms.businesslogic.packager { - /// - /// Package actions are executed on packge install / uninstall. - /// - public class PackageAction - { + /// + /// Package actions are executed on packge install / uninstall. + /// + public class PackageAction + { - /// - /// Runs the package action with the specified action alias. - /// - /// Name of the package. - /// The action alias. - /// The action XML. - public static void RunPackageAction(string packageName, string actionAlias, XmlNode actionXml) - { + /// + /// Runs the package action with the specified action alias. + /// + /// Name of the package. + /// The action alias. + /// The action XML. + public static void RunPackageAction(string packageName, string actionAlias, XmlNode actionXml) + { - foreach (var ipa in Current.PackageActions) - { - try - { - if (ipa.Alias() == actionAlias) - { + foreach (var ipa in Current.PackageActions) + { + try + { + if (ipa.Alias() == actionAlias) + { - ipa.Execute(packageName, actionXml); - } - } - catch (Exception ipaExp) - { + ipa.Execute(packageName, actionXml); + } + } + catch (Exception ipaExp) + { Current.Logger.Error(string.Format("Error loading package action '{0}' for package {1}", ipa.Alias(), packageName), ipaExp); - } - } - } + } + } + } - /// - /// Undos the package action with the specified action alias. - /// - /// Name of the package. - /// The action alias. - /// The action XML. - public static void UndoPackageAction(string packageName, string actionAlias, System.Xml.XmlNode actionXml) - { + /// + /// Undos the package action with the specified action alias. + /// + /// Name of the package. + /// The action alias. + /// The action XML. + public static void UndoPackageAction(string packageName, string actionAlias, System.Xml.XmlNode actionXml) + { - foreach (IPackageAction ipa in Current.PackageActions) - { - try - { - if (ipa.Alias() == actionAlias) - { + foreach (IPackageAction ipa in Current.PackageActions) + { + try + { + if (ipa.Alias() == actionAlias) + { - ipa.Undo(packageName, actionXml); - } - } - catch (Exception ipaExp) - { + ipa.Undo(packageName, actionXml); + } + } + catch (Exception ipaExp) + { Current.Logger.Error(string.Format("Error undoing package action '{0}' for package {1}", ipa.Alias(), packageName), ipaExp); - } - } - } + } + } + } - } + } } diff --git a/src/Umbraco.Web/_Legacy/Packager/PackageInstance/PackagerUtility.cs b/src/Umbraco.Web/_Legacy/Packager/PackageInstance/PackagerUtility.cs index 5f2bd46498..d887a706d5 100644 --- a/src/Umbraco.Web/_Legacy/Packager/PackageInstance/PackagerUtility.cs +++ b/src/Umbraco.Web/_Legacy/Packager/PackageInstance/PackagerUtility.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.IO; using System.Xml; @@ -8,13 +8,13 @@ using Umbraco.Core.Composing; using Umbraco.Core.IO; using Umbraco.Core.Services; -namespace umbraco.cms.businesslogic.packager +namespace umbraco.cms.businesslogic.packager { /// /// A utillity class for working with packager data. /// It provides basic methods for adding new items to a package manifest, moving files and other misc. /// - public class PackagerUtility + public class PackagerUtility { /// /// Creates a package manifest containing name, license, version and other meta data. @@ -223,7 +223,7 @@ namespace umbraco.cms.businesslogic.packager /// The GUID. /// The doc. /// - /// true if [is file in manifest]; otherwise, false. + /// true if [is file in manifest]; otherwise, false. /// public static bool IsFileInManifest(string guid, XmlDocument doc) { diff --git a/src/Umbraco.Web/_Legacy/Packager/Repositories/Repository.cs b/src/Umbraco.Web/_Legacy/Packager/Repositories/Repository.cs index c7394ff935..9ee22c04ea 100644 --- a/src/Umbraco.Web/_Legacy/Packager/Repositories/Repository.cs +++ b/src/Umbraco.Web/_Legacy/Packager/Repositories/Repository.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -16,7 +16,7 @@ namespace umbraco.cms.businesslogic.packager.repositories { [Obsolete("This should not be used and will be removed in future Umbraco versions")] public class Repository : DisposableObject - { + { public string Guid { get; private set; } public string Name { get; private set; } @@ -56,7 +56,7 @@ namespace umbraco.cms.businesslogic.packager.repositories fs1.Close(); fs1 = null; - byte[] thumb = new byte[0]; //todo upload thumbnail... + byte[] thumb = new byte[0]; //todo upload thumbnail... return Webservice.SubmitPackage(Guid, authorGuid, packageGuid, pack, doc, thumb, packageName, "", "", description); } @@ -116,7 +116,7 @@ namespace umbraco.cms.businesslogic.packager.repositories { return null; } - + var repository = new Repository { Guid = found.Id.ToString(), @@ -174,7 +174,7 @@ namespace umbraco.cms.businesslogic.packager.repositories var fileByteArray = Webservice.GetPackageFile(packageGuid, currentUmbracoVersion.ToString(3)); - //successfull + //successfull if (fileByteArray.Length > 0) { // Check for package directory @@ -188,7 +188,7 @@ namespace umbraco.cms.businesslogic.packager.repositories return "packages\\" + packageGuid + ".umb"; } } - + return ""; } @@ -259,7 +259,7 @@ namespace umbraco.cms.businesslogic.packager.repositories fileByteArray = Webservice.fetchProtectedPackage(packageGuid, key); } - //successfull + //successfull if (fileByteArray.Length > 0) { diff --git a/src/Umbraco.Web/_Legacy/Packager/Repositories/RepositoryWebservice.cs b/src/Umbraco.Web/_Legacy/Packager/Repositories/RepositoryWebservice.cs index 36f0965e26..35bf1eacb3 100644 --- a/src/Umbraco.Web/_Legacy/Packager/Repositories/RepositoryWebservice.cs +++ b/src/Umbraco.Web/_Legacy/Packager/Repositories/RepositoryWebservice.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.ComponentModel; using System.Diagnostics; using System.Web.Services; @@ -1792,7 +1792,7 @@ namespace umbraco.cms.businesslogic.packager.repositories /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] - public delegate void fetchPackageByVersionCompletedEventHandler(object sender, fetchPackageByVersionCompletedEventArgs e); + public delegate void fetchPackageByVersionCompletedEventHandler(object sender, fetchPackageByVersionCompletedEventArgs e); /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")] diff --git a/src/Umbraco.Web/_Legacy/Packager/RequirementsType.cs b/src/Umbraco.Web/_Legacy/Packager/RequirementsType.cs index 73022cda50..ea63ff6979 100644 --- a/src/Umbraco.Web/_Legacy/Packager/RequirementsType.cs +++ b/src/Umbraco.Web/_Legacy/Packager/RequirementsType.cs @@ -1,8 +1,8 @@ -namespace umbraco.cms.businesslogic.packager +namespace umbraco.cms.businesslogic.packager { public enum RequirementsType { Strict, Legacy } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/_Legacy/Packager/Settings.cs b/src/Umbraco.Web/_Legacy/Packager/Settings.cs index d91b0c4871..85cfebcfee 100644 --- a/src/Umbraco.Web/_Legacy/Packager/Settings.cs +++ b/src/Umbraco.Web/_Legacy/Packager/Settings.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Data; using System.Configuration; using System.Web; @@ -12,51 +12,51 @@ using Umbraco.Core.IO; namespace umbraco.cms.businesslogic.packager { - public class Settings - { + public class Settings + { - public static string PackagerRoot - { + public static string PackagerRoot + { get { return SystemDirectories.Packages; } - } + } - public static string PackagesStorage - { + public static string PackagesStorage + { get { return SystemDirectories.Packages + IOHelper.DirSepChar + "created"; } - } + } - public static string InstalledPackagesStorage - { + public static string InstalledPackagesStorage + { get { return SystemDirectories.Packages + IOHelper.DirSepChar + "installed"; } - } + } - public static string InstalledPackagesSettings - { + public static string InstalledPackagesSettings + { get { return SystemDirectories.Packages + IOHelper.DirSepChar + "installed" + IOHelper.DirSepChar + "installedPackages.config"; } - } + } - public static string CreatedPackagesSettings - { + public static string CreatedPackagesSettings + { get { return SystemDirectories.Packages + IOHelper.DirSepChar + "created" + IOHelper.DirSepChar + "createdPackages.config"; } - } + } - public static string PackageFileExtension - { - get { return "zip"; } - } + public static string PackageFileExtension + { + get { return "zip"; } + } - public static bool HasFileAccess(ref Exception exp) - { - bool hasAccess = false; - StreamWriter sw1 = null; - StreamWriter sw2 = null; - try - { - sw1 = System.IO.File.AppendText(IOHelper.MapPath(InstalledPackagesSettings)); - sw1.Close(); + public static bool HasFileAccess(ref Exception exp) + { + bool hasAccess = false; + StreamWriter sw1 = null; + StreamWriter sw2 = null; + try + { + sw1 = System.IO.File.AppendText(IOHelper.MapPath(InstalledPackagesSettings)); + sw1.Close(); sw2 = System.IO.File.AppendText(IOHelper.MapPath(CreatedPackagesSettings)); - sw1.Close(); + sw1.Close(); System.IO.Directory.CreateDirectory(IOHelper.MapPath(PackagesStorage) + IOHelper.DirSepChar + "__testFolder__"); System.IO.Directory.CreateDirectory(IOHelper.MapPath(InstalledPackagesStorage) + IOHelper.DirSepChar + "__testFolder__"); @@ -64,20 +64,20 @@ namespace umbraco.cms.businesslogic.packager System.IO.Directory.Delete(IOHelper.MapPath(PackagesStorage) + IOHelper.DirSepChar + "__testFolder__", true); System.IO.Directory.Delete(IOHelper.MapPath(InstalledPackagesStorage) + IOHelper.DirSepChar + "__testFolder__", true); - hasAccess = true; - } - finally - { - if (sw1 != null) - sw1.Close(); - if (sw2 != null) - sw2.Close(); - } + hasAccess = true; + } + finally + { + if (sw1 != null) + sw1.Close(); + if (sw2 != null) + sw2.Close(); + } - return hasAccess; - } + return hasAccess; + } - } + } } diff --git a/src/Umbraco.Web/_Legacy/UI/ITask.cs b/src/Umbraco.Web/_Legacy/UI/ITask.cs index c1f3b923bb..62ce4c92c8 100644 --- a/src/Umbraco.Web/_Legacy/UI/ITask.cs +++ b/src/Umbraco.Web/_Legacy/UI/ITask.cs @@ -1,18 +1,18 @@ -using System; +using System; namespace Umbraco.Web._Legacy.UI { - /// - /// Summary description for ITask. - /// + /// + /// Summary description for ITask. + /// [Obsolete("ITask is used for legacy webforms back office editors, change to using the v7 angular approach")] - public interface ITask - { - int ParentID {set; get;} - int TypeID {set; get;} - string Alias {set; get;} - bool Save(); - bool Delete(); - int UserId {set;} - } + public interface ITask + { + int ParentID {set; get;} + int TypeID {set; get;} + string Alias {set; get;} + bool Save(); + bool Delete(); + int UserId {set;} + } } diff --git a/src/Umbraco.Web/_Legacy/UI/ITaskReturnUrl.cs b/src/Umbraco.Web/_Legacy/UI/ITaskReturnUrl.cs index 97fad7ef86..c42ad9dbdb 100644 --- a/src/Umbraco.Web/_Legacy/UI/ITaskReturnUrl.cs +++ b/src/Umbraco.Web/_Legacy/UI/ITaskReturnUrl.cs @@ -1,10 +1,10 @@ -using System; +using System; namespace Umbraco.Web._Legacy.UI { [Obsolete("ITask is used for legacy webforms back office editors, change to using the v7 angular approach")] - public interface ITaskReturnUrl : ITask - { - string ReturnUrl {get;} - } -} \ No newline at end of file + public interface ITaskReturnUrl : ITask + { + string ReturnUrl {get;} + } +} diff --git a/src/Umbraco.Web/_Legacy/UI/LegacyDialogHandler.cs b/src/Umbraco.Web/_Legacy/UI/LegacyDialogHandler.cs index 77d6866221..bb37b30e86 100644 --- a/src/Umbraco.Web/_Legacy/UI/LegacyDialogHandler.cs +++ b/src/Umbraco.Web/_Legacy/UI/LegacyDialogHandler.cs @@ -72,7 +72,7 @@ namespace Umbraco.Web._Legacy.UI return null; } var taskAssembly = del.AttributeValue("assembly"); - + if (!del.Attributes.HasAttribute("type")) { return null; @@ -98,7 +98,7 @@ namespace Umbraco.Web._Legacy.UI typeInstance.UserId = umbracoUser.Id; } - //put in contextual cache + //put in contextual cache httpContext.Items[ctxKey] = typeInstance; return typeInstance; @@ -114,7 +114,7 @@ namespace Umbraco.Web._Legacy.UI /// /// If the ITask doesn't implement LegacyDialogTask then we will return 'true' since we cannot validate /// the application assigned. - /// + /// /// TODO: Create an API to assign a nodeType to an app so developers can manually secure it /// internal static bool UserHasCreateAccess(HttpContextBase httpContext, IUser umbracoUser, string nodeType) @@ -131,7 +131,7 @@ namespace Umbraco.Web._Legacy.UI public static void Delete(HttpContextBase httpContext, IUser umbracoUser, string nodeType, int nodeId, string text) { var typeInstance = GetTaskForOperation(httpContext, umbracoUser, Operation.Delete, nodeType); - + typeInstance.ParentID = nodeId; typeInstance.Alias = text; @@ -141,7 +141,7 @@ namespace Umbraco.Web._Legacy.UI public static string Create(HttpContextBase httpContext, IUser umbracoUser, string nodeType, int nodeId, string text, int typeId = 0) { var typeInstance = GetTaskForOperation(httpContext, umbracoUser, Operation.Create, nodeType); - + typeInstance.TypeID = typeId; typeInstance.ParentID = nodeId; typeInstance.Alias = text; @@ -175,9 +175,9 @@ namespace Umbraco.Web._Legacy.UI // otherwise cast to returnUrl interface returnUrlTask = typeInstance as ITaskReturnUrl; } - + typeInstance.Save(); - + return returnUrlTask != null ? returnUrlTask.ReturnUrl : ""; @@ -192,7 +192,7 @@ namespace Umbraco.Web._Legacy.UI createDef.Load(defReader); defReader.Close(); return createDef; - } + } } } } diff --git a/src/Umbraco.Web/umbraco.presentation/AttributeCollectionAdapter.cs b/src/Umbraco.Web/umbraco.presentation/AttributeCollectionAdapter.cs index b7c2f7907a..499c000c74 100644 --- a/src/Umbraco.Web/umbraco.presentation/AttributeCollectionAdapter.cs +++ b/src/Umbraco.Web/umbraco.presentation/AttributeCollectionAdapter.cs @@ -1,312 +1,312 @@ -using System; +using System; using System.Collections; using System.Web.UI; namespace umbraco { - /// - /// Class that adapts an to the interface. - /// - public class AttributeCollectionAdapter : IDictionary - { - private readonly AttributeCollection _collection; + /// + /// Class that adapts an to the interface. + /// + public class AttributeCollectionAdapter : IDictionary + { + private readonly AttributeCollection _collection; - /// - /// Initializes a new instance of the class. - /// - /// The collection. - public AttributeCollectionAdapter(AttributeCollection collection) - { - _collection = collection; - } + /// + /// Initializes a new instance of the class. + /// + /// The collection. + public AttributeCollectionAdapter(AttributeCollection collection) + { + _collection = collection; + } - #region IDictionary Members + #region IDictionary Members - /// - /// Adds an element with the provided key and value to the object. - /// - /// The to use as the key of the element to add. - /// The to use as the value of the element to add. - public void Add(object key, object value) - { - _collection.Add(key.ToString(), value.ToString()); - } + /// + /// Adds an element with the provided key and value to the object. + /// + /// The to use as the key of the element to add. + /// The to use as the value of the element to add. + public void Add(object key, object value) + { + _collection.Add(key.ToString(), value.ToString()); + } - /// - /// Removes all elements from the object. - /// - /// - /// The object is read-only. - /// - public void Clear() - { - _collection.Clear(); - } + /// + /// Removes all elements from the object. + /// + /// + /// The object is read-only. + /// + public void Clear() + { + _collection.Clear(); + } - /// - /// Determines whether the object contains an element with the specified key. - /// - /// The key to locate in the object. - /// - /// true if the contains an element with the key; otherwise, false. - /// - public bool Contains(object key) - { - return _collection[key.ToString()] != null; - } + /// + /// Determines whether the object contains an element with the specified key. + /// + /// The key to locate in the object. + /// + /// true if the contains an element with the key; otherwise, false. + /// + public bool Contains(object key) + { + return _collection[key.ToString()] != null; + } - /// - /// Returns an object for the object. - /// - /// - /// An object for the object. - /// - public IDictionaryEnumerator GetEnumerator() - { - return new AttributeCollectionAdapterEnumerator(this); - } + /// + /// Returns an object for the object. + /// + /// + /// An object for the object. + /// + public IDictionaryEnumerator GetEnumerator() + { + return new AttributeCollectionAdapterEnumerator(this); + } - /// - /// Gets a value indicating whether the object has a fixed size. - /// - /// - /// true if the object has a fixed size; otherwise, false. - /// - public bool IsFixedSize - { - get { return false; } - } + /// + /// Gets a value indicating whether the object has a fixed size. + /// + /// + /// true if the object has a fixed size; otherwise, false. + /// + public bool IsFixedSize + { + get { return false; } + } - /// - /// Gets a value indicating whether the object is read-only. - /// - /// - /// true if the object is read-only; otherwise, false. - /// - public bool IsReadOnly - { - get { return false; } - } + /// + /// Gets a value indicating whether the object is read-only. + /// + /// + /// true if the object is read-only; otherwise, false. + /// + public bool IsReadOnly + { + get { return false; } + } - /// - /// Gets an object containing the keys of the object. - /// - /// - /// - /// An object containing the keys of the object. - /// - public ICollection Keys - { - get { return _collection.Keys; } - } + /// + /// Gets an object containing the keys of the object. + /// + /// + /// + /// An object containing the keys of the object. + /// + public ICollection Keys + { + get { return _collection.Keys; } + } - /// - /// Removes the element with the specified key from the object. - /// - /// The key of the element to remove. - public void Remove(object key) - { - _collection.Remove(key.ToString()); - } + /// + /// Removes the element with the specified key from the object. + /// + /// The key of the element to remove. + public void Remove(object key) + { + _collection.Remove(key.ToString()); + } - /// - /// Gets an object containing the values in the object. - /// - /// - /// - /// An object containing the values in the object. - /// - public ICollection Values - { - get { throw new NotImplementedException(); } - } + /// + /// Gets an object containing the values in the object. + /// + /// + /// + /// An object containing the values in the object. + /// + public ICollection Values + { + get { throw new NotImplementedException(); } + } - /// - /// Gets or sets the with the specified key. - /// - /// - public object this[object key] - { - get { return _collection[key.ToString()]; } - set { _collection[key.ToString()] = value.ToString(); } - } + /// + /// Gets or sets the with the specified key. + /// + /// + public object this[object key] + { + get { return _collection[key.ToString()]; } + set { _collection[key.ToString()] = value.ToString(); } + } - #endregion + #endregion - #region ICollection Members + #region ICollection Members - /// Not implemented. - /// 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. - public void CopyTo(Array array, int index) - { - throw new NotImplementedException(); - } + /// Not implemented. + /// 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. + public void CopyTo(Array array, int index) + { + throw new NotImplementedException(); + } - /// - /// Gets the number of elements contained in the . - /// - /// - /// - /// The number of elements contained in the . - /// - public int Count - { - get { return _collection.Count; } - } + /// + /// Gets the number of elements contained in the . + /// + /// + /// + /// The number of elements contained in the . + /// + public int Count + { + get { return _collection.Count; } + } - /// - /// Gets a value indicating whether access to the is synchronized (thread safe). - /// - /// - /// true if access to the is synchronized (thread safe); otherwise, false. - /// - public bool IsSynchronized - { - get { return false; } - } + /// + /// Gets a value indicating whether access to the is synchronized (thread safe). + /// + /// + /// true if access to the is synchronized (thread safe); otherwise, false. + /// + public bool IsSynchronized + { + get { return false; } + } - /// - /// Gets an object that can be used to synchronize access to the . - /// - /// - /// - /// An object that can be used to synchronize access to the . - /// - public object SyncRoot - { - get { return _collection; } - } + /// + /// Gets an object that can be used to synchronize access to the . + /// + /// + /// + /// An object that can be used to synchronize access to the . + /// + public object SyncRoot + { + get { return _collection; } + } - #endregion + #endregion - #region IEnumerable Members + #region IEnumerable Members - /// - /// Returns an enumerator that iterates through a collection. - /// - /// - /// An object that can be used to iterate through the collection. - /// - IEnumerator IEnumerable.GetEnumerator() - { - foreach (object key in _collection.Keys) - yield return _collection[(string)key]; - } + /// + /// Returns an enumerator that iterates through a collection. + /// + /// + /// An object that can be used to iterate through the collection. + /// + IEnumerator IEnumerable.GetEnumerator() + { + foreach (object key in _collection.Keys) + yield return _collection[(string)key]; + } - #endregion + #endregion - /// - /// for the class. - /// - private class AttributeCollectionAdapterEnumerator : IDictionaryEnumerator - { - private readonly AttributeCollectionAdapter _adapter; - private readonly IEnumerator _enumerator; + /// + /// for the class. + /// + private class AttributeCollectionAdapterEnumerator : IDictionaryEnumerator + { + private readonly AttributeCollectionAdapter _adapter; + private readonly IEnumerator _enumerator; - /// - /// Initializes a new instance of the class. - /// - /// The adapter. - public AttributeCollectionAdapterEnumerator(AttributeCollectionAdapter adapter) - { - _adapter = adapter; - _enumerator = ((IEnumerable)adapter).GetEnumerator(); - } + /// + /// Initializes a new instance of the class. + /// + /// The adapter. + public AttributeCollectionAdapterEnumerator(AttributeCollectionAdapter adapter) + { + _adapter = adapter; + _enumerator = ((IEnumerable)adapter).GetEnumerator(); + } - #region IDictionaryEnumerator Members + #region IDictionaryEnumerator Members - /// - /// Gets both the key and the value of the current dictionary entry. - /// - /// - /// - /// A containing both the key and the value of the current dictionary entry. - /// - /// - /// The is positioned before the first entry of the dictionary or after the last entry. - /// - public DictionaryEntry Entry - { - get { return new DictionaryEntry(Key, Value); } - } + /// + /// Gets both the key and the value of the current dictionary entry. + /// + /// + /// + /// A containing both the key and the value of the current dictionary entry. + /// + /// + /// The is positioned before the first entry of the dictionary or after the last entry. + /// + public DictionaryEntry Entry + { + get { return new DictionaryEntry(Key, Value); } + } - /// - /// Gets the key of the current dictionary entry. - /// - /// - /// - /// The key of the current element of the enumeration. - /// - /// - /// The is positioned before the first entry of the dictionary or after the last entry. - /// - public object Key - { - get { return _enumerator.Current; } - } + /// + /// Gets the key of the current dictionary entry. + /// + /// + /// + /// The key of the current element of the enumeration. + /// + /// + /// The is positioned before the first entry of the dictionary or after the last entry. + /// + public object Key + { + get { return _enumerator.Current; } + } - /// - /// Gets the value of the current dictionary entry. - /// - /// - /// - /// The value of the current element of the enumeration. - /// - /// - /// The is positioned before the first entry of the dictionary or after the last entry. - /// - public object Value - { - get { return _adapter[_enumerator.Current]; } - } + /// + /// Gets the value of the current dictionary entry. + /// + /// + /// + /// The value of the current element of the enumeration. + /// + /// + /// The is positioned before the first entry of the dictionary or after the last entry. + /// + public object Value + { + get { return _adapter[_enumerator.Current]; } + } - #endregion + #endregion - #region IEnumerator Members + #region IEnumerator Members - /// - /// Gets the current element in the collection. - /// - /// - /// - /// The current element in the collection. - /// - /// - /// The enumerator is positioned before the first element of the collection or after the last element. - /// - public object Current - { - get { return _enumerator.Current; } - } + /// + /// Gets the current element in the collection. + /// + /// + /// + /// The current element in the collection. + /// + /// + /// The enumerator is positioned before the first element of the collection or after the last element. + /// + public object Current + { + get { return _enumerator.Current; } + } - /// - /// 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. - /// - /// - /// The collection was modified after the enumerator was created. - /// - public bool MoveNext() - { - return _enumerator.MoveNext(); - } + /// + /// 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. + /// + /// + /// The collection was modified after the enumerator was created. + /// + public bool MoveNext() + { + return _enumerator.MoveNext(); + } - /// - /// Sets the enumerator to its initial position, which is before the first element in the collection. - /// - /// - /// The collection was modified after the enumerator was created. - /// - public void Reset() - { - _enumerator.Reset(); - } + /// + /// Sets the enumerator to its initial position, which is before the first element in the collection. + /// + /// + /// The collection was modified after the enumerator was created. + /// + public void Reset() + { + _enumerator.Reset(); + } - #endregion - } - } -} \ No newline at end of file + #endregion + } + } +} diff --git a/src/Umbraco.Web/umbraco.presentation/MacroCacheContent.cs b/src/Umbraco.Web/umbraco.presentation/MacroCacheContent.cs index 85d295f535..8e8fc5d0bb 100644 --- a/src/Umbraco.Web/umbraco.presentation/MacroCacheContent.cs +++ b/src/Umbraco.Web/umbraco.presentation/MacroCacheContent.cs @@ -1,26 +1,26 @@ -using System.Web.UI; +using System.Web.UI; namespace umbraco { - public class MacroCacheContent - { - private readonly Control _control; - private readonly string _id; + public class MacroCacheContent + { + private readonly Control _control; + private readonly string _id; - public MacroCacheContent(Control control, string ID) - { - _control = control; - _id = ID; - } + public MacroCacheContent(Control control, string ID) + { + _control = control; + _id = ID; + } - public string ID - { - get { return _id; } - } + public string ID + { + get { return _id; } + } - public Control Content - { - get { return _control; } - } - } -} \ No newline at end of file + public Control Content + { + get { return _control; } + } + } +} diff --git a/src/Umbraco.Web/umbraco.presentation/XsltExtensionAttribute.cs b/src/Umbraco.Web/umbraco.presentation/XsltExtensionAttribute.cs index 1eb422949a..b3e0e7dce8 100644 --- a/src/Umbraco.Web/umbraco.presentation/XsltExtensionAttribute.cs +++ b/src/Umbraco.Web/umbraco.presentation/XsltExtensionAttribute.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Security.Permissions; using System.Web; @@ -16,13 +16,13 @@ namespace umbraco { public XsltExtensionAttribute() : base() { - + } public XsltExtensionAttribute(string ns) : base(ns) { - + } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/umbraco.presentation/default.aspx.cs b/src/Umbraco.Web/umbraco.presentation/default.aspx.cs index 4fd469469e..588c82a2c3 100644 --- a/src/Umbraco.Web/umbraco.presentation/default.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/default.aspx.cs @@ -19,7 +19,7 @@ namespace umbraco /// The codebehind class for the main default.aspx page that does the webforms rendering in Umbraco /// /// - /// We would move this to the UI project but there is a public API property and some protected properties which people may be using so + /// We would move this to the UI project but there is a public API property and some protected properties which people may be using so /// we cannot move it. /// public class UmbracoDefault : Page @@ -69,7 +69,7 @@ namespace umbraco this.MasterPageFile = template.GetMasterPageName(_upage.Template); - // reset the friendly path so it's used by forms, etc. + // reset the friendly path so it's used by forms, etc. Context.RewritePath(UmbracoContext.Current.OriginalRequestUrl.PathAndQuery); //fire the init finished event @@ -95,7 +95,7 @@ namespace umbraco var ctx = new ControllerContext(new HttpContextWrapper(Context), new RouteData(), new TempDataController()); provider.LoadTempData(ctx); - //This is only here for legacy if people arent' using master pages... + //This is only here for legacy if people arent' using master pages... //TODO: We need to test that this still works!! Or do we ?? if (!UmbracoConfig.For.UmbracoSettings().Templates.UseAspNetMasterPages) { @@ -130,7 +130,7 @@ namespace umbraco using (Current.ProfilingLogger.DebugDuration("Load")) { base.OnLoad(e); - + if (ValidateRequest) Request.ValidateInput(); } diff --git a/src/Umbraco.Web/umbraco.presentation/helper.cs b/src/Umbraco.Web/umbraco.presentation/helper.cs index 9f53056692..e745f7cc95 100644 --- a/src/Umbraco.Web/umbraco.presentation/helper.cs +++ b/src/Umbraco.Web/umbraco.presentation/helper.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using Umbraco.Web.Macros; @@ -34,4 +34,4 @@ namespace umbraco return attributeValue; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/umbraco.presentation/item.cs b/src/Umbraco.Web/umbraco.presentation/item.cs index 093254193c..80089afde7 100644 --- a/src/Umbraco.Web/umbraco.presentation/item.cs +++ b/src/Umbraco.Web/umbraco.presentation/item.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.Web; using System.Xml; @@ -15,7 +15,7 @@ using Umbraco.Web.Composing; namespace umbraco { /// - /// + /// /// public class item { @@ -228,4 +228,4 @@ namespace umbraco } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/umbraco.presentation/library.cs b/src/Umbraco.Web/umbraco.presentation/library.cs index e7a6913009..938193fbc8 100644 --- a/src/Umbraco.Web/umbraco.presentation/library.cs +++ b/src/Umbraco.Web/umbraco.presentation/library.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Globalization; using System.IO; using System.Linq; @@ -37,14 +37,14 @@ namespace umbraco [Obsolete("v8.kill.kill")] public class library { - /// - /// Returns a new UmbracoHelper so that we can start moving the logic from some of these methods to it - /// - /// - private static UmbracoHelper GetUmbracoHelper() - { - return new UmbracoHelper(Current.UmbracoContext, Current.Services, Current.ApplicationCache); - } + /// + /// Returns a new UmbracoHelper so that we can start moving the logic from some of these methods to it + /// + /// + private static UmbracoHelper GetUmbracoHelper() + { + return new UmbracoHelper(Current.UmbracoContext, Current.Services, Current.ApplicationCache); + } #region Declarations @@ -126,7 +126,7 @@ namespace umbraco /// String with a friendly url from a node public static string NiceUrl(int nodeID) { - return GetUmbracoHelper().NiceUrl(nodeID); + return GetUmbracoHelper().NiceUrl(nodeID); } /// @@ -136,7 +136,7 @@ namespace umbraco /// String with a friendly url with full domain from a node public static string NiceUrlWithDomain(int nodeId) { - return GetUmbracoHelper().NiceUrlWithDomain(nodeId); + return GetUmbracoHelper().NiceUrlWithDomain(nodeId); } /// @@ -155,7 +155,7 @@ namespace umbraco public static string ResolveVirtualPath(string path) { - return IOHelper.ResolveUrl(path); + return IOHelper.ResolveUrl(path); } @@ -170,40 +170,40 @@ namespace umbraco /// Returns a string with the data from the given element of a node public static string GetItem(int nodeId, string alias) { - var doc = UmbracoContext.Current.ContentCache.GetById(nodeId); + var doc = UmbracoContext.Current.ContentCache.GetById(nodeId); - if (doc == null) - return string.Empty; + if (doc == null) + return string.Empty; - switch (alias) - { - case "id": - return doc.Id.ToString(); - case "version": - return doc.Version.ToString(); - case "parentID": - return doc.Parent.Id.ToString(); - case "level": - return doc.Level.ToString(); - case "writerID": - return doc.WriterId.ToString(); - case "template": - return doc.TemplateId.ToString(); - case "sortOrder": - return doc.SortOrder.ToString(); - case "createDate": - return doc.CreateDate.ToString("yyyy-MM-dd'T'HH:mm:ss"); - case "updateDate": - return doc.UpdateDate.ToString("yyyy-MM-dd'T'HH:mm:ss"); - case "nodeName": - return doc.Name; - case "writerName": - return doc.WriterName; - case "path": - return doc.Path; - case "creatorName": - return doc.CreatorName; - } + switch (alias) + { + case "id": + return doc.Id.ToString(); + case "version": + return doc.Version.ToString(); + case "parentID": + return doc.Parent.Id.ToString(); + case "level": + return doc.Level.ToString(); + case "writerID": + return doc.WriterId.ToString(); + case "template": + return doc.TemplateId.ToString(); + case "sortOrder": + return doc.SortOrder.ToString(); + case "createDate": + return doc.CreateDate.ToString("yyyy-MM-dd'T'HH:mm:ss"); + case "updateDate": + return doc.UpdateDate.ToString("yyyy-MM-dd'T'HH:mm:ss"); + case "nodeName": + return doc.Name; + case "writerName": + return doc.WriterName; + case "path": + return doc.Path; + case "creatorName": + return doc.CreatorName; + } // in 4.9.0 the method returned the raw XML from the cache, unparsed // starting with 5c20f4f (4.10?) the method returns prop.Value.ToString() @@ -213,8 +213,8 @@ namespace umbraco // if we return Value.ToString() we'll have macros parsed and that's nice // // so, use Value.ToString() here. - var prop = doc.GetProperty(alias); - return prop == null ? string.Empty : prop.Value.ToString(); + var prop = doc.GetProperty(alias); + return prop == null ? string.Empty : prop.Value.ToString(); } /// @@ -354,7 +354,7 @@ namespace umbraco /// True is the current user is logged in public static bool IsLoggedOn() { - return GetUmbracoHelper().MemberIsLoggedOn(); + return GetUmbracoHelper().MemberIsLoggedOn(); } public static XPathNodeIterator AllowedGroups(int documentId, string path) @@ -384,7 +384,7 @@ namespace umbraco /// True if the document object is protected public static bool IsProtected(int DocumentId, string Path) { - return GetUmbracoHelper().IsProtected(DocumentId, Path); + return GetUmbracoHelper().IsProtected(DocumentId, Path); } /// @@ -395,7 +395,7 @@ namespace umbraco /// True if the current user has access or if the current document isn't protected public static bool HasAccess(int NodeId, string Path) { - return GetUmbracoHelper().MemberHasAccess(NodeId, Path); + return GetUmbracoHelper().MemberHasAccess(NodeId, Path); } @@ -406,7 +406,7 @@ namespace umbraco /// Md5 has of the string public static string md5(string text) { - return text.ToMd5(); + return text.ToMd5(); } /// @@ -739,7 +739,7 @@ namespace umbraco /// The text with text line breaks replaced with html linebreaks (
)
public static string ReplaceLineBreaks(string text) { - return GetUmbracoHelper().ReplaceLineBreaksForHtml(text); + return GetUmbracoHelper().ReplaceLineBreaksForHtml(text); } /// @@ -802,11 +802,11 @@ namespace umbraco p.RenderPage(TemplateId); var c = p.PageContentControl; - using (var sw = new StringWriter()) + using (var sw = new StringWriter()) using(var hw = new HtmlTextWriter(sw)) { - c.RenderControl(hw); - return sw.ToString(); + c.RenderControl(hw); + return sw.ToString(); } } @@ -819,7 +819,7 @@ namespace umbraco /// The rendered template as a string. public static string RenderTemplate(int PageId) { - return RenderTemplate(PageId, -1); + return RenderTemplate(PageId, -1); } /// @@ -1068,7 +1068,7 @@ namespace umbraco /// A dictionary items value as a string. public static string GetDictionaryItem(string Key) { - return GetUmbracoHelper().GetDictionaryValue(Key); + return GetUmbracoHelper().GetDictionaryValue(Key); } /// diff --git a/src/Umbraco.Web/umbraco.presentation/page.cs b/src/Umbraco.Web/umbraco.presentation/page.cs index bc8eb697e8..2826a1f6ed 100644 --- a/src/Umbraco.Web/umbraco.presentation/page.cs +++ b/src/Umbraco.Web/umbraco.presentation/page.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.Collections.Generic; using System.Linq; @@ -19,194 +19,194 @@ using Umbraco.Web.Composing; namespace umbraco { - /// - /// Summary description for page. - /// - public class page - { + /// + /// Summary description for page. + /// + public class page + { - #region Private members and properties + #region Private members and properties - string _pageName; - int _parentId; - string _writerName; - string _creatorName; - string _path; - int _nodeType; - string _nodeTypeAlias; - string[] _splitpath; - DateTime _createDate; - DateTime _updateDate; - int _pageId; - Guid _pageVersion; - readonly int _template; + string _pageName; + int _parentId; + string _writerName; + string _creatorName; + string _path; + int _nodeType; + string _nodeTypeAlias; + string[] _splitpath; + DateTime _createDate; + DateTime _updateDate; + int _pageId; + Guid _pageVersion; + readonly int _template; - readonly Hashtable _elements = new Hashtable(); - readonly StringBuilder _pageContent = new StringBuilder(); - Control _pageContentControl = new Control(); + readonly Hashtable _elements = new Hashtable(); + readonly StringBuilder _pageContent = new StringBuilder(); + Control _pageContentControl = new Control(); - #endregion + #endregion - #region Constructors + #region Constructors - /// - /// Initializes a new instance of the class for a published document request. - /// - /// The pointing to the document. - /// - /// The difference between creating the page with PublishedContentRequest vs an IPublishedContent item is - /// that the PublishedContentRequest takes into account how a template is assigned during the routing process whereas - /// with an IPublishedContent item, the template id is asssigned purely based on the default. - /// - internal page(PublishedContentRequest frequest) - { + /// + /// Initializes a new instance of the class for a published document request. + /// + /// The pointing to the document. + /// + /// The difference between creating the page with PublishedContentRequest vs an IPublishedContent item is + /// that the PublishedContentRequest takes into account how a template is assigned during the routing process whereas + /// with an IPublishedContent item, the template id is asssigned purely based on the default. + /// + internal page(PublishedContentRequest frequest) + { - if (!frequest.HasPublishedContent) - throw new ArgumentException("Document request has no node.", "frequest"); - - populatePageData(frequest.PublishedContent.Id, - frequest.PublishedContent.Name, frequest.PublishedContent.DocumentTypeId, frequest.PublishedContent.DocumentTypeAlias, - frequest.PublishedContent.WriterName, frequest.PublishedContent.CreatorName, frequest.PublishedContent.CreateDate, frequest.PublishedContent.UpdateDate, - frequest.PublishedContent.Path, frequest.PublishedContent.Version, frequest.PublishedContent.Parent == null ? -1 : frequest.PublishedContent.Parent.Id); + if (!frequest.HasPublishedContent) + throw new ArgumentException("Document request has no node.", "frequest"); - if (frequest.HasTemplate) - { + populatePageData(frequest.PublishedContent.Id, + frequest.PublishedContent.Name, frequest.PublishedContent.DocumentTypeId, frequest.PublishedContent.DocumentTypeAlias, + frequest.PublishedContent.WriterName, frequest.PublishedContent.CreatorName, frequest.PublishedContent.CreateDate, frequest.PublishedContent.UpdateDate, + frequest.PublishedContent.Path, frequest.PublishedContent.Version, frequest.PublishedContent.Parent == null ? -1 : frequest.PublishedContent.Parent.Id); - this._template = frequest.TemplateModel.Id; - _elements["template"] = _template.ToString(); - } + if (frequest.HasTemplate) + { - PopulateElementData(frequest.PublishedContent); + this._template = frequest.TemplateModel.Id; + _elements["template"] = _template.ToString(); + } - } + PopulateElementData(frequest.PublishedContent); - /// - /// Initializes a new instance of the page for a published document - /// - /// - internal page(IPublishedContent doc) - { - if (doc == null) throw new ArgumentNullException("doc"); - - populatePageData(doc.Id, - doc.Name, doc.DocumentTypeId, doc.DocumentTypeAlias, - doc.WriterName, doc.CreatorName, doc.CreateDate, doc.UpdateDate, - doc.Path, doc.Version, doc.Parent == null ? -1 : doc.Parent.Id); + } - if (doc.TemplateId > 0) - { - //set the template to whatever is assigned to the doc - _template = doc.TemplateId; - _elements["template"] = _template.ToString(); - } - - PopulateElementData(doc); - } + /// + /// Initializes a new instance of the page for a published document + /// + /// + internal page(IPublishedContent doc) + { + if (doc == null) throw new ArgumentNullException("doc"); + + populatePageData(doc.Id, + doc.Name, doc.DocumentTypeId, doc.DocumentTypeAlias, + doc.WriterName, doc.CreatorName, doc.CreateDate, doc.UpdateDate, + doc.Path, doc.Version, doc.Parent == null ? -1 : doc.Parent.Id); + + if (doc.TemplateId > 0) + { + //set the template to whatever is assigned to the doc + _template = doc.TemplateId; + _elements["template"] = _template.ToString(); + } + + PopulateElementData(doc); + } /// /// Initializes a new instance of the page for a content. /// /// The content. /// This is for usage only. - internal page(IContent content) + internal page(IContent content) : this(new PagePublishedContent(content)) - { } + { } - #endregion + #endregion - #region Initialize + #region Initialize - void populatePageData(int pageID, - string pageName, int nodeType, string nodeTypeAlias, - string writerName, string creatorName, DateTime createDate, DateTime updateDate, - string path, Guid pageVersion, int parentId) - { - this._pageId = pageID; - this._pageName = pageName; - this._nodeType = nodeType; - this._nodeTypeAlias = nodeTypeAlias; - this._writerName = writerName; - this._creatorName = creatorName; - this._createDate = createDate; - this._updateDate = updateDate; - this._parentId = parentId; - this._path = path; - this._splitpath = path.Split(','); - this._pageVersion = pageVersion; + void populatePageData(int pageID, + string pageName, int nodeType, string nodeTypeAlias, + string writerName, string creatorName, DateTime createDate, DateTime updateDate, + string path, Guid pageVersion, int parentId) + { + this._pageId = pageID; + this._pageName = pageName; + this._nodeType = nodeType; + this._nodeTypeAlias = nodeTypeAlias; + this._writerName = writerName; + this._creatorName = creatorName; + this._createDate = createDate; + this._updateDate = updateDate; + this._parentId = parentId; + this._path = path; + this._splitpath = path.Split(','); + this._pageVersion = pageVersion; - // Update the elements hashtable - _elements.Add("pageID", pageID); - _elements.Add("parentID", parentId); - _elements.Add("pageName", pageName); - _elements.Add("nodeType", nodeType); - _elements.Add("nodeTypeAlias", nodeTypeAlias); - _elements.Add("writerName", writerName); - _elements.Add("creatorName", creatorName); - _elements.Add("createDate", createDate); - _elements.Add("updateDate", updateDate); - _elements.Add("path", path); - _elements.Add("splitpath", _splitpath); - _elements.Add("pageVersion", pageVersion); - } + // Update the elements hashtable + _elements.Add("pageID", pageID); + _elements.Add("parentID", parentId); + _elements.Add("pageName", pageName); + _elements.Add("nodeType", nodeType); + _elements.Add("nodeTypeAlias", nodeTypeAlias); + _elements.Add("writerName", writerName); + _elements.Add("creatorName", creatorName); + _elements.Add("createDate", createDate); + _elements.Add("updateDate", updateDate); + _elements.Add("path", path); + _elements.Add("splitpath", _splitpath); + _elements.Add("pageVersion", pageVersion); + } - void populatePageData(XmlNode node) - { - String s; - DateTime dt; - Guid guid; - int i; + void populatePageData(XmlNode node) + { + String s; + DateTime dt; + Guid guid; + int i; - if (int.TryParse(attrValue(node, "id"), out i)) - _elements["pageID"] = this._pageId = i; + if (int.TryParse(attrValue(node, "id"), out i)) + _elements["pageID"] = this._pageId = i; - if ((s = attrValue(node, "nodeName")) != null) - _elements["pageName"] = this._pageName = s; + if ((s = attrValue(node, "nodeName")) != null) + _elements["pageName"] = this._pageName = s; - if (int.TryParse(attrValue(node, "parentId"), out i)) - _elements["parentId"] = this._parentId = i; + if (int.TryParse(attrValue(node, "parentId"), out i)) + _elements["parentId"] = this._parentId = i; - if (int.TryParse(attrValue(node, "nodeType"), out i)) - _elements["nodeType"] = this._nodeType = i; - if ((s = attrValue(node, "nodeTypeAlias")) != null) - _elements["nodeTypeAlias"] = this._nodeTypeAlias = s; + if (int.TryParse(attrValue(node, "nodeType"), out i)) + _elements["nodeType"] = this._nodeType = i; + if ((s = attrValue(node, "nodeTypeAlias")) != null) + _elements["nodeTypeAlias"] = this._nodeTypeAlias = s; - if ((s = attrValue(node, "writerName")) != null) - _elements["writerName"] = this._writerName = s; - if ((s = attrValue(node, "creatorName")) != null) - _elements["creatorName"] = this._creatorName = s; + if ((s = attrValue(node, "writerName")) != null) + _elements["writerName"] = this._writerName = s; + if ((s = attrValue(node, "creatorName")) != null) + _elements["creatorName"] = this._creatorName = s; - if (DateTime.TryParse(attrValue(node, "createDate"), out dt)) - _elements["createDate"] = this._createDate = dt; - if (DateTime.TryParse(attrValue(node, "updateDate"), out dt)) - _elements["updateDate"] = this._updateDate = dt; + if (DateTime.TryParse(attrValue(node, "createDate"), out dt)) + _elements["createDate"] = this._createDate = dt; + if (DateTime.TryParse(attrValue(node, "updateDate"), out dt)) + _elements["updateDate"] = this._updateDate = dt; - if (Guid.TryParse(attrValue(node, "pageVersion"), out guid)) - _elements["pageVersion"] = this._pageVersion = guid; + if (Guid.TryParse(attrValue(node, "pageVersion"), out guid)) + _elements["pageVersion"] = this._pageVersion = guid; - if ((s = attrValue(node, "path")) != null) - { - _elements["path"] = this._path = s; - _elements["splitpath"] = this._splitpath = _path.Split(','); - } - } + if ((s = attrValue(node, "path")) != null) + { + _elements["path"] = this._path = s; + _elements["splitpath"] = this._splitpath = _path.Split(','); + } + } - string attrValue(XmlNode node, string attributeName) - { - var attr = node.Attributes.GetNamedItem(attributeName); - var value = attr != null ? attr.Value : null; - return value; - } + string attrValue(XmlNode node, string attributeName) + { + var attr = node.Attributes.GetNamedItem(attributeName); + var value = attr != null ? attr.Value : null; + return value; + } - /// - /// Puts the properties of the node into the elements table - /// - /// - void PopulateElementData(IPublishedContent node) - { - foreach(var p in node.Properties) - { - if (_elements.ContainsKey(p.PropertyTypeAlias) == false) - { + /// + /// Puts the properties of the node into the elements table + /// + /// + void PopulateElementData(IPublishedContent node) + { + foreach(var p in node.Properties) + { + if (_elements.ContainsKey(p.PropertyTypeAlias) == false) + { // note: legacy used the raw value (see populating from an Xml node below) // so we're doing the same here, using DataValue. If we use Value then every // value will be converted NOW - including RTEs that may contain macros that @@ -215,145 +215,145 @@ namespace umbraco // to properly fix this, we'd need to turn the elements collection into some // sort of collection of lazy values. - _elements[p.PropertyTypeAlias] = p.SourceValue; - } - } - } + _elements[p.PropertyTypeAlias] = p.SourceValue; + } + } + } - void populateElementData(XmlNode node) - { - string xpath = "./* [not(@isDoc)]"; + void populateElementData(XmlNode node) + { + string xpath = "./* [not(@isDoc)]"; - foreach (XmlNode data in node.SelectNodes(xpath)) - { - // ignore empty elements - if (data.ChildNodes.Count == 0) - continue; + foreach (XmlNode data in node.SelectNodes(xpath)) + { + // ignore empty elements + if (data.ChildNodes.Count == 0) + continue; - string alias = data.Name; - string value = data.FirstChild.Value; + string alias = data.Name; + string value = data.FirstChild.Value; - // moved to PublishedContentRequest + UmbracoModule - //if (alias == "umbracoRedirect") - //{ - // int i; - // if (int.TryParse(value, out i)) - // HttpContext.Current.Response.Redirect(library.NiceUrl(int.Parse(data.FirstChild.Value)), true); - //} + // moved to PublishedContentRequest + UmbracoModule + //if (alias == "umbracoRedirect") + //{ + // int i; + // if (int.TryParse(value, out i)) + // HttpContext.Current.Response.Redirect(library.NiceUrl(int.Parse(data.FirstChild.Value)), true); + //} - if (_elements.ContainsKey(alias)) - { - Current.Logger.Debug( - string.Format("Aliases must be unique, an element with alias \"{0}\" has already been loaded!", alias)); - } - else - { - _elements[alias] = value; + if (_elements.ContainsKey(alias)) + { Current.Logger.Debug( - string.Format("Load element \"{0}\"", alias)); - } - } - } + string.Format("Aliases must be unique, an element with alias \"{0}\" has already been loaded!", alias)); + } + else + { + _elements[alias] = value; + Current.Logger.Debug( + string.Format("Load element \"{0}\"", alias)); + } + } + } - #endregion + #endregion - #region Wtf? + #region Wtf? - public void RenderPage(int templateId) - { - if (templateId != 0) - { - template templateDesign = new template(templateId); - - _pageContentControl = templateDesign.ParseWithControls(this); - _pageContent.Append(templateDesign.TemplateContent); - } - } + public void RenderPage(int templateId) + { + if (templateId != 0) + { + template templateDesign = new template(templateId); - #endregion + _pageContentControl = templateDesign.ParseWithControls(this); + _pageContent.Append(templateDesign.TemplateContent); + } + } - #region Public properties + #endregion - public Control PageContentControl - { - get { return _pageContentControl; } - } + #region Public properties - public string PageName - { - get { return _pageName; } - } + public Control PageContentControl + { + get { return _pageContentControl; } + } - public int ParentId - { - get { return _parentId; } - } + public string PageName + { + get { return _pageName; } + } - public string NodeTypeAlias - { - get { return _nodeTypeAlias; } - } + public int ParentId + { + get { return _parentId; } + } - public int NodeType - { - get { return _nodeType; } - } + public string NodeTypeAlias + { + get { return _nodeTypeAlias; } + } - public string WriterName - { - get { return _writerName; } - } + public int NodeType + { + get { return _nodeType; } + } - public string CreatorName - { - get { return _creatorName; } - } + public string WriterName + { + get { return _writerName; } + } - public DateTime CreateDate - { - get { return _createDate; } - } + public string CreatorName + { + get { return _creatorName; } + } - public DateTime UpdateDate - { - get { return _updateDate; } - } + public DateTime CreateDate + { + get { return _createDate; } + } - public int PageID - { - get { return _pageId; } - } + public DateTime UpdateDate + { + get { return _updateDate; } + } - public int Template - { - get { return _template; } - } + public int PageID + { + get { return _pageId; } + } - public Hashtable Elements - { - get { return _elements; } - } + public int Template + { + get { return _template; } + } - public string PageContent - { - get { return _pageContent.ToString(); } - } + public Hashtable Elements + { + get { return _elements; } + } - public string[] SplitPath - { - get { return this._splitpath; } - } + public string PageContent + { + get { return _pageContent.ToString(); } + } - #endregion + public string[] SplitPath + { + get { return this._splitpath; } + } - #region ToString + #endregion - public override string ToString() - { - return _pageName; - } + #region ToString - #endregion + public override string ToString() + { + return _pageName; + } + + #endregion #region PublishedContent diff --git a/src/Umbraco.Web/umbraco.presentation/template.cs b/src/Umbraco.Web/umbraco.presentation/template.cs index 4fd52025c7..98747b9ad7 100644 --- a/src/Umbraco.Web/umbraco.presentation/template.cs +++ b/src/Umbraco.Web/umbraco.presentation/template.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Text; using System.IO; using System.Text.RegularExpressions; @@ -344,7 +344,7 @@ namespace umbraco //{ // // NH adds Live Editing test stuff // item umbItem = new item(umbPage.Elements, attributes); - // // item umbItem = new item(umbPage.PageElements[helper.FindAttribute(attributes, "field")].ToString(), attributes); + // // item umbItem = new item(umbPage.PageElements[helper.FindAttribute(attributes, "field")].ToString(), attributes); // tempElementContent = umbItem.FieldContent; //} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/BaseTree.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/BaseTree.cs index 5d06b1d36b..af14f35592 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/BaseTree.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/BaseTree.cs @@ -240,8 +240,8 @@ namespace umbraco.cms.presentation.Trees protected void CreateRootNode() { m_initNode = XmlTreeNode.CreateRoot(this); - m_initNode.Icon = FolderIcon; - m_initNode.OpenIcon = FolderIconOpen; + m_initNode.Icon = FolderIcon; + m_initNode.OpenIcon = FolderIconOpen; CreateRootNode(ref m_initNode); } @@ -280,16 +280,16 @@ namespace umbraco.cms.presentation.Trees CreateAllowedActions(ref m_allowedActions); } - /// - /// A helper method to re-generate the root node for the current tree. - /// - /// - public XmlTreeNode GenerateRootNode() - { - XmlTreeNode node = XmlTreeNode.CreateRoot(this); - this.CreateRootNode(ref node); - return node; - } + /// + /// A helper method to re-generate the root node for the current tree. + /// + /// + public XmlTreeNode GenerateRootNode() + { + XmlTreeNode node = XmlTreeNode.CreateRoot(this); + this.CreateRootNode(ref node); + return node; + } /// /// This method can initialize the ITreeService parameters for this class with another ITreeService object. @@ -335,21 +335,21 @@ namespace umbraco.cms.presentation.Trees /// public string GetTreeServiceUrl(int id) { - // updated by NH to pass showcontextmenu, isdialog and dialogmode variables - TreeService treeSvc = new TreeService(id, TreeAlias, this.ShowContextMenu, this.IsDialog, this.DialogMode, ""); - return treeSvc.GetServiceUrl(); + // updated by NH to pass showcontextmenu, isdialog and dialogmode variables + TreeService treeSvc = new TreeService(id, TreeAlias, this.ShowContextMenu, this.IsDialog, this.DialogMode, ""); + return treeSvc.GetServiceUrl(); } - /// - /// Returns the tree service url to return the tree xml structure based on a string node key. - /// - /// - /// - public string GetTreeServiceUrl(string nodeKey) - { - TreeService treeSvc = new TreeService(-1, TreeAlias, this.ShowContextMenu, this.IsDialog, this.DialogMode, "", nodeKey); - return treeSvc.GetServiceUrl(); - } + /// + /// Returns the tree service url to return the tree xml structure based on a string node key. + /// + /// + /// + public string GetTreeServiceUrl(string nodeKey) + { + TreeService treeSvc = new TreeService(-1, TreeAlias, this.ShowContextMenu, this.IsDialog, this.DialogMode, "", nodeKey); + return treeSvc.GetServiceUrl(); + } @@ -374,30 +374,30 @@ namespace umbraco.cms.presentation.Trees return treeSvc.GetServiceUrl(); } - /// - /// Returns the serialized data for the nodeId passed in. - /// - /// - /// This may not work with ITrees that don't support the BaseTree structure with TreeService. - /// If a tree implements other query string data to make it work, this may not function since - /// it only relies on the 3 parameters. - /// - /// - /// - /// - public string GetSerializedNodeData(string nodeId) - { - XmlTree xTree = new XmlTree(); - int id; - if (int.TryParse(nodeId, out id)) - this.id = id; - else - this.NodeKey = nodeId; + /// + /// Returns the serialized data for the nodeId passed in. + /// + /// + /// This may not work with ITrees that don't support the BaseTree structure with TreeService. + /// If a tree implements other query string data to make it work, this may not function since + /// it only relies on the 3 parameters. + /// + /// + /// + /// + public string GetSerializedNodeData(string nodeId) + { + XmlTree xTree = new XmlTree(); + int id; + if (int.TryParse(nodeId, out id)) + this.id = id; + else + this.NodeKey = nodeId; - this.Render(ref xTree); + this.Render(ref xTree); - return xTree.ToString(); - } + return xTree.ToString(); + } /// /// Returns the default actions for a root node @@ -565,4 +565,4 @@ namespace umbraco.cms.presentation.Trees } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/ITreeService.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/ITreeService.cs index def5452768..df601444b2 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/ITreeService.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/ITreeService.cs @@ -1,20 +1,20 @@ -namespace umbraco.cms.presentation.Trees +namespace umbraco.cms.presentation.Trees { - /// - /// All Trees rely on the properties of an ITreeService interface. This has been created to avoid having trees - /// dependant on the HttpContext - /// - public interface ITreeService - { - /// - /// The NodeKey is a string representation of the nodeID. Generally this is used for tree's whos node's unique key value is a string in instead - /// of an integer such as folder names. - /// - string NodeKey { get; } - int StartNodeID { get; } - bool ShowContextMenu { get; } - bool IsDialog { get; } - TreeDialogModes DialogMode { get; } - string FunctionToCall { get; } - } + /// + /// All Trees rely on the properties of an ITreeService interface. This has been created to avoid having trees + /// dependant on the HttpContext + /// + public interface ITreeService + { + /// + /// The NodeKey is a string representation of the nodeID. Generally this is used for tree's whos node's unique key value is a string in instead + /// of an integer such as folder names. + /// + string NodeKey { get; } + int StartNodeID { get; } + bool ShowContextMenu { get; } + bool IsDialog { get; } + TreeDialogModes DialogMode { get; } + string FunctionToCall { get; } + } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/NullTree.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/NullTree.cs index 4dc1e45c1d..f75ea58bb1 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/NullTree.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/NullTree.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Data; using System.Configuration; using System.Web; @@ -19,13 +19,13 @@ namespace umbraco.cms.presentation.Trees public class NullTree : BaseTree { - public NullTree(string application) : base(application) { } + public NullTree(string application) : base(application) { } - protected override void CreateRootNodeActions(ref List actions) - { - actions.Clear(); - actions.Add(ActionRefresh.Instance); - } + protected override void CreateRootNodeActions(ref List actions) + { + actions.Clear(); + actions.Add(ActionRefresh.Instance); + } public override void RenderJS(ref System.Text.StringBuilder Javascript) { } @@ -41,11 +41,11 @@ namespace umbraco.cms.presentation.Trees tree.Add(xNode); OnAfterNodeRender(ref tree, ref xNode, EventArgs.Empty); } - + } protected override void CreateRootNode(ref XmlTreeNode rootNode) - { + { rootNode.Menu = null; rootNode.Text = "Error"; } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/TreeDefinition.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/TreeDefinition.cs index 142b4fb9a2..a4839904ee 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/TreeDefinition.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/TreeDefinition.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Data; using System.Configuration; using System.Web; @@ -13,8 +13,8 @@ namespace umbraco.cms.presentation.Trees { /// - /// Defines the entire structure of an application tree including it's Type, a reference to it's ApplicationTree object, and a reference - /// to it's Application object. Tree Definitions are based on defining a database in the umbracoAppTree database. Any tree defined in this table + /// Defines the entire structure of an application tree including it's Type, a reference to it's ApplicationTree object, and a reference + /// to it's Application object. Tree Definitions are based on defining a database in the umbracoAppTree database. Any tree defined in this table /// that is of an ITree type, it will be found and can be instantiated by this class. Any ITree that is not defined in the database will /// need to be instantiated with it's own tree constructor. /// @@ -41,7 +41,7 @@ namespace umbraco.cms.presentation.Trees /// Returns a new instance of a BaseTree based on this Tree Definition /// public BaseTree CreateInstance() - { + { //create the tree instance var typeInstance = CreateTreeInstance(m_treeType, m_app.Alias); diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/TreeDefinitionCollection.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/TreeDefinitionCollection.cs index 486c79ba75..33e2503aac 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/TreeDefinitionCollection.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/TreeDefinitionCollection.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using Umbraco.Web; using Umbraco.Web.Composing; @@ -21,7 +21,7 @@ namespace umbraco.cms.presentation.Trees { get { - instance.EnsureTreesRegistered(); + instance.EnsureTreesRegistered(); return instance; } } @@ -33,11 +33,11 @@ namespace umbraco.cms.presentation.Trees /// public TreeDefinition FindTree(BaseTree tree) { - EnsureTreesRegistered(); + EnsureTreesRegistered(); var foundTree = this.Find( - t => t.TreeType == tree.GetType() - ); + t => t.TreeType == tree.GetType() + ); if (foundTree != null) return foundTree; @@ -51,7 +51,7 @@ namespace umbraco.cms.presentation.Trees /// public TreeDefinition FindTree() where T : BaseTree { - EnsureTreesRegistered(); + EnsureTreesRegistered(); var foundTree = this.Find( delegate(TreeDefinition t) @@ -74,11 +74,11 @@ namespace umbraco.cms.presentation.Trees /// public TreeDefinition FindTree(string alias) { - EnsureTreesRegistered(); + EnsureTreesRegistered(); var foundTree = this.Find( - t => t.Tree.Alias.ToLower() == alias.ToLower() - ); + t => t.Tree.Alias.ToLower() == alias.ToLower() + ); if (foundTree != null) return foundTree; @@ -92,11 +92,11 @@ namespace umbraco.cms.presentation.Trees /// public List FindTrees(string appAlias) { - EnsureTreesRegistered(); + EnsureTreesRegistered(); return this.FindAll( - tree => (tree.App != null && tree.App.Alias.ToLower() == appAlias.ToLower()) - ); + tree => (tree.App != null && tree.App.Alias.ToLower() == appAlias.ToLower()) + ); } /// @@ -106,11 +106,11 @@ namespace umbraco.cms.presentation.Trees /// public List FindActiveTrees(string appAlias) { - EnsureTreesRegistered(); + EnsureTreesRegistered(); return this.FindAll( - tree => (tree.App != null && tree.App.Alias.ToLower() == appAlias.ToLower() && tree.Tree.Initialize) - ); + tree => (tree.App != null && tree.App.Alias.ToLower() == appAlias.ToLower() && tree.Tree.Initialize) + ); } public void ReRegisterTrees() diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/TreeEventArgs.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/TreeEventArgs.cs index 6b4473375a..d67b5bf653 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/TreeEventArgs.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/TreeEventArgs.cs @@ -1,10 +1,10 @@ -using System; +using System; namespace umbraco.cms.presentation.Trees { /// - /// + /// /// public class TreeEventArgs : EventArgs { diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/TreeRequestParams.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/TreeRequestParams.cs index d04d8cba84..dcf20d9078 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/TreeRequestParams.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/TreeRequestParams.cs @@ -1,135 +1,135 @@ -using System; +using System; using System.Collections.Generic; using System.Web; namespace umbraco.cms.presentation.Trees { - /// - /// An ITreeService class that returns the values found in the Query String or any dictionary - /// - internal class TreeRequestParams : ITreeService - { - private TreeRequestParams() { } + /// + /// An ITreeService class that returns the values found in the Query String or any dictionary + /// + internal class TreeRequestParams : ITreeService + { + private TreeRequestParams() { } - private Dictionary m_params; + private Dictionary m_params; - public static TreeRequestParams FromQueryStrings() - { - Dictionary p = new Dictionary(); - foreach (string key in HttpContext.Current.Request.QueryString.Keys) - { + public static TreeRequestParams FromQueryStrings() + { + Dictionary p = new Dictionary(); + foreach (string key in HttpContext.Current.Request.QueryString.Keys) + { p.Add(key, HttpUtility.HtmlEncode(HttpContext.Current.Request.QueryString[key])); - //p.Add(item.Key.ToString(), item.Value.ToString()); - } - return FromDictionary(p); - } + //p.Add(item.Key.ToString(), item.Value.ToString()); + } + return FromDictionary(p); + } - public static TreeRequestParams FromDictionary(Dictionary items) - { - TreeRequestParams treeParams = new TreeRequestParams(); - treeParams.m_params = items; - return treeParams; - } + public static TreeRequestParams FromDictionary(Dictionary items) + { + TreeRequestParams treeParams = new TreeRequestParams(); + treeParams.m_params = items; + return treeParams; + } - /// - /// Converts the tree parameters to a tree service object - /// - /// - public TreeService CreateTreeService() - { - return new TreeService() - { - ShowContextMenu = this.ShowContextMenu, - IsDialog = this.IsDialog, - DialogMode = this.DialogMode, - App = this.Application, - TreeType = this.TreeType, - NodeKey = this.NodeKey, - StartNodeID = this.StartNodeID, - FunctionToCall = this.FunctionToCall - }; - } + /// + /// Converts the tree parameters to a tree service object + /// + /// + public TreeService CreateTreeService() + { + return new TreeService() + { + ShowContextMenu = this.ShowContextMenu, + IsDialog = this.IsDialog, + DialogMode = this.DialogMode, + App = this.Application, + TreeType = this.TreeType, + NodeKey = this.NodeKey, + StartNodeID = this.StartNodeID, + FunctionToCall = this.FunctionToCall + }; + } - public string NodeKey - { - get - { - return (m_params.ContainsKey("nodeKey") ? m_params["nodeKey"] : ""); - } - } - public string Application - { - get - { - return (m_params.ContainsKey("app") ? m_params["app"] : m_params.ContainsKey("appAlias") ? m_params["appAlias"] : ""); - } - } - public int StartNodeID - { - get - { - if(m_params.ContainsKey("id")) + public string NodeKey + { + get + { + return (m_params.ContainsKey("nodeKey") ? m_params["nodeKey"] : ""); + } + } + public string Application + { + get + { + return (m_params.ContainsKey("app") ? m_params["app"] : m_params.ContainsKey("appAlias") ? m_params["appAlias"] : ""); + } + } + public int StartNodeID + { + get + { + if(m_params.ContainsKey("id")) { - int sNodeID; - if (int.TryParse(m_params["id"], out sNodeID)) - return sNodeID; + int sNodeID; + if (int.TryParse(m_params["id"], out sNodeID)) + return sNodeID; } - return -1; - } - } - public string FunctionToCall - { - get - { - return (m_params.ContainsKey("functionToCall") ? m_params["functionToCall"] : ""); - } - } - public bool IsDialog - { - get - { - bool value; - if (m_params.ContainsKey("isDialog")) - if (bool.TryParse(m_params["isDialog"], out value)) - return value; - return false; - } - } - public TreeDialogModes DialogMode - { - get - { - if (m_params.ContainsKey("dialogMode") && IsDialog) - { - try - { - return (TreeDialogModes)Enum.Parse(typeof(TreeDialogModes), m_params["dialogMode"]); - } - catch - { - return TreeDialogModes.none; - } - } - return TreeDialogModes.none; - } - } - public bool ShowContextMenu - { - get - { - bool value; - if (m_params.ContainsKey("contextMenu")) - if (bool.TryParse(m_params["contextMenu"], out value)) - return value; - return true; - } - } - public string TreeType - { - get - { - return (m_params.ContainsKey("treeType") ? m_params["treeType"] : ""); - } - } - } + return -1; + } + } + public string FunctionToCall + { + get + { + return (m_params.ContainsKey("functionToCall") ? m_params["functionToCall"] : ""); + } + } + public bool IsDialog + { + get + { + bool value; + if (m_params.ContainsKey("isDialog")) + if (bool.TryParse(m_params["isDialog"], out value)) + return value; + return false; + } + } + public TreeDialogModes DialogMode + { + get + { + if (m_params.ContainsKey("dialogMode") && IsDialog) + { + try + { + return (TreeDialogModes)Enum.Parse(typeof(TreeDialogModes), m_params["dialogMode"]); + } + catch + { + return TreeDialogModes.none; + } + } + return TreeDialogModes.none; + } + } + public bool ShowContextMenu + { + get + { + bool value; + if (m_params.ContainsKey("contextMenu")) + if (bool.TryParse(m_params["contextMenu"], out value)) + return value; + return true; + } + } + public string TreeType + { + get + { + return (m_params.ContainsKey("treeType") ? m_params["treeType"] : ""); + } + } + } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/TreeService.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/TreeService.cs index c9032c5cd5..b675b9b40e 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/TreeService.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/TreeService.cs @@ -1,4 +1,4 @@ -using System.Text; +using System.Text; using Umbraco.Web._Legacy.Controls; namespace umbraco.cms.presentation.Trees @@ -8,118 +8,118 @@ namespace umbraco.cms.presentation.Trees /// for reading the parameters from the URL when a request is made. /// public class TreeService : TreeUrlGenerator, ITreeService - { + { - /// - /// Default empty constructor - /// + /// + /// Default empty constructor + /// public TreeService() : base() { } - /// - /// Constructor to assign all TreeService properties except nodeKey in one call - /// - /// - /// - /// - /// - /// - /// - public TreeService(int? startNodeID, string treeType, bool? showContextMenu, - bool? isDialog, TreeDialogModes dialogMode, string app) - { + /// + /// Constructor to assign all TreeService properties except nodeKey in one call + /// + /// + /// + /// + /// + /// + /// + public TreeService(int? startNodeID, string treeType, bool? showContextMenu, + bool? isDialog, TreeDialogModes dialogMode, string app) + { StartNodeID = startNodeID ?? -1; - TreeType = treeType; + TreeType = treeType; ShowContextMenu = showContextMenu ?? true; IsDialog = isDialog ?? false; - m_dialogMode = dialogMode; - App = app; - } + m_dialogMode = dialogMode; + App = app; + } - /// - /// Constructor to assign all TreeService properties in one call - /// - /// - /// - /// - /// - /// - /// - /// - public TreeService(int? startNodeID, string treeType, bool? showContextMenu, - bool? isDialog, TreeDialogModes dialogMode, string app, string nodeKey) - { + /// + /// Constructor to assign all TreeService properties in one call + /// + /// + /// + /// + /// + /// + /// + /// + public TreeService(int? startNodeID, string treeType, bool? showContextMenu, + bool? isDialog, TreeDialogModes dialogMode, string app, string nodeKey) + { StartNodeID = startNodeID ?? -1; - TreeType = treeType; + TreeType = treeType; ShowContextMenu = showContextMenu ?? true; IsDialog = isDialog ?? false; - m_dialogMode = dialogMode; - App = app; - NodeKey = nodeKey; - } + m_dialogMode = dialogMode; + App = app; + NodeKey = nodeKey; + } - public TreeService(int? startNodeID, string treeType, bool? showContextMenu, - bool? isDialog, TreeDialogModes dialogMode, string app, string nodeKey, string functionToCall) - { - StartNodeID = startNodeID ?? -1; - TreeType = treeType; - ShowContextMenu = showContextMenu ?? true; - IsDialog = isDialog ?? false; - m_dialogMode = dialogMode; - App = app; - NodeKey = nodeKey; - FunctionToCall = functionToCall; - } + public TreeService(int? startNodeID, string treeType, bool? showContextMenu, + bool? isDialog, TreeDialogModes dialogMode, string app, string nodeKey, string functionToCall) + { + StartNodeID = startNodeID ?? -1; + TreeType = treeType; + ShowContextMenu = showContextMenu ?? true; + IsDialog = isDialog ?? false; + m_dialogMode = dialogMode; + App = app; + NodeKey = nodeKey; + FunctionToCall = functionToCall; + } private TreeDialogModes m_dialogMode; - #region Public Properties + #region Public Properties - public TreeDialogModes DialogMode - { - get { return m_dialogMode; } - set { m_dialogMode = value; } - } + public TreeDialogModes DialogMode + { + get { return m_dialogMode; } + set { m_dialogMode = value; } + } - #endregion + #endregion - /// - /// Static method to return the tree service url with the specified parameters - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - public static string GetServiceUrl(int? startNodeID, string treeType, bool? showContextMenu, - bool? isDialog, TreeDialogModes dialogMode, string app, string nodeKey, string functionToCall) - { - TreeService treeSvc = new TreeService(startNodeID, treeType, showContextMenu, isDialog, dialogMode, app, nodeKey, functionToCall); - return treeSvc.GetServiceUrl(); - } + /// + /// Static method to return the tree service url with the specified parameters + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public static string GetServiceUrl(int? startNodeID, string treeType, bool? showContextMenu, + bool? isDialog, TreeDialogModes dialogMode, string app, string nodeKey, string functionToCall) + { + TreeService treeSvc = new TreeService(startNodeID, treeType, showContextMenu, isDialog, dialogMode, app, nodeKey, functionToCall); + return treeSvc.GetServiceUrl(); + } - /// - /// static method to return the tree init url with the specified parameters - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - public static string GetInitUrl(int? startNodeID, string treeType, bool? showContextMenu, - bool? isDialog, TreeDialogModes dialogMode, string app, string nodeKey, string functionToCall) - { - TreeService treeSvc = new TreeService(startNodeID, treeType, showContextMenu, isDialog, dialogMode, app, nodeKey, functionToCall); - return treeSvc.GetInitUrl(); - } + /// + /// static method to return the tree init url with the specified parameters + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public static string GetInitUrl(int? startNodeID, string treeType, bool? showContextMenu, + bool? isDialog, TreeDialogModes dialogMode, string app, string nodeKey, string functionToCall) + { + TreeService treeSvc = new TreeService(startNodeID, treeType, showContextMenu, isDialog, dialogMode, app, nodeKey, functionToCall); + return treeSvc.GetInitUrl(); + } protected override string GetUrl(string pageUrl) { @@ -128,5 +128,5 @@ namespace umbraco.cms.presentation.Trees return sb.ToString(); } - } + } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/TreeUrlGenerator.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/TreeUrlGenerator.cs index 6bf18a9202..277c6270a1 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/TreeUrlGenerator.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/TreeUrlGenerator.cs @@ -1,11 +1,11 @@ -using System; +using System; using System.Text; namespace umbraco.cms.presentation.Trees { /// - /// This class will generate the URLs for iframe tree pages. - /// Generally used to get the a tree picker url. + /// This class will generate the URLs for iframe tree pages. + /// Generally used to get the a tree picker url. /// /// /// This was created in 4.1 so that this helper class can be exposed to other assemblies since @@ -160,8 +160,8 @@ namespace umbraco.cms.presentation.Trees public string GetPickerUrl() { return Umbraco.Core.IO.IOHelper.ResolveUrl(Umbraco.Core.IO.SystemDirectories.Umbraco) + "/dialogs/" + GetUrl(PICKER_URL); - } - + } + /// /// Generates the URL parameters for the tree service. /// @@ -186,4 +186,4 @@ namespace umbraco.cms.presentation.Trees } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/XmlTree.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/XmlTree.cs index 9b62e5ea1f..63e2316034 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/XmlTree.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/XmlTree.cs @@ -1,4 +1,4 @@ -using System.Xml.Serialization; +using System.Xml.Serialization; using System.Collections; using System; using System.Xml.Schema; @@ -11,69 +11,69 @@ using Action = Umbraco.Web._Legacy.Actions.Action; namespace umbraco.cms.presentation.Trees { - /// - /// Used for serializing data to XML as the data structure for the JavaScript tree - /// - [XmlRoot(ElementName = "tree", IsNullable = false), Serializable] - public class XmlTree - { + /// + /// Used for serializing data to XML as the data structure for the JavaScript tree + /// + [XmlRoot(ElementName = "tree", IsNullable = false), Serializable] + public class XmlTree + { - public XmlTree() - { - Init(); - } - - private void Init() - { - } - - public void Add(XmlTreeNode obj) - { - treeCollection.Add(obj); - } + public XmlTree() + { + Init(); + } - [XmlIgnore] - public XmlTreeNode this[int index] - { - get { return (XmlTreeNode)treeCollection[index]; } - } + private void Init() + { + } - [XmlIgnore] - public int Count - { - get { return treeCollection.Count; } - } + public void Add(XmlTreeNode obj) + { + treeCollection.Add(obj); + } - public void Clear() - { - treeCollection.Clear(); - } + [XmlIgnore] + public XmlTreeNode this[int index] + { + get { return (XmlTreeNode)treeCollection[index]; } + } - public XmlTreeNode Remove(int index) - { - XmlTreeNode obj = treeCollection[index]; - treeCollection.Remove(obj); - return obj; - } + [XmlIgnore] + public int Count + { + get { return treeCollection.Count; } + } - public void Remove(XmlTreeNode obj) - { - treeCollection.Remove(obj); - } + public void Clear() + { + treeCollection.Clear(); + } + + public XmlTreeNode Remove(int index) + { + XmlTreeNode obj = treeCollection[index]; + treeCollection.Remove(obj); + return obj; + } + + public void Remove(XmlTreeNode obj) + { + treeCollection.Remove(obj); + } - private List __treeCollection; + private List __treeCollection; - [XmlElement(Type = typeof(XmlTreeNode), ElementName = "tree", IsNullable = false, Form = XmlSchemaForm.Qualified)] - public List treeCollection - { - get - { - if (__treeCollection == null) __treeCollection = new List(); - return __treeCollection; - } - set { __treeCollection = value; } - } + [XmlElement(Type = typeof(XmlTreeNode), ElementName = "tree", IsNullable = false, Form = XmlSchemaForm.Qualified)] + public List treeCollection + { + get + { + if (__treeCollection == null) __treeCollection = new List(); + return __treeCollection; + } + set { __treeCollection = value; } + } [System.Runtime.InteropServices.DispIdAttribute(-4)] public IEnumerator GetEnumerator() @@ -83,89 +83,89 @@ namespace umbraco.cms.presentation.Trees } - /// - /// Used for serializing data to XML as the data structure for the JavaScript tree - /// - [Serializable] - public class XmlTreeNode : IXmlSerializable - { + /// + /// Used for serializing data to XML as the data structure for the JavaScript tree + /// + [Serializable] + public class XmlTreeNode : IXmlSerializable + { - private XmlTreeNode() - { - m_nodeStyle = new NodeStyle(); - } + private XmlTreeNode() + { + m_nodeStyle = new NodeStyle(); + } - /// - /// creates a new XmlTreeNode with the default parameters from the BaseTree - /// - /// - /// - public static XmlTreeNode Create(BaseTree bTree) - { - XmlTreeNode xNode = new XmlTreeNode(); - xNode.Menu = bTree.AllowedActions.FindAll(delegate(IAction a) { return true; }); //return a duplicate copy of the list - xNode.NodeType = bTree.TreeAlias; - xNode.Source = string.Empty; - xNode.IsRoot = false; - //generally the tree type and node type are the same but in some cased they are not. - xNode.m_treeType = bTree.TreeAlias; - return xNode; - } + /// + /// creates a new XmlTreeNode with the default parameters from the BaseTree + /// + /// + /// + public static XmlTreeNode Create(BaseTree bTree) + { + XmlTreeNode xNode = new XmlTreeNode(); + xNode.Menu = bTree.AllowedActions.FindAll(delegate(IAction a) { return true; }); //return a duplicate copy of the list + xNode.NodeType = bTree.TreeAlias; + xNode.Source = string.Empty; + xNode.IsRoot = false; + //generally the tree type and node type are the same but in some cased they are not. + xNode.m_treeType = bTree.TreeAlias; + return xNode; + } + + /// + /// creates a new XmlTreeNode with the default parameters for the BaseTree root node + /// + /// + /// + public static XmlTreeNode CreateRoot(BaseTree bTree) + { + XmlTreeNode xNode = new XmlTreeNode(); + xNode.NodeID = bTree.StartNodeID.ToString(); + xNode.Source = bTree.GetTreeServiceUrl(); + xNode.Menu = bTree.RootNodeActions.FindAll(delegate(IAction a) { return true; }); //return a duplicate copy of the list + xNode.NodeType = bTree.TreeAlias; + xNode.Text = BaseTree.GetTreeHeader(bTree.TreeAlias); - /// - /// creates a new XmlTreeNode with the default parameters for the BaseTree root node - /// - /// - /// - public static XmlTreeNode CreateRoot(BaseTree bTree) - { - XmlTreeNode xNode = new XmlTreeNode(); - xNode.NodeID = bTree.StartNodeID.ToString(); - xNode.Source = bTree.GetTreeServiceUrl(); - xNode.Menu = bTree.RootNodeActions.FindAll(delegate(IAction a) { return true; }); //return a duplicate copy of the list - xNode.NodeType = bTree.TreeAlias; - xNode.Text = BaseTree.GetTreeHeader(bTree.TreeAlias); - // The apps dashboard action will be used xNode.Action = "javascript:" + ClientTools.Scripts.OpenDashboard(bTree.app); - + xNode.IsRoot = true; - //generally the tree type and node type are the same but in some cased they are not. - xNode.m_treeType = bTree.TreeAlias; - return xNode; - } + //generally the tree type and node type are the same but in some cased they are not. + xNode.m_treeType = bTree.TreeAlias; + return xNode; + } - private NodeStyle m_nodeStyle; + private NodeStyle m_nodeStyle; - private bool? m_notPublished; - private bool? m_isProtected; - private List m_menu; - private string m_text; - private string m_action; - [Obsolete("This is never used. From version 3 and below probably")] - private string m_rootSrc; - private string m_src; - private string m_iconClass = ""; - private string m_icon; - private string m_openIcon; - private string m_nodeType; - private string m_nodeID; - private string m_treeType; + private bool? m_notPublished; + private bool? m_isProtected; + private List m_menu; + private string m_text; + private string m_action; + [Obsolete("This is never used. From version 3 and below probably")] + private string m_rootSrc; + private string m_src; + private string m_iconClass = ""; + private string m_icon; + private string m_openIcon; + private string m_nodeType; + private string m_nodeID; + private string m_treeType; - /// - /// Set to true when a node is created with CreateRootNode - /// - internal bool IsRoot { get; private set; } + /// + /// Set to true when a node is created with CreateRootNode + /// + internal bool IsRoot { get; private set; } - /// - /// Generally the tree type and node type are the same but in some cased they are not so - /// we need to store the tree type too which is read only. - /// - public string TreeType - { - get { return m_treeType; } - internal set { m_treeType = value; } - } + /// + /// Generally the tree type and node type are the same but in some cased they are not so + /// we need to store the tree type too which is read only. + /// + public string TreeType + { + get { return m_treeType; } + internal set { m_treeType = value; } + } public bool HasChildren { @@ -180,289 +180,289 @@ namespace umbraco.cms.presentation.Trees } private bool? m_HasChildren = null; - public string NodeID - { - get { return m_nodeID; } - set { m_nodeID = value; } - } + public string NodeID + { + get { return m_nodeID; } + set { m_nodeID = value; } + } - /// - /// The tree node text - /// - public string Text - { - get { return m_text; } - set { m_text = value; } - } + /// + /// The tree node text + /// + public string Text + { + get { return m_text; } + set { m_text = value; } + } - /// - /// The CSS class of the icon to use for the node - /// - public string IconClass - { - get { return m_iconClass; } - set { m_iconClass = value; } - } + /// + /// The CSS class of the icon to use for the node + /// + public string IconClass + { + get { return m_iconClass; } + set { m_iconClass = value; } + } - /// - /// The JavaScript action for the node - /// - public string Action - { - get { return m_action; } - set { m_action = value; } - } + /// + /// The JavaScript action for the node + /// + public string Action + { + get { return m_action; } + set { m_action = value; } + } - /// - /// A string of letters representing actions for the context menu - /// - public List Menu - { - get { return m_menu; } - set { m_menu = value; } - } + /// + /// A string of letters representing actions for the context menu + /// + public List Menu + { + get { return m_menu; } + set { m_menu = value; } + } - /// - /// The xml source for the child nodes (a URL) - /// - public string Source - { - get { return m_src; } - set { m_src = value; } - } + /// + /// The xml source for the child nodes (a URL) + /// + public string Source + { + get { return m_src; } + set { m_src = value; } + } - /// - /// The path to the icon to display for the node - /// - public string Icon - { - get { return m_icon; } - set { m_icon = value; } - } + /// + /// The path to the icon to display for the node + /// + public string Icon + { + get { return m_icon; } + set { m_icon = value; } + } - /// - /// The path to the icon to display for the node if the node is showing it's children - /// - public string OpenIcon - { - get { return m_openIcon; } - set { m_openIcon = value; } - } + /// + /// The path to the icon to display for the node if the node is showing it's children + /// + public string OpenIcon + { + get { return m_openIcon; } + set { m_openIcon = value; } + } - /// - /// Normally just the type of tree being rendered. - /// This should really only be set with this property in very special cases - /// where the create task for a node in the same tree as another node is different. - /// - public string NodeType - { - get { return m_nodeType; } - set { m_nodeType = value; } - } + /// + /// Normally just the type of tree being rendered. + /// This should really only be set with this property in very special cases + /// where the create task for a node in the same tree as another node is different. + /// + public string NodeType + { + get { return m_nodeType; } + set { m_nodeType = value; } + } - /// - /// Used by the content tree and flagged as true if the node is not published - /// - [Obsolete("Use the XmlTreeNode.NodeStyle object to set node styles")] - public bool? NotPublished - { - get { return m_notPublished; } - set { m_notPublished = value; } - } + /// + /// Used by the content tree and flagged as true if the node is not published + /// + [Obsolete("Use the XmlTreeNode.NodeStyle object to set node styles")] + public bool? NotPublished + { + get { return m_notPublished; } + set { m_notPublished = value; } + } - /// - /// Used by the content tree and flagged as true if the node is protected - /// - [Obsolete("Use the XmlTreeNode.NodeStyle object to set node styles")] - public bool? IsProtected - { - get { return m_isProtected; } - set - { - m_isProtected = value; - if (m_isProtected.HasValue && m_isProtected.Value) - this.Style.SecureNode(); - } - } + /// + /// Used by the content tree and flagged as true if the node is protected + /// + [Obsolete("Use the XmlTreeNode.NodeStyle object to set node styles")] + public bool? IsProtected + { + get { return m_isProtected; } + set + { + m_isProtected = value; + if (m_isProtected.HasValue && m_isProtected.Value) + this.Style.SecureNode(); + } + } - /// - /// Returns the styling object used to add common styles to a node - /// - public NodeStyle Style - { - get { return m_nodeStyle; } - } + /// + /// Returns the styling object used to add common styles to a node + /// + public NodeStyle Style + { + get { return m_nodeStyle; } + } - /// - /// Used to add common styles to an XmlTreeNode. - /// This also adds the ability to add a custom class which will add the class to the li node - /// that is rendered in the tree whereas the IconClass property of the XmlTreeNode object - /// adds a class to the anchor of the li node. - /// - public sealed class NodeStyle - { - internal NodeStyle() - { - AppliedClasses = new List(); - } + /// + /// Used to add common styles to an XmlTreeNode. + /// This also adds the ability to add a custom class which will add the class to the li node + /// that is rendered in the tree whereas the IconClass property of the XmlTreeNode object + /// adds a class to the anchor of the li node. + /// + public sealed class NodeStyle + { + internal NodeStyle() + { + AppliedClasses = new List(); + } private const string DimNodeCssClass = "not-published"; private const string HighlightNodeCssClass = "has-unpublished-version"; private const string SecureNodeCssClass = "protected"; - internal List AppliedClasses { get; private set; } + internal List AppliedClasses { get; private set; } - /// - /// Dims the color of the node - /// - public void DimNode() - { - if (!AppliedClasses.Contains(DimNodeCssClass)) - AppliedClasses.Add(DimNodeCssClass); - } + /// + /// Dims the color of the node + /// + public void DimNode() + { + if (!AppliedClasses.Contains(DimNodeCssClass)) + AppliedClasses.Add(DimNodeCssClass); + } - /// - /// Adds the star icon highlight overlay to a node - /// - public void HighlightNode() - { - if (!AppliedClasses.Contains(HighlightNodeCssClass)) - AppliedClasses.Add(HighlightNodeCssClass); - } + /// + /// Adds the star icon highlight overlay to a node + /// + public void HighlightNode() + { + if (!AppliedClasses.Contains(HighlightNodeCssClass)) + AppliedClasses.Add(HighlightNodeCssClass); + } - /// - /// Adds the padlock icon overlay to a node - /// - public void SecureNode() - { + /// + /// Adds the padlock icon overlay to a node + /// + public void SecureNode() + { if (!AppliedClasses.Contains(SecureNodeCssClass)) AppliedClasses.Add(SecureNodeCssClass); - } + } - /// - /// Adds a custom class to the li node of the tree - /// - /// - public void AddCustom(string cssClass) - { - if (!AppliedClasses.Contains(cssClass)) - AppliedClasses.Add(cssClass); - } - } + /// + /// Adds a custom class to the li node of the tree + /// + /// + public void AddCustom(string cssClass) + { + if (!AppliedClasses.Contains(cssClass)) + AppliedClasses.Add(cssClass); + } + } - /// - /// Dims the color of the node - /// - /// - ///This adds the class to the existing icon class as to not override anything. - /// - [Obsolete("Use XmlTreeNode.Style to style nodes. Example: myNode.Style.DimNode();")] - public void DimNode() - { - this.Style.DimNode(); - } + /// + /// Dims the color of the node + /// + /// + ///This adds the class to the existing icon class as to not override anything. + /// + [Obsolete("Use XmlTreeNode.Style to style nodes. Example: myNode.Style.DimNode();")] + public void DimNode() + { + this.Style.DimNode(); + } - #region IXmlSerializable Members + #region IXmlSerializable Members - public XmlSchema GetSchema() - { - return null; - } + public XmlSchema GetSchema() + { + return null; + } - public void ReadXml(System.Xml.XmlReader reader) - { - if (reader.HasAttributes) - { - while (reader.MoveToNextAttribute()) - { - //try to parse the name into enum - TreeAttributes current; - try - { - current = (TreeAttributes)Enum.Parse(typeof(TreeAttributes), reader.Name, true); - } - catch - { - break; - } - switch (current) - { - case TreeAttributes.nodeID: - this.m_nodeID = reader.Value; - break; - case TreeAttributes.text: - this.m_text = reader.Value; - break; - case TreeAttributes.iconClass: - this.m_iconClass = reader.Value; - break; - case TreeAttributes.action: - this.m_action = reader.Value; - break; - case TreeAttributes.menu: - this.m_menu = (!string.IsNullOrEmpty(reader.Value) ? Umbraco.Web._Legacy.Actions.Action.FromString(reader.Value) : null); - break; - case TreeAttributes.rootSrc: - this.m_rootSrc = reader.Value; - break; - case TreeAttributes.src: - this.m_src = reader.Value; - break; - case TreeAttributes.icon: - this.m_icon = reader.Value; - break; - case TreeAttributes.openIcon: - this.m_openIcon = reader.Value; - break; - case TreeAttributes.nodeType: - this.m_nodeType = reader.Value; - break; - case TreeAttributes.notPublished: - if (!string.IsNullOrEmpty(reader.Value)) this.m_notPublished = bool.Parse(reader.Value); - break; - case TreeAttributes.isProtected: - if (!string.IsNullOrEmpty(reader.Value)) this.m_isProtected = bool.Parse(reader.Value); - break; - case TreeAttributes.hasChildren: - if (!string.IsNullOrEmpty(reader.Value)) this.HasChildren = bool.Parse(reader.Value); - break; - } - } + public void ReadXml(System.Xml.XmlReader reader) + { + if (reader.HasAttributes) + { + while (reader.MoveToNextAttribute()) + { + //try to parse the name into enum + TreeAttributes current; + try + { + current = (TreeAttributes)Enum.Parse(typeof(TreeAttributes), reader.Name, true); + } + catch + { + break; + } + switch (current) + { + case TreeAttributes.nodeID: + this.m_nodeID = reader.Value; + break; + case TreeAttributes.text: + this.m_text = reader.Value; + break; + case TreeAttributes.iconClass: + this.m_iconClass = reader.Value; + break; + case TreeAttributes.action: + this.m_action = reader.Value; + break; + case TreeAttributes.menu: + this.m_menu = (!string.IsNullOrEmpty(reader.Value) ? Umbraco.Web._Legacy.Actions.Action.FromString(reader.Value) : null); + break; + case TreeAttributes.rootSrc: + this.m_rootSrc = reader.Value; + break; + case TreeAttributes.src: + this.m_src = reader.Value; + break; + case TreeAttributes.icon: + this.m_icon = reader.Value; + break; + case TreeAttributes.openIcon: + this.m_openIcon = reader.Value; + break; + case TreeAttributes.nodeType: + this.m_nodeType = reader.Value; + break; + case TreeAttributes.notPublished: + if (!string.IsNullOrEmpty(reader.Value)) this.m_notPublished = bool.Parse(reader.Value); + break; + case TreeAttributes.isProtected: + if (!string.IsNullOrEmpty(reader.Value)) this.m_isProtected = bool.Parse(reader.Value); + break; + case TreeAttributes.hasChildren: + if (!string.IsNullOrEmpty(reader.Value)) this.HasChildren = bool.Parse(reader.Value); + break; + } + } //need to set the hasChildren property if it is null but there is a source //this happens when the hasChildren attribute is not set because the developer didn't know it was there //only occurs for ITree obviously if (!this.HasChildren && !string.IsNullOrEmpty(this.m_src)) this.HasChildren = true; - } + } - reader.Read(); - } + reader.Read(); + } - public void WriteXml(System.Xml.XmlWriter writer) - { - writer.WriteAttributeString(TreeAttributes.nodeID.ToString(), this.m_nodeID); - writer.WriteAttributeString(TreeAttributes.text.ToString(), this.m_text); - writer.WriteAttributeString(TreeAttributes.iconClass.ToString(), this.m_iconClass); - writer.WriteAttributeString(TreeAttributes.action.ToString(), this.m_action); - writer.WriteAttributeString(TreeAttributes.menu.ToString(), (this.m_menu != null && this.m_menu.Count > 0 ? Umbraco.Web._Legacy.Actions.Action.ToString(this.m_menu) : "")); - writer.WriteAttributeString(TreeAttributes.rootSrc.ToString(), this.m_rootSrc); - writer.WriteAttributeString(TreeAttributes.src.ToString(), this.m_src); - writer.WriteAttributeString(TreeAttributes.icon.ToString(), this.m_icon); - writer.WriteAttributeString(TreeAttributes.openIcon.ToString(), this.m_openIcon); - writer.WriteAttributeString(TreeAttributes.nodeType.ToString(), this.m_nodeType); - writer.WriteAttributeString(TreeAttributes.hasChildren.ToString(), HasChildren.ToString().ToLower()); - if (m_notPublished.HasValue) writer.WriteAttributeString(TreeAttributes.notPublished.ToString(), this.m_notPublished.Value.ToString().ToLower()); - if (m_isProtected.HasValue) writer.WriteAttributeString(TreeAttributes.isProtected.ToString(), this.m_isProtected.Value.ToString().ToLower()); - } + public void WriteXml(System.Xml.XmlWriter writer) + { + writer.WriteAttributeString(TreeAttributes.nodeID.ToString(), this.m_nodeID); + writer.WriteAttributeString(TreeAttributes.text.ToString(), this.m_text); + writer.WriteAttributeString(TreeAttributes.iconClass.ToString(), this.m_iconClass); + writer.WriteAttributeString(TreeAttributes.action.ToString(), this.m_action); + writer.WriteAttributeString(TreeAttributes.menu.ToString(), (this.m_menu != null && this.m_menu.Count > 0 ? Umbraco.Web._Legacy.Actions.Action.ToString(this.m_menu) : "")); + writer.WriteAttributeString(TreeAttributes.rootSrc.ToString(), this.m_rootSrc); + writer.WriteAttributeString(TreeAttributes.src.ToString(), this.m_src); + writer.WriteAttributeString(TreeAttributes.icon.ToString(), this.m_icon); + writer.WriteAttributeString(TreeAttributes.openIcon.ToString(), this.m_openIcon); + writer.WriteAttributeString(TreeAttributes.nodeType.ToString(), this.m_nodeType); + writer.WriteAttributeString(TreeAttributes.hasChildren.ToString(), HasChildren.ToString().ToLower()); + if (m_notPublished.HasValue) writer.WriteAttributeString(TreeAttributes.notPublished.ToString(), this.m_notPublished.Value.ToString().ToLower()); + if (m_isProtected.HasValue) writer.WriteAttributeString(TreeAttributes.isProtected.ToString(), this.m_isProtected.Value.ToString().ToLower()); + } - internal enum TreeAttributes - { - nodeID, text, iconClass, action, menu, rootSrc, src, icon, openIcon, nodeType, notPublished, isProtected, hasChildren - } + internal enum TreeAttributes + { + nodeID, text, iconClass, action, menu, rootSrc, src, icon, openIcon, nodeType, notPublished, isProtected, hasChildren + } - #endregion + #endregion - } + } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadPackager.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadPackager.cs index 6632bd9881..0d63d92678 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadPackager.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadPackager.cs @@ -20,7 +20,7 @@ namespace umbraco public loadPackager(string application) : base(application) { } protected override void CreateRootNode(ref XmlTreeNode rootNode) { - + } private int _id; @@ -66,7 +66,7 @@ namespace umbraco { Javascript.Append( @"function openPackageCategory(url) { - UmbClientMgr.contentFrame('developer/packages/' + url);}" + UmbClientMgr.contentFrame('developer/packages/' + url);}" ); } @@ -75,7 +75,7 @@ namespace umbraco /// /// The tree. public override void Render(ref XmlTree tree) - { + { string[,] items = { { "BrowseRepository.aspx", "Install from repository" }, { "CreatePackage.aspx", "Created Packages" }, { "installedPackages.aspx", "Installed packages" }, { "StarterKits.aspx", "Starter kit" }, { "installer.aspx", "Install local package" } }; @@ -86,17 +86,17 @@ namespace umbraco xNode.Text = items[i, 1]; xNode.Icon = "icon-folder"; xNode.OpenIcon = "icon-folder"; - - + + //Make sure the different sections load the correct childnodes. switch (items[i, 0]) { case "installedPackages.aspx": - + if (cms.businesslogic.packager.InstalledPackage.GetAllInstalledPackages().Count > 0) { xNode.Source = "tree.aspx?app=" + this._app + "&id=" + this._id + "&treeType=packagerPackages&packageType=installed" + "&rnd=" + Guid.NewGuid(); - xNode.NodeType = "installedPackages"; + xNode.NodeType = "installedPackages"; xNode.Text = Services.TextService.Localize("treeHeaders/installedPackages"); xNode.HasChildren = true; } @@ -115,14 +115,14 @@ namespace umbraco /* //Gets all the repositories registered in umbracoSettings.config var repos = cms.businesslogic.packager.repositories.Repository.getAll(); - + //if more then one repo, then list them as child nodes under the "Install from repository" node. // the repositories will then be fetched from the loadPackages class. if (repos.Count > 1) { xNode.Source = "tree.aspx?app=" + this._app + "&id=" + this._id + "&treeType=packagerPackages&packageType=repositories" + "&rnd=" + Guid.NewGuid(); - xNode.NodeType = "packagesRepositories"; + xNode.NodeType = "packagesRepositories"; xNode.Text = Services.TextService.Localize("treeHeaders/repositories"); xNode.HasChildren = true; } @@ -130,7 +130,7 @@ namespace umbraco //if only one repo, then just list it directly and name it as the repository. //the packages will be loaded from the loadPackages class with a repoAlias querystring var repos = cms.businesslogic.packager.repositories.Repository.getAll(); - + xNode.Text = repos[0].Name; xNode.Source = "tree.aspx?app=" + this._app + "&id=" + this._id + "&treeType=packagerPackages&packageType=repository&repoGuid=" + repos[0].Guid + "&rnd=" + Guid.NewGuid(); xNode.NodeType = "packagesRepository"; @@ -144,13 +144,13 @@ namespace umbraco case "CreatePackage.aspx": xNode.Source = "tree.aspx?app=" + this._app + "&id=" + this._id + "&treeType=packagerPackages&packageType=created" + "&rnd=" + Guid.NewGuid(); xNode.NodeType = "createdPackages"; - xNode.Menu.Clear(); + xNode.Menu.Clear(); xNode.Menu.Add(ActionNew.Instance); xNode.Menu.Add(ActionRefresh.Instance); xNode.Text = Services.TextService.Localize("treeHeaders/createdPackages"); xNode.HasChildren = true; xNode.Action = "javascript:void(0);"; - + break; case "installer.aspx": @@ -183,5 +183,5 @@ namespace umbraco } #endregion - + } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadPackages.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadPackages.cs index c80a66b533..34da2e35c5 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadPackages.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadPackages.cs @@ -21,12 +21,12 @@ namespace umbraco public const string PACKAGE_TREE_PREFIX = "package_"; public loadPackages(string application) : base(application) { } - + protected override void CreateRootNode(ref XmlTreeNode rootNode) { - + } - + private int _id; private string _app; private string _packageType = ""; @@ -36,10 +36,10 @@ namespace umbraco { Javascript.Append(@" function openCreatedPackage(id) { - UmbClientMgr.contentFrame('developer/packages/editPackage.aspx?id=' + id); + UmbClientMgr.contentFrame('developer/packages/editPackage.aspx?id=' + id); } function openInstalledPackage(id) { - UmbClientMgr.contentFrame('developer/packages/installedPackage.aspx?id=' + id); + UmbClientMgr.contentFrame('developer/packages/installedPackage.aspx?id=' + id); } "); } @@ -53,7 +53,7 @@ namespace umbraco { _packageType = HttpContext.Current.Request.QueryString["packageType"]; - + switch (_packageType) { case "installed": @@ -107,7 +107,7 @@ namespace umbraco xNode.Menu.Add( ActionRefresh.Instance ); xNode.Source = "tree.aspx?app=" + this._app + "&id=" + this._id + "&treeType=packagerPackages&packageType=repository&repoGuid=" + repo.Guid + "&rnd=" + Guid.NewGuid(); tree.Add(xNode); - + } break; @@ -115,7 +115,7 @@ namespace umbraco _repoGuid = HttpContext.Current.Request.QueryString["repoGuid"]; Umbraco.Web.org.umbraco.our.Repository r = new Umbraco.Web.org.umbraco.our.Repository(); - + foreach (var cat in r.Categories(_repoGuid)) { XmlTreeNode xNode = XmlTreeNode.Create(this); @@ -124,17 +124,17 @@ namespace umbraco xNode.Action = "javascript:openPackageCategory('BrowseRepository.aspx?category=" + cat.Id + "&repoGuid=" + _repoGuid + "');"; xNode.Icon = "icon-folder"; xNode.OpenIcon = "icon-folder"; - xNode.NodeType = "packagesCategory" + cat.Id; + xNode.NodeType = "packagesCategory" + cat.Id; tree.Add(xNode); - + } - + break; } } - + } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadTranslationTasks.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadTranslationTasks.cs index 72c5631498..755fa53555 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadTranslationTasks.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadTranslationTasks.cs @@ -26,12 +26,12 @@ namespace umbraco { public override void RenderJS(ref StringBuilder Javascript) { Javascript.Append(@" function openTranslationTask(id) { - UmbClientMgr.contentFrame('translation/details.aspx?id=' + id); + UmbClientMgr.contentFrame('translation/details.aspx?id=' + id); } function openTranslationOverview(id, mode) { - UmbClientMgr.contentFrame('translation/default.aspx?id=' + id + '&mode=' + mode); + UmbClientMgr.contentFrame('translation/default.aspx?id=' + id + '&mode=' + mode); } - "); + "); } private IUser CurrentUser() @@ -41,7 +41,7 @@ namespace umbraco { public override void Render(ref XmlTree tree) { foreach (Task t in Task.GetTasks(CurrentUser(), false)) { - + if (t.Type.Alias == "toTranslate") { XmlTreeNode xNode = XmlTreeNode.Create(this); xNode.Menu.Clear(); @@ -58,11 +58,11 @@ namespace umbraco { tree.Add(xNode); OnAfterNodeRender(ref tree, ref xNode, EventArgs.Empty); } - + } } - } + } } public class loadYourTasks : BaseTree { @@ -82,7 +82,7 @@ namespace umbraco { public override void RenderJS(ref StringBuilder Javascript) { Javascript.Append(@" function openTranslationTask(id) { - UmbClientMgr.contentFrame('translation/details.aspx?id=' + id); + UmbClientMgr.contentFrame('translation/details.aspx?id=' + id); }"); } @@ -109,12 +109,12 @@ namespace umbraco { tree.Add(xNode); OnAfterNodeRender(ref tree, ref xNode, EventArgs.Empty); } - + } } } } - + } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/Web/UI/ContentPage.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/Web/UI/ContentPage.cs index 8e6ef481ca..11408fa572 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/Web/UI/ContentPage.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/Web/UI/ContentPage.cs @@ -1,25 +1,25 @@ -using System; +using System; namespace umbraco.presentation.Web.UI { - /// - /// Summary description for ContentPage. - /// - public class ContentPage : System.Web.UI.Page - { - private int _id = 0; + /// + /// Summary description for ContentPage. + /// + public class ContentPage : System.Web.UI.Page + { + private int _id = 0; - public int UmbracoNodeId - { - set - { - _id = value; - System.Web.HttpContext.Current.Items["pageID"] = _id; - } - get {return _id;} - } - public ContentPage() - { - } - } + public int UmbracoNodeId + { + set + { + _id = value; + System.Web.HttpContext.Current.Items["pageID"] = _id; + } + get {return _id;} + } + public ContentPage() + { + } + } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/actions/delete.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/actions/delete.aspx.cs index 9853b143d3..50588775cc 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/actions/delete.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/actions/delete.aspx.cs @@ -1,4 +1,4 @@ -using System; +using System; using Umbraco.Core; using Umbraco.Core.Models; using Umbraco.Core.Services; @@ -20,7 +20,7 @@ namespace umbraco.presentation.actions throw new ArgumentException("The current user doesn't have access to this application. Please contact the system administrator."); if (Security.ValidateUserNodeTreePermissions(Security.CurrentUser, c.Path, "D") == false) throw new ArgumentException("The current user doesn't have permissions to delete this document. Please contact the system administrator."); - + pane_delete.Text = Services.TextService.Localize("delete") + " '" + c.Name + "'"; Panel2.Text = Services.TextService.Localize("delete"); warning.Text = Services.TextService.Localize("confirmdelete") + " '" + c.Name + "'"; @@ -33,7 +33,7 @@ namespace umbraco.presentation.actions deleted.Text = "'" + c.Name + "' " + Services.TextService.Localize("deleted"); deleteMessage.Visible = true; confirm.Visible = false; - + Current.Services.ContentService.Delete(c); } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/actions/delete.aspx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/actions/delete.aspx.designer.cs index 9eb36c9422..9eaec05d7e 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/actions/delete.aspx.designer.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/actions/delete.aspx.designer.cs @@ -1,4 +1,4 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:2.0.50727.3053 @@ -9,10 +9,10 @@ //------------------------------------------------------------------------------ namespace umbraco.presentation.actions { - - + + public partial class delete { - + /// /// Panel2 control. /// @@ -21,7 +21,7 @@ namespace umbraco.presentation.actions { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.UmbracoPanel Panel2; - + /// /// confirm control. /// @@ -30,7 +30,7 @@ namespace umbraco.presentation.actions { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Panel confirm; - + /// /// pane_delete control. /// @@ -39,7 +39,7 @@ namespace umbraco.presentation.actions { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.Pane pane_delete; - + /// /// warning control. /// @@ -48,7 +48,7 @@ namespace umbraco.presentation.actions { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Literal warning; - + /// /// deleteButton control. /// @@ -57,7 +57,7 @@ namespace umbraco.presentation.actions { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Button deleteButton; - + /// /// deleteMessage control. /// @@ -66,7 +66,7 @@ namespace umbraco.presentation.actions { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.Pane deleteMessage; - + /// /// deleted control. /// diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/actions/editContent.aspx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/actions/editContent.aspx.designer.cs index aa2fe0e152..ae6deb3ac0 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/actions/editContent.aspx.designer.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/actions/editContent.aspx.designer.cs @@ -1,4 +1,4 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:2.0.50727.312 @@ -9,8 +9,8 @@ //------------------------------------------------------------------------------ namespace umbraco.presentation.actions { - - + + /// /// editContent class. /// @@ -18,7 +18,7 @@ namespace umbraco.presentation.actions { /// Auto-generated class. /// public partial class editContent { - + /// /// form1 control. /// diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/actions/preview.aspx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/actions/preview.aspx.designer.cs index ae110b81ed..b9e434581a 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/actions/preview.aspx.designer.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/actions/preview.aspx.designer.cs @@ -1,4 +1,4 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:2.0.50727.832 @@ -9,8 +9,8 @@ //------------------------------------------------------------------------------ namespace umbraco.presentation.actions { - - + + /// /// preview class. /// @@ -18,7 +18,7 @@ namespace umbraco.presentation.actions { /// Auto-generated class. /// public partial class preview { - + /// /// form1 control. /// diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/actions/publish.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/actions/publish.aspx.cs index 08ef45dd73..41c5a54cb5 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/actions/publish.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/actions/publish.aspx.cs @@ -1,4 +1,4 @@ -//TODO: REbuild this in angular and new apis then remove this +//TODO: REbuild this in angular and new apis then remove this //using System; //using System.Data; @@ -30,7 +30,7 @@ // if (!base.ValidateUserNodeTreePermissions(d.Path, "U")) // throw new ArgumentException("The current user doesn't have permissions to publish this document. Please contact the system administrator."); - + // pane_publish.Text = Services.TextService.Localize("publish") + " '" + d.Text + "'"; // Panel2.Text = Services.TextService.Localize("publish"); // warning.Text = Services.TextService.Localize("publish") + " '" + d.Text + "'. " + Services.TextService.Localize("areyousure"); @@ -53,7 +53,7 @@ // { // deleted.Text = "
" + GetMessageForStatus(result.Result) + "
"; // } - + // } // private string GetMessageForStatus(PublishStatus status) diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/actions/publish.aspx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/actions/publish.aspx.designer.cs index cf98a16379..70914fb668 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/actions/publish.aspx.designer.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/actions/publish.aspx.designer.cs @@ -1,4 +1,4 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:2.0.50727.3053 @@ -9,10 +9,10 @@ //------------------------------------------------------------------------------ namespace umbraco.presentation.actions { - - + + public partial class publish { - + /// /// Panel2 control. /// @@ -21,7 +21,7 @@ namespace umbraco.presentation.actions { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.UmbracoPanel Panel2; - + /// /// confirm control. /// @@ -30,7 +30,7 @@ namespace umbraco.presentation.actions { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Panel confirm; - + /// /// pane_publish control. /// @@ -39,7 +39,7 @@ namespace umbraco.presentation.actions { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.Pane pane_publish; - + /// /// warning control. /// @@ -48,7 +48,7 @@ namespace umbraco.presentation.actions { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Literal warning; - + /// /// deleteButton control. /// @@ -57,7 +57,7 @@ namespace umbraco.presentation.actions { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Button deleteButton; - + /// /// deleteMessage control. /// @@ -66,7 +66,7 @@ namespace umbraco.presentation.actions { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.Pane deleteMessage; - + /// /// deleted control. /// diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentControl.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentControl.cs index 68f68354fb..2619747074 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentControl.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentControl.cs @@ -1,4 +1,4 @@ -//TODO: This needs a full rewrite in angular! kept here for reference for now +//TODO: This needs a full rewrite in angular! kept here for reference for now //using System; //using System.Collections; @@ -62,7 +62,7 @@ // } // /// -// /// This property controls whether the content property values are persisted even if validation +// /// This property controls whether the content property values are persisted even if validation // /// fails. If set to false, then the values will not be persisted. // /// // /// @@ -281,7 +281,7 @@ // string[] errorVars = { Services.TextService.Localize("name") }; // NameTxtValidator.ErrorMessage = " " + ui.Text("errorHandling", "errorMandatoryWithoutTab", errorVars) + "
"; // NameTxtValidator.EnableClientScript = false; -// NameTxtValidator.Display = ValidatorDisplay.Dynamic; +// NameTxtValidator.Display = ValidatorDisplay.Dynamic; // _nameTxtCustomValidator.EnableClientScript = false; // _nameTxtCustomValidator.Display = ValidatorDisplay.Dynamic; // _nameTxtCustomValidator.ServerValidate += NameTxtCustomValidatorServerValidate; @@ -322,7 +322,7 @@ // /// // /// We need to ensure people are not entering XSS attacks on this field // /// http://issues.umbraco.org/issue/U4-485 -// /// +// /// // /// This doesn't actually 'validate' but changes the text field value and strips html // /// // void NameTxtCustomValidatorServerValidate(object source, ServerValidateEventArgs args) @@ -344,7 +344,7 @@ // ///
// private void SetNameAndDataTypeValues() // { -// //we only continue saving anything if: +// //we only continue saving anything if: // // SavePropertyDataWhenInvalid == true // // OR if the page is actually valid. // if (SavePropertyDataWhenInvalid || Page.IsValid) @@ -391,7 +391,7 @@ // if (SaveAndPublish != null) // { -// SaveAndPublish(this, new EventArgs()); +// SaveAndPublish(this, new EventArgs()); // } // } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentPicker.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentPicker.cs index 81deeadbcf..dce71e35fb 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentPicker.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentPicker.cs @@ -1,4 +1,4 @@ -using System; +using System; using Umbraco.Web._Legacy.Controls; using Umbraco.Core; using Umbraco.Core.Services; @@ -9,7 +9,7 @@ namespace umbraco.controls { public class ContentPicker : BaseTreePicker - { + { public ContentPicker() { @@ -17,18 +17,18 @@ namespace umbraco.controls TreeAlias = "content"; } - [Obsolete("Use Value property instead, this simply wraps it.")] - public string Text - { - get - { + [Obsolete("Use Value property instead, this simply wraps it.")] + public string Text + { + get + { return this.Value; - } + } set { this.Value = value; } - } + } public string AppAlias { get; set; } public string TreeAlias { get; set; } @@ -68,5 +68,5 @@ namespace umbraco.controls catch { } return tempTitle; } - } + } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentTypeControl.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentTypeControl.cs index 8d76ce98fc..fde87a7646 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentTypeControl.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentTypeControl.cs @@ -1,4 +1,4 @@ -//TODO: This needs a full rewrite in angular! kept here for reference for now +//TODO: This needs a full rewrite in angular! kept here for reference for now //using System; //using System.Web.UI.HtmlControls; @@ -14,7 +14,7 @@ // /// // /// Summary description for ContentTypeControl. // /// -// [Obsolete("No longer used, will be removed in v8")] +// [Obsolete("No longer used, will be removed in v8")] // [EditorBrowsable(EditorBrowsableState.Never)] // public class ContentTypeControl : Umbraco.Web._Legacy.Controls.TabView // { @@ -58,7 +58,7 @@ // Save.Click += new System.Web.UI.ImageClickEventHandler(save_click); // Save.ID = "Panel1Save"; // Save.ImageUrl = UmbracoPath + "/images/editor/save.gif"; - + // Panel2 = this.NewTabPage("Faneblade"); // Save = Panel2.Menu.NewImageButton(); @@ -72,7 +72,7 @@ // Save.ID = "Panel3Save"; // Save.Click += new System.Web.UI.ImageClickEventHandler(save_click); // Save.ImageUrl = UmbracoPath + "/images/editor/save.gif"; - + // Panel4 = this.NewTabPage("Generiske egenskaber"); // Save = Panel4.Menu.NewImageButton(); // Save.ID = "Panel4Save"; @@ -99,12 +99,12 @@ // br = new HtmlGenericControl(); // br.TagName = "br"; // Panel4.Controls.Add(br); - + // } -// protected void tmp_OnSave(object sender, System.EventArgs e) +// protected void tmp_OnSave(object sender, System.EventArgs e) // { - + // } // protected override void OnLoad(EventArgs e) @@ -124,15 +124,15 @@ // AllowedContentTypes = new ListBox(); // AllowedContentTypes.ID = "AllowedContentTypes"; // AllowedContentTypes.SelectionMode = ListSelectionMode.Multiple; - + // int[] allowedIds = docType.AllowedChildContentTypeIDs; -// foreach (cms.businesslogic.ContentType ct in docType.GetAll()) +// foreach (cms.businesslogic.ContentType ct in docType.GetAll()) // { // ListItem li = new ListItem(ct.Text,ct.Id.ToString()); // AllowedContentTypes.Items.Add(li); -// if (!Page.IsPostBack) +// if (!Page.IsPostBack) // {foreach (int i in allowedIds) if (i == ct.Id) li.Selected= true;} // } @@ -141,9 +141,9 @@ // Panel3.Controls.Add(pp); // } - -// public void save_click(object sender, System.Web.UI.ImageClickEventArgs e) + +// public void save_click(object sender, System.Web.UI.ImageClickEventArgs e) // { // OnSave(this, new System.EventArgs()); // docType.Text = NameTxt.Text; @@ -152,7 +152,7 @@ // string xtra = ""; -// if (TabTxt.Text.Trim() != "") +// if (TabTxt.Text.Trim() != "") // { // docType.AddVirtualTab(TabTxt.Text); // xtra = Services.TextService.Localize("speechBubbles/contentTypeTabCreated"); @@ -171,7 +171,7 @@ // private void SaveAllowedChildTypes() { // ArrayList tmp = new ArrayList(); -// foreach (ListItem li in AllowedContentTypes.Items) +// foreach (ListItem li in AllowedContentTypes.Items) // { // if (li.Selected) // tmp.Add(int.Parse(li.Value)); @@ -181,27 +181,27 @@ // docType.AllowedChildContentTypeIDs = ids; // } -// private void setupGeneralInfoTab() +// private void setupGeneralInfoTab() // { // Umbraco.Web._Legacy.Controls.Pane pp = new Umbraco.Web._Legacy.Controls.Pane(); - + // DirectoryInfo dirInfo = new DirectoryInfo( IOHelper.MapPath(SystemDirectories.Umbraco + "/images/umbraco")); // FileInfo[] fileInfo = dirInfo.GetFiles(); - -// for(int i = 0; i < fileInfo.Length;i++) + +// for(int i = 0; i < fileInfo.Length;i++) // { // ListItem li = new ListItem(fileInfo[i].Name); // if (!this.Page.IsPostBack && li.Value == docType.IconUrl) li.Selected = true; // IconDDL.Items.Add(li); // } -// if (!this.Page.IsPostBack) +// if (!this.Page.IsPostBack) // { // NameTxt.Text = docType.Text; // AliasTxt.Text = docType.Alias; // } - + // pp.addProperty("Navn",NameTxt); // pp.addProperty("Alias",AliasTxt); // pp.addProperty("Ikon",IconDDL); @@ -217,24 +217,24 @@ // #region "Generic properties" -// private void setupGenericPropertyTypesTab() +// private void setupGenericPropertyTypesTab() // { // // Add new generic propertytype // pp = new Umbraco.Web._Legacy.Controls.Pane(); - + // AddPropertyTypeCtrl = new NodeTypeAddPropertyTypeControl(docType,this); -// pp.addProperty(AddPropertyTypeCtrl); -// Panel4.Controls.Add(pp); +// pp.addProperty(AddPropertyTypeCtrl); +// Panel4.Controls.Add(pp); // tabDDLs.Add(AddPropertyTypeCtrl.TabDDL); // br = new HtmlGenericControl(); // br.TagName = "br"; // Panel4.Controls.Add(br); -// loadGenericPropertyTypesOnPane(); +// loadGenericPropertyTypesOnPane(); // } -// private void loadGenericPropertyTypesOnPane() +// private void loadGenericPropertyTypesOnPane() // { // // View/ Edit all propertytypes.. // GenericPropertyTypes = new Umbraco.Web._Legacy.Controls.Pane(); @@ -248,7 +248,7 @@ // #region "Tabs Add Delete Update DDL's" -// private void setupTabTab() +// private void setupTabTab() // { // pp = new Umbraco.Web._Legacy.Controls.Pane(); // pp.addProperty("Ny tab", TabTxt); @@ -258,14 +258,14 @@ // br.TagName = "br"; // Panel2.Controls.Add(br); - + // LoadExistingTabsOnTabsPane(); - - + + // } -// private void LoadExistingTabsOnTabsPane() +// private void LoadExistingTabsOnTabsPane() // { // Umbraco.Web._Legacy.Controls.Pane TabsPane = new Umbraco.Web._Legacy.Controls.Pane(); // foreach (cms.businesslogic.ContentType.TabI t in docType.getVirtualTabs.ToList()) @@ -278,30 +278,30 @@ // } // Panel2.Controls.Add(TabsPane); // } - - -// private void deleteTab(object sender, System.EventArgs e) + + +// private void deleteTab(object sender, System.EventArgs e) // { // Button b = (Button) sender; // docType.DeleteVirtualTab(int.Parse(b.ID.Replace("tab",""))); // TabsPane.Controls.Clear(); // LoadExistingTabsOnTabsPane(); - + // populateTabDDLs(); // prnt.ClientTools.ShowSpeechBubble(BasePages.BasePage.speechBubbleIcon.info, Services.TextService.Localize("speechBubbles/contentTypeTabDeleted"), ui.Text("speechBubbles", "contentTypeTabDeletedText", b.ID)); // } -// private void populateTabDDLs() +// private void populateTabDDLs() // { -// foreach (DropDownList ddl in tabDDLs) +// foreach (DropDownList ddl in tabDDLs) // { // string selVal = "0"; // if(ddl.SelectedIndex >= 0) selVal = ddl.SelectedValue; // ddl.Items.Clear(); -// foreach (cms.businesslogic.web.DocumentType.TabI t in docType.getVirtualTabs.ToList()) +// foreach (cms.businesslogic.web.DocumentType.TabI t in docType.getVirtualTabs.ToList()) // { // ListItem li = new ListItem(); // li.Text = t.Caption; @@ -309,7 +309,7 @@ // ddl.Items.Add(li); // } // ddl.Items.Add(new ListItem("Egenskaber","0")); -// try +// try // { // ddl.SelectedValue = selVal; // } @@ -322,9 +322,9 @@ // #endregion - + // #region "Custom controls" -// private class NodeTypeAddPropertyTypeControl : System.Web.UI.HtmlControls.HtmlTable +// private class NodeTypeAddPropertyTypeControl : System.Web.UI.HtmlControls.HtmlTable // { // private TextBox NameTxt = new TextBox(); // private TextBox AliasTxt = new TextBox(); @@ -332,7 +332,7 @@ // public DropDownList TabDDL = new DropDownList(); // private cms.businesslogic.ContentType _dt; // private ContentTypeControl ctctrl; -// public NodeTypeAddPropertyTypeControl(cms.businesslogic.ContentType dt, ContentTypeControl parent) +// public NodeTypeAddPropertyTypeControl(cms.businesslogic.ContentType dt, ContentTypeControl parent) // { // ctctrl = parent; // this.Attributes.Add("width","100%"); @@ -377,7 +377,7 @@ // td = new HtmlTableCell(); // Button btn = new Button(); - + // td.Controls.Add(btn); // btn.Text = "Opret"; // tr.Cells.Add(td); @@ -387,7 +387,7 @@ // btn.Click += new System.EventHandler(this.AddPropertyType); -// foreach (cms.businesslogic.ContentType.TabI t in dt.getVirtualTabs.ToList()) +// foreach (cms.businesslogic.ContentType.TabI t in dt.getVirtualTabs.ToList()) // { // ListItem li = new ListItem(); // li.Value = t.Id.ToString(); @@ -398,8 +398,8 @@ // lie.Text = "Egenskaber"; // lie.Value = "0"; // TabDDL.Items.Add(lie); - -// foreach(cms.businesslogic.datatype.DataTypeDefinition DataType in cms.businesslogic.datatype.DataTypeDefinition.GetAll()) + +// foreach(cms.businesslogic.datatype.DataTypeDefinition DataType in cms.businesslogic.datatype.DataTypeDefinition.GetAll()) // { // ListItem li = new ListItem(); // li.Value = DataType.Id.ToString(); @@ -410,16 +410,16 @@ // } -// private void AddPropertyType(object sender, System.EventArgs e) +// private void AddPropertyType(object sender, System.EventArgs e) // { - -// if (NameTxt.Text.Trim() != "" && AliasTxt.Text.Trim() != "") + +// if (NameTxt.Text.Trim() != "" && AliasTxt.Text.Trim() != "") // { // string[] info = {NameTxt.Text, DataTypeDDL.SelectedItem.Value}; // ctctrl.prnt.ClientTools.ShowSpeechBubble(BasePages.BasePage.speechBubbleIcon.info, Services.TextService.Localize("speechBubbles/contentTypePropertyTypeCreated"), ui.Text("speechBubbles", "contentTypePropertyTypeCreatedText", info)); // _dt.AddPropertyType(cms.businesslogic.datatype.DataTypeDefinition.GetDataTypeDefinition(int.Parse(DataTypeDDL.SelectedValue)),AliasTxt.Text,NameTxt.Text); - -// if (int.Parse(TabDDL.SelectedValue) != 0) + +// if (int.Parse(TabDDL.SelectedValue) != 0) // { // _dt.SetTabOnPropertyType(_dt.getPropertyType(AliasTxt.Text),int.Parse(TabDDL.SelectedValue)); // } @@ -429,10 +429,10 @@ // AliasTxt.Text = ""; // // fire event to tell that a new propertytype is created!! // ctctrl.OnPropertyTypeCreate(this, new System.EventArgs()); -// } +// } // else // { - + // ctctrl.prnt.ClientTools.ShowSpeechBubble(BasePages.BasePage.speechBubbleIcon.error, Services.TextService.Localize("error"), Services.TextService.Localize("errors/contentTypeAliasAndNameNotNull")); // } // } @@ -443,7 +443,7 @@ // { // private System.Collections.ArrayList PropertyTypes = new System.Collections.ArrayList(); // private ContentTypeControl prnt; -// public NodeTypeEditorControl(ContentTypeControl parent) +// public NodeTypeEditorControl(ContentTypeControl parent) // { // prnt = parent; // this.Attributes.Add("width","100%"); @@ -468,58 +468,58 @@ // tr.Cells.Add(td); // this.Rows.Add(tr); - -// cms.businesslogic.ContentType.TabI[] tbs = prnt.docType.getVirtualTabs; - -// foreach (cms.businesslogic.propertytype.PropertyType pt in prnt.docType.PropertyTypes) +// cms.businesslogic.ContentType.TabI[] tbs = prnt.docType.getVirtualTabs; + + +// foreach (cms.businesslogic.propertytype.PropertyType pt in prnt.docType.PropertyTypes) // { // editor e = new editor(pt,prnt); // PropertyTypes.Add(e); // this.Controls.Add(e); // } - + // } -// public string Save() +// public string Save() // { - -// foreach (editor e in PropertyTypes) + +// foreach (editor e in PropertyTypes) // { // e.save(); // } -// return "2 egenskabstyper ndret"; +// return "2 egenskabstyper �ndret"; // } - -// private class editor : System.Web.UI.HtmlControls.HtmlTableRow + +// private class editor : System.Web.UI.HtmlControls.HtmlTableRow // { // private DropDownList TabDDL = new DropDownList(); // private cms.businesslogic.propertytype.PropertyType pt; // ContentTypeControl ent; -// public editor(cms.businesslogic.propertytype.PropertyType pt,ContentTypeControl parent) +// public editor(cms.businesslogic.propertytype.PropertyType pt,ContentTypeControl parent) // { -// this.pt = pt; +// this.pt = pt; // ent = parent; // } // protected override void OnLoad(EventArgs e) // { // base.OnLoad (e); - - + + // ent.tabDDLs.Add(TabDDL); -// foreach (cms.businesslogic.ContentType.TabI t in ent.docType.getVirtualTabs.ToList()) +// foreach (cms.businesslogic.ContentType.TabI t in ent.docType.getVirtualTabs.ToList()) // TabDDL.Items.Add(new ListItem(t.Caption,t.Id.ToString())); // TabDDL.Items.Add(new ListItem("Egenskaber","0")); -// if (!Parent.Page.IsPostBack) +// if (!Parent.Page.IsPostBack) // { // int tabID = cms.businesslogic.ContentType.getTabIdFromPropertyType(pt); // TabDDL.SelectedValue = tabID.ToString(); // } - + // HtmlTableCell td = new HtmlTableCell(); // td.InnerText = pt.Alias; @@ -542,17 +542,17 @@ // btn.Text = "Slet"; // btn.ID = "propertytype" + pt.Id; // btn.Click += new EventHandler(deletepropertytype_click); - + // td.Controls.Add(btn); // this.Cells.Add(td); // } -// public void deletepropertytype_click(object sender, System.EventArgs e) +// public void deletepropertytype_click(object sender, System.EventArgs e) // { // Button s = (Button) sender; // int propertytypeId = int.Parse(s.ID.Replace("propertytype","")); // cms.businesslogic.propertytype.PropertyType.GetPropertyType(propertytypeId).delete(); - + // ent.GenericPropertyTypes.Controls.Clear(); // ent.loadGenericPropertyTypesOnPane(); @@ -561,12 +561,12 @@ // ent.OnPropertyTypeDelete(this, new System.EventArgs()); // } -// public void save() +// public void save() // { // if (int.Parse(TabDDL.SelectedValue) > 0) // { // ent.docType.SetTabOnPropertyType(pt,int.Parse(TabDDL.SelectedValue)); -// } +// } // else // { // ent.docType.removePropertyTypeFromTab(pt); diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ProgressBar.ascx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ProgressBar.ascx.cs index 86a90b692d..9c39639785 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ProgressBar.ascx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ProgressBar.ascx.cs @@ -7,17 +7,17 @@ using System.Web.UI.WebControls; namespace umbraco.presentation.umbraco.controls { - public partial class ProgressBar : System.Web.UI.UserControl - { - protected override void OnInit(EventArgs e) - { - base.OnInit(e); - EnableViewState = false; - } + public partial class ProgressBar : System.Web.UI.UserControl + { + protected override void OnInit(EventArgs e) + { + base.OnInit(e); + EnableViewState = false; + } - protected void Page_Load(object sender, EventArgs e) - { - DataBind(); - } - } -} \ No newline at end of file + protected void Page_Load(object sender, EventArgs e) + { + DataBind(); + } + } +} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ProgressBar.ascx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ProgressBar.ascx.designer.cs index 8c20442522..8c9893a1d6 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ProgressBar.ascx.designer.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ProgressBar.ascx.designer.cs @@ -3,13 +3,13 @@ // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace umbraco.presentation.umbraco.controls { - - + + public partial class ProgressBar { } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/CustomTreeControl.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/CustomTreeControl.cs index 11016e1830..a3f80a70c6 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/CustomTreeControl.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/CustomTreeControl.cs @@ -83,7 +83,7 @@ namespace umbraco.controls.Tree writer.Write(@" "); @@ -126,4 +126,4 @@ jQuery(document).ready(function() { TreeContainer.RenderControl(writer); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/CustomTreeService.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/CustomTreeService.cs index 549b678481..70b08fbf0f 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/CustomTreeService.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/CustomTreeService.cs @@ -61,7 +61,7 @@ namespace umbraco.controls.Tree /// /// Returns a key/value object with: json, app, js as the keys - /// + ///
/// [WebMethod] [ScriptMethod(ResponseFormat = ResponseFormat.Json)] @@ -85,14 +85,14 @@ namespace umbraco.controls.Tree if (string.IsNullOrEmpty(treeType)) { - //if there's not tree type specified, then render out the tree as per normal with the normal + //if there's not tree type specified, then render out the tree as per normal with the normal //way of doing things returnVal.Add("json", treeCtl.GetJSONInitNode()); } else { //since 4.5.1 has a bug in it, it ignores if the treeType is specified and will always only render - //the whole APP not just a specific tree. + //the whole APP not just a specific tree. //this is a work around for this bug until it is fixed (which should be fixed in 4.5.2 //get the tree that we need to render @@ -137,7 +137,7 @@ namespace umbraco.controls.Tree var identity = Context.GetCurrentIdentity( //DO NOT AUTO-AUTH UNLESS THE CURRENT HANDLER IS WEBFORMS! // Without this check, anything that is using this legacy API, like ui.Text will - // automatically log the back office user in even if it is a front-end request (if there is + // automatically log the back office user in even if it is a front-end request (if there is // a back office user logged in. This can cause problems becaues the identity is changing mid // request. For example: http://issues.umbraco.org/issue/U4-4010 HttpContext.Current.CurrentHandler is Page); @@ -149,4 +149,4 @@ namespace umbraco.controls.Tree return false; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/JTreeContextMenu.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/JTreeContextMenu.cs index 8e02b862c1..2b5ca28511 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/JTreeContextMenu.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/JTreeContextMenu.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Web.Script.Serialization; using Umbraco.Core.Logging; @@ -10,21 +10,21 @@ using Action = Umbraco.Web._Legacy.Actions.Action; namespace umbraco.controls.Tree { - internal class JTreeContextMenu - { - public string RenderJSONMenu() - { + internal class JTreeContextMenu + { + public string RenderJSONMenu() + { - JavaScriptSerializer jSSerializer = new JavaScriptSerializer(); + JavaScriptSerializer jSSerializer = new JavaScriptSerializer(); - jSSerializer.RegisterConverters(new List() - { - new JTreeContextMenuItem() - }); - - List allActions = new List(); - foreach (var a in Current.Actions) - { + jSSerializer.RegisterConverters(new List() + { + new JTreeContextMenuItem() + }); + + List allActions = new List(); + foreach (var a in Current.Actions) + { // NH: Added a try/catch block to this as an error in a 3rd party action can crash the whole menu initialization try { @@ -47,13 +47,13 @@ namespace umbraco.controls.Tree } catch (Exception ee) { - Current.Logger.Error("Error initializing tree action", ee); + Current.Logger.Error("Error initializing tree action", ee); } - } + } - return jSSerializer.Serialize(allActions); - } - } + return jSSerializer.Serialize(allActions); + } + } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/JTreeContextMenuItem.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/JTreeContextMenuItem.cs index f02d0ad01c..046105fdad 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/JTreeContextMenuItem.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/JTreeContextMenuItem.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Web.Script.Serialization; using System.Text; @@ -10,73 +10,73 @@ using Umbraco.Web._Legacy.Actions; namespace umbraco.controls.Tree { - internal class JTreeContextMenuItem : JavaScriptConverter - { + internal class JTreeContextMenuItem : JavaScriptConverter + { - /// - /// Not implemented as we never need to Deserialize - /// - /// - /// - /// - /// - public override object Deserialize(IDictionary dictionary, Type type, JavaScriptSerializer serializer) - { - throw new NotImplementedException(); - } + /// + /// Not implemented as we never need to Deserialize + /// + /// + /// + /// + /// + public override object Deserialize(IDictionary dictionary, Type type, JavaScriptSerializer serializer) + { + throw new NotImplementedException(); + } - public override IDictionary Serialize(object obj, JavaScriptSerializer serializer) - { - //{ - // "id": "L", - // "label": "Create", - // "icon": "create.png", - // "visible": function(NODE, TREE_OBJ) { if (NODE.length != 1) return false; return TREE_OBJ.check("creatable", NODE); }, - // "action": function(NODE, TREE_OBJ) { TREE_OBJ.create(false, NODE); }, - //} + public override IDictionary Serialize(object obj, JavaScriptSerializer serializer) + { + //{ + // "id": "L", + // "label": "Create", + // "icon": "create.png", + // "visible": function(NODE, TREE_OBJ) { if (NODE.length != 1) return false; return TREE_OBJ.check("creatable", NODE); }, + // "action": function(NODE, TREE_OBJ) { TREE_OBJ.create(false, NODE); }, + //} - IAction a = (IAction)obj; - Dictionary data = new Dictionary(); + IAction a = (IAction)obj; + Dictionary data = new Dictionary(); - data.Add("id", a.Letter); - data.Add("label", Current.Services.TextService.Localize(a.Alias)); + data.Add("id", a.Letter); + data.Add("label", Current.Services.TextService.Localize(a.Alias)); - if (a.Icon.StartsWith(".")) - { - StringBuilder sb = new StringBuilder(); - sb.Append(string.Format(""); - sb.Append(""); - data["label"] = sb.ToString(); - } - else - { - data.Add("icon", a.Icon); - } + if (a.Icon.StartsWith(".")) + { + StringBuilder sb = new StringBuilder(); + sb.Append(string.Format(""); + sb.Append(""); + data["label"] = sb.ToString(); + } + else + { + data.Add("icon", a.Icon); + } - return data; + return data; - } + } - /// - /// TODO: Find out why we can't just return IAction as one type (JavaScriptSerializer doesn't seem to pick up on it) - /// - public override IEnumerable SupportedTypes - { - get - { - List types = new List(); - foreach (var a in Current.Actions) - { - types.Add(a.GetType()); - } - return types; - } + /// + /// TODO: Find out why we can't just return IAction as one type (JavaScriptSerializer doesn't seem to pick up on it) + /// + public override IEnumerable SupportedTypes + { + get + { + List types = new List(); + foreach (var a in Current.Actions) + { + types.Add(a.GetType()); + } + return types; + } - } - } + } + } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/NodeInfo.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/NodeInfo.cs index 48f46e30db..384d0c5edd 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/NodeInfo.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/NodeInfo.cs @@ -1,32 +1,32 @@ namespace umbraco.controls.Tree { - /// - /// Simple data object to hold information about a node - /// - public class NodeInfo - { - /// - /// Gets or sets the id. - /// - /// The id. - public int Id { get; set; } + /// + /// Simple data object to hold information about a node + /// + public class NodeInfo + { + /// + /// Gets or sets the id. + /// + /// The id. + public int Id { get; set; } - /// - /// Gets or sets the path. - /// - /// The path. - public string Path { get; set; } + /// + /// Gets or sets the path. + /// + /// The path. + public string Path { get; set; } - /// - /// Gets or sets the path as names. - /// - /// The path as names. - public string PathAsNames { get; set; } + /// + /// Gets or sets the path as names. + /// + /// The path as names. + public string PathAsNames { get; set; } - /// - /// Gets or sets the type of the node. - /// - /// The type of the node. - public string NodeType { get; set; } - } -} \ No newline at end of file + /// + /// Gets or sets the type of the node. + /// + /// The type of the node. + public string NodeType { get; set; } + } +} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/TreeControl.ascx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/TreeControl.ascx.cs index 4fd8eb8892..385c4c1843 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/TreeControl.ascx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/TreeControl.ascx.cs @@ -222,7 +222,7 @@ namespace umbraco.controls.Tree // Validate permissions if (ValidateCurrentUser() == false) return; - + if (!Security.ValidateUserApp(GetCurrentApp())) throw new ArgumentException("The current user doesn't have access to this application. Please contact the system administrator."); @@ -231,7 +231,7 @@ namespace umbraco.controls.Tree //m_ActiveTreeDefs = TreeDefinitionCollection.Instance.FindActiveTrees(GetCurrentApp()); m_ActiveTreeDefs = Services.ApplicationTreeService.GetApplicationTrees(GetCurrentApp(), true).ToList(); - + if (!string.IsNullOrEmpty(this.TreeType)) { m_ActiveTreeDefs = m_ActiveTreeDefs @@ -268,7 +268,7 @@ namespace umbraco.controls.Tree var identity = Context.GetCurrentIdentity( //DO NOT AUTO-AUTH UNLESS THE CURRENT HANDLER IS WEBFORMS! // Without this check, anything that is using this legacy API, like ui.Text will - // automatically log the back office user in even if it is a front-end request (if there is + // automatically log the back office user in even if it is a front-end request (if there is // a back office user logged in. This can cause problems becaues the identity is changing mid // request. For example: http://issues.umbraco.org/issue/U4-4010 HttpContext.Current.CurrentHandler is Page); @@ -403,7 +403,7 @@ namespace umbraco.controls.Tree else { - //If there is more than 1 tree for the application than render out a + //If there is more than 1 tree for the application than render out a //container node labelled with the current application. XmlTree xTree = new XmlTree(); XmlTreeNode xNode = XmlTreeNode.CreateRoot(new NullTree(GetCurrentApp())); @@ -589,4 +589,4 @@ namespace umbraco.controls.Tree /// protected global::System.Web.UI.HtmlControls.HtmlGenericControl TreeContainer; } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/dualSelectBox.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/dualSelectBox.cs index fbad59622c..be92fec6ff 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/dualSelectBox.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/dualSelectBox.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Web.Razor; using System.Web.UI; using System.Web.UI.WebControls; @@ -11,39 +11,39 @@ using Umbraco.Web.Composing; namespace umbraco.controls { - /// - /// Summary description for dualSelectbox. - /// - [ClientDependency(ClientDependencyType.Javascript, "js/dualSelectBox.js", "UmbracoRoot")] - public class DualSelectbox : System.Web.UI.WebControls.WebControl, System.Web.UI.INamingContainer - { - private ListItemCollection _items = new ListItemCollection(); + /// + /// Summary description for dualSelectbox. + /// + [ClientDependency(ClientDependencyType.Javascript, "js/dualSelectBox.js", "UmbracoRoot")] + public class DualSelectbox : System.Web.UI.WebControls.WebControl, System.Web.UI.INamingContainer + { + private ListItemCollection _items = new ListItemCollection(); - private ListBox _possibleValues = new ListBox(); - private ListBox _selectedValues = new ListBox(); - private HtmlInputHidden _value = new HtmlInputHidden(); + private ListBox _possibleValues = new ListBox(); + private ListBox _selectedValues = new ListBox(); + private HtmlInputHidden _value = new HtmlInputHidden(); private HtmlInputButton _add = new HtmlInputButton(); private HtmlInputButton _remove = new HtmlInputButton(); - private int _rows = 8; + private int _rows = 8; - public ListItemCollection Items - { - get - { - EnsureChildControls(); - return _items; - } - } + public ListItemCollection Items + { + get + { + EnsureChildControls(); + return _items; + } + } - public new int Width - { - set - { - _possibleValues.Width = new Unit(value); - _selectedValues.Width = new Unit(value); - } - } + public new int Width + { + set + { + _possibleValues.Width = new Unit(value); + _selectedValues.Width = new Unit(value); + } + } protected override void CreateChildControls() { @@ -91,54 +91,54 @@ namespace umbraco.controls this.Controls.Add(_value); } - public string Value - { - get - { + public string Value + { + get + { return _value.Value; - } - - set - { + } + + set + { _value.Value = value; } - } + } - public int Rows - { - set - { - _rows = value; - } - } + public int Rows + { + set + { + _rows = value; + } + } - public DualSelectbox() - { - } + public DualSelectbox() + { + } - protected override void OnPreRender(EventArgs e) - { - base.OnPreRender (e); + protected override void OnPreRender(EventArgs e) + { + base.OnPreRender (e); - _selectedValues.Items.Clear(); - _possibleValues.Items.Clear(); + _selectedValues.Items.Clear(); + _possibleValues.Items.Clear(); - foreach(ListItem li in _items) - { - if (((string) (","+ this.Value +",")).IndexOf(","+li.Value+",") > -1) - _selectedValues.Items.Add(li); - else - _possibleValues.Items.Add(li); - } + foreach(ListItem li in _items) + { + if (((string) (","+ this.Value +",")).IndexOf(","+li.Value+",") > -1) + _selectedValues.Items.Add(li); + else + _possibleValues.Items.Add(li); + } // add js to buttons here to ensure full clientids _add.Attributes.Add("onClick", "dualSelectBoxShift('" + this.ClientID + "');"); _remove.Attributes.Add("onClick", "dualSelectBoxShift('" + this.ClientID + "');"); } - - } + + } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/passwordChanger.ascx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/passwordChanger.ascx.cs index ff0f2a396c..e409629767 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/passwordChanger.ascx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/passwordChanger.ascx.cs @@ -68,7 +68,7 @@ namespace umbraco.controls { _model.NewPassword = umbPasswordChanger_passwordNew.Text; _model.OldPassword = umbPasswordChanger_passwordCurrent.Text; - _model.Reset = ResetPasswordCheckBox.Checked; + _model.Reset = ResetPasswordCheckBox.Checked; return _model; } } @@ -149,4 +149,4 @@ namespace umbraco.controls /// protected global::System.Web.UI.WebControls.TextBox umbPasswordChanger_passwordCurrent; } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/create/CreatedPackageTasks.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/create/CreatedPackageTasks.cs index 9363f2b891..f4182770c7 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/create/CreatedPackageTasks.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/create/CreatedPackageTasks.cs @@ -1,4 +1,4 @@ -using Umbraco.Core.Logging; +using Umbraco.Core.Logging; using Umbraco.Web.UI; using Umbraco.Core; using Umbraco.Web; @@ -9,7 +9,7 @@ namespace umbraco { public class CreatedPackageTasks : LegacyDialogTask { - + public override bool PerformSave() { Current.Logger.Info("Xml save started"); diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/create/PartialViewMacrosTasks.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/create/PartialViewMacrosTasks.cs index d7879dd264..4a976b146c 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/create/PartialViewMacrosTasks.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/create/PartialViewMacrosTasks.cs @@ -8,7 +8,7 @@ namespace umbraco ///
[UmbracoWillObsolete("http://issues.umbraco.org/issue/U4-1373", "This will one day be removed when we overhaul the create process")] public class PartialViewMacroTasks : PartialViewTasksBase - { + { public override string AssignedApp { get { return Constants.Applications.Developer.ToString(); } @@ -19,4 +19,4 @@ namespace umbraco get { return true; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/create/PartialViewTasks.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/create/PartialViewTasks.cs index 14a9a029f8..7142bbab24 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/create/PartialViewTasks.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/create/PartialViewTasks.cs @@ -8,7 +8,7 @@ namespace umbraco ///
[UmbracoWillObsolete("http://issues.umbraco.org/issue/U4-1373", "This will one day be removed when we overhaul the create process")] public class PartialViewTasks : PartialViewTasksBase - { + { public override string AssignedApp { get { return Constants.Applications.Settings.ToString(); } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/create/XsltTasks.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/create/XsltTasks.cs index 046c138c81..8b9f5cb8e5 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/create/XsltTasks.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/create/XsltTasks.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.IO; using Umbraco.Core; using Umbraco.Core.IO; @@ -32,55 +32,55 @@ namespace umbraco fileName += ".xslt"; var xsltTemplateSource = IOHelper.MapPath(SystemDirectories.Umbraco + "/xslt/templates/" + template); var xsltNewFilename = IOHelper.MapPath(SystemDirectories.Xslt + "/" + fileName); - - if (File.Exists(xsltNewFilename) == false) - { - if (fileName.Contains("/")) //if there's a / create the folder structure for it - { - var folders = fileName.Split("/".ToCharArray()); - var xsltBasePath = IOHelper.MapPath(SystemDirectories.Xslt); - for (var i = 0; i < folders.Length - 1; i++) - { - xsltBasePath = System.IO.Path.Combine(xsltBasePath, folders[i]); - System.IO.Directory.CreateDirectory(xsltBasePath); - } - } - // update with xslt references - var xslt = ""; - using (var xsltFile = System.IO.File.OpenText(xsltTemplateSource)) - { + if (File.Exists(xsltNewFilename) == false) + { + if (fileName.Contains("/")) //if there's a / create the folder structure for it + { + var folders = fileName.Split("/".ToCharArray()); + var xsltBasePath = IOHelper.MapPath(SystemDirectories.Xslt); + for (var i = 0; i < folders.Length - 1; i++) + { + xsltBasePath = System.IO.Path.Combine(xsltBasePath, folders[i]); + System.IO.Directory.CreateDirectory(xsltBasePath); + } + } + + // update with xslt references + var xslt = ""; + using (var xsltFile = System.IO.File.OpenText(xsltTemplateSource)) + { xslt = xsltFile.ReadToEnd(); - xsltFile.Close(); - } + xsltFile.Close(); + } // prepare support for XSLT extensions xslt = Umbraco.Web.Macros.XsltMacroEngine.AddXsltExtensionsToHeader(xslt); var xsltWriter = System.IO.File.CreateText(xsltNewFilename); - xsltWriter.Write(xslt); - xsltWriter.Flush(); - xsltWriter.Close(); + xsltWriter.Write(xslt); + xsltWriter.Flush(); + xsltWriter.Close(); - // Create macro? - if (ParentID == 1) - { + // Create macro? + if (ParentID == 1) + { var name = Alias.Substring(Alias.IndexOf("|||") + 3, Alias.Length - Alias.IndexOf("|||") - 3); if (name.ToLowerInvariant().EndsWith(".xslt")) name = name.Substring(0, name.Length - 5); - name = name.SplitPascalCasing().ToFirstUpperInvariant(); - //cms.businesslogic.macro.Macro m = - // cms.businesslogic.macro.Macro.MakeNew(name); + name = name.SplitPascalCasing().ToFirstUpperInvariant(); + //cms.businesslogic.macro.Macro m = + // cms.businesslogic.macro.Macro.MakeNew(name); var m = new Macro - { - Name = name, - Alias = name.Replace(" ", String.Empty) - }; + { + Name = name, + Alias = name.Replace(" ", String.Empty) + }; m.XsltPath = fileName; //m.Save(); Current.Services.MacroService.Save(m); - } - } + } + } _returnUrl = string.Format(SystemDirectories.Umbraco + "/developer/xslt/editXslt.aspx?file={0}", fileName); @@ -96,7 +96,7 @@ namespace umbraco if(System.IO.Directory.Exists(path)) System.IO.Directory.Delete(path); else if(System.IO.File.Exists(path)) - System.IO.File.Delete(path); + System.IO.File.Delete(path); } catch (Exception ex) { @@ -106,7 +106,7 @@ namespace umbraco } private string _returnUrl = ""; - + public override string ReturnUrl { get { return _returnUrl; } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/create/dictionaryTasks.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/create/dictionaryTasks.cs index e685efd7a9..27f930ee0f 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/create/dictionaryTasks.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/create/dictionaryTasks.cs @@ -1,4 +1,4 @@ -using System; +using System; using Umbraco.Core.Logging; using Umbraco.Web.UI; using Umbraco.Core; @@ -34,7 +34,7 @@ namespace umbraco public override bool PerformDelete() { - Current.Logger.Debug(TypeID + " " + ParentID + " deleting " + Alias); + Current.Logger.Debug(TypeID + " " + ParentID + " deleting " + Alias); var di = Current.Services.LocalizationService.GetDictionaryItemById(ParentID); if (di == null) return true; diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/create/language.ascx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/create/language.ascx.cs index 24af1b4544..9e3b16e7a3 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/create/language.ascx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/create/language.ascx.cs @@ -11,7 +11,7 @@ using Umbraco.Web._Legacy.UI; namespace umbraco.cms.presentation.create.controls { /// - /// Summary description for language. + /// Summary description for language. /// public partial class language : global::Umbraco.Web.UI.Controls.UmbracoUserControl { @@ -88,4 +88,4 @@ namespace umbraco.cms.presentation.create.controls protected global::System.Web.UI.WebControls.Button sbmt; } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/create/languageTasks.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/create/languageTasks.cs index 6c2e5803ba..d50949311a 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/create/languageTasks.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/create/languageTasks.cs @@ -1,4 +1,4 @@ -using System.Globalization; +using System.Globalization; using Umbraco.Web.UI; using Umbraco.Core; using Umbraco.Core.Models; @@ -9,7 +9,7 @@ namespace umbraco { public class languageTasks : LegacyDialogTask { - + public override bool PerformSave() { //cms.businesslogic.language.Language.MakeNew(Alias); diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/create/script.ascx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/create/script.ascx.cs index 93763d260d..9f55b0e27f 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/create/script.ascx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/create/script.ascx.cs @@ -12,20 +12,20 @@ using Umbraco.Web._Legacy.UI; namespace umbraco.presentation.umbraco.create { - public partial class script : UmbracoUserControl - { + public partial class script : UmbracoUserControl + { protected override void OnLoad(EventArgs e) { base.OnLoad(e); - sbmt.Text = Services.TextService.Localize("create"); + sbmt.Text = Services.TextService.Localize("create"); // Enable new item in folders to place items in that folder. if (Request["nodeType"] == "scriptsFolder") rename.Text = Request["nodeId"].EnsureEndsWith('/'); - } + } - protected void SubmitClick(object sender, System.EventArgs e) - { + protected void SubmitClick(object sender, System.EventArgs e) + { int createFolder = 0; if (scriptType.SelectedValue == "") { @@ -34,28 +34,28 @@ namespace umbraco.presentation.umbraco.create Page.Validate(); } - if (Page.IsValid) - { + if (Page.IsValid) + { string returnUrl = LegacyDialogHandler.Create( new HttpContextWrapper(Context), Security.CurrentUser, Request.GetItemAsString("nodeType"), - createFolder, + createFolder, rename.Text + '\u00A4' + scriptType.SelectedValue); - ClientTools + ClientTools .ChangeContentFrameUrl(returnUrl) .ReloadActionNode(false, true) - .CloseModalWindow(); + .CloseModalWindow(); - } - } + } + } - override protected void OnInit(EventArgs e) - { - base.OnInit(e); + override protected void OnInit(EventArgs e) + { + base.OnInit(e); - ContainsValidator.Enabled = false; + ContainsValidator.Enabled = false; string[] fileTypes = UmbracoConfig.For.UmbracoSettings().Content.ScriptFileTypes.ToArray(); @@ -66,7 +66,7 @@ namespace umbraco.presentation.umbraco.create { scriptType.Items.Add(new ListItem("." + str + " file", str)); } - } + } /// /// rename control. @@ -86,7 +86,7 @@ namespace umbraco.presentation.umbraco.create /// protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator1; protected global::System.Web.UI.WebControls.RegularExpressionValidator EndsWithValidator; - protected global::System.Web.UI.WebControls.RegularExpressionValidator ContainsValidator; + protected global::System.Web.UI.WebControls.RegularExpressionValidator ContainsValidator; /// /// scriptType control. @@ -115,5 +115,5 @@ namespace umbraco.presentation.umbraco.create /// protected global::System.Web.UI.WebControls.Button sbmt; - } -} \ No newline at end of file + } +} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/create/simple.ascx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/create/simple.ascx.cs index 206fb1a3d8..d9efe6f7e5 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/create/simple.ascx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/create/simple.ascx.cs @@ -11,7 +11,7 @@ using UmbracoUserControl = Umbraco.Web.UI.Controls.UmbracoUserControl; namespace umbraco.cms.presentation.create.controls { /// - /// Summary description for simple. + /// Summary description for simple. /// public partial class simple : UmbracoUserControl { diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/create/templateTasks.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/create/templateTasks.cs index d4a821da43..29e6f8b2c3 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/create/templateTasks.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/create/templateTasks.cs @@ -1,4 +1,4 @@ -using Umbraco.Core; +using Umbraco.Core; using Umbraco.Core.Configuration; using Umbraco.Web.Composing; using Umbraco.Web.UI; @@ -7,11 +7,11 @@ using Umbraco.Web._Legacy.UI; namespace umbraco { public class templateTasks : LegacyDialogTask - { + { public override bool PerformSave() { var masterId = ParentID; - + var editor = "settings/editTemplate.aspx"; if (UmbracoConfig.For.UmbracoSettings().Templates.DefaultRenderingEngine == RenderingEngine.Mvc) editor = "settings/views/editView.aspx"; @@ -42,7 +42,7 @@ namespace umbraco } private string _returnUrl = ""; - + public override string ReturnUrl { get { return _returnUrl; } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/create/xslt.ascx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/create/xslt.ascx.cs index 5a243cb535..90ffd2101e 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/create/xslt.ascx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/create/xslt.ascx.cs @@ -14,7 +14,7 @@ namespace umbraco.presentation.create /// - /// Summary description for xslt. + /// Summary description for xslt. /// public partial class xslt : UmbracoUserControl { @@ -49,7 +49,7 @@ namespace umbraco.presentation.create createMacroVal = 1; var xsltName = Path.Combine("schema2", xsltTemplate.SelectedValue); - + var returnUrl = LegacyDialogHandler.Create( new HttpContextWrapper(Context), diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dashboard/FeedProxy.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dashboard/FeedProxy.aspx.cs index e856662eeb..1a167dd858 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dashboard/FeedProxy.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dashboard/FeedProxy.aspx.cs @@ -12,7 +12,7 @@ using Umbraco.Web.Composing; namespace dashboardUtilities { - + public partial class FeedProxy : UmbracoEnsuredPage { @@ -29,7 +29,7 @@ namespace dashboardUtilities if (Uri.TryCreate(url, UriKind.Absolute, out requestUri)) { var feedProxyXml = XmlHelper.OpenAsXmlDocument(IOHelper.MapPath(SystemFiles.FeedProxyConfig)); - if (feedProxyXml != null + if (feedProxyXml != null && feedProxyXml.SelectSingleNode(string.Concat("//allow[@host = '", requestUri.Host, "']")) != null && requestUri.Port == 80) { @@ -59,4 +59,4 @@ namespace dashboardUtilities } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dashboard/FeedProxy.aspx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dashboard/FeedProxy.aspx.designer.cs index e26427cb9e..7de5c199f3 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dashboard/FeedProxy.aspx.designer.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dashboard/FeedProxy.aspx.designer.cs @@ -3,13 +3,13 @@ // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace dashboardUtilities { - - + + public partial class FeedProxy { } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Macros/assemblyBrowser.aspx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Macros/assemblyBrowser.aspx.designer.cs index fe16914cfa..9b8f124443 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Macros/assemblyBrowser.aspx.designer.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Macros/assemblyBrowser.aspx.designer.cs @@ -1,17 +1,17 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace umbraco.developer { - - + + public partial class assemblyBrowser { - + /// /// AssemblyName control. /// @@ -20,7 +20,7 @@ namespace umbraco.developer { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Label AssemblyName; - + /// /// ChooseProperties control. /// @@ -29,7 +29,7 @@ namespace umbraco.developer { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Panel ChooseProperties; - + /// /// MacroProperties control. /// @@ -38,7 +38,7 @@ namespace umbraco.developer { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.CheckBoxList MacroProperties; - + /// /// Button1 control. /// @@ -47,7 +47,7 @@ namespace umbraco.developer { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Button Button1; - + /// /// ConfigProperties control. /// @@ -56,7 +56,7 @@ namespace umbraco.developer { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Panel ConfigProperties; - + /// /// resultLiteral control. /// diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Macros/editMacro.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Macros/editMacro.aspx.cs index 6abe3f9ab0..dacc8d0f18 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Macros/editMacro.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Macros/editMacro.aspx.cs @@ -20,32 +20,32 @@ using Umbraco.Web._Legacy.Controls; namespace umbraco.cms.presentation.developer { - /// - /// Summary description for editMacro. - /// - public partial class editMacro : UmbracoEnsuredPage - { - public editMacro() - { - CurrentApp = Constants.Applications.Developer.ToString(); - } + /// + /// Summary description for editMacro. + /// + public partial class editMacro : UmbracoEnsuredPage + { + public editMacro() + { + CurrentApp = Constants.Applications.Developer.ToString(); + } - protected PlaceHolder Buttons; - protected Table MacroElements; + protected PlaceHolder Buttons; + protected Table MacroElements; - public TabPage InfoTabPage; - public TabPage Parameters; + public TabPage InfoTabPage; + public TabPage Parameters; - private IMacro _macro; + private IMacro _macro; - protected void Page_Load(object sender, EventArgs e) - { - _macro = Services.MacroService.GetById(Convert.ToInt32(Request.QueryString["macroID"])); + protected void Page_Load(object sender, EventArgs e) + { + _macro = Services.MacroService.GetById(Convert.ToInt32(Request.QueryString["macroID"])); - if (IsPostBack == false) - { - ClientTools - .SetActiveTreeType(Constants.Trees.Macros) + if (IsPostBack == false) + { + ClientTools + .SetActiveTreeType(Constants.Trees.Macros) .SyncTree("-1,init," + _macro.Id, false); string tempMacroAssembly = _macro.ControlAssembly ?? ""; @@ -53,128 +53,128 @@ namespace umbraco.cms.presentation.developer PopulateFieldsOnLoad(_macro, tempMacroAssembly, tempMacroType); - // Check for assemblyBrowser - if (tempMacroType.IndexOf(".ascx", StringComparison.Ordinal) > 0) - assemblyBrowserUserControl.Controls.Add( - new LiteralControl("
")); - else if (tempMacroType != string.Empty && tempMacroAssembly != string.Empty) - assemblyBrowser.Controls.Add( - new LiteralControl("
")); + else if (tempMacroType != string.Empty && tempMacroAssembly != string.Empty) + assemblyBrowser.Controls.Add( + new LiteralControl("
")); + "', 'Browse Properties', true, 475,500); return false\" class=\"guiInputButton\"> Browse properties")); - // Load elements from macro - macroPropertyBind(); + // Load elements from macro + macroPropertyBind(); - // Load xslt files from default dir - PopulateXsltFiles(); + // Load xslt files from default dir + PopulateXsltFiles(); - // Load usercontrols - PopulateUserControls(IOHelper.MapPath(SystemDirectories.UserControls)); - userControlList.Items.Insert(0, new ListItem("Browse usercontrols on server...", string.Empty)); + // Load usercontrols + PopulateUserControls(IOHelper.MapPath(SystemDirectories.UserControls)); + userControlList.Items.Insert(0, new ListItem("Browse usercontrols on server...", string.Empty)); - } - } + } + } - /// - /// Populates the control (textbox) values on page load - /// - /// - /// - /// - protected virtual void PopulateFieldsOnLoad(IMacro macro, string macroAssemblyValue, string macroTypeValue) - { - macroName.Text = macro.Name; - macroAlias.Text = macro.Alias; - macroXslt.Text = macro.XsltPath; - cachePeriod.Text = macro.CacheDuration.ToInvariantString(); - macroRenderContent.Checked = macro.DontRender == false; - macroEditor.Checked = macro.UseInEditor; - cacheByPage.Checked = macro.CacheByPage; - cachePersonalized.Checked = macro.CacheByMember; + /// + /// Populates the control (textbox) values on page load + /// + /// + /// + /// + protected virtual void PopulateFieldsOnLoad(IMacro macro, string macroAssemblyValue, string macroTypeValue) + { + macroName.Text = macro.Name; + macroAlias.Text = macro.Alias; + macroXslt.Text = macro.XsltPath; + cachePeriod.Text = macro.CacheDuration.ToInvariantString(); + macroRenderContent.Checked = macro.DontRender == false; + macroEditor.Checked = macro.UseInEditor; + cacheByPage.Checked = macro.CacheByPage; + cachePersonalized.Checked = macro.CacheByMember; - // Populate either user control or custom control - if (macroTypeValue != string.Empty && macroAssemblyValue != string.Empty) - { - macroAssembly.Text = macroAssemblyValue; - macroType.Text = macroTypeValue; - } - else - { - macroUserControl.Text = macroTypeValue; - } - } + // Populate either user control or custom control + if (macroTypeValue != string.Empty && macroAssemblyValue != string.Empty) + { + macroAssembly.Text = macroAssemblyValue; + macroType.Text = macroTypeValue; + } + else + { + macroUserControl.Text = macroTypeValue; + } + } - /// - /// Sets the values on the Macro object from the values posted back before saving the macro - /// - protected virtual void SetMacroValuesFromPostBack(IMacro macro, int macroCachePeriod, string macroAssemblyValue, string macroTypeValue) - { - macro.UseInEditor = macroEditor.Checked; - macro.DontRender = macroRenderContent.Checked == false; - macro.CacheByPage = cacheByPage.Checked; - macro.CacheByMember = cachePersonalized.Checked; - macro.CacheDuration = macroCachePeriod; - macro.Alias = macroAlias.Text; - macro.Name = macroName.Text; - macro.ControlAssembly = macroAssemblyValue; - macro.ControlType = macroTypeValue; - macro.XsltPath = macroXslt.Text; - } + /// + /// Sets the values on the Macro object from the values posted back before saving the macro + /// + protected virtual void SetMacroValuesFromPostBack(IMacro macro, int macroCachePeriod, string macroAssemblyValue, string macroTypeValue) + { + macro.UseInEditor = macroEditor.Checked; + macro.DontRender = macroRenderContent.Checked == false; + macro.CacheByPage = cacheByPage.Checked; + macro.CacheByMember = cachePersonalized.Checked; + macro.CacheDuration = macroCachePeriod; + macro.Alias = macroAlias.Text; + macro.Name = macroName.Text; + macro.ControlAssembly = macroAssemblyValue; + macro.ControlType = macroTypeValue; + macro.XsltPath = macroXslt.Text; + } - private static void GetXsltFilesFromDir(string orgPath, string path, ArrayList files) - { - var dirInfo = new DirectoryInfo(path); + private static void GetXsltFilesFromDir(string orgPath, string path, ArrayList files) + { + var dirInfo = new DirectoryInfo(path); - if (dirInfo.Exists == false) return; + if (dirInfo.Exists == false) return; - // Populate subdirectories - var dirInfos = dirInfo.GetDirectories(); - foreach (var dir in dirInfos) - GetXsltFilesFromDir(orgPath, path + "/" + dir.Name, files); + // Populate subdirectories + var dirInfos = dirInfo.GetDirectories(); + foreach (var dir in dirInfos) + GetXsltFilesFromDir(orgPath, path + "/" + dir.Name, files); - var fileInfo = dirInfo.GetFiles("*.xsl*"); + var fileInfo = dirInfo.GetFiles("*.xsl*"); - foreach (var file in fileInfo) - files.Add((path.Replace(orgPath, string.Empty).Trim('/') + "/" + file.Name).Trim('/')); - } + foreach (var file in fileInfo) + files.Add((path.Replace(orgPath, string.Empty).Trim('/') + "/" + file.Name).Trim('/')); + } - private void PopulateXsltFiles() - { - var xslts = new ArrayList(); - var xsltDir = IOHelper.MapPath(SystemDirectories.Xslt + "/"); - GetXsltFilesFromDir(xsltDir, xsltDir, xslts); - xsltFiles.DataSource = xslts; - xsltFiles.DataBind(); - xsltFiles.Items.Insert(0, new ListItem("Browse xslt files on server...", string.Empty)); - } + private void PopulateXsltFiles() + { + var xslts = new ArrayList(); + var xsltDir = IOHelper.MapPath(SystemDirectories.Xslt + "/"); + GetXsltFilesFromDir(xsltDir, xsltDir, xslts); + xsltFiles.DataSource = xslts; + xsltFiles.DataBind(); + xsltFiles.Items.Insert(0, new ListItem("Browse xslt files on server...", string.Empty)); + } - - public void deleteMacroProperty(object sender, EventArgs e) - { - var macroPropertyId = (HtmlInputHidden)((Control)sender).Parent.FindControl("macroPropertyID"); - var property = _macro.Properties.Single(x => x.Id == int.Parse(macroPropertyId.Value)); - _macro.Properties.Remove(property); + public void deleteMacroProperty(object sender, EventArgs e) + { + var macroPropertyId = (HtmlInputHidden)((Control)sender).Parent.FindControl("macroPropertyID"); - Services.MacroService.Save(_macro); + var property = _macro.Properties.Single(x => x.Id == int.Parse(macroPropertyId.Value)); + _macro.Properties.Remove(property); - macroPropertyBind(); - } + Services.MacroService.Save(_macro); - public void macroPropertyBind() - { - macroProperties.DataSource = _macro.Properties.OrderBy(x => x.SortOrder); - macroProperties.DataBind(); - } + macroPropertyBind(); + } - public object CheckNull(object test) - { - return Convert.IsDBNull(test) ? 0 : test; - } + public void macroPropertyBind() + { + macroProperties.DataSource = _macro.Properties.OrderBy(x => x.SortOrder); + macroProperties.DataBind(); + } + + public object CheckNull(object test) + { + return Convert.IsDBNull(test) ? 0 : test; + } protected IEnumerable GetMacroParameterEditors() { @@ -183,13 +183,13 @@ namespace umbraco.cms.presentation.developer return Current.ParameterEditors; } - public void macroPropertyCreate(object sender, EventArgs e) - { + public void macroPropertyCreate(object sender, EventArgs e) + { //enable add validators var val1 = (RequiredFieldValidator)((Control)sender).Parent.FindControl("RequiredFieldValidator1"); var val2 = (RequiredFieldValidator)((Control)sender).Parent.FindControl("RequiredFieldValidator4"); var val3 = (RequiredFieldValidator)((Control)sender).Parent.FindControl("RequiredFieldValidator5"); - val1.Enabled = true; + val1.Enabled = true; val2.Enabled = true; val3.Enabled = true; @@ -200,71 +200,71 @@ namespace umbraco.cms.presentation.developer return; } - var macroPropertyAliasNew = (TextBox)((Control)sender).Parent.FindControl("macroPropertyAliasNew"); - var macroPropertyNameNew = (TextBox)((Control)sender).Parent.FindControl("macroPropertyNameNew"); - var macroPropertyTypeNew = (DropDownList)((Control)sender).Parent.FindControl("macroPropertyTypeNew"); + var macroPropertyAliasNew = (TextBox)((Control)sender).Parent.FindControl("macroPropertyAliasNew"); + var macroPropertyNameNew = (TextBox)((Control)sender).Parent.FindControl("macroPropertyNameNew"); + var macroPropertyTypeNew = (DropDownList)((Control)sender).Parent.FindControl("macroPropertyTypeNew"); - if (macroPropertyAliasNew.Text != Services.TextService.Localize("general/new") + " " + Services.TextService.Localize("general/alias")) - { + if (macroPropertyAliasNew.Text != Services.TextService.Localize("general/new") + " " + Services.TextService.Localize("general/alias")) + { if (_macro.Properties.ContainsKey(macroPropertyAliasNew.Text.Trim())) { //don't continue return; } - _macro.Properties.Add(new MacroProperty( - macroPropertyAliasNew.Text.Trim(), - macroPropertyNameNew.Text.Trim(), + _macro.Properties.Add(new MacroProperty( + macroPropertyAliasNew.Text.Trim(), + macroPropertyNameNew.Text.Trim(), _macro.Properties.Any() ? _macro.Properties.Max(x => x.SortOrder) + 1 : 0, - macroPropertyTypeNew.SelectedValue)); + macroPropertyTypeNew.SelectedValue)); - Services.MacroService.Save(_macro); + Services.MacroService.Save(_macro); macroPropertyBind(); - } - } + } + } - public bool macroIsVisible(object isChecked) - { - return Convert.ToBoolean(isChecked); - } + public bool macroIsVisible(object isChecked) + { + return Convert.ToBoolean(isChecked); + } - public void AddChooseList(Object sender, EventArgs e) - { - if (IsPostBack == false) - { - var dropDown = (DropDownList)sender; - dropDown.Items.Insert(0, new ListItem("Choose...", string.Empty)); - } - } + public void AddChooseList(Object sender, EventArgs e) + { + if (IsPostBack == false) + { + var dropDown = (DropDownList)sender; + dropDown.Items.Insert(0, new ListItem("Choose...", string.Empty)); + } + } - private void PopulateUserControls(string path) - { - var directoryInfo = new DirectoryInfo(path); - if (directoryInfo.Exists == false) return; + private void PopulateUserControls(string path) + { + var directoryInfo = new DirectoryInfo(path); + if (directoryInfo.Exists == false) return; - var rootDir = IOHelper.MapPath(SystemDirectories.UserControls); + var rootDir = IOHelper.MapPath(SystemDirectories.UserControls); - foreach (var uc in directoryInfo.GetFiles("*.ascx")) - { - userControlList.Items.Add( - new ListItem(SystemDirectories.UserControls + - uc.FullName.Substring(rootDir.Length).Replace(IOHelper.DirSepChar, '/'))); + foreach (var uc in directoryInfo.GetFiles("*.ascx")) + { + userControlList.Items.Add( + new ListItem(SystemDirectories.UserControls + + uc.FullName.Substring(rootDir.Length).Replace(IOHelper.DirSepChar, '/'))); - } - foreach (var dir in directoryInfo.GetDirectories()) - PopulateUserControls(dir.FullName); - } + } + foreach (var dir in directoryInfo.GetDirectories()) + PopulateUserControls(dir.FullName); + } - protected override void OnInit(EventArgs e) - { - base.OnInit(e); + protected override void OnInit(EventArgs e) + { + base.OnInit(e); EnsureChildControls(); - } + } - protected override void CreateChildControls() - { - base.CreateChildControls(); + protected override void CreateChildControls() + { + base.CreateChildControls(); // Tab setup InfoTabPage = TabView1.NewTabPage("Macro Properties"); @@ -281,7 +281,7 @@ namespace umbraco.cms.presentation.developer save.Text = Services.TextService.Localize("save"); save.ID = "save"; save.Click += Save_Click; - } + } void Save_Click(object sender, EventArgs e) { @@ -357,230 +357,230 @@ namespace umbraco.cms.presentation.developer macroPropertyBind(); } - /// - /// TabView1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.TabView TabView1; + /// + /// TabView1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.TabView TabView1; - /// - /// Pane1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.Pane Pane1; + /// + /// Pane1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.Pane Pane1; - /// - /// macroPane control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.HtmlControls.HtmlTable macroPane; + /// + /// macroPane control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTable macroPane; - /// - /// macroName control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox macroName; + /// + /// macroName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox macroName; - /// - /// macroAlias control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox macroAlias; + /// + /// macroAlias control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox macroAlias; - /// - /// Pane1_2 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.Pane Pane1_2; + /// + /// Pane1_2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.Pane Pane1_2; - /// - /// macroXslt control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox macroXslt; + /// + /// macroXslt control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox macroXslt; - /// - /// xsltFiles control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.DropDownList xsltFiles; + /// + /// xsltFiles control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList xsltFiles; - /// - /// macroUserControl control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox macroUserControl; + /// + /// macroUserControl control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox macroUserControl; - /// - /// userControlList control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.DropDownList userControlList; + /// + /// userControlList control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList userControlList; - /// - /// assemblyBrowserUserControl control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.PlaceHolder assemblyBrowserUserControl; + /// + /// assemblyBrowserUserControl control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.PlaceHolder assemblyBrowserUserControl; - /// - /// macroAssembly control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox macroAssembly; + /// + /// macroAssembly control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox macroAssembly; - /// - /// macroType control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox macroType; + /// + /// macroType control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox macroType; - /// - /// assemblyBrowser control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.PlaceHolder assemblyBrowser; + /// + /// assemblyBrowser control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.PlaceHolder assemblyBrowser; - /// - /// Pane1_3 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.Pane Pane1_3; + /// + /// Pane1_3 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.Pane Pane1_3; - /// - /// Table1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.HtmlControls.HtmlTable Table1; + /// + /// Table1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTable Table1; - /// - /// macroEditor control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.CheckBox macroEditor; + /// + /// macroEditor control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox macroEditor; - /// - /// macroRenderContent control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.CheckBox macroRenderContent; + /// + /// macroRenderContent control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox macroRenderContent; - /// - /// Pane1_4 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.Pane Pane1_4; + /// + /// Pane1_4 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.Pane Pane1_4; - /// - /// Table3 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.HtmlControls.HtmlTable Table3; + /// + /// Table3 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTable Table3; - /// - /// cachePeriod control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox cachePeriod; + /// + /// cachePeriod control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox cachePeriod; - /// - /// cacheByPage control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.CheckBox cacheByPage; + /// + /// cacheByPage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox cacheByPage; - /// - /// cachePersonalized control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.CheckBox cachePersonalized; + /// + /// cachePersonalized control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox cachePersonalized; - /// - /// Panel2 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.Pane Panel2; + /// + /// Panel2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.Pane Panel2; - /// - /// macroProperties control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Repeater macroProperties; - } + /// + /// macroProperties control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Repeater macroProperties; + } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/editPackage.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/editPackage.aspx.cs index 563ee2438e..35f36f9733 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/editPackage.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/editPackage.aspx.cs @@ -1,4 +1,4 @@ -using Umbraco.Core.Services; +using Umbraco.Core.Services; using System; using System.Collections.Generic; using System.ComponentModel; @@ -45,10 +45,10 @@ namespace umbraco.presentation.developer.packages cp = new ContentPicker(); content.Controls.Add(cp); - + if (string.IsNullOrEmpty(pack.PackagePath) == false) { - packageUmbFile.Text = "   Download"; + packageUmbFile.Text = "   Download"; } else { @@ -203,7 +203,7 @@ namespace umbraco.presentation.developer.packages try { - //we try to load an xml document with the potential malformed xml to ensure that this is actual action xml... + //we try to load an xml document with the potential malformed xml to ensure that this is actual action xml... XmlDocument xd = new XmlDocument(); xd.LoadXml(actions); e.IsValid = true; @@ -383,13 +383,13 @@ namespace umbraco.presentation.developer.packages { string tmpFFFF = ((TextBox)rItem.FindControl("packageFilePath")).Text; if (tmpFFFF.Trim() != "") - tmpFilePathString += tmpFFFF + ""; + tmpFilePathString += tmpFFFF + "�"; } cms.businesslogic.packager.CreatedPackage createdPackage = cms.businesslogic.packager.CreatedPackage.GetById(int.Parse(Request.QueryString["id"])); cms.businesslogic.packager.PackageInstance pack = createdPackage.Data; - pack.Files = new List(tmpFilePathString.Trim('').Split('')); + pack.Files = new List(tmpFilePathString.Trim('�').Split('�')); pack.Files.TrimExcess(); createdPackage.Save(); diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/editPackage.aspx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/editPackage.aspx.designer.cs index 636f35848a..1afba5aaa7 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/editPackage.aspx.designer.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/editPackage.aspx.designer.cs @@ -1,17 +1,17 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace umbraco.presentation.developer.packages { - - + + public partial class _Default { - + /// /// TabView1 control. /// @@ -20,7 +20,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.TabView TabView1; - + /// /// Pane1 control. /// @@ -29,7 +29,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.Pane Pane1; - + /// /// pp_name control. /// @@ -47,7 +47,7 @@ namespace umbraco.presentation.developer.packages { protected global::System.Web.UI.WebControls.RegularExpressionValidator VersionValidator; protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator7; - + /// /// packageName control. /// @@ -56,7 +56,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.TextBox packageName; - + /// /// RequiredFieldValidator0 control. /// @@ -65,7 +65,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator0; - + /// /// pp_url control. /// @@ -74,7 +74,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_url; - + /// /// packageUrl control. /// @@ -83,7 +83,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.TextBox packageUrl; - + /// /// RequiredFieldValidator1 control. /// @@ -92,7 +92,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator1; - + /// /// pp_version control. /// @@ -101,7 +101,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_version; - + /// /// packageVersion control. /// @@ -110,7 +110,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.TextBox packageVersion; - + /// /// RequiredFieldValidator2 control. /// @@ -119,7 +119,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator2; - + /// /// pp_file control. /// @@ -128,7 +128,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_file; - + /// /// packageUmbFile control. /// @@ -137,7 +137,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Literal packageUmbFile; - + /// /// Pane1_1 control. /// @@ -146,7 +146,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.Pane Pane1_1; - + /// /// pp_author control. /// @@ -155,7 +155,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_author; - + /// /// packageAuthorName control. /// @@ -164,7 +164,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.TextBox packageAuthorName; - + /// /// RequiredFieldValidator3 control. /// @@ -173,7 +173,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator3; - + /// /// pp_author_url control. /// @@ -182,7 +182,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_author_url; - + /// /// packageAuthorUrl control. /// @@ -191,7 +191,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.TextBox packageAuthorUrl; - + /// /// RequiredFieldValidator4 control. /// @@ -200,7 +200,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator4; - + /// /// Pane1_2 control. /// @@ -209,7 +209,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.Pane Pane1_2; - + /// /// pp_licens control. /// @@ -218,7 +218,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_licens; - + /// /// packageLicenseName control. /// @@ -227,7 +227,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.TextBox packageLicenseName; - + /// /// RequiredFieldValidator5 control. /// @@ -236,7 +236,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator5; - + /// /// pp_license_url control. /// @@ -245,7 +245,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_license_url; - + /// /// packageLicenseUrl control. /// @@ -254,7 +254,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.TextBox packageLicenseUrl; - + /// /// RequiredFieldValidator6 control. /// @@ -263,7 +263,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator6; - + /// /// Pane1_3 control. /// @@ -272,7 +272,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.Pane Pane1_3; - + /// /// pp_readme control. /// @@ -281,7 +281,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_readme; - + /// /// packageReadme control. /// @@ -290,7 +290,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.TextBox packageReadme; - + /// /// Pane2 control. /// @@ -299,7 +299,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.Pane Pane2; - + /// /// pp_content control. /// @@ -308,7 +308,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_content; - + /// /// content control. /// @@ -317,7 +317,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.PlaceHolder content; - + /// /// packageContentSubdirs control. /// @@ -326,7 +326,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.CheckBox packageContentSubdirs; - + /// /// Pane2_1 control. /// @@ -335,7 +335,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.Pane Pane2_1; - + /// /// documentTypes control. /// @@ -344,7 +344,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.CheckBoxList documentTypes; - + /// /// Pane2_2 control. /// @@ -353,7 +353,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.Pane Pane2_2; - + /// /// templates control. /// @@ -362,7 +362,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.CheckBoxList templates; - + /// /// Pane2_3 control. /// @@ -371,7 +371,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.Pane Pane2_3; - + /// /// stylesheets control. /// @@ -380,7 +380,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.CheckBoxList stylesheets; - + /// /// Pane2_4 control. /// @@ -389,7 +389,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.Pane Pane2_4; - + /// /// macros control. /// @@ -398,7 +398,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.CheckBoxList macros; - + /// /// Pane2_5 control. /// @@ -407,7 +407,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.Pane Pane2_5; - + /// /// languages control. /// @@ -416,7 +416,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.CheckBoxList languages; - + /// /// Pane2_6 control. /// @@ -425,7 +425,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.Pane Pane2_6; - + /// /// dictionary control. /// @@ -434,7 +434,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.CheckBoxList dictionary; - + /// /// Pane2_7 control. /// @@ -443,7 +443,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.Pane Pane2_7; - + /// /// cbl_datatypes control. /// @@ -452,7 +452,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.CheckBoxList cbl_datatypes; - + /// /// Pane3 control. /// @@ -461,7 +461,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.Pane Pane3; - + /// /// Pane3_1 control. /// @@ -470,7 +470,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.Pane Pane3_1; - + /// /// packageFilesRepeater control. /// @@ -479,7 +479,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Repeater packageFilesRepeater; - + /// /// packageFilePathNew control. /// @@ -488,7 +488,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.TextBox packageFilePathNew; - + /// /// createNewFilePath control. /// @@ -497,7 +497,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Button createNewFilePath; - + /// /// Pane3_2 control. /// @@ -506,7 +506,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.Pane Pane3_2; - + /// /// packageControlPath control. /// @@ -515,7 +515,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.TextBox packageControlPath; - + /// /// Pane4 control. /// @@ -524,7 +524,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.Pane Pane4; - + /// /// actionsVal control. /// @@ -533,7 +533,7 @@ namespace umbraco.presentation.developer.packages { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.CustomValidator actionsVal; - + /// /// tb_actions control. /// diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/installer.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/installer.aspx.cs index a4198edb8a..a05a4f1fdf 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/installer.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/installer.aspx.cs @@ -49,10 +49,10 @@ namespace umbraco.presentation.developer.packages ButtonLoadPackage.Attributes.Add("onClick", "jQuery(this).hide(); jQuery('#loadingbar').show();; return true;"); } - //if we are actually in the middle of installing something... meaning we keep redirecting back to this page with - // custom query strings + //if we are actually in the middle of installing something... meaning we keep redirecting back to this page with + // custom query strings // TODO: SD: This process needs to be fixed/changed/etc... to use the InstallPackageController - // http://issues.umbraco.org/issue/U4-1047 + // http://issues.umbraco.org/issue/U4-1047 if (!string.IsNullOrEmpty(Request.GetItemAsString("installing"))) { HideAllPanes(); @@ -344,13 +344,13 @@ namespace umbraco.presentation.developer.packages /// /// private void PerformPostInstallCleanup(int packageId, string dir) - { + { _installer.InstallCleanUp(packageId, dir); // Update ClientDependency version var clientDependencyConfig = new Umbraco.Core.Configuration.ClientDependencyConfiguration(Current.Logger); var clientDependencyUpdated = clientDependencyConfig.IncreaseVersionNumber(); - + //clear the tree cache - we'll do this here even though the browser will reload, but just in case it doesn't can't hurt. ClientTools.ClearClientTreeCache().RefreshTree("packager"); TreeDefinitionCollection.Instance.ReRegisterTrees(); @@ -369,9 +369,9 @@ namespace umbraco.presentation.developer.packages //and then copy over the files. This will take some time if it contains .dlls that will reboot the system.. _installer.InstallFiles(pId, tempFile.Value); - //TODO: This is a total hack, we need to refactor the installer to be just like the package installer during the + //TODO: This is a total hack, we need to refactor the installer to be just like the package installer during the // install process and use AJAX to ensure that app pool restarts and restarts PROPERLY before installing the business - // logic. Until then, we are going to put a thread sleep here for 2 seconds in hopes that we always fluke out and the app + // logic. Until then, we are going to put a thread sleep here for 2 seconds in hopes that we always fluke out and the app // pool will be restarted after redirect. Thread.Sleep(2000); diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/EditRelationType.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/EditRelationType.aspx.cs index ebb4d6f2be..2a38651262 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/EditRelationType.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/EditRelationType.aspx.cs @@ -32,7 +32,7 @@ // /// // /// Umbraco ObjectType used to represent all parent items in this relation type // /// -// /// +// /// // private UmbracoObjectTypes _parentObjectType; // /// @@ -41,7 +41,7 @@ // private UmbracoObjectTypes _childObjectType; // /// -// /// Gets the name of the parent object type for all relations in this relation type +// /// Gets the name of the parent object type for all relations in this relation type // /// // protected string ParentObjectType // { @@ -85,17 +85,17 @@ // this._relations = new List(); // using (var reader = uQuery.SqlHelper.ExecuteReader(@" -// SELECT A.id, +// SELECT A.id, // A.parentId, -// B.[text] AS parentText, -// A.childId, -// C.[text] AS childText, +// B.[text] AS parentText, +// A.childId, +// C.[text] AS childText, // A.relType, -// A.[datetime], -// A.comment -// FROM umbracoRelation A -// LEFT OUTER JOIN umbracoNode B ON A.parentId = B.id -// LEFT OUTER JOIN umbracoNode C ON A.childId = C.id +// A.[datetime], +// A.comment +// FROM umbracoRelation A +// LEFT OUTER JOIN umbracoNode B ON A.parentId = B.id +// LEFT OUTER JOIN umbracoNode C ON A.childId = C.id // WHERE A.relType = " + this._relationType.Id.ToString())) // { // while (reader.Read()) @@ -275,7 +275,7 @@ // var relationService = Services.RelationService; // relationService.Save(this._relationType); - + // ClientTools.ShowSpeechBubble(SpeechBubbleIcon.Save, "Relation Type Updated", bubbleBody); // } // } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/EditRelationType.aspx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/EditRelationType.aspx.designer.cs index 8f92c9f32a..3d1b215134 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/EditRelationType.aspx.designer.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/EditRelationType.aspx.designer.cs @@ -3,247 +3,247 @@ // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace umbraco.cms.presentation.developer.RelationTypes { - public partial class EditRelationType - { + public partial class EditRelationType + { - /// - /// tabControl control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.TabView tabControl; + /// + /// tabControl control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.TabView tabControl; - /// - /// idPane control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.Pane idPane; + /// + /// idPane control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.Pane idPane; - /// - /// idPropertyPanel control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.PropertyPanel idPropertyPanel; + /// + /// idPropertyPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.PropertyPanel idPropertyPanel; - /// - /// idLiteral control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Literal idLiteral; + /// + /// idLiteral control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal idLiteral; - /// - /// nameAliasPane control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.Pane nameAliasPane; + /// + /// nameAliasPane control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.Pane nameAliasPane; - /// - /// nameProperyPanel control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.PropertyPanel nameProperyPanel; + /// + /// nameProperyPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.PropertyPanel nameProperyPanel; - /// - /// nameTextBox control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox nameTextBox; + /// + /// nameTextBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox nameTextBox; - /// - /// nameRequiredFieldValidator control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.RequiredFieldValidator nameRequiredFieldValidator; + /// + /// nameRequiredFieldValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator nameRequiredFieldValidator; - /// - /// aliasPropertyPanel control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.PropertyPanel aliasPropertyPanel; + /// + /// aliasPropertyPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.PropertyPanel aliasPropertyPanel; - /// - /// aliasTextBox control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox aliasTextBox; + /// + /// aliasTextBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox aliasTextBox; - /// - /// aliasRequiredFieldValidator control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.RequiredFieldValidator aliasRequiredFieldValidator; + /// + /// aliasRequiredFieldValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator aliasRequiredFieldValidator; - /// - /// aliasCustomValidator control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.CustomValidator aliasCustomValidator; + /// + /// aliasCustomValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CustomValidator aliasCustomValidator; - /// - /// directionPane control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.Pane directionPane; + /// + /// directionPane control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.Pane directionPane; - /// - /// dualPropertyPanel control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.PropertyPanel dualPropertyPanel; + /// + /// dualPropertyPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.PropertyPanel dualPropertyPanel; - /// - /// dualRadioButtonList control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.RadioButtonList dualRadioButtonList; + /// + /// dualRadioButtonList control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RadioButtonList dualRadioButtonList; - /// - /// objectTypePane control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.Pane objectTypePane; + /// + /// objectTypePane control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.Pane objectTypePane; - /// - /// parentPropertyPanel control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.PropertyPanel parentPropertyPanel; + /// + /// parentPropertyPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.PropertyPanel parentPropertyPanel; - /// - /// parentLiteral control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Literal parentLiteral; + /// + /// parentLiteral control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal parentLiteral; - /// - /// childPropertyPanel control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.PropertyPanel childPropertyPanel; + /// + /// childPropertyPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.PropertyPanel childPropertyPanel; - /// - /// childLiteral control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Literal childLiteral; + /// + /// childLiteral control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal childLiteral; - /// - /// relationsCountPane control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.Pane relationsCountPane; + /// + /// relationsCountPane control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.Pane relationsCountPane; - /// - /// relationsCountPropertyPanel control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.PropertyPanel relationsCountPropertyPanel; + /// + /// relationsCountPropertyPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.PropertyPanel relationsCountPropertyPanel; - /// - /// relationsCountLiteral control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Literal relationsCountLiteral; + /// + /// relationsCountLiteral control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal relationsCountLiteral; - /// - /// relationsPane control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.Pane relationsPane; + /// + /// relationsPane control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.Pane relationsPane; - /// - /// relationsPropertyPanel control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.PropertyPanel relationsPropertyPanel; + /// + /// relationsPropertyPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.PropertyPanel relationsPropertyPanel; - /// - /// relationsRepeater control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Repeater relationsRepeater; - } + /// + /// relationsRepeater control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Repeater relationsRepeater; + } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/NewRelationType.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/NewRelationType.aspx.cs index c37feb57bd..3cfe6ff34e 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/NewRelationType.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/NewRelationType.aspx.cs @@ -6,84 +6,84 @@ using Umbraco.Core.Models; namespace umbraco.cms.presentation.developer.RelationTypes { - /// - /// Add a new Relation Type - /// + /// + /// Add a new Relation Type + /// [WebformsPageTreeAuthorize(Constants.Trees.RelationTypes)] - public partial class NewRelationType : UmbracoEnsuredPage - { - /// - /// On Load event - /// - /// this aspx page - /// EventArgs (expect empty) - protected void Page_Load(object sender, EventArgs e) - { - if (!this.Page.IsPostBack) - { - this.Form.DefaultFocus = this.descriptionTextBox.ClientID; - } + public partial class NewRelationType : UmbracoEnsuredPage + { + /// + /// On Load event + /// + /// this aspx page + /// EventArgs (expect empty) + protected void Page_Load(object sender, EventArgs e) + { + if (!this.Page.IsPostBack) + { + this.Form.DefaultFocus = this.descriptionTextBox.ClientID; + } - this.AppendUmbracoObjectTypes(this.parentDropDownList); - this.AppendUmbracoObjectTypes(this.childDropDownList); - } + this.AppendUmbracoObjectTypes(this.parentDropDownList); + this.AppendUmbracoObjectTypes(this.childDropDownList); + } - /// - /// Server side validation to ensure there are no existing relationshipTypes with the alias of - /// the relation type being added - /// - /// the aliasCustomValidator control - /// to set validation respose - protected void AliasCustomValidator_ServerValidate(object source, ServerValidateEventArgs args) - { - var relationService = Services.RelationService; - args.IsValid = relationService.GetRelationTypeByAlias(this.aliasTextBox.Text.Trim()) == null; - } + /// + /// Server side validation to ensure there are no existing relationshipTypes with the alias of + /// the relation type being added + /// + /// the aliasCustomValidator control + /// to set validation respose + protected void AliasCustomValidator_ServerValidate(object source, ServerValidateEventArgs args) + { + var relationService = Services.RelationService; + args.IsValid = relationService.GetRelationTypeByAlias(this.aliasTextBox.Text.Trim()) == null; + } - /// - /// Add a new relation type into the database, and redirects to it's editing page. - /// - /// expects the addButton control - /// expects EventArgs for addButton - protected void AddButton_Click(object sender, EventArgs e) - { - if (Page.IsValid) - { + /// + /// Add a new relation type into the database, and redirects to it's editing page. + /// + /// expects the addButton control + /// expects EventArgs for addButton + protected void AddButton_Click(object sender, EventArgs e) + { + if (Page.IsValid) + { var newRelationTypeAlias = this.aliasTextBox.Text.Trim(); - var relationService = Services.RelationService; - var relationType = new RelationType(new Guid(this.childDropDownList.SelectedValue), - new Guid(this.parentDropDownList.SelectedValue), newRelationTypeAlias, this.descriptionTextBox.Text) - { - IsBidirectional = this.dualRadioButtonList.SelectedValue == "1" - }; + var relationService = Services.RelationService; + var relationType = new RelationType(new Guid(this.childDropDownList.SelectedValue), + new Guid(this.parentDropDownList.SelectedValue), newRelationTypeAlias, this.descriptionTextBox.Text) + { + IsBidirectional = this.dualRadioButtonList.SelectedValue == "1" + }; relationService.Save(relationType); - var newRelationTypeId = relationService.GetRelationTypeByAlias(newRelationTypeAlias).Id; + var newRelationTypeId = relationService.GetRelationTypeByAlias(newRelationTypeAlias).Id; - ClientTools.ChangeContentFrameUrl("developer/RelationTypes/EditRelationType.aspx?id=" + newRelationTypeId).CloseModalWindow().ChildNodeCreated(); - } - } + ClientTools.ChangeContentFrameUrl("developer/RelationTypes/EditRelationType.aspx?id=" + newRelationTypeId).CloseModalWindow().ChildNodeCreated(); + } + } - /// - /// Adds the Umbraco Object types to a drop down list - /// - /// control for which to add the Umbraco object types - private void AppendUmbracoObjectTypes(ListControl dropDownList) - { + /// + /// Adds the Umbraco Object types to a drop down list + /// + /// control for which to add the Umbraco object types + private void AppendUmbracoObjectTypes(ListControl dropDownList) + { dropDownList.Items.Add(new ListItem(UmbracoObjectTypes.Document.GetFriendlyName(), Umbraco.Core.Constants.ObjectTypes.Document)); - dropDownList.Items.Add(new ListItem(UmbracoObjectTypes.Media.GetFriendlyName(), Umbraco.Core.Constants.ObjectTypes.Media)); - dropDownList.Items.Add(new ListItem(UmbracoObjectTypes.Member.GetFriendlyName(), Umbraco.Core.Constants.ObjectTypes.Member)); - dropDownList.Items.Add(new ListItem(UmbracoObjectTypes.MediaType.GetFriendlyName(), Umbraco.Core.Constants.ObjectTypes.MediaType)); - dropDownList.Items.Add(new ListItem(UmbracoObjectTypes.DocumentType.GetFriendlyName(), Umbraco.Core.Constants.ObjectTypes.DocumentType)); - dropDownList.Items.Add(new ListItem(UmbracoObjectTypes.MemberType.GetFriendlyName(), Umbraco.Core.Constants.ObjectTypes.MemberType)); - dropDownList.Items.Add(new ListItem(UmbracoObjectTypes.DataType.GetFriendlyName(), Umbraco.Core.Constants.ObjectTypes.DataType)); - dropDownList.Items.Add(new ListItem(UmbracoObjectTypes.MemberGroup.GetFriendlyName(), Umbraco.Core.Constants.ObjectTypes.MemberGroup)); - dropDownList.Items.Add(new ListItem(UmbracoObjectTypes.Stylesheet.GetFriendlyName(), Umbraco.Core.Constants.ObjectTypes.Stylesheet)); - dropDownList.Items.Add(new ListItem(UmbracoObjectTypes.Template.GetFriendlyName(), Umbraco.Core.Constants.ObjectTypes.Template)); - dropDownList.Items.Add(new ListItem(UmbracoObjectTypes.ROOT.GetFriendlyName(), Umbraco.Core.Constants.ObjectTypes.SystemRoot)); - dropDownList.Items.Add(new ListItem(UmbracoObjectTypes.RecycleBin.GetFriendlyName(), Umbraco.Core.Constants.ObjectTypes.ContentRecycleBin)); - } - } + dropDownList.Items.Add(new ListItem(UmbracoObjectTypes.Media.GetFriendlyName(), Umbraco.Core.Constants.ObjectTypes.Media)); + dropDownList.Items.Add(new ListItem(UmbracoObjectTypes.Member.GetFriendlyName(), Umbraco.Core.Constants.ObjectTypes.Member)); + dropDownList.Items.Add(new ListItem(UmbracoObjectTypes.MediaType.GetFriendlyName(), Umbraco.Core.Constants.ObjectTypes.MediaType)); + dropDownList.Items.Add(new ListItem(UmbracoObjectTypes.DocumentType.GetFriendlyName(), Umbraco.Core.Constants.ObjectTypes.DocumentType)); + dropDownList.Items.Add(new ListItem(UmbracoObjectTypes.MemberType.GetFriendlyName(), Umbraco.Core.Constants.ObjectTypes.MemberType)); + dropDownList.Items.Add(new ListItem(UmbracoObjectTypes.DataType.GetFriendlyName(), Umbraco.Core.Constants.ObjectTypes.DataType)); + dropDownList.Items.Add(new ListItem(UmbracoObjectTypes.MemberGroup.GetFriendlyName(), Umbraco.Core.Constants.ObjectTypes.MemberGroup)); + dropDownList.Items.Add(new ListItem(UmbracoObjectTypes.Stylesheet.GetFriendlyName(), Umbraco.Core.Constants.ObjectTypes.Stylesheet)); + dropDownList.Items.Add(new ListItem(UmbracoObjectTypes.Template.GetFriendlyName(), Umbraco.Core.Constants.ObjectTypes.Template)); + dropDownList.Items.Add(new ListItem(UmbracoObjectTypes.ROOT.GetFriendlyName(), Umbraco.Core.Constants.ObjectTypes.SystemRoot)); + dropDownList.Items.Add(new ListItem(UmbracoObjectTypes.RecycleBin.GetFriendlyName(), Umbraco.Core.Constants.ObjectTypes.ContentRecycleBin)); + } + } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/NewRelationType.aspx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/NewRelationType.aspx.designer.cs index 09080af7d9..a1810b986f 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/NewRelationType.aspx.designer.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/NewRelationType.aspx.designer.cs @@ -3,166 +3,166 @@ // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace umbraco.cms.presentation.developer.RelationTypes { - public partial class NewRelationType - { + public partial class NewRelationType + { - /// - /// nameAliasPane control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.Pane nameAliasPane; + /// + /// nameAliasPane control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.Pane nameAliasPane; - /// - /// nameProperyPanel control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.PropertyPanel nameProperyPanel; + /// + /// nameProperyPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.PropertyPanel nameProperyPanel; - /// - /// descriptionTextBox control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox descriptionTextBox; + /// + /// descriptionTextBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox descriptionTextBox; - /// - /// descriptionRequiredFieldValidator control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.RequiredFieldValidator descriptionRequiredFieldValidator; + /// + /// descriptionRequiredFieldValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator descriptionRequiredFieldValidator; - /// - /// aliasPropertyPanel control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.PropertyPanel aliasPropertyPanel; + /// + /// aliasPropertyPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.PropertyPanel aliasPropertyPanel; - /// - /// aliasTextBox control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox aliasTextBox; + /// + /// aliasTextBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox aliasTextBox; - /// - /// aliasRequiredFieldValidator control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.RequiredFieldValidator aliasRequiredFieldValidator; + /// + /// aliasRequiredFieldValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator aliasRequiredFieldValidator; - /// - /// aliasCustomValidator control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.CustomValidator aliasCustomValidator; + /// + /// aliasCustomValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CustomValidator aliasCustomValidator; - /// - /// directionPane control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.Pane directionPane; + /// + /// directionPane control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.Pane directionPane; - /// - /// PropertyPanel1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.PropertyPanel PropertyPanel1; + /// + /// PropertyPanel1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.PropertyPanel PropertyPanel1; - /// - /// dualRadioButtonList control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.RadioButtonList dualRadioButtonList; + /// + /// dualRadioButtonList control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RadioButtonList dualRadioButtonList; - /// - /// objectTypePane control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.Pane objectTypePane; + /// + /// objectTypePane control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.Pane objectTypePane; - /// - /// PropertyPanel2 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.PropertyPanel PropertyPanel2; + /// + /// PropertyPanel2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.PropertyPanel PropertyPanel2; - /// - /// parentDropDownList control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.DropDownList parentDropDownList; + /// + /// parentDropDownList control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList parentDropDownList; - /// - /// PropertyPanel3 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.PropertyPanel PropertyPanel3; + /// + /// PropertyPanel3 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.PropertyPanel PropertyPanel3; - /// - /// childDropDownList control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.DropDownList childDropDownList; + /// + /// childDropDownList control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList childDropDownList; - /// - /// addButton control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Button addButton; - } + /// + /// addButton control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button addButton; + } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/RelationTypesWebService.asmx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/RelationTypesWebService.asmx.cs index a494965d1c..47969c600c 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/RelationTypesWebService.asmx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/RelationTypesWebService.asmx.cs @@ -5,30 +5,30 @@ using Umbraco.Web.Composing; namespace umbraco.cms.presentation.developer.RelationTypes { - /// - /// Webservice to delete relation types, this allows deletion via a javacscript call hooked into the tree UI - /// - [WebService(Namespace = "http://tempuri.org/")] - [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] - [System.ComponentModel.ToolboxItem(false)] - [System.Web.Script.Services.ScriptService] // Allows this Web Service to be called from script, using ASP.NET AJAX - public class RelationTypesWebService : WebService - { - /// - /// Delete an Umbraco RelationType and all it's associated Relations - /// - /// database id of the relation type to delete - [WebMethod] - public void DeleteRelationType(int relationTypeId) - { - var user = UmbracoContext.Current.Security.CurrentUser; + /// + /// Webservice to delete relation types, this allows deletion via a javacscript call hooked into the tree UI + /// + [WebService(Namespace = "http://tempuri.org/")] + [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] + [System.ComponentModel.ToolboxItem(false)] + [System.Web.Script.Services.ScriptService] // Allows this Web Service to be called from script, using ASP.NET AJAX + public class RelationTypesWebService : WebService + { + /// + /// Delete an Umbraco RelationType and all it's associated Relations + /// + /// database id of the relation type to delete + [WebMethod] + public void DeleteRelationType(int relationTypeId) + { + var user = UmbracoContext.Current.Security.CurrentUser; - if (user.UserType.Name == "Administrators") - { + if (user.UserType.Name == "Administrators") + { var relationService = Current.Services.RelationService; - var relationType = relationService.GetRelationTypeById(relationTypeId); - relationService.Delete(relationType); - } - } - } + var relationType = relationService.GetRelationTypeById(relationTypeId); + relationService.Delete(relationType); + } + } + } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/TreeMenu/ActionDeleteRelationType.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/TreeMenu/ActionDeleteRelationType.cs index b29758003d..307dca15c4 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/TreeMenu/ActionDeleteRelationType.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/TreeMenu/ActionDeleteRelationType.cs @@ -2,82 +2,82 @@ namespace umbraco.cms.presentation.developer.RelationTypes.TreeMenu { - /// - /// Delete a Relation Type - an Umbraco tree context menu action - /// - public class ActionDeleteRelationType : IAction - { - /// - /// Private field for the singleton instance - /// - private static readonly ActionDeleteRelationType instance = new ActionDeleteRelationType(); + /// + /// Delete a Relation Type - an Umbraco tree context menu action + /// + public class ActionDeleteRelationType : IAction + { + /// + /// Private field for the singleton instance + /// + private static readonly ActionDeleteRelationType instance = new ActionDeleteRelationType(); - /// - /// Gets a singleton instance of this action - /// - public static ActionDeleteRelationType Instance - { - get { return instance; } - } + /// + /// Gets a singleton instance of this action + /// + public static ActionDeleteRelationType Instance + { + get { return instance; } + } - #region IAction Members + #region IAction Members - /// - /// Gets a string alias used to identify this action - /// - public string Alias - { - get { return "delete"; } - } + /// + /// Gets a string alias used to identify this action + /// + public string Alias + { + get { return "delete"; } + } - /// - /// Gets a unique char to associate with this action - /// - public char Letter - { - get { return '¤'; } - } + /// + /// Gets a unique char to associate with this action + /// + public char Letter + { + get { return '¤'; } + } - /// - /// Gets a value indicating whether the Umbraco notification area is used ? - /// - public bool ShowInNotifier - { - get { return false; } - } + /// + /// Gets a value indicating whether the Umbraco notification area is used ? + /// + public bool ShowInNotifier + { + get { return false; } + } - /// - /// Gets a value indicating whether this action can be configured for use only by specific members - /// - public bool CanBePermissionAssigned - { - get { return false; } // Since this tree is in the developer section, no further granular permissions are required - } + /// + /// Gets a value indicating whether this action can be configured for use only by specific members + /// + public bool CanBePermissionAssigned + { + get { return false; } // Since this tree is in the developer section, no further granular permissions are required + } - /// - /// Gets an icon to be used for the right click action - /// - public string Icon - { + /// + /// Gets an icon to be used for the right click action + /// + public string Icon + { get { return "delete"; } // delete refers to an existing sprite - } + } - /// - /// Gets a string for the javascript source - /// - public string JsSource - { - get { return "developer/RelationTypes/TreeMenu/ActionDeleteRelationType.js"; } - } + /// + /// Gets a string for the javascript source + /// + public string JsSource + { + get { return "developer/RelationTypes/TreeMenu/ActionDeleteRelationType.js"; } + } - /// - /// Gets a javascript string to execute when this action is fired - /// - public string JsFunctionName - { - get { return "javascript:actionDeleteRelationType(UmbClientMgr.mainTree().getActionNode().nodeId,UmbClientMgr.mainTree().getActionNode().nodeName);"; } - } + /// + /// Gets a javascript string to execute when this action is fired + /// + public string JsFunctionName + { + get { return "javascript:actionDeleteRelationType(UmbClientMgr.mainTree().getActionNode().nodeId,UmbClientMgr.mainTree().getActionNode().nodeName);"; } + } - #endregion - } + #endregion + } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/TreeMenu/ActionNewRelationType.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/TreeMenu/ActionNewRelationType.cs index 0e0ae5bc07..61862564e8 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/TreeMenu/ActionNewRelationType.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/TreeMenu/ActionNewRelationType.cs @@ -2,82 +2,82 @@ namespace umbraco.cms.presentation.developer.RelationTypes.TreeMenu { - /// - /// Create new Relation Type - an Umbraco tree context menu action - /// - public class ActionNewRelationType : IAction - { - /// - /// Private field for the singleton instance - /// - private static readonly ActionNewRelationType instance = new ActionNewRelationType(); + /// + /// Create new Relation Type - an Umbraco tree context menu action + /// + public class ActionNewRelationType : IAction + { + /// + /// Private field for the singleton instance + /// + private static readonly ActionNewRelationType instance = new ActionNewRelationType(); - /// - /// Gets a singleton instance of this action - /// - public static ActionNewRelationType Instance - { - get { return instance; } - } + /// + /// Gets a singleton instance of this action + /// + public static ActionNewRelationType Instance + { + get { return instance; } + } - #region IAction Members + #region IAction Members - /// - /// Gets a string alias used to identify this action - /// - public string Alias - { - get { return "create"; } - } + /// + /// Gets a string alias used to identify this action + /// + public string Alias + { + get { return "create"; } + } - /// - /// Gets a unique char to associate with this action - /// - public char Letter - { - get { return '®'; } - } + /// + /// Gets a unique char to associate with this action + /// + public char Letter + { + get { return '®'; } + } - /// - /// Gets a value indicating whether the Umbraco notification area is used ? - /// - public bool ShowInNotifier - { - get { return false; } - } + /// + /// Gets a value indicating whether the Umbraco notification area is used ? + /// + public bool ShowInNotifier + { + get { return false; } + } - /// - /// Gets a value indicating whether this action can be configured for use only by specific members - /// - public bool CanBePermissionAssigned - { - get { return false; } // Since this tree is in the developer section, no further granular permissions are required - } + /// + /// Gets a value indicating whether this action can be configured for use only by specific members + /// + public bool CanBePermissionAssigned + { + get { return false; } // Since this tree is in the developer section, no further granular permissions are required + } - /// - /// Gets an icon to be used for the right click action - /// - public string Icon - { - get { return "add"; } // add refers to an existing sprite - } + /// + /// Gets an icon to be used for the right click action + /// + public string Icon + { + get { return "add"; } // add refers to an existing sprite + } - /// - /// Gets a string for the javascript source - /// - public string JsSource - { - get { return "developer/RelationTypes/TreeMenu/ActionNewRelationType.js"; } - } + /// + /// Gets a string for the javascript source + /// + public string JsSource + { + get { return "developer/RelationTypes/TreeMenu/ActionNewRelationType.js"; } + } - /// - /// Gets a javascript string to execute when this action is fired - /// - public string JsFunctionName - { - get { return "javascript:actionNewRelationType();"; } - } + /// + /// Gets a javascript string to execute when this action is fired + /// + public string JsFunctionName + { + get { return "javascript:actionNewRelationType();"; } + } - #endregion - } + #endregion + } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/editXslt.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/editXslt.aspx.cs index 53133358ce..0768475133 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/editXslt.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/editXslt.aspx.cs @@ -12,35 +12,35 @@ using Umbraco.Web.UI.Pages; namespace umbraco.cms.presentation.developer { - /// - /// Summary description for editXslt. - /// + /// + /// Summary description for editXslt. + /// [WebformsPageTreeAuthorize(Constants.Trees.Xslt)] - public partial class editXslt : UmbracoEnsuredPage - { + public partial class editXslt : UmbracoEnsuredPage + { - protected PlaceHolder buttons; + protected PlaceHolder buttons; protected MenuButton SaveButton; - protected void Page_Load(object sender, EventArgs e) - { - if (!IsPostBack) - { - string file = Request.QueryString["file"]; - string path = BaseTree.GetTreePathFromFilePath(file); - ClientTools - .SetActiveTreeType(Constants.Trees.Xslt) - .SyncTree(path, false); - } + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + string file = Request.QueryString["file"]; + string path = BaseTree.GetTreePathFromFilePath(file); + ClientTools + .SetActiveTreeType(Constants.Trees.Xslt) + .SyncTree(path, false); + } - } + } - protected override void OnInit(EventArgs e) - { - base.OnInit(e); + protected override void OnInit(EventArgs e) + { + base.OnInit(e); SaveButton = UmbracoPanel1.Menu.NewButton(); SaveButton.ToolTip = "Save Xslt File"; @@ -56,147 +56,147 @@ namespace umbraco.cms.presentation.developer props.Controls.Add(pane2); var tmp = editorSource.Menu.NewIcon(); - tmp.ImageURL = IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/images/editor/insField.GIF"; - tmp.OnClickCommand = ClientTools.Scripts.OpenModalWindow(IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/developer/xslt/xsltinsertvalueof.aspx?objectId=" + editorSource.ClientID, "Insert value", 750, 250); - //"umbracoInsertField(document.getElementById('editorSource'), 'xsltInsertValueOf', '','felt', 750, 230, '');"; - tmp.AltText = "Insert xslt:value-of"; + tmp.ImageURL = IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/images/editor/insField.GIF"; + tmp.OnClickCommand = ClientTools.Scripts.OpenModalWindow(IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/developer/xslt/xsltinsertvalueof.aspx?objectId=" + editorSource.ClientID, "Insert value", 750, 250); + //"umbracoInsertField(document.getElementById('editorSource'), 'xsltInsertValueOf', '','felt', 750, 230, '');"; + tmp.AltText = "Insert xslt:value-of"; editorSource.Menu.InsertSplitter(); tmp = editorSource.Menu.NewIcon(); - tmp.ImageURL = SystemDirectories.Umbraco + "/images/editor/insMemberItem.GIF"; - tmp.OnClickCommand = "UmbEditor.Insert('\\n', '" + editorSource.ClientID + "'); return false;"; - tmp.AltText = "Insert xsl:variable"; + tmp.ImageURL = SystemDirectories.Umbraco + "/images/editor/insMemberItem.GIF"; + tmp.OnClickCommand = "UmbEditor.Insert('\\n', '" + editorSource.ClientID + "'); return false;"; + tmp.AltText = "Insert xsl:variable"; editorSource.Menu.InsertSplitter(); tmp = editorSource.Menu.NewIcon(); - tmp.ImageURL = SystemDirectories.Umbraco + "/images/editor/insChildTemplateNew.GIF"; - tmp.OnClickCommand = "UmbEditor.Insert('\\n', '\\n\\n', '" + editorSource.ClientID + "'); return false;"; - tmp.AltText = "Insert xsl:if"; + tmp.ImageURL = SystemDirectories.Umbraco + "/images/editor/insChildTemplateNew.GIF"; + tmp.OnClickCommand = "UmbEditor.Insert('\\n', '\\n\\n', '" + editorSource.ClientID + "'); return false;"; + tmp.AltText = "Insert xsl:if"; tmp = editorSource.Menu.NewIcon(); - tmp.ImageURL = SystemDirectories.Umbraco + "/images/editor/insChildTemplateNew.GIF"; - tmp.OnClickCommand = "UmbEditor.Insert('\\n', '\\n\\n', '" + editorSource.ClientID + "'); return false;"; - tmp.AltText = "Insert xsl:for-each"; + tmp.ImageURL = SystemDirectories.Umbraco + "/images/editor/insChildTemplateNew.GIF"; + tmp.OnClickCommand = "UmbEditor.Insert('\\n', '\\n\\n', '" + editorSource.ClientID + "'); return false;"; + tmp.AltText = "Insert xsl:for-each"; editorSource.Menu.InsertSplitter(); tmp = editorSource.Menu.NewIcon(); - tmp.ImageURL = SystemDirectories.Umbraco + "/images/editor/insFieldByLevel.GIF"; - tmp.OnClickCommand = "UmbEditor.Insert('\\n\\n', '\\n\\n\\n\\n\\n', '" + editorSource.ClientID + "'); return false;"; - tmp.AltText = "Insert xsl:choose"; + tmp.ImageURL = SystemDirectories.Umbraco + "/images/editor/insFieldByLevel.GIF"; + tmp.OnClickCommand = "UmbEditor.Insert('\\n\\n', '\\n\\n\\n\\n\\n', '" + editorSource.ClientID + "'); return false;"; + tmp.AltText = "Insert xsl:choose"; editorSource.Menu.InsertSplitter(); tmp = editorSource.Menu.NewIcon(); - tmp.ImageURL = SystemDirectories.Umbraco + "/images/editor/xslVisualize.GIF"; - tmp.OnClickCommand = "xsltVisualize();"; - tmp.AltText = "Visualize XSLT"; + tmp.ImageURL = SystemDirectories.Umbraco + "/images/editor/xslVisualize.GIF"; + tmp.OnClickCommand = "xsltVisualize();"; + tmp.AltText = "Visualize XSLT"; - // Add source and filename - var file = IOHelper.MapPath(SystemDirectories.Xslt + "/" + Request.QueryString["file"]); + // Add source and filename + var file = IOHelper.MapPath(SystemDirectories.Xslt + "/" + Request.QueryString["file"]); - // validate file - IOHelper.ValidateEditPath(file, SystemDirectories.Xslt); - // validate extension - IOHelper.ValidateFileExtension(file, new List() { "xslt", "xsl" }); + // validate file + IOHelper.ValidateEditPath(file, SystemDirectories.Xslt); + // validate extension + IOHelper.ValidateFileExtension(file, new List() { "xslt", "xsl" }); - xsltFileName.Text = file.Replace(IOHelper.MapPath(SystemDirectories.Xslt), "").Substring(1).Replace(@"\", "/"); + xsltFileName.Text = file.Replace(IOHelper.MapPath(SystemDirectories.Xslt), "").Substring(1).Replace(@"\", "/"); - StreamReader SR; - string S; - SR = File.OpenText(file); + StreamReader SR; + string S; + SR = File.OpenText(file); - S = SR.ReadToEnd(); - SR.Close(); + S = SR.ReadToEnd(); + SR.Close(); - editorSource.Text = S; - } + editorSource.Text = S; + } - protected override void OnPreRender(EventArgs e) - { - base.OnPreRender(e); + protected override void OnPreRender(EventArgs e) + { + base.OnPreRender(e); - ScriptManager.GetCurrent(Page).Services.Add(new ServiceReference(IOHelper.ResolveUrl(SystemDirectories.WebServices) + "/codeEditorSave.asmx")); - ScriptManager.GetCurrent(Page).Services.Add(new ServiceReference(IOHelper.ResolveUrl(SystemDirectories.WebServices) + "/legacyAjaxCalls.asmx")); - } + ScriptManager.GetCurrent(Page).Services.Add(new ServiceReference(IOHelper.ResolveUrl(SystemDirectories.WebServices) + "/codeEditorSave.asmx")); + ScriptManager.GetCurrent(Page).Services.Add(new ServiceReference(IOHelper.ResolveUrl(SystemDirectories.WebServices) + "/legacyAjaxCalls.asmx")); + } - /// - /// JsInclude1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude1; + /// + /// JsInclude1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::ClientDependency.Core.Controls.JsInclude JsInclude1; - /// - /// UmbracoPanel1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.TabView UmbracoPanel1; + /// + /// UmbracoPanel1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.TabView UmbracoPanel1; - /// - /// Pane1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.Pane pane1; + /// + /// Pane1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.Pane pane1; protected global::Umbraco.Web._Legacy.Controls.Pane pane2; - /// - /// pp_filename control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_filename; + /// + /// pp_filename control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_filename; - /// - /// xsltFileName control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox xsltFileName; + /// + /// xsltFileName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox xsltFileName; - /// - /// pp_errorMsg control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_errorMsg; + /// + /// pp_errorMsg control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_errorMsg; - /// - /// editorSource control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.CodeArea editorSource; + /// + /// editorSource control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.CodeArea editorSource; - /// - /// editorJs control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Literal editorJs; - } + /// + /// editorJs control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal editorJs; + } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/getXsltStatus.asmx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/getXsltStatus.asmx.cs index ae0b9f8166..99a74b0d8c 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/getXsltStatus.asmx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/getXsltStatus.asmx.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.ComponentModel; using System.Data; @@ -13,76 +13,76 @@ using Umbraco.Web.WebServices; namespace umbraco.developer { - /// - /// Summary description for getXsltStatus. - /// - [WebService(Namespace="http://umbraco.org/webservices")] - public class getXsltStatus : UmbracoAuthorizedWebService + /// + /// Summary description for getXsltStatus. + /// + [WebService(Namespace="http://umbraco.org/webservices")] + public class getXsltStatus : UmbracoAuthorizedWebService { - public getXsltStatus() - { - //CODEGEN: This call is required by the ASP.NET Web Services Designer - InitializeComponent(); - } + public getXsltStatus() + { + //CODEGEN: This call is required by the ASP.NET Web Services Designer + InitializeComponent(); + } - // TODO: Security-check - [WebMethod] - public XmlDocument FilesFromDirectory(string dir) - { - AuthorizeRequest(true); + // TODO: Security-check + [WebMethod] + public XmlDocument FilesFromDirectory(string dir) + { + AuthorizeRequest(true); - XmlDocument xd = new XmlDocument(); - xd.LoadXml(""); - foreach (string file in System.IO.Directory.GetFiles(IOHelper.MapPath(SystemDirectories.Umbraco + "/xslt/" + dir), "*.xsl*")) - { - FileInfo fi = new FileInfo(file); - FileAttributes fa = fi.Attributes; - XmlElement fileXml = xd.CreateElement("file"); - fileXml.SetAttribute("name", fi.Name); - //fileXml.SetAttribute("created", fi.CreationTimeUtc); - fileXml.SetAttribute("modified", fi.LastWriteTimeUtc.ToString()); - fileXml.SetAttribute("size", fi.Length.ToString()); - xd.DocumentElement.AppendChild((XmlNode) fileXml); - } - return xd; - } + XmlDocument xd = new XmlDocument(); + xd.LoadXml(""); + foreach (string file in System.IO.Directory.GetFiles(IOHelper.MapPath(SystemDirectories.Umbraco + "/xslt/" + dir), "*.xsl*")) + { + FileInfo fi = new FileInfo(file); + FileAttributes fa = fi.Attributes; + XmlElement fileXml = xd.CreateElement("file"); + fileXml.SetAttribute("name", fi.Name); + //fileXml.SetAttribute("created", fi.CreationTimeUtc); + fileXml.SetAttribute("modified", fi.LastWriteTimeUtc.ToString()); + fileXml.SetAttribute("size", fi.Length.ToString()); + xd.DocumentElement.AppendChild((XmlNode) fileXml); + } + return xd; + } - #region Component Designer generated code - - //Required by the Web Services Designer - private IContainer components = null; - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - } + #region Component Designer generated code - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if(disposing && components != null) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #endregion + //Required by the Web Services Designer + private IContainer components = null; - // WEB SERVICE EXAMPLE - // The HelloWorld() example service returns the string Hello World - // To build, uncomment the following lines then save and build the project - // To test this web service, press F5 + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + } -// [WebMethod] -// public string HelloWorld() -// { -// return "Hello World"; -// } - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if(disposing && components != null) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #endregion + + // WEB SERVICE EXAMPLE + // The HelloWorld() example service returns the string Hello World + // To build, uncomment the following lines then save and build the project + // To test this web service, press F5 + +// [WebMethod] +// public string HelloWorld() +// { +// return "Hello World"; +// } + } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/xsltChooseExtension.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/xsltChooseExtension.aspx.cs index 52b6b78678..e258a69a65 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/xsltChooseExtension.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/xsltChooseExtension.aspx.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.Collections.Generic; using System.Reflection; @@ -14,84 +14,84 @@ namespace umbraco.developer /// Summary description for xsltChooseExtension. /// [WebformsPageTreeAuthorize(Constants.Trees.Xslt)] - public partial class xsltChooseExtension : UmbracoEnsuredPage - { + public partial class xsltChooseExtension : UmbracoEnsuredPage + { - protected void Page_Load(object sender, System.EventArgs e) - { + protected void Page_Load(object sender, System.EventArgs e) + { SortedList> ht = GetXsltAssembliesAndMethods(); - if (!IsPostBack) - { - assemblies.Attributes.Add("onChange", "document.forms[0].submit()"); - foreach(string s in ht.Keys) - assemblies.Items.Add(new ListItem(s)); + if (!IsPostBack) + { + assemblies.Attributes.Add("onChange", "document.forms[0].submit()"); + foreach(string s in ht.Keys) + assemblies.Items.Add(new ListItem(s)); - // Select the umbraco extensions as default - assemblies.Items[0].Selected = true; - } + // Select the umbraco extensions as default + assemblies.Items[0].Selected = true; + } - string selectedMethod = ""; - if (methods.SelectedValue != "") - { - selectedMethod = methods.SelectedValue; - PlaceHolderParamters.Controls.Clear(); - PlaceHolderParamters.Controls.Add(new LiteralControl("
" + assemblies.SelectedItem + ":" + methods.SelectedValue.Substring(0, methods.SelectedValue.IndexOf("(")) + "(")); + string selectedMethod = ""; + if (methods.SelectedValue != "") + { + selectedMethod = methods.SelectedValue; + PlaceHolderParamters.Controls.Clear(); + PlaceHolderParamters.Controls.Add(new LiteralControl("
" + assemblies.SelectedItem + ":" + methods.SelectedValue.Substring(0, methods.SelectedValue.IndexOf("(")) + "(")); PlaceHolderParamters.Controls.Add(new LiteralControl("")); - int counter = 0; - string[] props = methods.SelectedValue.Substring(methods.SelectedValue.IndexOf("(") + 1, methods.SelectedValue.IndexOf(")") - methods.SelectedValue.IndexOf("(") - 1).Split(','); - - foreach (string s in props) - { - if (s.Trim() != "") - { - counter++; - TextBox t = new TextBox(); - t.ID = "param" + Guid.NewGuid().ToString(); - t.Text = s.Trim(); - t.TabIndex = (short) counter; - t.Attributes.Add("onFocus", "if (this.value == '" + s.Trim() + "') this.value = '';"); - t.Attributes.Add("onBlur", "if (this.value == '') this.value = '" + s.Trim() + "'"); - t.Attributes.Add("style", "width:80px;"); - PlaceHolderParamters.Controls.Add(t); + int counter = 0; + string[] props = methods.SelectedValue.Substring(methods.SelectedValue.IndexOf("(") + 1, methods.SelectedValue.IndexOf(")") - methods.SelectedValue.IndexOf("(") - 1).Split(','); + + foreach (string s in props) + { + if (s.Trim() != "") + { + counter++; + TextBox t = new TextBox(); + t.ID = "param" + Guid.NewGuid().ToString(); + t.Text = s.Trim(); + t.TabIndex = (short) counter; + t.Attributes.Add("onFocus", "if (this.value == '" + s.Trim() + "') this.value = '';"); + t.Attributes.Add("onBlur", "if (this.value == '') this.value = '" + s.Trim() + "'"); + t.Attributes.Add("style", "width:80px;"); + PlaceHolderParamters.Controls.Add(t); if(counter < props.Length) PlaceHolderParamters.Controls.Add(new LiteralControl(",")); - } - } + } + } - counter++; + counter++; - //PlaceHolderParamters.Controls.Add(new LiteralControl(")

")); + //PlaceHolderParamters.Controls.Add(new LiteralControl(")

")); PlaceHolderParamters.Controls.Add(new LiteralControl(")
")); bt_insert.Enabled = true; - } - else - PlaceHolderParamters.Controls.Clear(); + } + else + PlaceHolderParamters.Controls.Clear(); - if (assemblies.SelectedValue != "") - { - methods.Items.Clear(); - methods.Items.Add(new ListItem("Choose method", "")); - methods.Attributes.Add("onChange", "document.forms[0].submit()"); - List methodList = ht[assemblies.SelectedValue]; + if (assemblies.SelectedValue != "") + { + methods.Items.Clear(); + methods.Items.Add(new ListItem("Choose method", "")); + methods.Attributes.Add("onChange", "document.forms[0].submit()"); + List methodList = ht[assemblies.SelectedValue]; foreach (string method in methodList) - { - ListItem li = new ListItem(method); + { + ListItem li = new ListItem(method); if (method == selectedMethod) - li.Selected = true; - methods.Items.Add(li); - } - } - } + li.Selected = true; + methods.Items.Add(li); + } + } + } /// /// Gets the XSLT assemblies and their methods. /// /// A list of assembly names linked to a list of method signatures. - private SortedList> GetXsltAssembliesAndMethods() - { + private SortedList> GetXsltAssembliesAndMethods() + { SortedList> _tempAssemblies = new SortedList>(); // add all extensions definied by macro @@ -101,9 +101,9 @@ namespace umbraco.developer // add the Umbraco library (not included in macro extensions) _tempAssemblies.Add("umbraco.library", GetStaticMethods(typeof(umbraco.library))); - return _tempAssemblies; + return _tempAssemblies; - } + } /// /// Gets the static methods of the specified type, alphabetically sorted. @@ -140,25 +140,25 @@ namespace umbraco.developer methods.Sort(); return methods; } - - #region Web Form Designer generated code - override protected void OnInit(EventArgs e) - { - // - // CODEGEN: This call is required by the ASP.NET Web Form Designer. - // - InitializeComponent(); - base.OnInit(e); - } - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - } - #endregion - } + + #region Web Form Designer generated code + override protected void OnInit(EventArgs e) + { + // + // CODEGEN: This call is required by the ASP.NET Web Form Designer. + // + InitializeComponent(); + base.OnInit(e); + } + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + } + #endregion + } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/xsltChooseExtension.aspx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/xsltChooseExtension.aspx.designer.cs index 61084257b6..236667c51a 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/xsltChooseExtension.aspx.designer.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/xsltChooseExtension.aspx.designer.cs @@ -1,4 +1,4 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:2.0.50727.3053 @@ -9,10 +9,10 @@ //------------------------------------------------------------------------------ namespace umbraco.developer { - - + + public partial class xsltChooseExtension { - + /// /// assemblies control. /// @@ -21,7 +21,7 @@ namespace umbraco.developer { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.DropDownList assemblies; - + /// /// methods control. /// @@ -30,7 +30,7 @@ namespace umbraco.developer { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.DropDownList methods; - + /// /// PlaceHolderParamters control. /// @@ -39,7 +39,7 @@ namespace umbraco.developer { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.PlaceHolder PlaceHolderParamters; - + /// /// bt_insert control. /// diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/xsltInsertValueOf.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/xsltInsertValueOf.aspx.cs index 35c9fdbd2c..1a0c1d1c90 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/xsltInsertValueOf.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/xsltInsertValueOf.aspx.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.Linq; using System.Web.UI.WebControls; @@ -7,15 +7,15 @@ using Umbraco.Web.UI.Pages; namespace umbraco.developer { - /// - /// Summary description for xsltInsertValueOf. - /// + /// + /// Summary description for xsltInsertValueOf. + /// [WebformsPageTreeAuthorize(Constants.Trees.Xslt)] - public partial class xsltInsertValueOf : UmbracoEnsuredPage - { - protected void Page_Load(object sender, System.EventArgs e) - { - ArrayList preValuesSource = new ArrayList(); + public partial class xsltInsertValueOf : UmbracoEnsuredPage + { + protected void Page_Load(object sender, System.EventArgs e) + { + ArrayList preValuesSource = new ArrayList(); // Attributes string[] attributes = {"@id", "@parentID", "@level", "@writerID", "@nodeType", "@template", "@sortOrder", "@createDate", "@creatorName", "@updateDate", "@nodeName", "@urlName", "@writerName", "@nodeTypeAlias", "@path"}; @@ -24,32 +24,32 @@ namespace umbraco.developer // generic properties string existingGenProps = ","; - var exclude = Constants.Conventions.Member.GetStandardPropertyTypeStubs().Select(x => x.Key).ToArray(); + var exclude = Constants.Conventions.Member.GetStandardPropertyTypeStubs().Select(x => x.Key).ToArray(); - var propertyTypes = Services.ContentTypeService.GetAllPropertyTypeAliases(); + var propertyTypes = Services.ContentTypeService.GetAllPropertyTypeAliases(); foreach (var ptAlias in propertyTypes.Where(x => exclude.Contains(x) == false)) - { + { if (!existingGenProps.Contains("," + ptAlias + ",")) { preValuesSource.Add(ptAlias); - + existingGenProps += ptAlias + ","; } - } - + } + preValuesSource.Sort(); - preValues.DataSource = preValuesSource; - preValues.DataBind(); - preValues.Items.Insert(0, new ListItem("Prevalues...", "")); + preValues.DataSource = preValuesSource; + preValues.DataBind(); + preValues.Items.Insert(0, new ListItem("Prevalues...", "")); - preValues.Attributes.Add("onChange", "if (this.value != '') document.getElementById('" + valueOf.ClientID + "').value = this.value"); + preValues.Attributes.Add("onChange", "if (this.value != '') document.getElementById('" + valueOf.ClientID + "').value = this.value"); if(!String.IsNullOrEmpty(Request.QueryString["value"])) valueOf.Text = Request.QueryString["value"]; - } + } - } + } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/xsltInsertValueOf.aspx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/xsltInsertValueOf.aspx.designer.cs index 8aecfe2a2f..10c24c58ed 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/xsltInsertValueOf.aspx.designer.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/xsltInsertValueOf.aspx.designer.cs @@ -1,4 +1,4 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:2.0.50727.4200 @@ -9,10 +9,10 @@ //------------------------------------------------------------------------------ namespace umbraco.developer { - - + + public partial class xsltInsertValueOf { - + /// /// JsInclude1 control. /// @@ -21,7 +21,7 @@ namespace umbraco.developer { /// To modify move field declaration from designer file to code-behind file. /// protected global::ClientDependency.Core.Controls.JsInclude JsInclude1; - + /// /// valueOf control. /// @@ -30,7 +30,7 @@ namespace umbraco.developer { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.TextBox valueOf; - + /// /// preValues control. /// @@ -39,7 +39,7 @@ namespace umbraco.developer { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.DropDownList preValues; - + /// /// disableOutputEscaping control. /// diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/xsltVisualize.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/xsltVisualize.aspx.cs index dae9d17088..fe4bca93e5 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/xsltVisualize.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/xsltVisualize.aspx.cs @@ -25,8 +25,8 @@ namespace umbraco.presentation.umbraco.developer.Xslt if (!IsPostBack) { // Check if cookie exists in the current request. - // zb-00004 #29956 : refactor cookies names & handling - if (Request.HasCookieValue(XsltVisualizeCookieName)) + // zb-00004 #29956 : refactor cookies names & handling + if (Request.HasCookieValue(XsltVisualizeCookieName)) contentPicker.Value = Request.GetCookieValue(XsltVisualizeCookieName); } @@ -73,10 +73,10 @@ namespace umbraco.presentation.umbraco.developer.Xslt // add cookie with current page - // zb-00004 #29956 : refactor cookies names & handling - Response.Cookies.Set(new HttpCookie(XsltVisualizeCookieName, contentPicker.Value) - { - Expires = DateTime.Now + TimeSpan.FromMinutes(20) + // zb-00004 #29956 : refactor cookies names & handling + Response.Cookies.Set(new HttpCookie(XsltVisualizeCookieName, contentPicker.Value) + { + Expires = DateTime.Now + TimeSpan.FromMinutes(20) }); } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/xsltVisualize.aspx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/xsltVisualize.aspx.designer.cs index 704948a622..394b3f7a3a 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/xsltVisualize.aspx.designer.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/xsltVisualize.aspx.designer.cs @@ -9,10 +9,10 @@ //------------------------------------------------------------------------------ namespace umbraco.presentation.umbraco.developer.Xslt { - - + + public partial class xsltVisualize { - + /// /// Pane1 control. /// @@ -21,7 +21,7 @@ namespace umbraco.presentation.umbraco.developer.Xslt { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.Pane Pane1; - + /// /// PropertyPanel1 control. /// @@ -30,7 +30,7 @@ namespace umbraco.presentation.umbraco.developer.Xslt { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.PropertyPanel PropertyPanel1; - + /// /// xsltSelection control. /// @@ -39,7 +39,7 @@ namespace umbraco.presentation.umbraco.developer.Xslt { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.HtmlControls.HtmlInputHidden xsltSelection; - + /// /// contentPicker control. /// @@ -48,7 +48,7 @@ namespace umbraco.presentation.umbraco.developer.Xslt { /// To modify move field declaration from designer file to code-behind file. /// protected global::umbraco.controls.ContentPicker contentPicker; - + /// /// visualizeDo control. /// @@ -57,7 +57,7 @@ namespace umbraco.presentation.umbraco.developer.Xslt { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Button visualizeDo; - + /// /// visualizeContainer control. /// @@ -66,7 +66,7 @@ namespace umbraco.presentation.umbraco.developer.Xslt { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.Pane visualizeContainer; - + /// /// visualizePanel control. /// @@ -75,7 +75,7 @@ namespace umbraco.presentation.umbraco.developer.Xslt { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.PropertyPanel visualizePanel; - + /// /// visualizeArea control. /// diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/autoDoc.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/autoDoc.aspx.cs index 288b5fab1b..2c4534859e 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/autoDoc.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/autoDoc.aspx.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -8,52 +8,52 @@ using Umbraco.Web.UI.Pages; namespace umbraco.developer { - /// - /// Summary description for autoDoc. - /// - public partial class autoDoc : UmbracoEnsuredPage - { - public autoDoc() - { - CurrentApp = Constants.Applications.Developer.ToString(); - } + /// + /// Summary description for autoDoc. + /// + public partial class autoDoc : UmbracoEnsuredPage + { + public autoDoc() + { + CurrentApp = Constants.Applications.Developer.ToString(); + } - protected void Page_Load(object sender, EventArgs e) - { + protected void Page_Load(object sender, EventArgs e) + { var sb = new StringBuilder(); AppendTypes(sb, Services.ContentTypeService.GetAll()); - AppendTypes(sb, Services.MediaTypeService.GetAll()); - AppendTypes(sb, Services.MemberTypeService.GetAll()); - LabelDoc.Text = sb.ToString(); - } + AppendTypes(sb, Services.MediaTypeService.GetAll()); + AppendTypes(sb, Services.MemberTypeService.GetAll()); + LabelDoc.Text = sb.ToString(); + } private void AppendTypes(StringBuilder text, IEnumerable types) - { - foreach (var type in types) - { - text.Append( - "

" + type.Name + "

Id: " + type.Id + ", Alias: " + type.Alias + ")

"); - if (type.PropertyTypes.Any()) - text.Append("

Property Types:

"); - foreach (var pt in type.PropertyTypes) - text.Append( + { + foreach (var type in types) + { + text.Append( + "

" + type.Name + "

Id: " + type.Id + ", Alias: " + type.Alias + ")

"); + if (type.PropertyTypes.Any()) + text.Append("

Property Types:

"); + foreach (var pt in type.PropertyTypes) + text.Append( "

" + pt.Id + ", " + pt.Alias + ", " + pt.Name + "

"); - if (type.PropertyGroups.Count > 0) - text.Append("

Tabs:

"); - foreach (var t in type.PropertyGroups) - text.Append( + if (type.PropertyGroups.Count > 0) + text.Append("

Tabs:

"); + foreach (var t in type.PropertyGroups) + text.Append( "

" + t.Id + ", " + t.Name + "

"); - if (type.AllowedContentTypes.Any()) - text.Append("

Allowed children:

"); - foreach (var child in type.AllowedContentTypes) - { - var contentType = types.First(x => x.Id == child.Id.Value); - text.Append( + if (type.AllowedContentTypes.Any()) + text.Append("

Allowed children:

"); + foreach (var child in type.AllowedContentTypes) + { + var contentType = types.First(x => x.Id == child.Id.Value); + text.Append( "

" + child.Id + ", " + contentType.Name + "

"); - } + } - text.Append("
"); - } + text.Append("
"); + } } } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/autoDoc.aspx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/autoDoc.aspx.designer.cs index 5ace170f12..e597a9b8a1 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/autoDoc.aspx.designer.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/autoDoc.aspx.designer.cs @@ -1,4 +1,4 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:2.0.50727.42 @@ -9,7 +9,7 @@ //------------------------------------------------------------------------------ namespace umbraco.developer { - + public partial class autoDoc { protected System.Web.UI.HtmlControls.HtmlForm Form1; protected System.Web.UI.WebControls.Label LabelDoc; diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/AssignDomain2.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/AssignDomain2.aspx.cs index 50e5629a2f..9eb763bfd6 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/AssignDomain2.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/AssignDomain2.aspx.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Text; using System.Linq; using Umbraco.Core; @@ -80,4 +80,4 @@ namespace umbraco.dialogs return path.TrimEnd(action).EnsureEndsWith('/'); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/AssignDomain2.aspx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/AssignDomain2.aspx.designer.cs index 588946d2ff..8975879c97 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/AssignDomain2.aspx.designer.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/AssignDomain2.aspx.designer.cs @@ -1,17 +1,17 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace umbraco.dialogs { - - + + public partial class AssignDomain2 { - + /// /// data control. /// @@ -20,7 +20,7 @@ namespace umbraco.dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Literal data; - + /// /// feedback control. /// @@ -29,7 +29,7 @@ namespace umbraco.dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.Feedback feedback; - + /// /// pane_language control. /// @@ -38,7 +38,7 @@ namespace umbraco.dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.Pane pane_language; - + /// /// prop_language control. /// @@ -47,7 +47,7 @@ namespace umbraco.dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.PropertyPanel prop_language; - + /// /// pane_domains control. /// @@ -56,7 +56,7 @@ namespace umbraco.dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.Pane pane_domains; - + /// /// p_buttons control. /// diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/Preview.aspx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/Preview.aspx.designer.cs index aac79aa1eb..f07d34b908 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/Preview.aspx.designer.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/Preview.aspx.designer.cs @@ -9,10 +9,10 @@ //------------------------------------------------------------------------------ namespace umbraco.presentation.dialogs { - - + + public partial class Preview { - + /// /// feedback1 control. /// @@ -21,7 +21,7 @@ namespace umbraco.presentation.dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.Feedback feedback1; - + /// /// pane_form control. /// @@ -30,7 +30,7 @@ namespace umbraco.presentation.dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.Pane pane_form; - + /// /// PropertyPanel1 control. /// @@ -39,7 +39,7 @@ namespace umbraco.presentation.dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.PropertyPanel PropertyPanel1; - + /// /// docLit control. /// @@ -48,7 +48,7 @@ namespace umbraco.presentation.dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Literal docLit; - + /// /// PropertyPanel2 control. /// @@ -57,7 +57,7 @@ namespace umbraco.presentation.dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.PropertyPanel PropertyPanel2; - + /// /// changeSetUrl control. /// diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/SendPublish.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/SendPublish.aspx.cs index 30ad7bce2e..0da4a4f111 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/SendPublish.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/SendPublish.aspx.cs @@ -1,23 +1,23 @@ -using System; +using System; using Umbraco.Web; using Umbraco.Core; using Umbraco.Web._Legacy.Actions; namespace umbraco.dialogs { - /// - /// Runs all action handlers for the ActionToPublish action for the document with + /// + /// Runs all action handlers for the ActionToPublish action for the document with /// the corresponding document id passed in by query string - /// - public partial class SendPublish : Umbraco.Web.UI.Pages.UmbracoEnsuredPage - { - public SendPublish() - { - CurrentApp = Constants.Applications.Content.ToString(); - } + /// + public partial class SendPublish : Umbraco.Web.UI.Pages.UmbracoEnsuredPage + { + public SendPublish() + { + CurrentApp = Constants.Applications.Content.ToString(); + } - protected void Page_Load(object sender, EventArgs e) - { + protected void Page_Load(object sender, EventArgs e) + { if (!string.IsNullOrEmpty(Request.QueryString["id"])) { int docId; @@ -30,8 +30,8 @@ namespace umbraco.dialogs } - } + } - } + } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/SendPublish.aspx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/SendPublish.aspx.designer.cs index 5b2becec2f..12bc9054fc 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/SendPublish.aspx.designer.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/SendPublish.aspx.designer.cs @@ -1,4 +1,4 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:2.0.50727.4200 @@ -9,8 +9,8 @@ //------------------------------------------------------------------------------ namespace umbraco.dialogs { - - + + public partial class SendPublish { } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/about.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/about.aspx.cs index 53fbe0f624..6e2cfe6633 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/about.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/about.aspx.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Globalization; using Umbraco.Core; using Umbraco.Core.Configuration; @@ -6,37 +6,37 @@ using Umbraco.Web.UI.Pages; namespace umbraco.dialogs { - /// - /// Summary description for about. - /// - public partial class about : UmbracoEnsuredPage - { + /// + /// Summary description for about. + /// + public partial class about : UmbracoEnsuredPage + { - protected void Page_Load(object sender, EventArgs e) - { - // Put user code to initialize the page here - thisYear.Text = DateTime.Now.Year.ToString(CultureInfo.InvariantCulture); - version.Text = UmbracoVersion.SemanticVersion.ToSemanticString(); - } + protected void Page_Load(object sender, EventArgs e) + { + // Put user code to initialize the page here + thisYear.Text = DateTime.Now.Year.ToString(CultureInfo.InvariantCulture); + version.Text = UmbracoVersion.SemanticVersion.ToSemanticString(); + } - #region Web Form Designer generated code - override protected void OnInit(EventArgs e) - { - // - // CODEGEN: This call is required by the ASP.NET Web Form Designer. - // - InitializeComponent(); - base.OnInit(e); - } - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { + #region Web Form Designer generated code + override protected void OnInit(EventArgs e) + { + // + // CODEGEN: This call is required by the ASP.NET Web Form Designer. + // + InitializeComponent(); + base.OnInit(e); + } - } - #endregion - } + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + + } + #endregion + } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/about.aspx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/about.aspx.designer.cs index 526ec5e833..9acd219cb3 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/about.aspx.designer.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/about.aspx.designer.cs @@ -1,17 +1,17 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace umbraco.dialogs { - - + + public partial class about { - + /// /// version control. /// @@ -20,7 +20,7 @@ namespace umbraco.dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Literal version; - + /// /// thisYear control. /// diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/create.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/create.aspx.cs index 4154e3edea..f1df183074 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/create.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/create.aspx.cs @@ -86,7 +86,7 @@ namespace umbraco.dialogs protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); - + ScriptManager.GetCurrent(Page).Services.Add(new ServiceReference(IOHelper.ResolveUrl(SystemDirectories.WebServices) + "/legacyAjaxCalls.asmx")); } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/cruds.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/cruds.aspx.cs index 2ea7149351..60155c6747 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/cruds.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/cruds.aspx.cs @@ -28,11 +28,11 @@ namespace umbraco.dialogs private readonly Dictionary _permissions = new Dictionary(); private IUmbracoEntity _node; - + protected void Page_Load(object sender, EventArgs e) { Button1.Text = Services.TextService.Localize("update"); - pane_form.Text = Services.TextService.Localize("actions/SetPermissionsForThePage",_node.Name); + pane_form.Text = Services.TextService.Localize("actions/SetPermissionsForThePage",_node.Name); } override protected void OnInit(EventArgs e) @@ -49,7 +49,7 @@ namespace umbraco.dialogs var corner = new HtmlTableCell("th"); corner.Style.Add("border", "none"); names.Cells.Add(corner); - + foreach (var a in Current.Actions) { if (a.CanBePermissionAssigned == false) continue; @@ -84,7 +84,7 @@ namespace umbraco.dialogs var chk = new CheckBox { //Each checkbox is named with the user _ permission alias so we can parse - ID = u.Id + "_" + a.Letter + ID = u.Id + "_" + a.Letter }; if (a.CanBePermissionAssigned == false) continue; @@ -108,7 +108,7 @@ namespace umbraco.dialogs //add all collected rows foreach (var perm in _permissions.Values) { - ht.Rows.Add(perm); + ht.Rows.Add(perm); } PlaceHolder1.Controls.Add(ht); @@ -117,13 +117,13 @@ namespace umbraco.dialogs protected void Button1_Click(object sender, EventArgs e) { - //get non disabled, non admin users and project to a dictionary, + //get non disabled, non admin users and project to a dictionary, // the string (value) portion will store the array of chars = their permissions long totalUsers; var usersPermissions = Services.UserService.GetAll(0, int.MaxValue, out totalUsers) .Where(user => user.IsApproved && user.Id > 0) .ToDictionary(user => user, user => ""); - + //iterate over each row which equals: // * a certain permission and the user's who will be allowed/denied that permission foreach (var row in _permissions) @@ -144,11 +144,11 @@ namespace umbraco.dialogs //get the char permission var permAlias = split[1]; //now append that char permission to the user - usersPermissions[user] += permAlias; + usersPermissions[user] += permAlias; } } } - + // Loop through the users and update their permissions foreach (var user in usersPermissions) { diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/exportDocumenttype.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/exportDocumenttype.aspx.cs index b9c73d4aa1..ce1b4fdeaf 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/exportDocumenttype.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/exportDocumenttype.aspx.cs @@ -1,33 +1,33 @@ -using System; +using System; using Umbraco.Core; using Umbraco.Core.Services; using Umbraco.Web; namespace umbraco.presentation.dialogs { - /// - /// Summary description for exportDocumenttype. - /// - public class exportDocumenttype : Umbraco.Web.UI.Pages.UmbracoEnsuredPage - { - public exportDocumenttype() - { + /// + /// Summary description for exportDocumenttype. + /// + public class exportDocumenttype : Umbraco.Web.UI.Pages.UmbracoEnsuredPage + { + public exportDocumenttype() + { CurrentApp = Constants.Applications.Settings.ToString(); - } - private void Page_Load(object sender, System.EventArgs e) - { - int documentTypeId = Request.GetItemAs("nodeID"); - if (documentTypeId > 0) - { - var contentType = Services.ContentTypeService.Get(documentTypeId); + } + private void Page_Load(object sender, System.EventArgs e) + { + int documentTypeId = Request.GetItemAs("nodeID"); + if (documentTypeId > 0) + { + var contentType = Services.ContentTypeService.Get(documentTypeId); if (contentType == null) throw new NullReferenceException("No content type found with id " + documentTypeId); - + Response.AddHeader("Content-Disposition", "attachment;filename=" + contentType.Alias + ".udt"); Response.ContentType = "application/octet-stream"; - var serializer = new EntityXmlSerializer(); - var xml = serializer.Serialize( + var serializer = new EntityXmlSerializer(); + var xml = serializer.Serialize( Services.DataTypeService, Services.ContentTypeService, contentType); @@ -36,24 +36,24 @@ namespace umbraco.presentation.dialogs } } - #region Web Form Designer generated code - override protected void OnInit(EventArgs e) - { - // - // CODEGEN: This call is required by the ASP.NET Web Form Designer. - // - InitializeComponent(); - base.OnInit(e); - } - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.Load += new System.EventHandler(this.Page_Load); - } - #endregion - } + #region Web Form Designer generated code + override protected void OnInit(EventArgs e) + { + // + // CODEGEN: This call is required by the ASP.NET Web Form Designer. + // + InitializeComponent(); + base.OnInit(e); + } + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.Load += new System.EventHandler(this.Page_Load); + } + #endregion + } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/importDocumenttype.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/importDocumenttype.aspx.cs index 582fb4dee0..d934ea725b 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/importDocumenttype.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/importDocumenttype.aspx.cs @@ -1,4 +1,4 @@ -using Umbraco.Core.Services; +using Umbraco.Core.Services; using System; using System.Linq; using System.Web.UI.WebControls; @@ -12,76 +12,76 @@ using Umbraco.Web.Composing; namespace umbraco.presentation.umbraco.dialogs { - /// - /// Summary description for importDocumentType. - /// - public class importDocumentType : Umbraco.Web.UI.Pages.UmbracoEnsuredPage - { - public importDocumentType() - { + /// + /// Summary description for importDocumentType. + /// + public class importDocumentType : Umbraco.Web.UI.Pages.UmbracoEnsuredPage + { + public importDocumentType() + { CurrentApp = Constants.Applications.Settings.ToString(); - } - protected Literal FeedBackMessage; - protected Literal jsShowWindow; - protected Panel Wizard; - protected HtmlTable Table1; - protected HtmlInputHidden tempFile; - protected HtmlInputFile documentTypeFile; - protected Button submit; - protected Panel Confirm; - protected Literal dtName; - protected Literal dtAlias; - protected Button import; - protected Literal dtNameConfirm; - protected Panel done; - private string tempFileName = ""; + } + protected Literal FeedBackMessage; + protected Literal jsShowWindow; + protected Panel Wizard; + protected HtmlTable Table1; + protected HtmlInputHidden tempFile; + protected HtmlInputFile documentTypeFile; + protected Button submit; + protected Panel Confirm; + protected Literal dtName; + protected Literal dtAlias; + protected Button import; + protected Literal dtNameConfirm; + protected Panel done; + private string tempFileName = ""; - private void Page_Load(object sender, EventArgs e) - { - if (!IsPostBack) - { - submit.Text = Services.TextService.Localize("import"); - import.Text = Services.TextService.Localize("import"); - } - } + private void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + submit.Text = Services.TextService.Localize("import"); + import.Text = Services.TextService.Localize("import"); + } + } - #region Web Form Designer generated code - override protected void OnInit(EventArgs e) - { - // - // CODEGEN: This call is required by the ASP.NET Web Form Designer. - // - InitializeComponent(); - base.OnInit(e); - } + #region Web Form Designer generated code + override protected void OnInit(EventArgs e) + { + // + // CODEGEN: This call is required by the ASP.NET Web Form Designer. + // + InitializeComponent(); + base.OnInit(e); + } - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.submit.Click += new System.EventHandler(this.submit_Click); - this.import.Click += new System.EventHandler(this.import_Click); - this.Load += new System.EventHandler(this.Page_Load); + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.submit.Click += new System.EventHandler(this.submit_Click); + this.import.Click += new System.EventHandler(this.import_Click); + this.Load += new System.EventHandler(this.Page_Load); - } - #endregion + } + #endregion - private void import_Click(object sender, EventArgs e) - { + private void import_Click(object sender, EventArgs e) + { var xd = new XmlDocument(); xd.Load(tempFile.Value); - var userId = Security.GetUserId(); + var userId = Security.GetUserId(); var element = XElement.Parse(xd.InnerXml); - var importContentTypes = Current.Services.PackagingService.ImportContentTypes(element, userId); - var contentType = importContentTypes.FirstOrDefault(); - if (contentType != null) - dtNameConfirm.Text = contentType.Name; + var importContentTypes = Current.Services.PackagingService.ImportContentTypes(element, userId); + var contentType = importContentTypes.FirstOrDefault(); + if (contentType != null) + dtNameConfirm.Text = contentType.Name; // Try to clean up the temporary file. try @@ -93,27 +93,27 @@ namespace umbraco.presentation.umbraco.dialogs Current.Logger.Error(typeof(importDocumentType), "Error cleaning up temporary udt file in App_Data: " + ex.Message, ex); } - Wizard.Visible = false; - Confirm.Visible = false; - done.Visible = true; - } + Wizard.Visible = false; + Confirm.Visible = false; + done.Visible = true; + } - private void submit_Click(object sender, EventArgs e) - { - tempFileName = "justDelete_" + Guid.NewGuid().ToString() + ".udt"; - var fileName = IOHelper.MapPath(SystemDirectories.Data + "/" + tempFileName); - tempFile.Value = fileName; + private void submit_Click(object sender, EventArgs e) + { + tempFileName = "justDelete_" + Guid.NewGuid().ToString() + ".udt"; + var fileName = IOHelper.MapPath(SystemDirectories.Data + "/" + tempFileName); + tempFile.Value = fileName; - documentTypeFile.PostedFile.SaveAs(fileName); + documentTypeFile.PostedFile.SaveAs(fileName); - var xd = new XmlDocument(); - xd.Load(fileName); - dtName.Text = xd.DocumentElement.SelectSingleNode("//DocumentType/Info/Name").FirstChild.Value; - dtAlias.Text = xd.DocumentElement.SelectSingleNode("//DocumentType/Info/Alias").FirstChild.Value; + var xd = new XmlDocument(); + xd.Load(fileName); + dtName.Text = xd.DocumentElement.SelectSingleNode("//DocumentType/Info/Name").FirstChild.Value; + dtAlias.Text = xd.DocumentElement.SelectSingleNode("//DocumentType/Info/Alias").FirstChild.Value; - Wizard.Visible = false; - done.Visible = false; - Confirm.Visible = true; - } - } + Wizard.Visible = false; + done.Visible = false; + Confirm.Visible = true; + } + } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/insertMasterpageContent.aspx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/insertMasterpageContent.aspx.designer.cs index fbda589028..bb533f26a7 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/insertMasterpageContent.aspx.designer.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/insertMasterpageContent.aspx.designer.cs @@ -3,15 +3,15 @@ // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace umbraco.presentation.umbraco.dialogs { - - + + public partial class insertMasterpageContent { - + /// /// pane_insert control. /// @@ -20,7 +20,7 @@ namespace umbraco.presentation.umbraco.dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.Pane pane_insert; - + /// /// pp_placeholder control. /// @@ -29,7 +29,7 @@ namespace umbraco.presentation.umbraco.dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_placeholder; - + /// /// dd_detectedAlias control. /// diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/insertMasterpagePlaceholder.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/insertMasterpagePlaceholder.aspx.cs index 49568f25a1..6a8456635a 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/insertMasterpagePlaceholder.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/insertMasterpagePlaceholder.aspx.cs @@ -12,7 +12,7 @@ namespace umbraco.presentation.umbraco.dialogs { protected void Page_Load(object sender, EventArgs e) { //labels pp_placeholder.Text = Services.TextService.Localize("placeHolderID"); - + } } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/insertMasterpagePlaceholder.aspx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/insertMasterpagePlaceholder.aspx.designer.cs index 5fb7cb041a..e334036fcb 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/insertMasterpagePlaceholder.aspx.designer.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/insertMasterpagePlaceholder.aspx.designer.cs @@ -3,15 +3,15 @@ // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace umbraco.presentation.umbraco.dialogs { - - + + public partial class insertMasterpagePlaceholder { - + /// /// tb_alias control. /// diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/notifications.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/notifications.aspx.cs index 307d1e8d74..eecd44bc81 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/notifications.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/notifications.aspx.cs @@ -1,4 +1,4 @@ -using Umbraco.Core.Services; +using Umbraco.Core.Services; using System; using System.Collections; using System.Linq; @@ -107,4 +107,4 @@ namespace umbraco.dialogs pl_buttons.Visible = false; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/notifications.aspx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/notifications.aspx.designer.cs index 5c92ddede5..2122134e97 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/notifications.aspx.designer.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/notifications.aspx.designer.cs @@ -1,17 +1,17 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace umbraco.dialogs { - - + + public partial class notifications { - + /// /// pane_form control. /// @@ -20,7 +20,7 @@ namespace umbraco.dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.Pane pane_form; - + /// /// pl_buttons control. /// @@ -29,7 +29,7 @@ namespace umbraco.dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.HtmlControls.HtmlGenericControl pl_buttons; - + /// /// Button1 control. /// diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/protectPage.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/protectPage.aspx.cs index 86dd3a2c29..fa60bd90c8 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/protectPage.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/protectPage.aspx.cs @@ -164,7 +164,7 @@ namespace umbraco.presentation.umbraco.dialogs if (entry.Success == false && entry.Result.Value == null) { throw new Exception("Document is not protected!"); - } + } } private void AddMembershipUserToDocument(int documentId, string membershipUserName) @@ -198,7 +198,7 @@ namespace umbraco.presentation.umbraco.dialogs if (entry != null) { Services.PublicAccessService.Delete(entry); - } + } } protected void Page_Load(object sender, EventArgs e) @@ -223,7 +223,7 @@ namespace umbraco.presentation.umbraco.dialogs if (IsPostBack == false) { - if (Services.PublicAccessService.IsProtected(documentId.ToString()) + if (Services.PublicAccessService.IsProtected(documentId.ToString()) && GetProtectionType(documentId) != ProtectionType.NotProtected) { bt_buttonRemoveProtection.Visible = true; diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/republish.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/republish.aspx.cs index e79b8354b8..85ac261e07 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/republish.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/republish.aspx.cs @@ -1,4 +1,4 @@ -//TODO: Re-create this in angular and new APIS! then remove it +//TODO: Re-create this in angular and new APIS! then remove it //using System; //using System.Collections; @@ -29,7 +29,7 @@ // if (Request.GetItemAsString("xml") != "") // { // Server.ScriptTimeout = 100000; -// Services.ContentService.RePublishAll(); +// Services.ContentService.RePublishAll(); // } // else if (Request.GetItemAsString("previews") != "") // { @@ -50,7 +50,7 @@ // Response.Flush(); // } // } - + // //PPH changed this to a general library call for load balancing support // library.RefreshContent(); @@ -63,6 +63,6 @@ // bt_go.Text = Services.TextService.Localize("republish"); // } - + // } //} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/republish.aspx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/republish.aspx.designer.cs index 81bd26801d..dbb419478c 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/republish.aspx.designer.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/republish.aspx.designer.cs @@ -1,4 +1,4 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:2.0.50727.4200 @@ -9,10 +9,10 @@ //------------------------------------------------------------------------------ namespace umbraco.cms.presentation { - - + + public partial class republish { - + /// /// p_republish control. /// @@ -21,7 +21,7 @@ namespace umbraco.cms.presentation { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Panel p_republish; - + /// /// bt_go control. /// @@ -30,7 +30,7 @@ namespace umbraco.cms.presentation { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Button bt_go; - + /// /// progbar control. /// @@ -39,7 +39,7 @@ namespace umbraco.cms.presentation { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.ProgressBar progbar; - + /// /// p_done control. /// diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/rollBack.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/rollBack.aspx.cs index 225e4a154e..03558ad847 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/rollBack.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/rollBack.aspx.cs @@ -1,4 +1,4 @@ -//TODO: REbuild this in angular and then remove +//TODO: REbuild this in angular and then remove //using System; //using System.Collections; @@ -53,7 +53,7 @@ // if (p.Value != null) // { -// //new property value... +// //new property value... // string thevalue = p.Value.ToString(); // if (rbl_mode.SelectedValue == "diff") @@ -141,7 +141,7 @@ // /// the contents of this method with the code editor. // ///
// private void InitializeComponent() -// { +// { // } // #endregion diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/rollBack.aspx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/rollBack.aspx.designer.cs index 5f33bfb0bb..8e412d1a5c 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/rollBack.aspx.designer.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/rollBack.aspx.designer.cs @@ -1,17 +1,17 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace umbraco.presentation.dialogs { - - + + public partial class rollBack { - + /// /// JsInclude1 control. /// @@ -20,7 +20,7 @@ namespace umbraco.presentation.dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::ClientDependency.Core.Controls.JsInclude JsInclude1; - + /// /// feedBackMsg control. /// @@ -29,7 +29,7 @@ namespace umbraco.presentation.dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.Feedback feedBackMsg; - + /// /// pp_selectVersion control. /// @@ -38,7 +38,7 @@ namespace umbraco.presentation.dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.Pane pp_selectVersion; - + /// /// pp_currentVersion control. /// @@ -47,7 +47,7 @@ namespace umbraco.presentation.dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_currentVersion; - + /// /// currentVersionTitle control. /// @@ -56,7 +56,7 @@ namespace umbraco.presentation.dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Literal currentVersionTitle; - + /// /// currentVersionMeta control. /// @@ -65,7 +65,7 @@ namespace umbraco.presentation.dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Literal currentVersionMeta; - + /// /// pp_rollBackTo control. /// @@ -74,7 +74,7 @@ namespace umbraco.presentation.dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_rollBackTo; - + /// /// allVersions control. /// @@ -83,7 +83,7 @@ namespace umbraco.presentation.dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.DropDownList allVersions; - + /// /// pp_view control. /// @@ -92,7 +92,7 @@ namespace umbraco.presentation.dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_view; - + /// /// rbl_mode control. /// @@ -101,7 +101,7 @@ namespace umbraco.presentation.dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.RadioButtonList rbl_mode; - + /// /// diffPanel control. /// @@ -110,7 +110,7 @@ namespace umbraco.presentation.dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Panel diffPanel; - + /// /// lt_notice control. /// @@ -119,7 +119,7 @@ namespace umbraco.presentation.dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Literal lt_notice; - + /// /// propertiesCompare control. /// @@ -128,7 +128,7 @@ namespace umbraco.presentation.dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Literal propertiesCompare; - + /// /// pl_buttons control. /// @@ -137,7 +137,7 @@ namespace umbraco.presentation.dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.HtmlControls.HtmlGenericControl pl_buttons; - + /// /// Button1 control. /// diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/search.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/search.aspx.cs index ab04f98224..c14e4006de 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/search.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/search.aspx.cs @@ -44,7 +44,7 @@ namespace umbraco.presentation.dialogs protected void search_Click(object sender, EventArgs e) { - DoSearch(); + DoSearch(); } private void DoSearch() @@ -99,7 +99,7 @@ namespace umbraco.presentation.dialogs { var result = new XmlDocument(); result.LoadXml(""); - + foreach (var r in results) { var x = XmlHelper.AddTextNode(result, "result", ""); diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/search.aspx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/search.aspx.designer.cs index efc60d5bed..4d3d61fd05 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/search.aspx.designer.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/search.aspx.designer.cs @@ -3,15 +3,15 @@ // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace umbraco.presentation.dialogs { - - + + public partial class search { - + /// /// Wizard control. /// @@ -20,7 +20,7 @@ namespace umbraco.presentation.dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.Pane Wizard; - + /// /// keyword control. /// @@ -29,7 +29,7 @@ namespace umbraco.presentation.dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.TextBox keyword; - + /// /// searchButton control. /// @@ -38,7 +38,7 @@ namespace umbraco.presentation.dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Button searchButton; - + /// /// nothingFound control. /// @@ -47,7 +47,7 @@ namespace umbraco.presentation.dialogs { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Panel nothingFound; - + /// /// searchResult control. /// diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/sendToTranslation.aspx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/sendToTranslation.aspx.designer.cs index 626f1fc8cd..a067bf09ed 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/sendToTranslation.aspx.designer.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/sendToTranslation.aspx.designer.cs @@ -1,9 +1,9 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ @@ -15,7 +15,7 @@ namespace umbraco.presentation.dialogs public partial class sendToTranslation { - + /// /// feedback control. /// @@ -24,7 +24,7 @@ namespace umbraco.presentation.dialogs /// To modify move field declaration from designer file to code-behind file. /// protected Umbraco.Web._Legacy.Controls.Feedback feedback; - + /// /// pane_form control. /// @@ -33,7 +33,7 @@ namespace umbraco.presentation.dialogs /// To modify move field declaration from designer file to code-behind file. /// protected Umbraco.Web._Legacy.Controls.Pane pane_form; - + /// /// pp_translator control. /// @@ -42,7 +42,7 @@ namespace umbraco.presentation.dialogs /// To modify move field declaration from designer file to code-behind file. /// protected Umbraco.Web._Legacy.Controls.PropertyPanel pp_translator; - + /// /// translator control. /// @@ -51,7 +51,7 @@ namespace umbraco.presentation.dialogs /// To modify move field declaration from designer file to code-behind file. /// protected DropDownList translator; - + /// /// pp_language control. /// @@ -60,7 +60,7 @@ namespace umbraco.presentation.dialogs /// To modify move field declaration from designer file to code-behind file. /// protected Umbraco.Web._Legacy.Controls.PropertyPanel pp_language; - + /// /// language control. /// @@ -69,7 +69,7 @@ namespace umbraco.presentation.dialogs /// To modify move field declaration from designer file to code-behind file. /// protected DropDownList language; - + /// /// defaultLanguage control. /// @@ -78,7 +78,7 @@ namespace umbraco.presentation.dialogs /// To modify move field declaration from designer file to code-behind file. /// protected Literal defaultLanguage; - + /// /// pp_includeSubs control. /// @@ -87,7 +87,7 @@ namespace umbraco.presentation.dialogs /// To modify move field declaration from designer file to code-behind file. /// protected Umbraco.Web._Legacy.Controls.PropertyPanel pp_includeSubs; - + /// /// includeSubpages control. /// @@ -96,7 +96,7 @@ namespace umbraco.presentation.dialogs /// To modify move field declaration from designer file to code-behind file. /// protected CheckBox includeSubpages; - + /// /// pp_comment control. /// @@ -105,7 +105,7 @@ namespace umbraco.presentation.dialogs /// To modify move field declaration from designer file to code-behind file. /// protected Umbraco.Web._Legacy.Controls.PropertyPanel pp_comment; - + /// /// comment control. /// @@ -114,7 +114,7 @@ namespace umbraco.presentation.dialogs /// To modify move field declaration from designer file to code-behind file. /// protected TextBox comment; - + /// /// pl_buttons control. /// @@ -123,7 +123,7 @@ namespace umbraco.presentation.dialogs /// To modify move field declaration from designer file to code-behind file. /// protected Panel pl_buttons; - + /// /// doTranslation control. /// diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/sort.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/sort.aspx.cs index 227a4bb507..0ac86233d6 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/sort.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/sort.aspx.cs @@ -239,4 +239,4 @@ namespace umbraco.cms.presentation #endregion } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/treePicker.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/treePicker.aspx.cs index 5a98efdda0..d82306e708 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/treePicker.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/treePicker.aspx.cs @@ -12,36 +12,36 @@ using umbraco.cms.presentation.Trees; namespace umbraco.dialogs { - [Obsolete("Use the TreeControl instead. This does however get used by the TreeService when requesting the tree init url.")] - public partial class treePicker : Umbraco.Web.UI.Pages.UmbracoEnsuredPage - { - protected override void OnLoad(EventArgs e) - { - base.OnLoad(e); - TreeParams = TreeRequestParams.FromQueryStrings().CreateTreeService(); - DataBind(); + [Obsolete("Use the TreeControl instead. This does however get used by the TreeService when requesting the tree init url.")] + public partial class treePicker : Umbraco.Web.UI.Pages.UmbracoEnsuredPage + { + protected override void OnLoad(EventArgs e) + { + base.OnLoad(e); + TreeParams = TreeRequestParams.FromQueryStrings().CreateTreeService(); + DataBind(); - if(Request.QueryString["selected"] != null && TreeParams.TreeType == "content") + if(Request.QueryString["selected"] != null && TreeParams.TreeType == "content") { var currContent = Services.ContentService.GetById(int.Parse(Request.QueryString["selected"])); if (currContent != null) { if (currContent.ParentId > 0) - DialogTree.SelectedNodePath = currContent.Path; + DialogTree.SelectedNodePath = currContent.Path; } } - } + } - protected TreeService TreeParams { get; private set; } + protected TreeService TreeParams { get; private set; } - /// - /// DialogTree control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::umbraco.controls.Tree.TreeControl DialogTree; + /// + /// DialogTree control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::umbraco.controls.Tree.TreeControl DialogTree; - } + } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/umbracoField.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/umbracoField.aspx.cs index 84f98d9de8..c0f0354fe6 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/umbracoField.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/umbracoField.aspx.cs @@ -8,247 +8,247 @@ using Umbraco.Web.Composing; namespace umbraco.dialogs { - /// - /// Summary description for umbracoField. - /// - public partial class umbracoField : Umbraco.Web.UI.Pages.UmbracoEnsuredPage - { - string[] preValuesSource = { "@createDate", "@creatorName", "@level", "@nodeType", "@nodeTypeAlias", "@pageID", "@pageName", "@parentID", "@path", "@template", "@updateDate", "@writerID", "@writerName" }; - bool m_IsDictionaryMode = false; + /// + /// Summary description for umbracoField. + /// + public partial class umbracoField : Umbraco.Web.UI.Pages.UmbracoEnsuredPage + { + string[] preValuesSource = { "@createDate", "@creatorName", "@level", "@nodeType", "@nodeTypeAlias", "@pageID", "@pageName", "@parentID", "@path", "@template", "@updateDate", "@writerID", "@writerName" }; + bool m_IsDictionaryMode = false; - public umbracoField() - { - CurrentApp = Constants.Applications.Settings.ToString(); - } + public umbracoField() + { + CurrentApp = Constants.Applications.Settings.ToString(); + } - protected void Page_Load(object sender, System.EventArgs e) - { + protected void Page_Load(object sender, System.EventArgs e) + { - //set labels on properties... - pp_insertAltField.Text = Services.TextService.Localize("templateEditor/alternativeField"); - pp_insertAltText.Text = Services.TextService.Localize("templateEditor/alternativeText"); - pp_insertBefore.Text = Services.TextService.Localize("templateEditor/preContent"); - pp_insertAfter.Text = Services.TextService.Localize("templateEditor/postContent"); + //set labels on properties... + pp_insertAltField.Text = Services.TextService.Localize("templateEditor/alternativeField"); + pp_insertAltText.Text = Services.TextService.Localize("templateEditor/alternativeText"); + pp_insertBefore.Text = Services.TextService.Localize("templateEditor/preContent"); + pp_insertAfter.Text = Services.TextService.Localize("templateEditor/postContent"); - pp_FormatAsDate.Text = Services.TextService.Localize("templateEditor/formatAsDate"); - pp_casing.Text = Services.TextService.Localize("templateEditor/casing"); - pp_encode.Text = Services.TextService.Localize("templateEditor/encoding"); + pp_FormatAsDate.Text = Services.TextService.Localize("templateEditor/formatAsDate"); + pp_casing.Text = Services.TextService.Localize("templateEditor/casing"); + pp_encode.Text = Services.TextService.Localize("templateEditor/encoding"); - if (UmbracoConfig.For.UmbracoSettings().Templates.UseAspNetMasterPages) - { - tagName.Value = "umbraco:Item"; - } + if (UmbracoConfig.For.UmbracoSettings().Templates.UseAspNetMasterPages) + { + tagName.Value = "umbraco:Item"; + } - using (var scope = Current.ScopeProvider.CreateScope()) - { - // either get page fields or dictionary items - string fieldSql = ""; - if (Request.GetItemAsString("tagName") == "UMBRACOGETDICTIONARY") - { - fieldSql = "select '#'+[key] as alias from cmsDictionary order by alias"; - m_IsDictionaryMode = true; - pp_insertField.Text = "Insert Dictionary Item"; - } - else - { - //exclude built-in memberhip properties from showing up here - var exclude = Constants.Conventions.Member.GetStandardPropertyTypeStubs() - .Select(x => Current.DatabaseContext.SqlSyntax.GetQuotedValue(x.Key)).ToArray(); + using (var scope = Current.ScopeProvider.CreateScope()) + { + // either get page fields or dictionary items + string fieldSql = ""; + if (Request.GetItemAsString("tagName") == "UMBRACOGETDICTIONARY") + { + fieldSql = "select '#'+[key] as alias from cmsDictionary order by alias"; + m_IsDictionaryMode = true; + pp_insertField.Text = "Insert Dictionary Item"; + } + else + { + //exclude built-in memberhip properties from showing up here + var exclude = Constants.Conventions.Member.GetStandardPropertyTypeStubs() + .Select(x => Current.DatabaseContext.SqlSyntax.GetQuotedValue(x.Key)).ToArray(); - fieldSql = string.Format( - "select distinct alias from cmsPropertyType where alias not in ({0}) order by alias", - string.Join(",", exclude)); - pp_insertField.Text = Services.TextService.Localize("templateEditor/chooseField"); - } + fieldSql = string.Format( + "select distinct alias from cmsPropertyType where alias not in ({0}) order by alias", + string.Join(",", exclude)); + pp_insertField.Text = Services.TextService.Localize("templateEditor/chooseField"); + } - fieldPicker.ChooseText = Services.TextService.Localize("templateEditor/chooseField"); - fieldPicker.StandardPropertiesLabel = Services.TextService.Localize("templateEditor/standardFields"); - fieldPicker.CustomPropertiesLabel = Services.TextService.Localize("templateEditor/customFields"); + fieldPicker.ChooseText = Services.TextService.Localize("templateEditor/chooseField"); + fieldPicker.StandardPropertiesLabel = Services.TextService.Localize("templateEditor/standardFields"); + fieldPicker.CustomPropertiesLabel = Services.TextService.Localize("templateEditor/customFields"); - var dataTypes = scope.Database.Fetch(fieldSql); - fieldPicker.DataTextField = "alias"; - fieldPicker.DataValueField = "alias"; - fieldPicker.DataSource = dataTypes; - fieldPicker.DataBind(); - fieldPicker.Attributes.Add("onChange", "document.forms[0].field.value = document.forms[0]." + fieldPicker.ClientID + "[document.forms[0]." + fieldPicker.ClientID + ".selectedIndex].value;"); + var dataTypes = scope.Database.Fetch(fieldSql); + fieldPicker.DataTextField = "alias"; + fieldPicker.DataValueField = "alias"; + fieldPicker.DataSource = dataTypes; + fieldPicker.DataBind(); + fieldPicker.Attributes.Add("onChange", "document.forms[0].field.value = document.forms[0]." + fieldPicker.ClientID + "[document.forms[0]." + fieldPicker.ClientID + ".selectedIndex].value;"); - altFieldPicker.ChooseText = Services.TextService.Localize("templateEditor/chooseField"); - altFieldPicker.StandardPropertiesLabel = Services.TextService.Localize("templateEditor/standardFields"); - altFieldPicker.CustomPropertiesLabel = Services.TextService.Localize("templateEditor/customFields"); + altFieldPicker.ChooseText = Services.TextService.Localize("templateEditor/chooseField"); + altFieldPicker.StandardPropertiesLabel = Services.TextService.Localize("templateEditor/standardFields"); + altFieldPicker.CustomPropertiesLabel = Services.TextService.Localize("templateEditor/customFields"); - var dataTypes2 = scope.Database.Fetch(fieldSql); - altFieldPicker.DataTextField = "alias"; - altFieldPicker.DataValueField = "alias"; - altFieldPicker.DataSource = dataTypes2; - altFieldPicker.DataBind(); - altFieldPicker.Attributes.Add("onChange", "document.forms[0].useIfEmpty.value = document.forms[0]." + altFieldPicker.ClientID + "[document.forms[0]." + altFieldPicker.ClientID + ".selectedIndex].value;"); + var dataTypes2 = scope.Database.Fetch(fieldSql); + altFieldPicker.DataTextField = "alias"; + altFieldPicker.DataValueField = "alias"; + altFieldPicker.DataSource = dataTypes2; + altFieldPicker.DataBind(); + altFieldPicker.Attributes.Add("onChange", "document.forms[0].useIfEmpty.value = document.forms[0]." + altFieldPicker.ClientID + "[document.forms[0]." + altFieldPicker.ClientID + ".selectedIndex].value;"); - scope.Complete(); - } + scope.Complete(); + } // Pre values if (!m_IsDictionaryMode) - { - foreach (string s in preValuesSource) - { - fieldPicker.Items.Add(new ListItem(s, s.Replace("@", ""))); - altFieldPicker.Items.Add(new ListItem(s, s.Replace("@", ""))); - } - } - } + { + foreach (string s in preValuesSource) + { + fieldPicker.Items.Add(new ListItem(s, s.Replace("@", ""))); + altFieldPicker.Items.Add(new ListItem(s, s.Replace("@", ""))); + } + } + } - /// - /// JsInclude1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude1; + /// + /// JsInclude1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::ClientDependency.Core.Controls.JsInclude JsInclude1; - /// - /// JsInclude2 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude2; + /// + /// JsInclude2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::ClientDependency.Core.Controls.JsInclude JsInclude2; - /// - /// tagName control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.HtmlControls.HtmlInputHidden tagName; + /// + /// tagName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlInputHidden tagName; - /// - /// pane_form control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.Pane pane_form; + /// + /// pane_form control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.Pane pane_form; - /// - /// pp_insertField control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_insertField; + /// + /// pp_insertField control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_insertField; - /// - /// fieldPicker control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.FieldDropDownList fieldPicker; + /// + /// fieldPicker control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.FieldDropDownList fieldPicker; - /// - /// pp_insertAltField control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_insertAltField; + /// + /// pp_insertAltField control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_insertAltField; - /// - /// altFieldPicker control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.FieldDropDownList altFieldPicker; + /// + /// altFieldPicker control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.FieldDropDownList altFieldPicker; - /// - /// pp_insertAltText control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_insertAltText; + /// + /// pp_insertAltText control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_insertAltText; - /// - /// pp_recursive control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_recursive; + /// + /// pp_recursive control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_recursive; - /// - /// pp_insertBefore control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_insertBefore; + /// + /// pp_insertBefore control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_insertBefore; - /// - /// pp_insertAfter control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_insertAfter; + /// + /// pp_insertAfter control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_insertAfter; - /// - /// pp_FormatAsDate control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_FormatAsDate; + /// + /// pp_FormatAsDate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_FormatAsDate; - /// - /// pp_casing control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_casing; + /// + /// pp_casing control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_casing; - /// - /// pp_encode control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_encode; + /// + /// pp_encode control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_encode; - /// - /// pp_convertLineBreaks control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_convertLineBreaks; + /// + /// pp_convertLineBreaks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_convertLineBreaks; - /// - /// pp_removePTags control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_removePTags; - } + /// + /// pp_removePTags control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_removePTags; + } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/viewAuditTrail.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/viewAuditTrail.aspx.cs index b36cf059c5..cc86075033 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/viewAuditTrail.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/viewAuditTrail.aspx.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.ComponentModel; using System.Data; @@ -17,58 +17,58 @@ using Action = Umbraco.Web._Legacy.Actions.Action; namespace umbraco.presentation.umbraco.dialogs { - /// - /// Summary description for viewAuditTrail. - /// - public partial class viewAuditTrail : Umbraco.Web.UI.Pages.UmbracoEnsuredPage - { - public viewAuditTrail() - { + /// + /// Summary description for viewAuditTrail. + /// + public partial class viewAuditTrail : Umbraco.Web.UI.Pages.UmbracoEnsuredPage + { + public viewAuditTrail() + { CurrentApp = Constants.Applications.Content.ToString(); - } - - protected void Page_Load(object sender, System.EventArgs e) - { - // Put user code to initialize the page here - //nodeName.Text = new cms.businesslogic.CMSNode(int.Parse(helper.Request("nodeID"))).Text; - auditLog.DataSource = Services.AuditService.GetLogs(int.Parse(Request["nodeID"])); - auditLog.DataBind(); - auditLog.BorderWidth = 0; - auditLog.BorderStyle = BorderStyle.None; - } + } - public string FormatAction(string action) - { - action = action.ToLower(); - if (action == "new") - action = "create"; - var actions = Current.Actions; - foreach (var a in actions) - { - return Services.TextService.Localize(action); + protected void Page_Load(object sender, System.EventArgs e) + { + // Put user code to initialize the page here + //nodeName.Text = new cms.businesslogic.CMSNode(int.Parse(helper.Request("nodeID"))).Text; + auditLog.DataSource = Services.AuditService.GetLogs(int.Parse(Request["nodeID"])); + auditLog.DataBind(); + auditLog.BorderWidth = 0; + auditLog.BorderStyle = BorderStyle.None; + } + + public string FormatAction(string action) + { + action = action.ToLower(); + if (action == "new") + action = "create"; + var actions = Current.Actions; + foreach (var a in actions) + { + return Services.TextService.Localize(action); } - return action; - } + return action; + } - #region Web Form Designer generated code - override protected void OnInit(EventArgs e) - { - // - // CODEGEN: This call is required by the ASP.NET Web Form Designer. - // - InitializeComponent(); - base.OnInit(e); - } - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { + #region Web Form Designer generated code + override protected void OnInit(EventArgs e) + { + // + // CODEGEN: This call is required by the ASP.NET Web Form Designer. + // + InitializeComponent(); + base.OnInit(e); + } - } - #endregion - } + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + + } + #endregion + } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/viewAuditTrail.aspx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/viewAuditTrail.aspx.designer.cs index 986351af0d..d8f02782e8 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/viewAuditTrail.aspx.designer.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/viewAuditTrail.aspx.designer.cs @@ -1,17 +1,17 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace umbraco.presentation.umbraco.dialogs { - - + + public partial class viewAuditTrail { - + /// /// auditLog control. /// diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/endPreview.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/endPreview.aspx.cs index ef3d0c1783..b341a42cdd 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/endPreview.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/endPreview.aspx.cs @@ -33,4 +33,4 @@ namespace umbraco.presentation Response.Redirect(url.ToString(), true); } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/masterpages/default.Master.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/masterpages/default.Master.cs index 4b765274fb..8bc2446e2c 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/masterpages/default.Master.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/masterpages/default.Master.cs @@ -8,7 +8,7 @@ namespace umbraco.presentation.masterpages { public partial class _default : MasterPage { - + protected override void Render(HtmlTextWriter writer) { // get base output diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/masterpages/umbracoDialog.Master.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/masterpages/umbracoDialog.Master.cs index 340457599b..0074a93223 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/masterpages/umbracoDialog.Master.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/masterpages/umbracoDialog.Master.cs @@ -8,154 +8,154 @@ using Umbraco.Web.UI.JavaScript; namespace umbraco.presentation.masterpages { - public partial class umbracoDialog : System.Web.UI.MasterPage - { + public partial class umbracoDialog : System.Web.UI.MasterPage + { - public bool reportModalSize { get; set; } - public static new event MasterPageLoadHandler Load; - public new static event MasterPageLoadHandler Init; + public bool reportModalSize { get; set; } + public static new event MasterPageLoadHandler Load; + public new static event MasterPageLoadHandler Init; - protected void Page_Load(object sender, EventArgs e) - { - ClientLoader.DataBind(); - ScriptManager.RegisterStartupScript(Page, Page.GetType(), "setRoot", "UmbClientMgr.setUmbracoPath(\"" + IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "\");", true); - FireOnLoad(e); - } + protected void Page_Load(object sender, EventArgs e) + { + ClientLoader.DataBind(); + ScriptManager.RegisterStartupScript(Page, Page.GetType(), "setRoot", "UmbClientMgr.setUmbracoPath(\"" + IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "\");", true); + FireOnLoad(e); + } - protected override void OnInit(EventArgs e) - { - base.OnInit(e); + protected override void OnInit(EventArgs e) + { + base.OnInit(e); - if (Init != null) - { - Init(this, e); - } - } + if (Init != null) + { + Init(this, e); + } + } - protected virtual void FireOnLoad(EventArgs e) - { - if (Load != null) - { - Load(this, e); - } - } + protected virtual void FireOnLoad(EventArgs e) + { + if (Load != null) + { + Load(this, e); + } + } - /// - /// Head1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.HtmlControls.HtmlHead Head1; + /// + /// Head1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlHead Head1; - /// - /// ClientLoader control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected UmbracoClientDependencyLoader ClientLoader; + /// + /// ClientLoader control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected UmbracoClientDependencyLoader ClientLoader; - /// - /// CssInclude1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.CssInclude CssInclude1; + /// + /// CssInclude1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::ClientDependency.Core.Controls.CssInclude CssInclude1; - /// - /// JsInclude1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude1; + /// + /// JsInclude1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::ClientDependency.Core.Controls.JsInclude JsInclude1; - /// - /// JsInclude3 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude3; + /// + /// JsInclude3 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::ClientDependency.Core.Controls.JsInclude JsInclude3; - /// - /// JsInclude6 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude6; + /// + /// JsInclude6 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::ClientDependency.Core.Controls.JsInclude JsInclude6; - /// - /// JsInclude4 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude4; + /// + /// JsInclude4 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::ClientDependency.Core.Controls.JsInclude JsInclude4; - /// - /// JsInclude2 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude2; + /// + /// JsInclude2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::ClientDependency.Core.Controls.JsInclude JsInclude2; - /// - /// head control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.ContentPlaceHolder head; + /// + /// head control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ContentPlaceHolder head; - /// - /// form1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.HtmlControls.HtmlForm form1; + /// + /// form1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; - /// - /// ScriptManager1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.ScriptManager ScriptManager1; + /// + /// ScriptManager1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.ScriptManager ScriptManager1; - /// - /// body control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.ContentPlaceHolder body; + /// + /// body control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ContentPlaceHolder body; - /// - /// footer control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.ContentPlaceHolder footer; - } + /// + /// footer control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ContentPlaceHolder footer; + } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/ping.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/ping.aspx.cs index 410ada9f4d..3d8f80ef97 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/ping.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/ping.aspx.cs @@ -13,7 +13,7 @@ namespace umbraco.presentation { [Obsolete("This class will be removed in future versions.")] - [EditorBrowsable(EditorBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] public partial class ping : System.Web.UI.Page { #region Web Form Designer generated code diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/DictionaryItemList.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/DictionaryItemList.aspx.cs index b0c3885c79..d81e4c129b 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/DictionaryItemList.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/DictionaryItemList.aspx.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using Umbraco.Core; @@ -9,14 +9,14 @@ namespace umbraco.presentation.settings { [WebformsPageTreeAuthorize(Constants.Trees.Dictionary)] public partial class DictionaryItemList : Umbraco.Web.UI.Pages.UmbracoEnsuredPage { - + private readonly ILanguage[] _languages = Current.Services.LocalizationService.GetAllLanguages().ToArray(); - - + + protected void Page_Load(object sender, EventArgs e) { - - + + string header = "Key"; foreach (var lang in _languages) { header += "" + lang.CultureName + ""; @@ -35,7 +35,7 @@ namespace umbraco.presentation.settings { private void ProcessKeys(IEnumerable dictionaryItems, int level) { - string style = "style='padding-left: " + level * 10 + "px;'"; + string style = "style='padding-left: " + level * 10 + "px;'"; foreach (var di in dictionaryItems) { lt_table.Text += "" + di.ItemKey + ""; @@ -44,7 +44,7 @@ namespace umbraco.presentation.settings { lt_table.Text += ""; var trans = di.Translations.FirstOrDefault(x => x.LanguageId == lang.Id); - + if (trans == null || string.IsNullOrEmpty(trans.Value)) lt_table.Text += ""; else diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/DictionaryItemList.aspx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/DictionaryItemList.aspx.designer.cs index b314c8e7eb..cdb58334cf 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/DictionaryItemList.aspx.designer.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/DictionaryItemList.aspx.designer.cs @@ -1,17 +1,17 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace umbraco.presentation.settings { - - + + public partial class DictionaryItemList { - + /// /// Panel1 control. /// @@ -20,7 +20,7 @@ namespace umbraco.presentation.settings { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.UmbracoPanel Panel1; - + /// /// pane1 control. /// @@ -29,7 +29,7 @@ namespace umbraco.presentation.settings { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.Pane pane1; - + /// /// lt_table control. /// diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/EditDictionaryItem.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/EditDictionaryItem.aspx.cs index b8cbc0454d..5676a98a3a 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/EditDictionaryItem.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/EditDictionaryItem.aspx.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using System.Web.UI; using System.Web.UI.WebControls; @@ -17,7 +17,7 @@ namespace umbraco.settings /// Summary description for EditDictionaryItem. /// [WebformsPageTreeAuthorize(Constants.Trees.Dictionary)] - public partial class EditDictionaryItem : Umbraco.Web.UI.Pages.UmbracoEnsuredPage + public partial class EditDictionaryItem : Umbraco.Web.UI.Pages.UmbracoEnsuredPage { protected LiteralControl keyTxt = new LiteralControl(); protected Umbraco.Web._Legacy.Controls.TabView tbv = new Umbraco.Web._Legacy.Controls.TabView(); @@ -29,16 +29,16 @@ namespace umbraco.settings protected void Page_Load(object sender, System.EventArgs e) { - currentItem = Services.LocalizationService.GetDictionaryItemById(int.Parse(Request.QueryString["id"])); + currentItem = Services.LocalizationService.GetDictionaryItemById(int.Parse(Request.QueryString["id"])); // Put user code to initialize the page here Panel1.hasMenu = true; - Panel1.Text = Services.TextService.Localize("editdictionary") + ": " + currentItem.ItemKey; + Panel1.Text = Services.TextService.Localize("editdictionary") + ": " + currentItem.ItemKey; var save = Panel1.Menu.NewButton(); save.Text = Services.TextService.Localize("save"); save.Click += save_Click; - save.ToolTip = Services.TextService.Localize("save"); + save.ToolTip = Services.TextService.Localize("save"); save.ID = "save"; save.ButtonType = Umbraco.Web._Legacy.Controls.MenuButtonType.Primary; @@ -77,10 +77,10 @@ namespace umbraco.settings languageBox.ID = l.Id.ToString(); languageBox.CssClass = "umbEditorTextFieldMultiple"; - if (!IsPostBack) - { - languageBox.Text = currentItem.GetTranslatedValue(l.Id); - } + if (!IsPostBack) + { + languageBox.Text = currentItem.GetTranslatedValue(l.Id); + } languageFields.Add(languageBox); p.addProperty(l.CultureName, languageBox); @@ -92,17 +92,17 @@ namespace umbraco.settings { var path = BuildPath(currentItem); ClientTools - .SetActiveTreeType(Constants.Trees.Dictionary) + .SetActiveTreeType(Constants.Trees.Dictionary) .SyncTree(path, false); } Panel1.Controls.Add(p); } - private string BuildPath(IDictionaryItem current) + private string BuildPath(IDictionaryItem current) { - var parentPath = current.ParentId.HasValue == false ? "" : BuildPath(current) + ","; - return parentPath + current.Id; + var parentPath = current.ParentId.HasValue == false ? "" : BuildPath(current) + ","; + return parentPath + current.Id; } void save_Click(object sender, EventArgs e) @@ -172,5 +172,5 @@ namespace umbraco.settings } #endregion - } + } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/EditDictionaryItem.aspx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/EditDictionaryItem.aspx.designer.cs index 03448bce09..59631a01e9 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/EditDictionaryItem.aspx.designer.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/EditDictionaryItem.aspx.designer.cs @@ -1,17 +1,17 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace umbraco.settings { - - + + public partial class EditDictionaryItem { - + /// /// Panel1 control. /// diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/editLanguage.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/editLanguage.aspx.cs index 9a20747e40..4b4bf36740 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/editLanguage.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/editLanguage.aspx.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.Globalization; using System.Web.UI.WebControls; @@ -11,44 +11,44 @@ using Umbraco.Web.UI; namespace umbraco.settings { - /// - /// Summary description for editLanguage. - /// + /// + /// Summary description for editLanguage. + /// [WebformsPageTreeAuthorize(Constants.Trees.Languages)] - public partial class editLanguage : Umbraco.Web.UI.Pages.UmbracoEnsuredPage - { - public editLanguage() - { + public partial class editLanguage : Umbraco.Web.UI.Pages.UmbracoEnsuredPage + { + public editLanguage() + { CurrentApp = Constants.Applications.Settings.ToString(); - } - protected System.Web.UI.WebControls.TextBox NameTxt; - protected System.Web.UI.WebControls.Literal DisplayName; - //cms.businesslogic.language.Language currentLanguage; - private ILanguage lang; - - protected void Page_Load(object sender, System.EventArgs e) - { - //currentLanguage = new cms.businesslogic.language.Language(int.Parse(Request.GetItemAsString("id"))); - lang = Current.Services.LocalizationService.GetLanguageById(int.Parse(Request.GetItemAsString("id"))); - + } + protected System.Web.UI.WebControls.TextBox NameTxt; + protected System.Web.UI.WebControls.Literal DisplayName; + //cms.businesslogic.language.Language currentLanguage; + private ILanguage lang; - // Put user code to initialize the page here + protected void Page_Load(object sender, System.EventArgs e) + { + //currentLanguage = new cms.businesslogic.language.Language(int.Parse(Request.GetItemAsString("id"))); + lang = Current.Services.LocalizationService.GetLanguageById(int.Parse(Request.GetItemAsString("id"))); + + + // Put user code to initialize the page here Panel1.Text = Services.TextService.Localize("editlanguage"); pp_language.Text = Services.TextService.Localize("language/displayName"); - if (!IsPostBack) - { - updateCultureList(); + if (!IsPostBack) + { + updateCultureList(); - ClientTools - .SetActiveTreeType(Constants.Trees.Languages) - .SyncTree(Request.GetItemAsString("id"), false); - } - - } + ClientTools + .SetActiveTreeType(Constants.Trees.Languages) + .SyncTree(Request.GetItemAsString("id"), false); + } - private void updateCultureList() - { + } + + private void updateCultureList() + { SortedList sortedCultures = new SortedList(); Cultures.Items.Clear(); Cultures.Items.Add(new ListItem(Services.TextService.Localize("choose") + "...", "")); @@ -66,42 +66,42 @@ namespace umbraco.settings } } - private void save_click(object sender, EventArgs e) - { - //currentLanguage.CultureAlias = Cultures.SelectedValue; - //currentLanguage.Save(); - lang.IsoCode = Cultures.SelectedValue; + private void save_click(object sender, EventArgs e) + { + //currentLanguage.CultureAlias = Cultures.SelectedValue; + //currentLanguage.Save(); + lang.IsoCode = Cultures.SelectedValue; Current.Services.LocalizationService.Save(lang); - updateCultureList(); + updateCultureList(); - ClientTools.ShowSpeechBubble(SpeechBubbleIcon.Save, Services.TextService.Localize("speechBubbles/languageSaved"), ""); - } + ClientTools.ShowSpeechBubble(SpeechBubbleIcon.Save, Services.TextService.Localize("speechBubbles/languageSaved"), ""); + } - #region Web Form Designer generated code - override protected void OnInit(EventArgs e) - { - Panel1.hasMenu = true; - var save = Panel1.Menu.NewButton(); - save.Click += save_click; - save.ToolTip = Services.TextService.Localize("save"); + #region Web Form Designer generated code + override protected void OnInit(EventArgs e) + { + Panel1.hasMenu = true; + var save = Panel1.Menu.NewButton(); + save.Click += save_click; + save.ToolTip = Services.TextService.Localize("save"); save.Text = Services.TextService.Localize("save"); - save.ID = "save"; + save.ID = "save"; save.ButtonType = Umbraco.Web._Legacy.Controls.MenuButtonType.Primary; - - Panel1.Text = Services.TextService.Localize("language/editLanguage"); - InitializeComponent(); - base.OnInit(e); - } - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { + Panel1.Text = Services.TextService.Localize("language/editLanguage"); - } - #endregion - } + InitializeComponent(); + base.OnInit(e); + } + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + + } + #endregion + } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/editLanguage.aspx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/editLanguage.aspx.designer.cs index 7abd800029..02aa907395 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/editLanguage.aspx.designer.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/editLanguage.aspx.designer.cs @@ -1,17 +1,17 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace umbraco.settings { - - + + public partial class editLanguage { - + /// /// Panel1 control. /// @@ -20,7 +20,7 @@ namespace umbraco.settings { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.UmbracoPanel Panel1; - + /// /// Pane7 control. /// @@ -29,7 +29,7 @@ namespace umbraco.settings { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.Pane Pane7; - + /// /// pp_language control. /// @@ -38,7 +38,7 @@ namespace umbraco.settings { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_language; - + /// /// Cultures control. /// diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/editTemplate.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/editTemplate.aspx.cs index e4f1fa516e..f48d32cdee 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/editTemplate.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/editTemplate.aspx.cs @@ -15,91 +15,91 @@ using Umbraco.Web.UI.Pages; namespace umbraco.cms.presentation.settings { - /// - /// Summary description for editTemplate. - /// - public partial class editTemplate : UmbracoEnsuredPage - { - private Umbraco.Core.Models.ITemplate _template; + /// + /// Summary description for editTemplate. + /// + public partial class editTemplate : UmbracoEnsuredPage + { + private Umbraco.Core.Models.ITemplate _template; public MenuButton SaveButton; - public editTemplate() - { - CurrentApp = Constants.Applications.Settings.ToString(); - } + public editTemplate() + { + CurrentApp = Constants.Applications.Settings.ToString(); + } - protected override void OnPreRender(EventArgs e) - { - base.OnPreRender(e); + protected override void OnPreRender(EventArgs e) + { + base.OnPreRender(e); - ScriptManager.GetCurrent(Page).Services.Add( - new ServiceReference(IOHelper.ResolveUrl(SystemDirectories.WebServices + "/codeEditorSave.asmx"))); - ScriptManager.GetCurrent(Page).Services.Add( + ScriptManager.GetCurrent(Page).Services.Add( + new ServiceReference(IOHelper.ResolveUrl(SystemDirectories.WebServices + "/codeEditorSave.asmx"))); + ScriptManager.GetCurrent(Page).Services.Add( new ServiceReference(IOHelper.ResolveUrl(SystemDirectories.WebServices + "/legacyAjaxCalls.asmx"))); - } + } protected string TemplateTreeSyncPath { get; private set; } - protected void Page_Load(object sender, EventArgs e) - { - MasterTemplate.Attributes.Add("onchange", "changeMasterPageFile()"); - TemplateTreeSyncPath = "-1,init," + _template.Path.Replace("-1,", ""); + protected void Page_Load(object sender, EventArgs e) + { + MasterTemplate.Attributes.Add("onchange", "changeMasterPageFile()"); + TemplateTreeSyncPath = "-1,init," + _template.Path.Replace("-1,", ""); - if (!IsPostBack) - { - MasterTemplate.Items.Add(new ListItem(Services.TextService.Localize("none"), "0")); - foreach (var t in Current.Services.FileService.GetTemplates()) - { - if (t.Id != _template.Id) - { - var text = t.Name; - if (text.StartsWith("#")) - { - var lang = Current.Services.LocalizationService.GetLanguageByIsoCode(System.Threading.Thread.CurrentThread.CurrentCulture.Name); - if (lang != null && Current.Services.LocalizationService.DictionaryItemExists(text.Substring(1))) - { - var di = Current.Services.LocalizationService.GetDictionaryItemByKey(text.Substring(1)); - text = di.GetTranslatedValue(lang.Id); - } - else - { - text = "[" + text + "]"; - } + if (!IsPostBack) + { + MasterTemplate.Items.Add(new ListItem(Services.TextService.Localize("none"), "0")); + foreach (var t in Current.Services.FileService.GetTemplates()) + { + if (t.Id != _template.Id) + { + var text = t.Name; + if (text.StartsWith("#")) + { + var lang = Current.Services.LocalizationService.GetLanguageByIsoCode(System.Threading.Thread.CurrentThread.CurrentCulture.Name); + if (lang != null && Current.Services.LocalizationService.DictionaryItemExists(text.Substring(1))) + { + var di = Current.Services.LocalizationService.GetDictionaryItemByKey(text.Substring(1)); + text = di.GetTranslatedValue(lang.Id); + } + else + { + text = "[" + text + "]"; + } } var li = new ListItem(text, t.Id.ToString()); - li.Attributes.Add("id", t.Alias.Replace(" ", "")); - MasterTemplate.Items.Add(li); - } - } + li.Attributes.Add("id", t.Alias.Replace(" ", "")); + MasterTemplate.Items.Add(li); + } + } - NameTxt.Text = _template.Name; - AliasTxt.Text = _template.Alias; - editorSource.Text = _template.Content; + NameTxt.Text = _template.Name; + AliasTxt.Text = _template.Alias; + editorSource.Text = _template.Content; - var master = Current.Services.FileService.GetTemplate(_template.MasterTemplateAlias); + var master = Current.Services.FileService.GetTemplate(_template.MasterTemplateAlias); if (master != null) MasterTemplate.SelectedValue = master.Id.ToString(); - ClientTools + ClientTools .SetActiveTreeType(Constants.Trees.Templates) .SyncTree(TemplateTreeSyncPath, false); - LoadScriptingTemplates(); - LoadMacros(); - } - } + LoadScriptingTemplates(); + LoadMacros(); + } + } - protected override void OnInit(EventArgs e) - { - _template = Current.Services.FileService.GetTemplate(int.Parse(Request.QueryString["templateID"])); - // - // CODEGEN: This call is required by the ASP.NET Web Form Designer. - // - InitializeComponent(); - base.OnInit(e); - Panel1.hasMenu = true; + protected override void OnInit(EventArgs e) + { + _template = Current.Services.FileService.GetTemplate(int.Parse(Request.QueryString["templateID"])); + // + // CODEGEN: This call is required by the ASP.NET Web Form Designer. + // + InitializeComponent(); + base.OnInit(e); + Panel1.hasMenu = true; - var editor = Panel1.NewTabPage(Services.TextService.Localize("template")); + var editor = Panel1.NewTabPage(Services.TextService.Localize("template")); editor.Controls.Add(Pane8); var props = Panel1.NewTabPage(Services.TextService.Localize("properties")); @@ -111,265 +111,265 @@ namespace umbraco.cms.presentation.settings SaveButton.ID = "save"; SaveButton.CssClass = "client-side"; - Panel1.Text = Services.TextService.Localize("edittemplate"); - pp_name.Text = Services.TextService.Localize("name"); + Panel1.Text = Services.TextService.Localize("edittemplate"); + pp_name.Text = Services.TextService.Localize("name"); pp_alias.Text = Services.TextService.Localize("alias"); pp_masterTemplate.Text = Services.TextService.Localize("mastertemplate"); - // Editing buttons + // Editing buttons MenuIconI umbField = editorSource.Menu.NewIcon(); - umbField.ImageURL = SystemDirectories.Umbraco + "/images/editor/insField.gif"; - umbField.OnClickCommand = - ClientTools.Scripts.OpenModalWindow( - IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/dialogs/umbracoField.aspx?objectId=" + - editorSource.ClientID + "&tagName=UMBRACOGETDATA", Services.TextService.Localize("template/insertPageField"), 640, 550); - umbField.AltText = Services.TextService.Localize("template/insertPageField"); + umbField.ImageURL = SystemDirectories.Umbraco + "/images/editor/insField.gif"; + umbField.OnClickCommand = + ClientTools.Scripts.OpenModalWindow( + IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/dialogs/umbracoField.aspx?objectId=" + + editorSource.ClientID + "&tagName=UMBRACOGETDATA", Services.TextService.Localize("template/insertPageField"), 640, 550); + umbField.AltText = Services.TextService.Localize("template/insertPageField"); - // TODO: Update icon + // TODO: Update icon MenuIconI umbDictionary = editorSource.Menu.NewIcon(); - umbDictionary.ImageURL = GlobalSettings.Path + "/images/editor/dictionaryItem.gif"; - umbDictionary.OnClickCommand = - ClientTools.Scripts.OpenModalWindow( - IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/dialogs/umbracoField.aspx?objectId=" + - editorSource.ClientID + "&tagName=UMBRACOGETDICTIONARY", Services.TextService.Localize("template/insertDictionaryItem"), - 640, 550); - umbDictionary.AltText = "Insert umbraco dictionary item"; + umbDictionary.ImageURL = GlobalSettings.Path + "/images/editor/dictionaryItem.gif"; + umbDictionary.OnClickCommand = + ClientTools.Scripts.OpenModalWindow( + IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/dialogs/umbracoField.aspx?objectId=" + + editorSource.ClientID + "&tagName=UMBRACOGETDICTIONARY", Services.TextService.Localize("template/insertDictionaryItem"), + 640, 550); + umbDictionary.AltText = "Insert umbraco dictionary item"; - editorSource.Menu.NewElement("div", "splitButtonMacroPlaceHolder", "sbPlaceHolder", 40); + editorSource.Menu.NewElement("div", "splitButtonMacroPlaceHolder", "sbPlaceHolder", 40); - if (UmbracoConfig.For.UmbracoSettings().Templates.UseAspNetMasterPages) - { - MenuIconI umbContainer = editorSource.Menu.NewIcon(); - umbContainer.ImageURL = SystemDirectories.Umbraco + "/images/editor/masterpagePlaceHolder.gif"; - umbContainer.AltText = Services.TextService.Localize("template/insertContentAreaPlaceHolder"); - umbContainer.OnClickCommand = - ClientTools.Scripts.OpenModalWindow( - IOHelper.ResolveUrl(SystemDirectories.Umbraco) + - "/dialogs/insertMasterpagePlaceholder.aspx?&id=" + _template.Id, - Services.TextService.Localize("template/insertContentAreaPlaceHolder"), 470, 320); + if (UmbracoConfig.For.UmbracoSettings().Templates.UseAspNetMasterPages) + { + MenuIconI umbContainer = editorSource.Menu.NewIcon(); + umbContainer.ImageURL = SystemDirectories.Umbraco + "/images/editor/masterpagePlaceHolder.gif"; + umbContainer.AltText = Services.TextService.Localize("template/insertContentAreaPlaceHolder"); + umbContainer.OnClickCommand = + ClientTools.Scripts.OpenModalWindow( + IOHelper.ResolveUrl(SystemDirectories.Umbraco) + + "/dialogs/insertMasterpagePlaceholder.aspx?&id=" + _template.Id, + Services.TextService.Localize("template/insertContentAreaPlaceHolder"), 470, 320); MenuIconI umbContent = editorSource.Menu.NewIcon(); - umbContent.ImageURL = SystemDirectories.Umbraco + "/images/editor/masterpageContent.gif"; - umbContent.AltText = Services.TextService.Localize("template/insertContentArea"); - umbContent.OnClickCommand = - ClientTools.Scripts.OpenModalWindow( - IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/dialogs/insertMasterpageContent.aspx?id=" + - _template.Id, Services.TextService.Localize("template/insertContentArea"), 470, 300); - } + umbContent.ImageURL = SystemDirectories.Umbraco + "/images/editor/masterpageContent.gif"; + umbContent.AltText = Services.TextService.Localize("template/insertContentArea"); + umbContent.OnClickCommand = + ClientTools.Scripts.OpenModalWindow( + IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/dialogs/insertMasterpageContent.aspx?id=" + + _template.Id, Services.TextService.Localize("template/insertContentArea"), 470, 300); + } - //Spit button + //Spit button editorSource.Menu.InsertSplitter(); editorSource.Menu.NewElement("div", "splitButtonPlaceHolder", "sbPlaceHolder", 40); - // Help + // Help editorSource.Menu.InsertSplitter(); MenuIconI helpIcon = editorSource.Menu.NewIcon(); - helpIcon.OnClickCommand = - ClientTools.Scripts.OpenModalWindow( - IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/settings/modals/showumbracotags.aspx?alias=" + - _template.Alias, Services.TextService.Localize("template/quickGuide"), 600, 580); - helpIcon.ImageURL = SystemDirectories.Umbraco + "/images/editor/help.png"; - helpIcon.AltText = Services.TextService.Localize("template/quickGuide"); - } + helpIcon.OnClickCommand = + ClientTools.Scripts.OpenModalWindow( + IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/settings/modals/showumbracotags.aspx?alias=" + + _template.Alias, Services.TextService.Localize("template/quickGuide"), 600, 580); + helpIcon.ImageURL = SystemDirectories.Umbraco + "/images/editor/help.png"; + helpIcon.AltText = Services.TextService.Localize("template/quickGuide"); + } - private void LoadScriptingTemplates() - { - string path = SystemDirectories.Umbraco + "/scripting/templates/cshtml/"; - string abPath = IOHelper.MapPath(path); + private void LoadScriptingTemplates() + { + string path = SystemDirectories.Umbraco + "/scripting/templates/cshtml/"; + string abPath = IOHelper.MapPath(path); - var files = new List>(); + var files = new List>(); - if (Directory.Exists(abPath)) - { - string extension = ".cshtml"; + if (Directory.Exists(abPath)) + { + string extension = ".cshtml"; - foreach (FileInfo fi in new DirectoryInfo(abPath).GetFiles("*" + extension)) - { - string filename = Path.GetFileName(fi.FullName); + foreach (FileInfo fi in new DirectoryInfo(abPath).GetFiles("*" + extension)) + { + string filename = Path.GetFileName(fi.FullName); - files.Add(new KeyValuePair( - filename, + files.Add(new KeyValuePair( + filename, filename.Replace(extension, "").SplitPascalCasing().ToFirstUpperInvariant() - )); - } - } + )); + } + } - rpt_codeTemplates.DataSource = files; - rpt_codeTemplates.DataBind(); - } + rpt_codeTemplates.DataSource = files; + rpt_codeTemplates.DataBind(); + } - private void LoadMacros() - { - var macroRenderings = - Services.MacroService.GetAll() - .Select(x => new TempMacroClass() - { - id = x.Id, - macroAlias = x.Alias, - macroName = x.Name - }); + private void LoadMacros() + { + var macroRenderings = + Services.MacroService.GetAll() + .Select(x => new TempMacroClass() + { + id = x.Id, + macroAlias = x.Alias, + macroName = x.Name + }); - rpt_macros.DataSource = macroRenderings; - rpt_macros.DataBind(); - } + rpt_macros.DataSource = macroRenderings; + rpt_macros.DataBind(); + } - private class TempMacroClass - { - public int id { get; set; } + private class TempMacroClass + { + public int id { get; set; } public string macroAlias { get; set; } public string macroName { get; set; } - } + } - public string DoesMacroHaveSettings(string macroId) - { - int val; - using (var scope = Current.ScopeProvider.CreateScope()) - { - val = scope.Database.ExecuteScalar("select 1 from cmsMacroProperty where macro = @macroId", new { macroId }); - scope.Complete(); - } + public string DoesMacroHaveSettings(string macroId) + { + int val; + using (var scope = Current.ScopeProvider.CreateScope()) + { + val = scope.Database.ExecuteScalar("select 1 from cmsMacroProperty where macro = @macroId", new { macroId }); + scope.Complete(); + } - return val == 1 ? "1" : "0"; - } + return val == 1 ? "1" : "0"; + } - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - } + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + } - /// - /// CssInclude1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.CssInclude CssInclude1; + /// + /// CssInclude1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::ClientDependency.Core.Controls.CssInclude CssInclude1; - /// - /// JsInclude control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude; + /// + /// JsInclude control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::ClientDependency.Core.Controls.JsInclude JsInclude; - /// - /// Panel1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.TabView Panel1; + /// + /// Panel1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.TabView Panel1; - /// - /// Pane7 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.Pane Pane7; + /// + /// Pane7 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.Pane Pane7; protected global::Umbraco.Web._Legacy.Controls.Pane Pane8; - /// - /// pp_name control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_name; + /// + /// pp_name control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_name; - /// - /// NameTxt control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox NameTxt; + /// + /// NameTxt control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox NameTxt; - /// - /// pp_alias control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_alias; + /// + /// pp_alias control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_alias; - /// - /// AliasTxt control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox AliasTxt; + /// + /// AliasTxt control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox AliasTxt; - /// - /// pp_masterTemplate control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_masterTemplate; + /// + /// pp_masterTemplate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_masterTemplate; - /// - /// MasterTemplate control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.DropDownList MasterTemplate; + /// + /// MasterTemplate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList MasterTemplate; - /// - /// pp_source control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_source; + /// + /// pp_source control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_source; - /// - /// editorSource control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.CodeArea editorSource; + /// + /// editorSource control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Umbraco.Web._Legacy.Controls.CodeArea editorSource; - /// - /// rpt_codeTemplates control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Repeater rpt_codeTemplates; + /// + /// rpt_codeTemplates control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Repeater rpt_codeTemplates; - /// - /// rpt_macros control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Repeater rpt_macros; - } -} \ No newline at end of file + /// + /// rpt_macros control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Repeater rpt_macros; + } +} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/stylesheet/editstylesheet.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/stylesheet/editstylesheet.aspx.cs index 248cd8886f..e831bd4757 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/stylesheet/editstylesheet.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/stylesheet/editstylesheet.aspx.cs @@ -44,7 +44,7 @@ namespace umbraco.cms.presentation.settings.stylesheet } protected void Page_Load(object sender, EventArgs e) - { + { Panel1.Text = Services.TextService.Localize("stylesheet/editstylesheet"); pp_name.Text = Services.TextService.Localize("name"); pp_path.Text = Services.TextService.Localize("path"); @@ -149,4 +149,4 @@ namespace umbraco.cms.presentation.settings.stylesheet protected global::Umbraco.Web._Legacy.Controls.CodeArea editorSource; } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/stylesheet/property/EditStyleSheetProperty.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/stylesheet/property/EditStyleSheetProperty.aspx.cs index e1c3da39b8..7c90a9a16b 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/stylesheet/property/EditStyleSheetProperty.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/stylesheet/property/EditStyleSheetProperty.aspx.cs @@ -30,7 +30,7 @@ namespace umbraco.cms.presentation.settings.stylesheet protected override void OnLoad(EventArgs e) { base.OnLoad(e); - + _sheet = Services.FileService.GetStylesheetByName(Request.QueryString["id"]); if (_sheet == null) throw new InvalidOperationException("No stylesheet found with name: " + Request.QueryString["id"]); @@ -83,7 +83,7 @@ namespace umbraco.cms.presentation.settings.stylesheet //to change the name we actually have to remove the property and re-add it as a different one _sheet.AddProperty(new Umbraco.Core.Models.StylesheetProperty(NameTxt.Text, _stylesheetproperty.Alias, _stylesheetproperty.Value)); _sheet.RemoveProperty(_stylesheetproperty.Name); - //reset our variable + //reset our variable _stylesheetproperty = _sheet.Properties.Single(x => x.Name == NameTxt.Text); } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/ContentType.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/ContentType.cs index 95425bafde..e2bb158825 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/ContentType.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/ContentType.cs @@ -5,7 +5,7 @@ using System.ComponentModel; using System.Web.UI; using System.Web.UI.WebControls; -namespace umbraco.presentation.templateControls +namespace umbraco.presentation.templateControls { [DefaultProperty("MimeType")] [ToolboxData("<{0}:ContentType runat=server>")] @@ -25,7 +25,7 @@ namespace umbraco.presentation.templateControls protected override void Render(HtmlTextWriter writer) { - + } } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/DisableEventValidation.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/DisableEventValidation.cs index 4f46c0d8e5..f08725539c 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/DisableEventValidation.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/DisableEventValidation.cs @@ -11,7 +11,7 @@ namespace umbraco.presentation.templateControls /// This control disables request validation (equalevant of setting validateRequest to false in page directive) /// [ToolboxData("<{0}:DisableRequestValidation runat=\"server\">")] - [Designer("umbraco.presentation.templateControls.ItemDesigner, Umbraco.Web")] + [Designer("umbraco.presentation.templateControls.ItemDesigner, Umbraco.Web")] public class DisableRequestValidation : System.Web.UI.WebControls.WebControl { protected override void OnInit(EventArgs e) diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/Image.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/Image.cs index dd0c0e0554..801f689848 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/Image.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/Image.cs @@ -1,23 +1,23 @@ -using System; -using System.Web.UI; -using System.Web.UI.HtmlControls; -using Umbraco.Core.Media; -using Umbraco.Web.Media; +using System; +using System.Web.UI; +using System.Web.UI.HtmlControls; +using Umbraco.Core.Media; +using Umbraco.Web.Media; -namespace umbraco.presentation.templateControls -{ - [Obsolete("This is no longer used and will be removed in future versions")] - public class Image : HtmlImage - { - public string NodeId { get; set; } - public string Field { get; set; } - public string Provider { get; set; } - public string Parameters { get; set; } +namespace umbraco.presentation.templateControls +{ + [Obsolete("This is no longer used and will be removed in future versions")] + public class Image : HtmlImage + { + public string NodeId { get; set; } + public string Field { get; set; } + public string Provider { get; set; } + public string Parameters { get; set; } - protected override void Render(HtmlTextWriter writer) - { - int id; - bool hasid = int.TryParse(NodeId, out id); + protected override void Render(HtmlTextWriter writer) + { + int id; + bool hasid = int.TryParse(NodeId, out id); int? nodeId = hasid ? id : (int?)null; string url; @@ -27,6 +27,6 @@ namespace umbraco.presentation.templateControls { base.Render(writer); } - } - } -} \ No newline at end of file + } + } +} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/Item.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/Item.cs index 397b626201..21c681b7bd 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/Item.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/Item.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.ComponentModel; using System.Web; @@ -21,7 +21,7 @@ namespace umbraco.presentation.templateControls /// [DefaultProperty("Field")] [ToolboxData("<{0}:Item runat=\"server\">")] - [Designer("umbraco.presentation.templateControls.ItemDesigner, Umbraco.Web")] + [Designer("umbraco.presentation.templateControls.ItemDesigner, Umbraco.Web")] public class Item : CompositeControl { diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/Macro.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/Macro.cs index f0130fdeb6..1847871ac5 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/Macro.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/Macro.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel; using System.Web.UI; @@ -68,36 +68,36 @@ namespace umbraco.presentation.templateControls ViewState["FileLocation"] = value.ToLower(); } } - [Bindable(true)] - [Category("Umbraco")] - [DefaultValue(RenderEvents.Init)] - [Localizable(true)] - public RenderEvents RenderEvent - { - get - { - var renderEvent = RenderEvents.Init; - if (ViewState["RenderEvent"] != null) - renderEvent = (RenderEvents)ViewState["RenderEvent"]; - return renderEvent; - } - set - { - ViewState["RenderEvent"] = value; - } - } + [Bindable(true)] + [Category("Umbraco")] + [DefaultValue(RenderEvents.Init)] + [Localizable(true)] + public RenderEvents RenderEvent + { + get + { + var renderEvent = RenderEvents.Init; + if (ViewState["RenderEvent"] != null) + renderEvent = (RenderEvents)ViewState["RenderEvent"]; + return renderEvent; + } + set + { + ViewState["RenderEvent"] = value; + } + } - // Indicates where to run EnsureChildControls and effectively render the macro - public enum RenderEvents - { - Init, - PreRender, - Render - } + // Indicates where to run EnsureChildControls and effectively render the macro + public enum RenderEvents + { + Init, + PreRender, + Render + } public IList Exceptions = new List(); - /// + /// /// Raises the event. /// /// An object that contains the event data. @@ -105,18 +105,18 @@ namespace umbraco.presentation.templateControls base.OnInit(e); // Create child controls when told to - this is the default - if (RenderEvent == RenderEvents.Init) - EnsureChildControls(); + if (RenderEvent == RenderEvents.Init) + EnsureChildControls(); } - // Create child controls when told to - new option to render at PreRender - protected override void OnPreRender(EventArgs e) - { - base.OnPreRender(e); + // Create child controls when told to - new option to render at PreRender + protected override void OnPreRender(EventArgs e) + { + base.OnPreRender(e); - if (RenderEvent == RenderEvents.PreRender) - EnsureChildControls(); - } + if (RenderEvent == RenderEvents.PreRender) + EnsureChildControls(); + } /// /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering. @@ -203,7 +203,7 @@ namespace umbraco.presentation.templateControls /// The object that receives the control content. protected override void Render(HtmlTextWriter writer) { - // Create child controls when told to - do it here anyway as it has to be done + // Create child controls when told to - do it here anyway as it has to be done EnsureChildControls(); var isDebug = GlobalSettings.DebugMode && (Context.Request.GetItemAsString("umbdebugshowtrace") != "" || Context.Request.GetItemAsString("umbdebug") != ""); diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/Resources.Designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/Resources.Designer.cs index 3adaf973ca..e76b5ad4f7 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/Resources.Designer.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/Resources.Designer.cs @@ -10,8 +10,8 @@ namespace Umbraco.Web.umbraco.presentation.umbraco.templateControls { using System; - - + + /// /// A strongly-typed resource class, for looking up localized strings, etc. /// @@ -23,15 +23,15 @@ namespace Umbraco.Web.umbraco.presentation.umbraco.templateControls { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { - + private static global::System.Resources.ResourceManager resourceMan; - + private static global::System.Globalization.CultureInfo resourceCulture; - + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Resources() { } - + /// /// Returns the cached ResourceManager instance used by this class. /// @@ -45,7 +45,7 @@ namespace Umbraco.Web.umbraco.presentation.umbraco.templateControls { return resourceMan; } } - + /// /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. @@ -59,17 +59,17 @@ namespace Umbraco.Web.umbraco.presentation.umbraco.templateControls { resourceCulture = value; } } - + /// /// Looks up a localized string similar to <?xml version="1.0" encoding="UTF-8"?> ///<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]> - ///<xsl:stylesheet - /// version="1.0" - /// xmlns:xsl="http://www.w3.org/1999/XSL/Transform" - /// xmlns:msxml="urn:schemas-microsoft-com:xslt" - /// xmlns:umbraco.library="urn:umbraco.library" + ///<xsl:stylesheet + /// version="1.0" + /// xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + /// xmlns:msxml="urn:schemas-microsoft-com:xslt" + /// xmlns:umbraco.library="urn:umbraco.library" /// {3} - /// exclude-result-prefixes="msxml umbraco.library {2}"> + /// exclude-result-prefixes="msxml umbraco.library {2}"> ///<xsl:output method="xml" omit-xml-declaration="yes"/> ///<xsl:param name="currentPage"/> ///<xsl:param name="itemData"/> diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/default.aspx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/translation/default.aspx.designer.cs index 038b619259..3bc3fbef53 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/default.aspx.designer.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/translation/default.aspx.designer.cs @@ -1,4 +1,4 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:2.0.50727.3053 @@ -9,10 +9,10 @@ //------------------------------------------------------------------------------ namespace umbraco.presentation.translation { - - + + public partial class _default { - + /// /// Panel2 control. /// @@ -21,7 +21,7 @@ namespace umbraco.presentation.translation { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.UmbracoPanel Panel2; - + /// /// feedback control. /// @@ -30,7 +30,7 @@ namespace umbraco.presentation.translation { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.Feedback feedback; - + /// /// pane_uploadFile control. /// @@ -39,7 +39,7 @@ namespace umbraco.presentation.translation { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.Pane pane_uploadFile; - + /// /// translationFile control. /// @@ -48,7 +48,7 @@ namespace umbraco.presentation.translation { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.HtmlControls.HtmlInputFile translationFile; - + /// /// uploadFile control. /// @@ -57,7 +57,7 @@ namespace umbraco.presentation.translation { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Button uploadFile; - + /// /// pane_tasks control. /// @@ -66,7 +66,7 @@ namespace umbraco.presentation.translation { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.Pane pane_tasks; - + /// /// lt_tasksHelp control. /// @@ -75,7 +75,7 @@ namespace umbraco.presentation.translation { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Literal lt_tasksHelp; - + /// /// taskList control. /// diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/details.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/translation/details.aspx.cs index bfc56a16fb..8736baf6e8 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/details.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/translation/details.aspx.cs @@ -32,7 +32,7 @@ namespace umbraco.presentation.umbraco.translation { //Document page = new Document(t.Node.Id); var page = Current.Services.ContentService.GetById(t.TaskEntity.EntityId); - //Bind meta data and language... + //Bind meta data and language... Literal lt = new Literal(); lt.Text = t.Date.ToLongDateString() + " " + t.Date.ToLongTimeString(); pp_date.Controls.Add(lt); @@ -81,7 +81,7 @@ namespace umbraco.presentation.umbraco.translation { DataTable pageTable = new DataTable(); pageTable.Columns.Add(Services.TextService.Localize("name")); pageTable.Columns.Add(Services.TextService.Localize("value")); - + DataRow pageRow = pageTable.NewRow(); pageRow[Services.TextService.Localize("name")] = Services.TextService.Localize("nodeName"); pageRow[Services.TextService.Localize("value")] = page.Name; @@ -94,7 +94,7 @@ namespace umbraco.presentation.umbraco.translation { // pageRow[Services.TextService.Localize("value")] = page.getProperty(pt.Alias).Value; // pageTable.Rows.Add(pageRow); //} - + dg_fields.DataSource = pageTable; dg_fields.DataBind(); } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/details.aspx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/translation/details.aspx.designer.cs index e94d462516..4a046832d4 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/details.aspx.designer.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/translation/details.aspx.designer.cs @@ -9,10 +9,10 @@ //------------------------------------------------------------------------------ namespace umbraco.presentation.umbraco.translation { - - + + public partial class details { - + /// /// panel1 control. /// @@ -21,7 +21,7 @@ namespace umbraco.presentation.umbraco.translation { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.UmbracoPanel panel1; - + /// /// pane_details control. /// @@ -30,7 +30,7 @@ namespace umbraco.presentation.umbraco.translation { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.Pane pane_details; - + /// /// pp_date control. /// @@ -39,7 +39,7 @@ namespace umbraco.presentation.umbraco.translation { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_date; - + /// /// pp_owner control. /// @@ -48,7 +48,7 @@ namespace umbraco.presentation.umbraco.translation { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_owner; - + /// /// pp_totalWords control. /// @@ -57,7 +57,7 @@ namespace umbraco.presentation.umbraco.translation { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_totalWords; - + /// /// pp_comment control. /// @@ -66,7 +66,7 @@ namespace umbraco.presentation.umbraco.translation { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_comment; - + /// /// pane_tasks control. /// @@ -75,7 +75,7 @@ namespace umbraco.presentation.umbraco.translation { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.Pane pane_tasks; - + /// /// pp_xml control. /// @@ -84,7 +84,7 @@ namespace umbraco.presentation.umbraco.translation { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_xml; - + /// /// pp_upload control. /// @@ -93,7 +93,7 @@ namespace umbraco.presentation.umbraco.translation { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_upload; - + /// /// pp_closeTask control. /// @@ -102,7 +102,7 @@ namespace umbraco.presentation.umbraco.translation { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_closeTask; - + /// /// bt_close control. /// @@ -111,7 +111,7 @@ namespace umbraco.presentation.umbraco.translation { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Button bt_close; - + /// /// pane_fields control. /// @@ -120,7 +120,7 @@ namespace umbraco.presentation.umbraco.translation { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.Pane pane_fields; - + /// /// dg_fields control. /// diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/preview.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/translation/preview.aspx.cs index c1f370dab6..c8be083564 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/preview.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/translation/preview.aspx.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using Umbraco.Core; using Umbraco.Web; @@ -18,7 +18,7 @@ namespace umbraco.presentation.translation protected void Page_Load(object sender, EventArgs e) { - + var taskId = int.Parse(Request.GetItemAsString("id")); var t = new Task(taskId); @@ -26,7 +26,7 @@ namespace umbraco.presentation.translation translatedUrl = string.Format("../dialogs/preview.aspx?id={0}", t.TaskEntity.EntityId); var orgRel = Services.RelationService.GetByParentOrChildId(t.TaskEntity.EntityId, "relateDocumentOnCopy").ToArray(); - + if (orgRel.Length > 0) { originalUrl = String.Format("../dialogs/preview.aspx?id={0}", orgRel[0].ParentId); diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/preview.aspx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/translation/preview.aspx.designer.cs index d673b0d677..3bdf1f5600 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/preview.aspx.designer.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/translation/preview.aspx.designer.cs @@ -1,4 +1,4 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:2.0.50727.3053 @@ -9,8 +9,8 @@ //------------------------------------------------------------------------------ namespace umbraco.presentation.translation { - - + + public partial class preview { } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/xml.aspx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/translation/xml.aspx.designer.cs index 7b5a902496..b2fd358057 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/xml.aspx.designer.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/translation/xml.aspx.designer.cs @@ -1,4 +1,4 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:2.0.50727.3053 @@ -9,10 +9,10 @@ //------------------------------------------------------------------------------ namespace umbraco.presentation.translation { - - + + public partial class xml { - + /// /// xmlContents control. /// diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/users/EditUser.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/users/EditUser.aspx.cs index ffa044313d..747accaef7 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/users/EditUser.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/users/EditUser.aspx.cs @@ -145,7 +145,7 @@ namespace umbraco.cms.presentation.user contentPicker.Value = "-1"; content.Controls.Add(contentPicker); - + // Add password changer var passwordChanger = (passwordChanger)LoadControl(SystemDirectories.Umbraco + "/controls/passwordChanger.ascx"); passwordChanger.MembershipProviderName = UmbracoConfig.For.UmbracoSettings().Providers.DefaultBackOfficeUserProvider; @@ -458,8 +458,8 @@ namespace umbraco.cms.presentation.user } else { - ClientTools.ShowSpeechBubble(SpeechBubbleIcon.Error, - Services.TextService.Localize("speechBubbles/validationFailedHeader"), + ClientTools.ShowSpeechBubble(SpeechBubbleIcon.Error, + Services.TextService.Localize("speechBubbles/validationFailedHeader"), Services.TextService.Localize("speechBubbles/validationFailedMessage")); } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/users/EditUserType.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/users/EditUserType.aspx.cs index 740c6d2b3c..c32fcaf76e 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/users/EditUserType.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/users/EditUserType.aspx.cs @@ -1,4 +1,4 @@ -using Umbraco.Core.Services; +using Umbraco.Core.Services; using System; using System.Web.UI.WebControls; using System.Collections.Generic; @@ -33,7 +33,7 @@ namespace umbraco.cms.presentation.user pp_name.Text = Services.TextService.Localize("usertype") + " " + Services.TextService.Localize("name"); pp_rights.Text = Services.TextService.Localize("default") + " " + Services.TextService.Localize("rights"); - + //ensure we have a query string if (string.IsNullOrEmpty(Request.QueryString["id"])) return; @@ -109,6 +109,6 @@ namespace umbraco.cms.presentation.user } - + } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/users/EditUserType.aspx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/users/EditUserType.aspx.designer.cs index a5849b71ab..fc88ec213c 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/users/EditUserType.aspx.designer.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/users/EditUserType.aspx.designer.cs @@ -1,17 +1,17 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace umbraco.cms.presentation.user { - - + + public partial class EditUserType { - + /// /// pnlUmbraco control. /// @@ -20,7 +20,7 @@ namespace umbraco.cms.presentation.user { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.UmbracoPanel pnlUmbraco; - + /// /// pnl1 control. /// @@ -29,7 +29,7 @@ namespace umbraco.cms.presentation.user { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.Pane pnl1; - + /// /// hidUserTypeID control. /// @@ -38,7 +38,7 @@ namespace umbraco.cms.presentation.user { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.HiddenField hidUserTypeID; - + /// /// pp_name control. /// @@ -47,7 +47,7 @@ namespace umbraco.cms.presentation.user { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_name; - + /// /// txtUserTypeName control. /// @@ -56,7 +56,7 @@ namespace umbraco.cms.presentation.user { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.TextBox txtUserTypeName; - + /// /// pp_alias control. /// @@ -65,7 +65,7 @@ namespace umbraco.cms.presentation.user { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_alias; - + /// /// lblUserTypeAlias control. /// @@ -74,7 +74,7 @@ namespace umbraco.cms.presentation.user { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Label lblUserTypeAlias; - + /// /// pnl2 control. /// @@ -83,7 +83,7 @@ namespace umbraco.cms.presentation.user { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.Pane pnl2; - + /// /// pp_rights control. /// @@ -92,7 +92,7 @@ namespace umbraco.cms.presentation.user { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.PropertyPanel pp_rights; - + /// /// cbl_rights control. /// diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/users/NodePermissions.ascx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/users/NodePermissions.ascx.cs index 90b41d6bfa..e194933d8e 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/users/NodePermissions.ascx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/users/NodePermissions.ascx.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using Umbraco.Core.Models.Membership; @@ -64,20 +64,20 @@ namespace umbraco.cms.presentation.user public override void DataBind() { base.DataBind(); - - + + if (m_umbracoUser == null) throw new ArgumentNullException("No User specified"); //get the logged in user's permissions UserPermissions currUserPermissions = new UserPermissions(Security.CurrentUser); - + //lookup permissions for last node selected int selectedNodeId = m_nodeID[m_nodeID.Length - 1]; - + List lstCurrUserActions = currUserPermissions.GetExistingNodePermission(selectedNodeId); List lstLookupUserActions = m_userPermissions.GetExistingNodePermission(selectedNodeId); - + List lstAllActions = Action.GetPermissionAssignable(); //no node is selected, disable the check boxes @@ -103,19 +103,19 @@ namespace umbraco.cms.presentation.user } } - lt_names.Text = names.Trim().Trim(','); + lt_names.Text = names.Trim().Trim(','); } private void ShowMessage(string msg) { lblMessage.Visible = true; lblMessage.Text = msg; - + } private void BindExistingPermissions(List allActions, List userActions) { - + List assignedPermissions = new List(); foreach (var a in allActions) { @@ -124,11 +124,11 @@ namespace umbraco.cms.presentation.user p.HasPermission = (userActions != null ? userActions.Contains(a) : false); assignedPermissions.Add(p); } - + rptPermissionsList.DataSource = assignedPermissions; rptPermissionsList.DataBind(); - - } + + } protected struct AssignedPermission { @@ -137,4 +137,4 @@ namespace umbraco.cms.presentation.user } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/users/NodePermissions.ascx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/users/NodePermissions.ascx.designer.cs index c981de682b..a1e109b458 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/users/NodePermissions.ascx.designer.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/users/NodePermissions.ascx.designer.cs @@ -1,17 +1,17 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace umbraco.cms.presentation.user { - - + + public partial class NodePermissions { - + /// /// lt_names control. /// @@ -20,7 +20,7 @@ namespace umbraco.cms.presentation.user { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Literal lt_names; - + /// /// pnlReplaceChildren control. /// @@ -29,7 +29,7 @@ namespace umbraco.cms.presentation.user { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Panel pnlReplaceChildren; - + /// /// lblMessage control. /// @@ -38,7 +38,7 @@ namespace umbraco.cms.presentation.user { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Label lblMessage; - + /// /// rptPermissionsList control. /// diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/users/PermissionEditor.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/users/PermissionEditor.aspx.cs index 9cada91e56..330c53f8db 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/users/PermissionEditor.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/users/PermissionEditor.aspx.cs @@ -1,4 +1,4 @@ -using Umbraco.Core.Services; +using Umbraco.Core.Services; using System; using System.Web.UI; using Umbraco.Core; @@ -10,25 +10,25 @@ using Umbraco.Web.UI.Pages; namespace umbraco.cms.presentation.user { - public partial class PermissionEditor : UmbracoEnsuredPage + public partial class PermissionEditor : UmbracoEnsuredPage { - public PermissionEditor() - { + public PermissionEditor() + { CurrentApp = Constants.Applications.Users; - } + } - protected override void OnInit(EventArgs e) - { - base.OnInit(e); + protected override void OnInit(EventArgs e) + { + base.OnInit(e); - if (!IsPostBack) - { - JTree.App = Constants.Applications.Content; - JTree.ShowContextMenu = false; - JTree.IsDialog = true; - } - } + if (!IsPostBack) + { + JTree.App = Constants.Applications.Content; + JTree.ShowContextMenu = false; + JTree.IsDialog = true; + } + } protected void Page_Load(object sender, EventArgs e) { @@ -49,12 +49,12 @@ namespace umbraco.cms.presentation.user pnlUmbraco.Text = Services.TextService.Localize("user/userPermissions"); pnl1.Text = Services.TextService.Localize("user/permissionSelectPages"); - if (!IsPostBack) - { - ClientTools cTools = new ClientTools(this); - cTools.SetActiveTreeType(Constants.Trees.UserPermissions) - .SyncTree(Request.QueryString["id"], false); - } + if (!IsPostBack) + { + ClientTools cTools = new ClientTools(this); + cTools.SetActiveTreeType(Constants.Trees.UserPermissions) + .SyncTree(Request.QueryString["id"], false); + } } /// @@ -67,7 +67,7 @@ namespace umbraco.cms.presentation.user return Services.UserService.GetUserById(Convert.ToInt32(Request.QueryString["id"])); } } - + /// /// Makes sure the user exists with the id specified /// @@ -84,7 +84,7 @@ namespace umbraco.cms.presentation.user throw new Exception("No user found with id: " + strID); } - + protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); ScriptManager.GetCurrent(Page).Services.Add(new ServiceReference(SystemDirectories.Umbraco + "/users/PermissionsHandler.asmx")); diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/users/PermissionEditor.aspx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/users/PermissionEditor.aspx.designer.cs index 00374a5562..1397e88629 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/users/PermissionEditor.aspx.designer.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/users/PermissionEditor.aspx.designer.cs @@ -1,17 +1,17 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace umbraco.cms.presentation.user { - - + + public partial class PermissionEditor { - + /// /// CssInclude2 control. /// @@ -20,7 +20,7 @@ namespace umbraco.cms.presentation.user { /// To modify move field declaration from designer file to code-behind file. /// protected global::ClientDependency.Core.Controls.CssInclude CssInclude2; - + /// /// CssInclude1 control. /// @@ -29,7 +29,7 @@ namespace umbraco.cms.presentation.user { /// To modify move field declaration from designer file to code-behind file. /// protected global::ClientDependency.Core.Controls.CssInclude CssInclude1; - + /// /// JsInclude1 control. /// @@ -38,7 +38,7 @@ namespace umbraco.cms.presentation.user { /// To modify move field declaration from designer file to code-behind file. /// protected global::ClientDependency.Core.Controls.JsInclude JsInclude1; - + /// /// pnlUmbraco control. /// @@ -47,7 +47,7 @@ namespace umbraco.cms.presentation.user { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.UmbracoPanel pnlUmbraco; - + /// /// pnl1 control. /// @@ -56,7 +56,7 @@ namespace umbraco.cms.presentation.user { /// To modify move field declaration from designer file to code-behind file. /// protected global::Umbraco.Web._Legacy.Controls.Pane pnl1; - + /// /// JTree control. /// @@ -65,7 +65,7 @@ namespace umbraco.cms.presentation.user { /// To modify move field declaration from designer file to code-behind file. /// protected global::umbraco.controls.Tree.TreeControl JTree; - + /// /// nodePermissions control. /// diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/users/UserPermissions.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/users/UserPermissions.cs index 732e12f548..abd0343773 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/users/UserPermissions.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/users/UserPermissions.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using Umbraco.Core.Models; using Umbraco.Core.Services; @@ -11,7 +11,7 @@ namespace umbraco.cms.presentation.user { /// /// Provides umbraco user permission functionality on various nodes. Only nodes that are published are queried via the cache. - /// + /// public class UserPermissions { readonly IUser _user; @@ -37,7 +37,7 @@ namespace umbraco.cms.presentation.user foreach (var nodeId in nodeIDs) { var nodeActions = Current.Services.UserService.GetPermissions(UmbracoContext.Current.Security.CurrentUser, GetNodePath(nodeId)); - + var lstActions = Action.FromEntityPermission(nodeActions); if (lstActions == null || !lstActions.Contains(ActionRights.Instance)) lstNoPermissions.Add(nodeId); @@ -76,7 +76,7 @@ namespace umbraco.cms.presentation.user //the node will inherit from it's parent. Current.Services.UserService.ReplaceUserPermissions( _user.Id, new[] { ActionNull.Instance.Letter }, allNodes.ToArray()); - } + } } @@ -126,4 +126,4 @@ namespace umbraco.cms.presentation.user return nodeIds; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/CacheRefresher.asmx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/CacheRefresher.asmx.cs index a9953318e5..0488589e7b 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/CacheRefresher.asmx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/CacheRefresher.asmx.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using System.Web; using System.Web.Services; @@ -19,11 +19,11 @@ using Umbraco.Web.Composing; namespace umbraco.presentation.webservices { - /// - /// CacheRefresher web service. - /// - [WebService(Namespace="http://umbraco.org/webservices/")] - public class CacheRefresher : WebService + /// + /// CacheRefresher web service. + /// + [WebService(Namespace="http://umbraco.org/webservices/")] + public class CacheRefresher : WebService { #region Helpers @@ -66,13 +66,13 @@ namespace umbraco.presentation.webservices private bool Authorized(string login, string rawPassword) { - //TODO: This technique of passing the raw password in is a legacy idea and isn't really - // a very happy way to secure this webservice. To prevent brute force attacks, we need + //TODO: This technique of passing the raw password in is a legacy idea and isn't really + // a very happy way to secure this webservice. To prevent brute force attacks, we need // to ensure that the lockout policies are applied, though because we are not authenticating // the user with their real password, we need to do this a bit manually. var userMgr = Context.GetOwinContext().GetBackOfficeUserManager(); - + var user = Current.Services.UserService.GetByUsername(login); if (user == null) return false; @@ -116,7 +116,7 @@ namespace umbraco.presentation.webservices break; case RefreshMethodType.RefreshByIds: // not directly supported by ICacheRefresher foreach (var id in JsonConvert.DeserializeObject(instruction.JsonIds)) - refresher.Refresh(id); + refresher.Refresh(id); break; case RefreshMethodType.RefreshByJson: GetJsonRefresher(refresher).Refresh(instruction.JsonPayload); @@ -132,34 +132,34 @@ namespace umbraco.presentation.webservices } } - [WebMethod] - public void RefreshAll(Guid uniqueIdentifier, string Login, string Password) - { - if (Authorized(Login, Password) == false) return; - GetRefresher(uniqueIdentifier).RefreshAll(); - } + [WebMethod] + public void RefreshAll(Guid uniqueIdentifier, string Login, string Password) + { + if (Authorized(Login, Password) == false) return; + GetRefresher(uniqueIdentifier).RefreshAll(); + } - [WebMethod] - public void RefreshByGuid(Guid uniqueIdentifier, Guid Id, string Login, string Password) - { + [WebMethod] + public void RefreshByGuid(Guid uniqueIdentifier, Guid Id, string Login, string Password) + { if (Authorized(Login, Password) == false) return; GetRefresher(uniqueIdentifier).Refresh(Id); - } + } - [WebMethod] - public void RefreshById(Guid uniqueIdentifier, int Id, string Login, string Password) - { - if (Authorized(Login, Password) == false) return; - GetRefresher(uniqueIdentifier).Refresh(Id); - } + [WebMethod] + public void RefreshById(Guid uniqueIdentifier, int Id, string Login, string Password) + { + if (Authorized(Login, Password) == false) return; + GetRefresher(uniqueIdentifier).Refresh(Id); + } [WebMethod] public void RefreshByIds(Guid uniqueIdentifier, string jsonIds, string Login, string Password) { if (Authorized(Login, Password) == false) return; var refresher = GetRefresher(uniqueIdentifier); - foreach (var id in JsonConvert.DeserializeObject(jsonIds)) - refresher.Refresh(id); + foreach (var id in JsonConvert.DeserializeObject(jsonIds)) + refresher.Refresh(id); } [WebMethod] @@ -169,27 +169,27 @@ namespace umbraco.presentation.webservices GetJsonRefresher(uniqueIdentifier).Refresh(jsonPayload); } - [WebMethod] - public void RemoveById(Guid uniqueIdentifier, int Id, string Login, string Password) + [WebMethod] + public void RemoveById(Guid uniqueIdentifier, int Id, string Login, string Password) { if (Authorized(Login, Password) == false) return; GetRefresher(uniqueIdentifier).Remove(Id); } - [WebMethod] - public XmlDocument GetRefreshers(string Login, string Password) - { - if (Authorized(Login, Password) == false) return null; + [WebMethod] + public XmlDocument GetRefreshers(string Login, string Password) + { + if (Authorized(Login, Password) == false) return null; - var xd = new XmlDocument(); - xd.LoadXml(""); - foreach (var cr in Current.CacheRefreshers) - { - var n = XmlHelper.AddTextNode(xd, "cacheRefresher", cr.Name); - n.Attributes.Append(XmlHelper.AddAttribute(xd, "uniqueIdentifier", cr.RefresherUniqueId.ToString())); - xd.DocumentElement.AppendChild(n); - } - return xd; - } - } + var xd = new XmlDocument(); + xd.LoadXml(""); + foreach (var cr in Current.CacheRefreshers) + { + var n = XmlHelper.AddTextNode(xd, "cacheRefresher", cr.Name); + n.Attributes.Append(XmlHelper.AddAttribute(xd, "uniqueIdentifier", cr.RefresherUniqueId.ToString())); + xd.DocumentElement.AppendChild(n); + } + return xd; + } + } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/Developer.asmx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/Developer.asmx.cs index d73235b199..8b519f0a2f 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/Developer.asmx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/Developer.asmx.cs @@ -1,4 +1,4 @@ -using System.Globalization; +using System.Globalization; using System.Web.Services; using System.Xml; using Umbraco.Core; @@ -7,43 +7,43 @@ using Umbraco.Core.Xml; namespace umbraco.webservices { - /// - /// Summary description for Developer. - /// - [WebService(Namespace="http://umbraco.org/webservices/")] + /// + /// Summary description for Developer. + /// + [WebService(Namespace="http://umbraco.org/webservices/")] public class Developer : UmbracoAuthorizedWebService - { + { - [WebMethod] - public XmlNode GetMacros(string Login, string Password) - { - if (ValidateCredentials(Login, Password) - && UserHasAppAccess(Constants.Applications.Developer.ToString(), Login)) - { - var xmlDoc = new XmlDocument(); - var macros = xmlDoc.CreateElement("macros"); - foreach (var m in Services.MacroService.GetAll()) - { - var mXml = xmlDoc.CreateElement("macro"); - mXml.Attributes.Append(XmlHelper.AddAttribute(xmlDoc, "id", m.Id.ToString(CultureInfo.InvariantCulture))); + [WebMethod] + public XmlNode GetMacros(string Login, string Password) + { + if (ValidateCredentials(Login, Password) + && UserHasAppAccess(Constants.Applications.Developer.ToString(), Login)) + { + var xmlDoc = new XmlDocument(); + var macros = xmlDoc.CreateElement("macros"); + foreach (var m in Services.MacroService.GetAll()) + { + var mXml = xmlDoc.CreateElement("macro"); + mXml.Attributes.Append(XmlHelper.AddAttribute(xmlDoc, "id", m.Id.ToString(CultureInfo.InvariantCulture))); mXml.Attributes.Append(XmlHelper.AddAttribute(xmlDoc, "alias", m.Alias)); mXml.Attributes.Append(XmlHelper.AddAttribute(xmlDoc, "name", m.Name)); - macros.AppendChild(mXml); - } - return macros; - } - return null; - } + macros.AppendChild(mXml); + } + return macros; + } + return null; + } - [WebMethod] - public XmlNode GetMacro(int Id, string Login, string Password) - { - if (ValidateCredentials(Login, Password) - && UserHasAppAccess(Constants.Applications.Developer.ToString(), Login)) - { - var xmlDoc = new XmlDocument(); - var macro = xmlDoc.CreateElement("macro"); - var m = Services.MacroService.GetById(Id); //new cms.businesslogic.macro.Macro(Id); + [WebMethod] + public XmlNode GetMacro(int Id, string Login, string Password) + { + if (ValidateCredentials(Login, Password) + && UserHasAppAccess(Constants.Applications.Developer.ToString(), Login)) + { + var xmlDoc = new XmlDocument(); + var macro = xmlDoc.CreateElement("macro"); + var m = Services.MacroService.GetById(Id); //new cms.businesslogic.macro.Macro(Id); macro.Attributes.Append(XmlHelper.AddAttribute(xmlDoc, "id", m.Id.ToString(CultureInfo.InvariantCulture))); macro.Attributes.Append(XmlHelper.AddAttribute(xmlDoc, "refreshRate", m.CacheDuration.ToString(CultureInfo.InvariantCulture))); macro.Attributes.Append(XmlHelper.AddAttribute(xmlDoc, "useInEditor", m.UseInEditor.ToString())); @@ -51,19 +51,19 @@ namespace umbraco.webservices macro.Attributes.Append(XmlHelper.AddAttribute(xmlDoc, "name", m.Name)); macro.Attributes.Append(XmlHelper.AddAttribute(xmlDoc, "type", m.ControlType)); macro.Attributes.Append(XmlHelper.AddAttribute(xmlDoc, "xslt", m.XsltPath)); - var properties = xmlDoc.CreateElement("properties"); - foreach (var mp in m.Properties) - { - var pXml = xmlDoc.CreateElement("property"); + var properties = xmlDoc.CreateElement("properties"); + foreach (var mp in m.Properties) + { + var pXml = xmlDoc.CreateElement("property"); pXml.Attributes.Append(XmlHelper.AddAttribute(xmlDoc, "alias", mp.Alias)); pXml.Attributes.Append(XmlHelper.AddAttribute(xmlDoc, "name", mp.Name)); - pXml.Attributes.Append(XmlHelper.AddAttribute(xmlDoc, "public", true.ToString())); - properties.AppendChild(pXml); - } - macro.AppendChild(properties); - return macro; - } - return null; - } - } + pXml.Attributes.Append(XmlHelper.AddAttribute(xmlDoc, "public", true.ToString())); + properties.AppendChild(pXml); + } + macro.AppendChild(properties); + return macro; + } + return null; + } + } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/codeEditorSave.asmx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/codeEditorSave.asmx.cs index ea3ae203d7..f39dd051be 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/codeEditorSave.asmx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/codeEditorSave.asmx.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel; using System.IO; @@ -34,7 +34,7 @@ namespace umbraco.presentation.webservices // validate extension IOHelper.ValidateFileExtension(IOHelper.MapPath(SystemDirectories.Xslt + "/" + fileName), new List() { "xsl", "xslt" }); - + StreamWriter SW; string tempFileName = IOHelper.MapPath(SystemDirectories.Xslt + "/" + DateTime.Now.Ticks + "_temp.xslt"); SW = File.CreateText(tempFileName); @@ -151,7 +151,7 @@ namespace umbraco.presentation.webservices if (errorMessage == "" && fileName.ToLower().EndsWith(".xslt")) { - //Hardcoded security-check... only allow saving files in xslt directory... + //Hardcoded security-check... only allow saving files in xslt directory... var savePath = IOHelper.MapPath(SystemDirectories.Xslt + "/" + fileName); if (savePath.StartsWith(IOHelper.MapPath(SystemDirectories.Xslt + "/"))) @@ -170,7 +170,7 @@ namespace umbraco.presentation.webservices SW.Close(); errorMessage = "true"; - + } else { @@ -185,4 +185,4 @@ namespace umbraco.presentation.webservices return "false"; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/legacyAjaxCalls.asmx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/legacyAjaxCalls.asmx.cs index a45af720e7..ea22777168 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/legacyAjaxCalls.asmx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/legacyAjaxCalls.asmx.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Web; using System.Web.Services; using System.ComponentModel; @@ -22,7 +22,7 @@ namespace umbraco.presentation.webservices public class legacyAjaxCalls : UmbracoAuthorizedWebService { private IUser _currentUser; - + /// /// method to accept a string value for the node id. Used for tree's such as python /// and xslt since the file names are the node IDs @@ -36,8 +36,8 @@ namespace umbraco.presentation.webservices { if (!AuthorizeRequest()) return; - - //U4-2686 - alias is html encoded, make sure to decode + + //U4-2686 - alias is html encoded, make sure to decode alias = HttpUtility.HtmlDecode(alias); //check which parameters to pass depending on the types passed in @@ -97,7 +97,7 @@ namespace umbraco.presentation.webservices if (content != null) Current.Services.ContentService.Delete(content); break; - } + } } else { diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/nodeSorter.asmx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/nodeSorter.asmx.cs index 96f3e23a72..672aa151cf 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/nodeSorter.asmx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/nodeSorter.asmx.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; @@ -256,4 +256,4 @@ namespace umbraco.presentation.webservices set { _id = value; } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/templates.asmx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/templates.asmx.cs index 52bd4dadfa..bb696f60a1 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/templates.asmx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/templates.asmx.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Web.Services; using System.Web.Script.Services; using Umbraco.Core; @@ -7,23 +7,23 @@ using Umbraco.Web.WebServices; namespace umbraco.webservices { - /// - /// Summary description for templates. - /// - [WebService(Namespace="http://umbraco.org/webservices/")] + /// + /// Summary description for templates. + /// + [WebService(Namespace="http://umbraco.org/webservices/")] [ScriptService] public class templates : UmbracoAuthorizedWebService - { + { - [WebMethod] + [WebMethod] [ScriptMethod] public string GetCodeSnippet(object templateId) - { + { //NOTE: The legacy code threw an exception so will continue to do that. - AuthorizeRequest(Constants.Applications.Settings.ToString(), true); + AuthorizeRequest(Constants.Applications.Settings.ToString(), true); - var snippetPath = SystemDirectories.Umbraco + "/scripting/templates/cshtml/"; - var filePath = IOHelper.MapPath(snippetPath + templateId); + var snippetPath = SystemDirectories.Umbraco + "/scripting/templates/cshtml/"; + var filePath = IOHelper.MapPath(snippetPath + templateId); //Directory check.. only allow files in script dir and below to be edited if (filePath.StartsWith(IOHelper.MapPath(snippetPath))) @@ -37,9 +37,9 @@ namespace umbraco.webservices else { throw new ArgumentException("Couldn't open snippet - Illegal path"); - + } } - - } + + } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbracoPageHolder.cs b/src/Umbraco.Web/umbraco.presentation/umbracoPageHolder.cs index 071adf02c0..5518780fcd 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbracoPageHolder.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbracoPageHolder.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Web.UI; using System.Web.UI.WebControls; using System.ComponentModel; @@ -7,108 +7,108 @@ using System.Collections; namespace umbraco.layoutControls { - /// - /// Summary description for umbracoPageHolder. - /// - [DefaultProperty("Text"), - ToolboxData("<{0}:umbracoPageHolder runat=server>")] - public class umbracoPageHolder : System.Web.UI.WebControls.PlaceHolder - { - #region private properties + /// + /// Summary description for umbracoPageHolder. + /// + [DefaultProperty("Text"), + ToolboxData("<{0}:umbracoPageHolder runat=server>")] + public class umbracoPageHolder : System.Web.UI.WebControls.PlaceHolder + { + #region private properties - private String _pageName; - private String _writerName; - private DateTime _createDate; - private DateTime _updateDate; - private int _pageID; - private int _pageVersion; - private int _templateID; - private Hashtable _elements = new Hashtable(); - private StringBuilder _pageContent = new StringBuilder(); + private String _pageName; + private String _writerName; + private DateTime _createDate; + private DateTime _updateDate; + private int _pageID; + private int _pageVersion; + private int _templateID; + private Hashtable _elements = new Hashtable(); + private StringBuilder _pageContent = new StringBuilder(); - #endregion + #endregion - [Bindable(true), Category("umbraco"), DefaultValue("")] - public string PageName - { - get {return _pageName;} - set {_pageName = value;} - } + [Bindable(true), Category("umbraco"), DefaultValue("")] + public string PageName + { + get {return _pageName;} + set {_pageName = value;} + } - [Bindable(true), Category("umbraco"), DefaultValue("")] - public string WriterName - { - get {return _writerName;} - set {_writerName = value;} - } - [Bindable(true), Category("umbraco"), DefaultValue("")] - public DateTime CreateDate - { - get {return _createDate;} - set {_createDate = value;} - } - [Bindable(true), Category("umbraco"), DefaultValue("")] - public DateTime updateDate - { - get {return _updateDate;} - set {_updateDate = value;} - } - [Bindable(true), Category("umbraco"), DefaultValue("")] - public int pageID - { - get {return _pageID;} - set {_pageID = value;} - } - [Bindable(true), Category("umbraco"), DefaultValue("")] - public int pageVersion - { - get {return _pageVersion;} - set {_pageVersion = value;} - } - [Bindable(true), Category("umbraco"), DefaultValue("")] - public int templateID - { - get {return _templateID;} - set {_templateID = value;} - } - [Bindable(true), Category("umbraco"), DefaultValue("")] - public Hashtable Elements - { - get {return _elements;} - set {_elements = value;} - } - [Bindable(true), Category("umbraco"), DefaultValue("")] - public StringBuilder PageContent - { - get {return _pageContent;} - set {_pageContent = value;} - } + [Bindable(true), Category("umbraco"), DefaultValue("")] + public string WriterName + { + get {return _writerName;} + set {_writerName = value;} + } + [Bindable(true), Category("umbraco"), DefaultValue("")] + public DateTime CreateDate + { + get {return _createDate;} + set {_createDate = value;} + } + [Bindable(true), Category("umbraco"), DefaultValue("")] + public DateTime updateDate + { + get {return _updateDate;} + set {_updateDate = value;} + } + [Bindable(true), Category("umbraco"), DefaultValue("")] + public int pageID + { + get {return _pageID;} + set {_pageID = value;} + } + [Bindable(true), Category("umbraco"), DefaultValue("")] + public int pageVersion + { + get {return _pageVersion;} + set {_pageVersion = value;} + } + [Bindable(true), Category("umbraco"), DefaultValue("")] + public int templateID + { + get {return _templateID;} + set {_templateID = value;} + } + [Bindable(true), Category("umbraco"), DefaultValue("")] + public Hashtable Elements + { + get {return _elements;} + set {_elements = value;} + } + [Bindable(true), Category("umbraco"), DefaultValue("")] + public StringBuilder PageContent + { + get {return _pageContent;} + set {_pageContent = value;} + } - public void Populate(page Page) { - if (Page != null) - { - _pageID = Page.PageID; - _templateID = Page.Template; + public void Populate(page Page) { + if (Page != null) + { + _pageID = Page.PageID; + _templateID = Page.Template; - _createDate = Page.CreateDate; - _updateDate = Page.UpdateDate; - - _writerName = Page.WriterName; - _pageName = Page.PageName; - _elements = Page.Elements; + _createDate = Page.CreateDate; + _updateDate = Page.UpdateDate; - _pageContent.Append(Page.PageContent); - this.Controls.Add(Page.PageContentControl); - } - } + _writerName = Page.WriterName; + _pageName = Page.PageName; + _elements = Page.Elements; - /// - /// Render this control to the output parameter specified. - /// - /// The HTML writer to write out to - protected override void Render(HtmlTextWriter output) - { - base.Render(output); - } - } + _pageContent.Append(Page.PageContent); + this.Controls.Add(Page.PageContentControl); + } + } + + /// + /// Render this control to the output parameter specified. + /// + /// The HTML writer to write out to + protected override void Render(HtmlTextWriter output) + { + base.Render(output); + } + } } diff --git a/src/UmbracoExamine/DataServices/UmbracoContentService.cs b/src/UmbracoExamine/DataServices/UmbracoContentService.cs index 34c05a82d8..a6b1c5feab 100644 --- a/src/UmbracoExamine/DataServices/UmbracoContentService.cs +++ b/src/UmbracoExamine/DataServices/UmbracoContentService.cs @@ -31,7 +31,7 @@ namespace UmbracoExamine.DataServices /// /// /// - public string StripHtml(string value) + public string StripHtml(string value) { return value.StripHtml(); } @@ -41,7 +41,7 @@ namespace UmbracoExamine.DataServices /// /// /// - public XDocument GetPublishedContentByXPath(string xpath) + public XDocument GetPublishedContentByXPath(string xpath) { //TODO: Remove the need for this, the best way would be to remove all requirements of examine based on Xml but that // would take some time. Another way in the in-term would be to add a static delegate to this class which can be set diff --git a/src/UmbracoExamine/DeletePolicyTracker.cs b/src/UmbracoExamine/DeletePolicyTracker.cs index 1697a797c1..484217aac3 100644 --- a/src/UmbracoExamine/DeletePolicyTracker.cs +++ b/src/UmbracoExamine/DeletePolicyTracker.cs @@ -20,4 +20,4 @@ namespace UmbracoExamine return resolved; } } -} \ No newline at end of file +} diff --git a/src/UmbracoExamine/ExamineIndexCollectionAccessor.cs b/src/UmbracoExamine/ExamineIndexCollectionAccessor.cs index f2e30fe5d0..8106c2bb40 100644 --- a/src/UmbracoExamine/ExamineIndexCollectionAccessor.cs +++ b/src/UmbracoExamine/ExamineIndexCollectionAccessor.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using Examine; namespace UmbracoExamine @@ -10,4 +10,4 @@ namespace UmbracoExamine { public IReadOnlyDictionary Indexes => ExamineManager.Instance.IndexProviders; } -} \ No newline at end of file +} diff --git a/src/UmbracoExamine/IExamineIndexCollectionAccessor.cs b/src/UmbracoExamine/IExamineIndexCollectionAccessor.cs index 7edb93719c..9682136677 100644 --- a/src/UmbracoExamine/IExamineIndexCollectionAccessor.cs +++ b/src/UmbracoExamine/IExamineIndexCollectionAccessor.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using Examine; namespace UmbracoExamine @@ -10,4 +10,4 @@ namespace UmbracoExamine { IReadOnlyDictionary Indexes { get; } } -} \ No newline at end of file +} diff --git a/src/UmbracoExamine/IndexTypes.cs b/src/UmbracoExamine/IndexTypes.cs index 22e25197e7..fb68d1dceb 100644 --- a/src/UmbracoExamine/IndexTypes.cs +++ b/src/UmbracoExamine/IndexTypes.cs @@ -13,7 +13,7 @@ namespace UmbracoExamine { /// - /// The content index type + /// The content index type /// /// /// Is lower case because the Standard Analyzer requires lower case @@ -21,7 +21,7 @@ namespace UmbracoExamine public const string Content = "content"; /// - /// The media index type + /// The media index type /// /// /// Is lower case because the Standard Analyzer requires lower case @@ -29,7 +29,7 @@ namespace UmbracoExamine public const string Media = "media"; /// - /// The member index type + /// The member index type /// /// /// Is lower case because the Standard Analyzer requires lower case diff --git a/src/UmbracoExamine/LegacyExtensions.cs b/src/UmbracoExamine/LegacyExtensions.cs index 8f228db8a5..64b1eb0778 100644 --- a/src/UmbracoExamine/LegacyExtensions.cs +++ b/src/UmbracoExamine/LegacyExtensions.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; using Examine; using Examine.LuceneEngine.Config; using Umbraco.Core.Services; @@ -9,7 +9,7 @@ namespace UmbracoExamine { private static readonly object Locker = new object(); - + public static IIndexCriteria ToIndexCriteria(this IndexSet set, IContentTypeService contentTypeService) { if (set.IndexUserFields.Count == 0) @@ -47,4 +47,4 @@ namespace UmbracoExamine } } -} \ No newline at end of file +} diff --git a/src/UmbracoExamine/LegacyLibrary.cs b/src/UmbracoExamine/LegacyLibrary.cs index 207f92373c..b92712c8a4 100644 --- a/src/UmbracoExamine/LegacyLibrary.cs +++ b/src/UmbracoExamine/LegacyLibrary.cs @@ -9,39 +9,39 @@ namespace UmbracoExamine /// via reflection because of the circular reference we have between Umbraco.Web and UmbracoExamine. /// internal static class LegacyLibrary - { - private static volatile Type _libraryType; - private static readonly object Locker = new object(); - private static Type LibraryType - { - get - { - if (_libraryType == null) - { - lock (Locker) - { - if (_libraryType == null) - { - var ass = Assembly.Load("Umbraco.Web"); - if (ass == null) - throw new InvalidOperationException("Could not load assembly Umbraco.Web.dll, the Umbraco.Web.dll needs to be loaded in the current app domain"); - var lib = ass.GetType("umbraco.library"); - if (lib == null) - throw new InvalidOperationException("Could not load type umbraco.library, the Umbraco.Web.dll needs to be loaded in the current app domain"); - _libraryType = lib; - } - } - } - return _libraryType; - } - } + { + private static volatile Type _libraryType; + private static readonly object Locker = new object(); + private static Type LibraryType + { + get + { + if (_libraryType == null) + { + lock (Locker) + { + if (_libraryType == null) + { + var ass = Assembly.Load("Umbraco.Web"); + if (ass == null) + throw new InvalidOperationException("Could not load assembly Umbraco.Web.dll, the Umbraco.Web.dll needs to be loaded in the current app domain"); + var lib = ass.GetType("umbraco.library"); + if (lib == null) + throw new InvalidOperationException("Could not load type umbraco.library, the Umbraco.Web.dll needs to be loaded in the current app domain"); + _libraryType = lib; + } + } + } + return _libraryType; + } + } - internal static XPathNodeIterator GetXmlNodeByXPath(string xpathQuery) - { - var meth = LibraryType.GetMethod("GetXmlNodeByXPath", BindingFlags.Public | BindingFlags.Static); - return (XPathNodeIterator)meth.Invoke(null, new object[] { xpathQuery }); - } + internal static XPathNodeIterator GetXmlNodeByXPath(string xpathQuery) + { + var meth = LibraryType.GetMethod("GetXmlNodeByXPath", BindingFlags.Public | BindingFlags.Static); + return (XPathNodeIterator)meth.Invoke(null, new object[] { xpathQuery }); + } - } -} \ No newline at end of file + } +} diff --git a/src/UmbracoExamine/LocalStorage/AzureLocalStorageDirectory.cs b/src/UmbracoExamine/LocalStorage/AzureLocalStorageDirectory.cs index 56d1b414c5..5f9ea6ca34 100644 --- a/src/UmbracoExamine/LocalStorage/AzureLocalStorageDirectory.cs +++ b/src/UmbracoExamine/LocalStorage/AzureLocalStorageDirectory.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Specialized; using System.ComponentModel; using System.IO; @@ -17,7 +17,7 @@ namespace UmbracoExamine.LocalStorage public DirectoryInfo GetLocalStorageDirectory(NameValueCollection config, string configuredPath) { var appDomainHash = HttpRuntime.AppDomainAppId.ToMd5(); - var cachePath = Path.Combine(Environment.ExpandEnvironmentVariables("%temp%"), "LuceneDir", + var cachePath = Path.Combine(Environment.ExpandEnvironmentVariables("%temp%"), "LuceneDir", //include the appdomain hash is just a safety check, for example if a website is moved from worker A to worker B and then back // to worker A again, in theory the %temp% folder should already be empty but we really want to make sure that its not // utilizing an old index @@ -30,4 +30,4 @@ namespace UmbracoExamine.LocalStorage return azureDir; } } -} \ No newline at end of file +} diff --git a/src/UmbracoExamine/LocalStorage/CodeGenLocalStorageDirectory.cs b/src/UmbracoExamine/LocalStorage/CodeGenLocalStorageDirectory.cs index 4aa92f0e53..8e29dad8c9 100644 --- a/src/UmbracoExamine/LocalStorage/CodeGenLocalStorageDirectory.cs +++ b/src/UmbracoExamine/LocalStorage/CodeGenLocalStorageDirectory.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Specialized; using System.ComponentModel; using System.IO; @@ -20,10 +20,10 @@ namespace UmbracoExamine.LocalStorage public DirectoryInfo GetLocalStorageDirectory(NameValueCollection config, string configuredPath) { var codegenPath = HttpRuntime.CodegenDir; - var path = Path.Combine(codegenPath, + var path = Path.Combine(codegenPath, //ensure the temp path is consistent with the configured path location configuredPath.TrimStart('~', '/').Replace("/", "\\")); return new DirectoryInfo(path); } } -} \ No newline at end of file +} diff --git a/src/UmbracoExamine/LocalStorage/DirectoryTracker.cs b/src/UmbracoExamine/LocalStorage/DirectoryTracker.cs index 175e15a05b..4b067d1a7a 100644 --- a/src/UmbracoExamine/LocalStorage/DirectoryTracker.cs +++ b/src/UmbracoExamine/LocalStorage/DirectoryTracker.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Concurrent; using System.IO; using Lucene.Net.Store; @@ -23,4 +23,4 @@ namespace UmbracoExamine.LocalStorage return resolved; } } -} \ No newline at end of file +} diff --git a/src/UmbracoExamine/LocalStorage/ILocalStorageDirectory.cs b/src/UmbracoExamine/LocalStorage/ILocalStorageDirectory.cs index 25d9afb857..7eb532b7e9 100644 --- a/src/UmbracoExamine/LocalStorage/ILocalStorageDirectory.cs +++ b/src/UmbracoExamine/LocalStorage/ILocalStorageDirectory.cs @@ -1,4 +1,4 @@ -using System.Collections.Specialized; +using System.Collections.Specialized; using System.IO; namespace UmbracoExamine.LocalStorage @@ -10,4 +10,4 @@ namespace UmbracoExamine.LocalStorage { DirectoryInfo GetLocalStorageDirectory(NameValueCollection config, string configuredPath); } -} \ No newline at end of file +} diff --git a/src/UmbracoExamine/LocalStorage/LocalStorageType.cs b/src/UmbracoExamine/LocalStorage/LocalStorageType.cs index 457b211c64..87a289dca8 100644 --- a/src/UmbracoExamine/LocalStorage/LocalStorageType.cs +++ b/src/UmbracoExamine/LocalStorage/LocalStorageType.cs @@ -5,4 +5,4 @@ Sync, LocalOnly } -} \ No newline at end of file +} diff --git a/src/UmbracoExamine/LocalStorage/LocalTempStorageDirectory.cs b/src/UmbracoExamine/LocalStorage/LocalTempStorageDirectory.cs index e902c03e9e..b77870c188 100644 --- a/src/UmbracoExamine/LocalStorage/LocalTempStorageDirectory.cs +++ b/src/UmbracoExamine/LocalStorage/LocalTempStorageDirectory.cs @@ -8,7 +8,7 @@ namespace UmbracoExamine.LocalStorage { /// /// Used to read data from local temp storage and write to both local storage and main storage - /// + /// public class LocalTempStorageDirectory : Directory { private readonly FSDirectory _tempStorageDir; @@ -25,16 +25,16 @@ namespace UmbracoExamine.LocalStorage _tempStorageDir = new SimpleFSDirectory(tempStorageDir); _realDirectory = realDirectory; _lockFactory = new MultiIndexLockFactory(_realDirectory, _tempStorageDir); - + Enabled = true; } - + /// /// If initialization fails, it will be disabled and then this will just wrap the 'real directory' /// internal bool Enabled { get; set; } - + public override string[] ListAll() { //always from the real dir @@ -70,7 +70,7 @@ namespace UmbracoExamine.LocalStorage /// Removes an existing file in the directory. public override void DeleteFile(string name) - { + { _realDirectory.DeleteFile(name); //perform on both dirs @@ -79,7 +79,7 @@ namespace UmbracoExamine.LocalStorage _tempStorageDir.DeleteFile(name); } } - + /// Returns the length of a file in the directory. public override long FileLength(string name) @@ -90,7 +90,7 @@ namespace UmbracoExamine.LocalStorage /// /// Creates a new, empty file in the directory with the given name. - /// Returns a stream writing this file. + /// Returns a stream writing this file. /// public override IndexOutput CreateOutput(string name) { @@ -99,7 +99,7 @@ namespace UmbracoExamine.LocalStorage { return new MultiIndexOutput( _tempStorageDir.CreateOutput(name), - _realDirectory.CreateOutput(name)); + _realDirectory.CreateOutput(name)); } return _realDirectory.CreateOutput(name); @@ -113,14 +113,14 @@ namespace UmbracoExamine.LocalStorage if (Enabled) { //return the reader from the cache, not the real dir - return _tempStorageDir.OpenInput(name); + return _tempStorageDir.OpenInput(name); } return _realDirectory.OpenInput(name); } /// - /// Creates an IndexInput for the file with the given name. + /// Creates an IndexInput for the file with the given name. /// public override IndexInput OpenInput(string name, int bufferSize) { @@ -131,19 +131,19 @@ namespace UmbracoExamine.LocalStorage } return _realDirectory.OpenInput(name, bufferSize); } - + /// /// 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. + /// from corrupting the index. /// public override void Sync(string name) { _realDirectory.Sync(name); _tempStorageDir.Sync(name); base.Sync(name); - } + } public override Lock MakeLock(string name) { @@ -157,19 +157,19 @@ namespace UmbracoExamine.LocalStorage /// (even in different JVMs and/or on different machines) /// are considered "the same index". This is how locking /// "scopes" to the right index. - /// + /// /// public override string GetLockId() { return string.Concat(_realDirectory.GetLockId(), _tempStorageDir.GetLockId()); } - + public override LockFactory LockFactory { get { return _lockFactory; - //return _realDirectory.GetLockFactory(); + //return _realDirectory.GetLockFactory(); } } @@ -200,7 +200,7 @@ namespace UmbracoExamine.LocalStorage _lockFactory = lf; //_realDirectory.SetLockFactory(lf); } - + } diff --git a/src/UmbracoExamine/LocalStorage/LocalTempStorageDirectoryTracker.cs b/src/UmbracoExamine/LocalStorage/LocalTempStorageDirectoryTracker.cs index d7c65edced..481eec1696 100644 --- a/src/UmbracoExamine/LocalStorage/LocalTempStorageDirectoryTracker.cs +++ b/src/UmbracoExamine/LocalStorage/LocalTempStorageDirectoryTracker.cs @@ -22,8 +22,8 @@ namespace UmbracoExamine.LocalStorage { resolved.Enabled = false; } - + return resolved; } } -} \ No newline at end of file +} diff --git a/src/UmbracoExamine/LocalStorage/LocalTempStorageIndexer.cs b/src/UmbracoExamine/LocalStorage/LocalTempStorageIndexer.cs index f33d2b9278..2e05eb2bb8 100644 --- a/src/UmbracoExamine/LocalStorage/LocalTempStorageIndexer.cs +++ b/src/UmbracoExamine/LocalStorage/LocalTempStorageIndexer.cs @@ -330,7 +330,7 @@ namespace UmbracoExamine.LocalStorage var allSnapshotFiles = commit.FileNames .Concat(new[] { - commit.SegmentsFileName, + commit.SegmentsFileName, //we need to manually include the segments.gen file "segments.gen" }) @@ -409,4 +409,4 @@ namespace UmbracoExamine.LocalStorage } } } -} \ No newline at end of file +} diff --git a/src/UmbracoExamine/LocalStorage/MultiIndexLock.cs b/src/UmbracoExamine/LocalStorage/MultiIndexLock.cs index 7c309075f8..f7a74c1285 100644 --- a/src/UmbracoExamine/LocalStorage/MultiIndexLock.cs +++ b/src/UmbracoExamine/LocalStorage/MultiIndexLock.cs @@ -1,4 +1,4 @@ -using Lucene.Net.Store; +using Lucene.Net.Store; namespace UmbracoExamine.LocalStorage { @@ -34,7 +34,7 @@ namespace UmbracoExamine.LocalStorage } /// - /// Releases exclusive access. + /// Releases exclusive access. /// public override void Release() { @@ -44,11 +44,11 @@ namespace UmbracoExamine.LocalStorage /// /// Returns true if the resource is currently locked. Note that one must - /// still call before using the resource. + /// still call before using the resource. /// public override bool IsLocked() { return _dirMaster.IsLocked() || _dirChild.IsLocked(); } } -} \ No newline at end of file +} diff --git a/src/UmbracoExamine/LocalStorage/MultiIndexLockFactory.cs b/src/UmbracoExamine/LocalStorage/MultiIndexLockFactory.cs index 55bb986ce9..af99c7f95c 100644 --- a/src/UmbracoExamine/LocalStorage/MultiIndexLockFactory.cs +++ b/src/UmbracoExamine/LocalStorage/MultiIndexLockFactory.cs @@ -1,4 +1,4 @@ -using System; +using System; using Lucene.Net.Store; namespace UmbracoExamine.LocalStorage @@ -23,11 +23,11 @@ namespace UmbracoExamine.LocalStorage { return new MultiIndexLock(_master.LockFactory.MakeLock(lockName), _child.LockFactory.MakeLock(lockName)); } - + public override void ClearLock(string lockName) { _master.LockFactory.ClearLock(lockName); _child.LockFactory.ClearLock(lockName); } } -} \ No newline at end of file +} diff --git a/src/UmbracoExamine/LocalStorage/MultiIndexOutput.cs b/src/UmbracoExamine/LocalStorage/MultiIndexOutput.cs index a43a561c5d..3fea50e38c 100644 --- a/src/UmbracoExamine/LocalStorage/MultiIndexOutput.cs +++ b/src/UmbracoExamine/LocalStorage/MultiIndexOutput.cs @@ -56,7 +56,7 @@ namespace UmbracoExamine.LocalStorage //return the first return _outputs[0].FilePointer; } - + } public override void Seek(long pos) @@ -74,7 +74,7 @@ namespace UmbracoExamine.LocalStorage //return the first return _outputs[0].FilePointer; } - + } } -} \ No newline at end of file +} diff --git a/src/UmbracoExamine/LoggingLevel.cs b/src/UmbracoExamine/LoggingLevel.cs index efa87c194d..f4daae513f 100644 --- a/src/UmbracoExamine/LoggingLevel.cs +++ b/src/UmbracoExamine/LoggingLevel.cs @@ -5,7 +5,7 @@ using System.Text; namespace UmbracoExamine { - [Obsolete("This object is no longer used since we support the log levels that are available with LogHelper")] + [Obsolete("This object is no longer used since we support the log levels that are available with LogHelper")] public enum LoggingLevel { Verbose, Normal diff --git a/src/UmbracoExamine/StaticField.cs b/src/UmbracoExamine/StaticField.cs index c68ce21226..c39eaff70d 100644 --- a/src/UmbracoExamine/StaticField.cs +++ b/src/UmbracoExamine/StaticField.cs @@ -18,4 +18,4 @@ namespace UmbracoExamine public bool EnableSorting { get; set; } public string Type { get; set; } } -} \ No newline at end of file +} diff --git a/src/UmbracoExamine/StaticFieldCollection.cs b/src/UmbracoExamine/StaticFieldCollection.cs index 909271e0b5..8b277767d8 100644 --- a/src/UmbracoExamine/StaticFieldCollection.cs +++ b/src/UmbracoExamine/StaticFieldCollection.cs @@ -25,4 +25,4 @@ namespace UmbracoExamine return Dictionary.TryGetValue(key, out field); } } -} \ No newline at end of file +} diff --git a/src/UmbracoExamine/UmbracoContentIndexer.cs b/src/UmbracoExamine/UmbracoContentIndexer.cs index 7cea5f8dc7..0b41bc86fe 100644 --- a/src/UmbracoExamine/UmbracoContentIndexer.cs +++ b/src/UmbracoExamine/UmbracoContentIndexer.cs @@ -138,7 +138,7 @@ namespace UmbracoExamine SupportProtectedContent = supportProtected; else SupportProtectedContent = false; - + base.Initialize(name, config); } diff --git a/src/UmbracoExamine/UmbracoContentIndexerOptions.cs b/src/UmbracoExamine/UmbracoContentIndexerOptions.cs index 7f7003a97d..125d33cef3 100644 --- a/src/UmbracoExamine/UmbracoContentIndexerOptions.cs +++ b/src/UmbracoExamine/UmbracoContentIndexerOptions.cs @@ -1,4 +1,4 @@ -using System; +using System; namespace UmbracoExamine { @@ -19,4 +19,4 @@ namespace UmbracoExamine ParentId = parentId; } } -} \ No newline at end of file +} diff --git a/src/UmbracoExamine/UmbracoContentValueSetValidator.cs b/src/UmbracoExamine/UmbracoContentValueSetValidator.cs index 18842db11b..76929aca82 100644 --- a/src/UmbracoExamine/UmbracoContentValueSetValidator.cs +++ b/src/UmbracoExamine/UmbracoContentValueSetValidator.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using Examine; using Examine.LuceneEngine.Providers; @@ -8,7 +8,7 @@ using Umbraco.Core.Services; namespace UmbracoExamine { /// - /// Used to validate a ValueSet for content - based on permissions, parent id, etc.... + /// Used to validate a ValueSet for content - based on permissions, parent id, etc.... /// public class UmbracoContentValueSetValidator : IValueSetValidator { @@ -42,14 +42,14 @@ namespace UmbracoExamine // Test for access if we're only indexing published content // return nothing if we're not supporting protected content and it is protected, and we're not supporting unpublished content if (valueSet.IndexCategory == IndexTypes.Content - && _options.SupportUnpublishedContent == false - && _options.SupportProtectedContent == false + && _options.SupportUnpublishedContent == false + && _options.SupportProtectedContent == false && _publicAccessService.IsProtected(path)) { return false; } - //check if this document is a descendent of the parent + //check if this document is a descendent of the parent if (_options.ParentId.HasValue && _options.ParentId.Value > 0) { if (path.IsNullOrWhiteSpace()) return false; @@ -69,4 +69,4 @@ namespace UmbracoExamine return true; } } -} \ No newline at end of file +} diff --git a/src/UmbracoExamine/XsltExtensions.cs b/src/UmbracoExamine/XsltExtensions.cs index 4d73c371b8..f2aa8b950e 100644 --- a/src/UmbracoExamine/XsltExtensions.cs +++ b/src/UmbracoExamine/XsltExtensions.cs @@ -21,7 +21,7 @@ namespace UmbracoExamine /// XSLT extensions will ONLY work for provider that have a base class of BaseUmbracoIndexer /// [XsltExtension("Examine")] - + public class XsltExtensions { /// @@ -37,7 +37,7 @@ namespace UmbracoExamine if (provider == null) throw new ArgumentNullException("provider"); var results = provider.Search(searchText, useWildcards, indexType); - return GetResultsAsXml(results); + return GetResultsAsXml(results); } /// @@ -64,7 +64,7 @@ namespace UmbracoExamine /// public static XPathNodeIterator Search(string searchText, bool useWildcards, string providerName) { - return Search(searchText, useWildcards, providerName, string.Empty); + return Search(searchText, useWildcards, providerName, string.Empty); } /// @@ -252,4 +252,4 @@ namespace UmbracoExamine return doc.CreateNavigator().Select("/"); } } -} \ No newline at end of file +}