├── Source ├── Caching Application Block │ ├── Caching.Database │ │ └── Scripts │ │ │ ├── CreateCachingDb.cmd │ │ │ └── CreateCachingDatabase.sql │ └── Caching │ │ ├── ICacheScavenger.cs │ │ ├── Configuration │ │ ├── Unity │ │ │ └── CachingBlockExtension.cs │ │ └── Fluent │ │ │ ├── ICachingConfiguration.cs │ │ │ ├── IStoreInCustomStore.cs │ │ │ └── ICachingConfigurationCustomCacheManager.cs │ │ ├── CacheItemRemovedReason.cs │ │ ├── CacheItemPriority.cs │ │ ├── ICacheOperations.cs │ │ ├── Expirations │ │ └── NeverExpired.cs │ │ ├── BackingStoreImplementations │ │ └── IStorageEncryptionProvider.cs │ │ └── ICacheItemExpiration.cs ├── Core │ └── Common │ │ ├── GlobalSuppressions.cs │ │ ├── Configuration │ │ ├── IObjectWithName.cs │ │ ├── Manageability │ │ │ ├── RegistryAccessor.cs │ │ │ ├── IRegistryAccessor.cs │ │ │ ├── GroupPolicyNotificationRegistrationBuilder.cs │ │ │ ├── Adm │ │ │ │ ├── AdmTextPart.cs │ │ │ │ └── AdmDropDownListItem.cs │ │ │ ├── IGroupPolicyWatcher.cs │ │ │ └── NativeMethods.cs │ │ ├── IObjectWithNameAndType.cs │ │ ├── Design │ │ │ ├── OmitCustomAttributesPropertyAttribute.cs │ │ │ ├── PromoteCommandsAttribute.cs │ │ │ └── TypeSelectorIncludes.cs │ │ ├── ICustomProviderData.cs │ │ ├── Storage │ │ │ └── ConfigurationChangeWatcherPauser.cs │ │ ├── ContainerModel │ │ │ ├── IContainerReconfiguringEventSource.cs │ │ │ ├── NullContainerReconfiguringEventSource.cs │ │ │ ├── InjectedProperty.cs │ │ │ ├── ConstantParameterValue.cs │ │ │ └── IContainerConfigurator.cs │ │ ├── IProtectedConfigurationSource.cs │ │ ├── ICloneableConfigurationElement.cs │ │ ├── Unity │ │ │ └── EnterpriseLibraryBlockExtension.cs │ │ ├── NonNegativeOrInfiniteTimeSpanValidatorAttribute.cs │ │ ├── EnumConverterWithExclusiveSuggestedValues.cs │ │ └── GenericEnumeratorWrapper.cs │ │ ├── Instrumentation │ │ ├── HasInstallableResourcesAttribute.cs │ │ ├── InstrumentationConsumerAttribute.cs │ │ ├── InstrumentationProviderAttribute.cs │ │ ├── IPerformanceCounterNameFormatter.cs │ │ ├── InstrumentationBaseAttribute.cs │ │ └── NoPrefixNameFormatter.cs │ │ └── Utility │ │ ├── IStringResolver.cs │ │ ├── ConstantStringResolver.cs │ │ ├── ServiceLocatorExtensions.cs │ │ └── DelegateStringResolver.cs ├── Data Access Application Block │ └── Data │ │ ├── GlobalSuppressions.cs │ │ ├── System.Data.Common │ │ └── PrivilegedConfigurationManager.cs │ │ ├── Oracle │ │ └── IOraclePackage.cs │ │ ├── Configuration │ │ └── Fluent │ │ │ ├── IDatabaseConfigurationProviders.cs │ │ │ ├── IDatabaseConfigurationProviderEntry.cs │ │ │ ├── NpgsqlDatabaseConfigurationExtension.cs │ │ │ ├── IDatabaseConfiguration.cs │ │ │ ├── IDatabaseConfigurationProperties.cs │ │ │ ├── MySqlConnectorDatabaseConfigurationExtension.cs │ │ │ ├── OdbcConfigurationExtension.cs │ │ │ ├── SqlCeDatabaseConfigurationExtension.cs │ │ │ ├── IDatabaseProviderExtensionContext.cs │ │ │ └── IDatabaseDefaultConnectionString.cs │ │ ├── IParameterMapper.cs │ │ ├── IRowMapper.cs │ │ ├── UpdateBehavior.cs │ │ └── IResultSetMapper.cs ├── Logging Application Block │ ├── Logging │ │ ├── GlobalSuppressions.cs │ │ ├── ReportTracingError.cs │ │ ├── Formatters │ │ │ ├── JsonFormatting.cs │ │ │ ├── LogFormatter.cs │ │ │ └── ILogFormatter.cs │ │ ├── CategoryFilterMode.cs │ │ ├── Configuration │ │ │ ├── Fluent │ │ │ │ ├── ITextFormatterBuilder.cs │ │ │ │ ├── ILoggingConfigurationCategoryContd.cs │ │ │ │ ├── ILoggingConfigurationStart.cs │ │ │ │ ├── ILoggingConfigurationCategoryStart.cs │ │ │ │ ├── IFormatterBuilder.cs │ │ │ │ ├── ILoggingConfigurationSendTo.cs │ │ │ │ ├── ILoggingConfigurationCustomCategoryStart.cs │ │ │ │ ├── ILoggingConfigurationExtension.cs │ │ │ │ ├── ILoggingConfigurationSendToExtention.cs │ │ │ │ ├── ILoggingConfigurationFilterLogEnabled.cs │ │ │ │ ├── ILoggingConfigurationContd.cs │ │ │ │ └── ILoggingConfigurationSpecialSources.cs │ │ │ └── CustomTraceListenerDataHelper.cs │ │ ├── TraceListeners │ │ │ ├── RollFileExistsBehavior.cs │ │ │ ├── EmailAuthenticationMode.cs │ │ │ ├── RollInterval.cs │ │ │ └── CustomTraceListener.cs │ │ ├── ExtraInformation │ │ │ ├── Helpers │ │ │ │ └── IDebugUtils.cs │ │ │ └── IExtraInformationProvider.cs │ │ └── Filters │ │ │ ├── ILogFilter.cs │ │ │ ├── ILogFilterErrorHandler.cs │ │ │ └── LogFilter.cs │ └── Logging.Database │ │ └── Scripts │ │ ├── CreateLoggingDb.cmd │ │ ├── CreateLoggingDatabase.sql │ │ └── CreateLoggingDatabaseObjects.sql ├── Validation Application Block │ └── Validation │ │ ├── GlobalSuppressions.cs │ │ ├── TagFilter.cs │ │ ├── Validators │ │ ├── RangeBoundaryType.cs │ │ ├── CompositionType.cs │ │ ├── HasSelfValidationAttribute.cs │ │ ├── ContainsCharacters.cs │ │ ├── DateTimeUnit.cs │ │ ├── ComparisonOperator.cs │ │ └── IgnoreNullsAttribute.cs │ │ ├── Configuration │ │ ├── ValidatorDataCollection.cs │ │ ├── ValidatedTypeReferenceCollection.cs │ │ ├── ValidatedMethodReferenceCollection.cs │ │ ├── ValidationRulesetDataCollection.cs │ │ ├── ValidatedPropertyReferenceCollection.cs │ │ └── ValidatedFieldReferenceCollection.cs │ │ └── IValidatorDescriptor.cs ├── Policy Injection Application Block │ └── PolicyInjection │ │ ├── GlobalSuppressions.cs │ │ └── Utilities │ │ └── ServiceLocatorExtensions.cs ├── Exception Handling Application Block │ ├── ExceptionHandling │ │ ├── GlobalSuppressions.cs │ │ ├── Configuration │ │ │ └── Fluent │ │ │ │ ├── IExceptionConfigurationWrapWithProvider.cs │ │ │ │ ├── IExceptionConfigurationReplaceWithProvider.cs │ │ │ │ ├── IExceptionConfigurationForExceptionTypeOrPostHandling.cs │ │ │ │ └── IExceptionConfigurationGivenPolicyWithName.cs │ │ └── PostHandlingAction.cs │ └── ExceptionHandling.Logging │ │ └── Configuration │ │ └── ExceptionHandlingLoggingDesigntime.cs ├── Semantic Logging Application Block │ ├── SemanticLogging.Database │ │ ├── Scripts │ │ │ ├── CreateSemanticLoggingDb.cmd │ │ │ └── CreateSemanticLoggingDatabase.sql │ │ ├── Utility │ │ │ └── DbConnectionExtensions.cs │ │ └── GlobalSuppressions.cs │ ├── SemanticLogging │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── Keywords.cs │ │ ├── Formatters │ │ │ ├── EventTextFormatting.cs │ │ │ ├── IEventTextFormatter.cs │ │ │ ├── IConsoleColorMapper.cs │ │ │ └── PropertyNames.cs │ │ ├── Utility │ │ │ ├── Buffering.cs │ │ │ ├── XmlExtensions.cs │ │ │ └── TextFormatterExtensions.cs │ │ └── Configuration │ │ │ ├── Constants.cs │ │ │ ├── CustomFormatterElement.cs │ │ │ ├── ISinkElement.cs │ │ │ ├── IFormatterElement.cs │ │ │ ├── ParameterElement.cs │ │ │ └── CustomSinkElement.cs │ └── SemanticLogging.TextFile │ │ └── Sinks │ │ ├── RollFileExistsBehavior.cs │ │ └── RollInterval.cs ├── Cryptography Application Block │ └── Security.Cryptography │ │ ├── Configuration │ │ ├── Fluent │ │ │ ├── IConfigureCryptography.cs │ │ │ └── IEncryptUsingCustomHashProviderNamed.cs │ │ ├── Unity │ │ │ └── CryptographyBlockExtension.cs │ │ └── Manageability │ │ │ └── CustomHashProviderDataManageabilityProvider.cs │ │ ├── Instrumentation │ │ ├── NullSymmetricAlgorithmInstrumentationProvider.cs │ │ ├── ISymmetricAlgorithmInstrumentationProvider.cs │ │ ├── NullHashAlgorithmInstrumentationProvider.cs │ │ └── IHashAlgorithmInstrumentationProvider.cs │ │ ├── ISymmetricCryptoProvider.cs │ │ └── IHashProvider.cs └── Transient Fault Handling Application Block │ ├── TransientFaultHandling │ └── ITransientErrorDetectionStrategy.cs │ └── TransientFaultHandling.Configuration │ └── Configuration │ └── WellKnownRetryStrategies.cs ├── .gitignore └── Examples └── EnterpriseLibrary.Test.MySql ├── EnterpriseLibrary.Test.MySql ├── EnterpriseLibrary.Test.MySql.csproj ├── App.config └── DetouringMySqlFactory.cs └── EnterpriseLibrary.Test.MySql.sln /Source/Caching Application Block/Caching.Database/Scripts/CreateCachingDb.cmd: -------------------------------------------------------------------------------- 1 | osql -S (local)\SQLEXPRESS -E -i CreateCachingDatabase.sql 2 | -------------------------------------------------------------------------------- /Source/Core/Common/GlobalSuppressions.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chavoshi/EnterpriseLibrary.NetCore/HEAD/Source/Core/Common/GlobalSuppressions.cs -------------------------------------------------------------------------------- /Source/Data Access Application Block/Data/GlobalSuppressions.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chavoshi/EnterpriseLibrary.NetCore/HEAD/Source/Data Access Application Block/Data/GlobalSuppressions.cs -------------------------------------------------------------------------------- /Source/Logging Application Block/Logging/GlobalSuppressions.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chavoshi/EnterpriseLibrary.NetCore/HEAD/Source/Logging Application Block/Logging/GlobalSuppressions.cs -------------------------------------------------------------------------------- /Source/Validation Application Block/Validation/GlobalSuppressions.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chavoshi/EnterpriseLibrary.NetCore/HEAD/Source/Validation Application Block/Validation/GlobalSuppressions.cs -------------------------------------------------------------------------------- /Source/Logging Application Block/Logging.Database/Scripts/CreateLoggingDb.cmd: -------------------------------------------------------------------------------- 1 | sqlcmd -S (localdb)\v11.0 -E -i CreateLoggingDatabase.sql 2 | sqlcmd -S (localdb)\v11.0 -E -i CreateLoggingDatabaseObjects.sql -d Logging -------------------------------------------------------------------------------- /Source/Policy Injection Application Block/PolicyInjection/GlobalSuppressions.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chavoshi/EnterpriseLibrary.NetCore/HEAD/Source/Policy Injection Application Block/PolicyInjection/GlobalSuppressions.cs -------------------------------------------------------------------------------- /Source/Caching Application Block/Caching.Database/Scripts/CreateCachingDatabase.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chavoshi/EnterpriseLibrary.NetCore/HEAD/Source/Caching Application Block/Caching.Database/Scripts/CreateCachingDatabase.sql -------------------------------------------------------------------------------- /Source/Exception Handling Application Block/ExceptionHandling/GlobalSuppressions.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chavoshi/EnterpriseLibrary.NetCore/HEAD/Source/Exception Handling Application Block/ExceptionHandling/GlobalSuppressions.cs -------------------------------------------------------------------------------- /Source/Logging Application Block/Logging.Database/Scripts/CreateLoggingDatabase.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chavoshi/EnterpriseLibrary.NetCore/HEAD/Source/Logging Application Block/Logging.Database/Scripts/CreateLoggingDatabase.sql -------------------------------------------------------------------------------- /Source/Logging Application Block/Logging.Database/Scripts/CreateLoggingDatabaseObjects.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chavoshi/EnterpriseLibrary.NetCore/HEAD/Source/Logging Application Block/Logging.Database/Scripts/CreateLoggingDatabaseObjects.sql -------------------------------------------------------------------------------- /Source/Semantic Logging Application Block/SemanticLogging.Database/Scripts/CreateSemanticLoggingDb.cmd: -------------------------------------------------------------------------------- 1 | sqlcmd -S (localdb)\v11.0 -E -i CreateSemanticLoggingDatabase.sql 2 | sqlcmd -S (localdb)\v11.0 -E -i CreateSemanticLoggingDatabaseObjects.sql -d Logging -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # This .gitignore file was automatically created by Microsoft(R) Visual Studio. 3 | ################################################################################ 4 | 5 | /Build 6 | *.suo 7 | *.user 8 | bin 9 | obj 10 | packages 11 | .vs -------------------------------------------------------------------------------- /Source/Semantic Logging Application Block/SemanticLogging/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.CompilerServices; 2 | 3 | [assembly: InternalsVisibleTo("Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Database")] 4 | [assembly: InternalsVisibleTo("Microsoft.Practices.EnterpriseLibrary.SemanticLogging.TextFile")] 5 | [assembly: InternalsVisibleTo("Microsoft.Practices.EnterpriseLibrary.SemanticLogging.EventSourceAnalyzer")] -------------------------------------------------------------------------------- /Source/Semantic Logging Application Block/SemanticLogging.Database/Scripts/CreateSemanticLoggingDatabase.sql: -------------------------------------------------------------------------------- 1 | /* NOT SUPPORTED IN SQL AZURE: Both the CREATE DATABASE and DROP DATABASE statements must be in a seperate file. 2 | IF EXISTS (SELECT name FROM master.dbo.sysdatabases WHERE name = N'Logging') 3 | DROP DATABASE [Logging] 4 | GO 5 | */ 6 | 7 | CREATE DATABASE [Logging] 8 | /* NOT SUPPORTED IN SQL AZURE 9 | COLLATE SQL_Latin1_General_CP1_CI_AS 10 | */ 11 | GO -------------------------------------------------------------------------------- /Examples/EnterpriseLibrary.Test.MySql/EnterpriseLibrary.Test.MySql/EnterpriseLibrary.Test.MySql.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp2.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Source/Semantic Logging Application Block/SemanticLogging/Keywords.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information. 2 | 3 | using System.Diagnostics.Tracing; 4 | 5 | namespace Microsoft.Practices.EnterpriseLibrary.SemanticLogging 6 | { 7 | /// 8 | /// EventKeywords additional constants for . 9 | /// 10 | public static class Keywords 11 | { 12 | /// 13 | /// Keyword flags to enable all the events. 14 | /// 15 | public const EventKeywords All = (EventKeywords)(-1); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Source/Semantic Logging Application Block/SemanticLogging/Formatters/EventTextFormatting.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information. 2 | 3 | namespace Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Formatters 4 | { 5 | /// 6 | /// Specifies formatting options . 7 | /// 8 | public enum EventTextFormatting 9 | { 10 | /// 11 | /// No special formatting applied. This is the default. 12 | /// 13 | None, 14 | 15 | /// 16 | /// Causes child objects to be indented. 17 | /// 18 | Indented 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Source/Semantic Logging Application Block/SemanticLogging/Formatters/IEventTextFormatter.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information. 2 | 3 | using System.IO; 4 | 5 | namespace Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Formatters 6 | { 7 | /// 8 | /// Provides a generic interface for an event text formatter used 9 | /// whenever an event has been written by an event source for which the event listener has enabled events. 10 | /// 11 | public interface IEventTextFormatter 12 | { 13 | /// 14 | /// Writes the event. 15 | /// 16 | /// The event entry. 17 | /// The writer. 18 | void WriteEvent(EventEntry eventEntry, TextWriter writer); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Source/Semantic Logging Application Block/SemanticLogging.TextFile/Sinks/RollFileExistsBehavior.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information. 2 | 3 | namespace Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Sinks 4 | { 5 | /// 6 | /// Defines the behavior when the roll file is created. 7 | /// 8 | public enum RollFileExistsBehavior 9 | { 10 | /// 11 | /// Overwrites the file if it already exists. 12 | /// 13 | Overwrite, 14 | 15 | /// 16 | /// Use a sequence number at the end of the generated file if it already exists. 17 | /// 18 | /// 19 | /// If it fails again then increment the sequence until a non existent filename is found. 20 | /// 21 | Increment 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Source/Semantic Logging Application Block/SemanticLogging/Formatters/IConsoleColorMapper.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information. 2 | 3 | using System; 4 | using System.Diagnostics.Tracing; 5 | 6 | namespace Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Formatters 7 | { 8 | /// 9 | /// Provides mapping between an and a console foreground color. 10 | /// 11 | public interface IConsoleColorMapper 12 | { 13 | /// 14 | /// Maps the specified to a 15 | /// 16 | /// The . 17 | /// The . 18 | ConsoleColor? Map(EventLevel eventLevel); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Source/Core/Common/Configuration/IObjectWithName.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Core 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Configuration 13 | { 14 | /// 15 | /// Represents the abstraction of an object with a name. 16 | /// 17 | public interface IObjectWithName 18 | { 19 | /// 20 | /// Gets the name. 21 | /// 22 | string Name { get; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Source/Caching Application Block/Caching/ICacheScavenger.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Caching Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System; 13 | namespace Microsoft.Practices.EnterpriseLibrary.Caching 14 | { 15 | /// 16 | /// Represents a cache scavenger. 17 | /// 18 | public interface ICacheScavenger 19 | { 20 | /// 21 | /// Starts the scavenging process. 22 | /// 23 | void StartScavenging(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Source/Semantic Logging Application Block/SemanticLogging/Utility/Buffering.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information. 2 | 3 | using System; 4 | 5 | namespace Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Utility 6 | { 7 | /// 8 | /// Buffering constants. 9 | /// 10 | public static class Buffering 11 | { 12 | /// 13 | /// The default buffering count. 14 | /// 15 | public const int DefaultBufferingCount = 1000; 16 | 17 | /// 18 | /// The default buffering interval. 19 | /// 20 | public static readonly TimeSpan DefaultBufferingInterval = TimeSpan.FromSeconds(30); 21 | 22 | /// 23 | /// The maximum number of entries that can be buffered while it's sending to database before the sink starts dropping entries. 24 | /// 25 | public const int DefaultMaxBufferSize = 30000; 26 | } 27 | } -------------------------------------------------------------------------------- /Source/Data Access Application Block/Data/System.Data.Common/PrivilegedConfigurationManager.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | //------------------------------------------------------------------------------ 6 | 7 | 8 | namespace System.Configuration 9 | { 10 | internal static class PrivilegedConfigurationManager 11 | { 12 | internal static ConnectionStringSettingsCollection ConnectionStrings 13 | { 14 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 15 | get 16 | { 17 | return ConfigurationManager.ConnectionStrings; 18 | } 19 | } 20 | 21 | internal static object GetSection(string sectionName) 22 | { 23 | return ConfigurationManager.GetSection(sectionName); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Source/Semantic Logging Application Block/SemanticLogging/Configuration/Constants.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information. 2 | 3 | using System; 4 | 5 | namespace Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Configuration 6 | { 7 | /// 8 | /// Configuration constants and default values. 9 | /// 10 | public static class Constants 11 | { 12 | /// 13 | /// The configuration namespace. 14 | /// 15 | public const string Namespace = "http://schemas.microsoft.com/practices/2013/entlib/semanticlogging/etw"; 16 | 17 | /// 18 | /// The default session name prefix. 19 | /// 20 | public const string DefaultSessionNamePrefix = "Microsoft-SemanticLogging-Etw"; 21 | 22 | /// 23 | /// The default max timeout for flushing all pending events in the buffer. 24 | /// 25 | public static readonly TimeSpan DefaultBufferingFlushAllTimeout = TimeSpan.FromSeconds(5); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Source/Core/Common/Instrumentation/HasInstallableResourcesAttribute.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Core 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System; 13 | 14 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation 15 | { 16 | /// 17 | /// Defines those classes and structs that have some sort of resources that need to be installed. 18 | /// 19 | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple = false)] 20 | public sealed class HasInstallableResourcesAttribute : Attribute 21 | { 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Source/Core/Common/Configuration/Manageability/RegistryAccessor.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Core 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System; 13 | using Microsoft.Win32; 14 | 15 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Manageability 16 | { 17 | internal class RegistryAccessor : IRegistryAccessor 18 | { 19 | public IRegistryKey CurrentUser 20 | { 21 | get { return new RegistryKeyWrapper(Registry.CurrentUser); } 22 | } 23 | 24 | public IRegistryKey LocalMachine 25 | { 26 | get { return new RegistryKeyWrapper(Registry.LocalMachine); } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Source/Logging Application Block/Logging/ReportTracingError.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Logging Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System; 13 | 14 | namespace Microsoft.Practices.EnterpriseLibrary.Logging 15 | { 16 | /// 17 | /// Error handling delegate. 18 | /// 19 | /// The exception that was thrown while tracing. 20 | /// The data. 21 | /// The source. 22 | public delegate void ReportTracingError(Exception exception, object data, string source); 23 | } 24 | -------------------------------------------------------------------------------- /Source/Validation Application Block/Validation/TagFilter.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Validation Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | namespace Microsoft.Practices.EnterpriseLibrary.Validation 13 | { 14 | /// 15 | /// Specifies the kind of filtering to perform for 16 | /// 17 | public enum TagFilter 18 | { 19 | /// 20 | /// Include results with the supplied tags. 21 | /// 22 | Include, 23 | 24 | /// 25 | /// Ignore results with the supplied tags. 26 | /// 27 | Ignore 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Source/Exception Handling Application Block/ExceptionHandling/Configuration/Fluent/IExceptionConfigurationWrapWithProvider.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Exception Handling Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using Microsoft.Practices.EnterpriseLibrary.ExceptionHandling; 13 | 14 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Fluent 15 | { 16 | /// 17 | /// This interface supports the fluent configuration of 18 | /// 19 | public interface IExceptionConfigurationWrapWithProvider : IExceptionConfigurationWithMessage 20 | { 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Source/Core/Common/Configuration/IObjectWithNameAndType.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Core 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System; 13 | using System.Collections.Generic; 14 | using System.Text; 15 | using Microsoft.Practices.EnterpriseLibrary.Common.Configuration; 16 | 17 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Configuration 18 | { 19 | /// 20 | /// Represents the abstraction of an object with a name and a type. 21 | /// 22 | public interface IObjectWithNameAndType : IObjectWithName 23 | { 24 | /// 25 | /// Gets the type. 26 | /// 27 | Type Type { get; } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Source/Semantic Logging Application Block/SemanticLogging.Database/Utility/DbConnectionExtensions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information. 2 | 3 | using System.Data.Common; 4 | using System.Threading; 5 | using System.Threading.Tasks; 6 | using System.Transactions; 7 | 8 | namespace Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Database.Utility 9 | { 10 | internal static class DbConnectionExtensions 11 | { 12 | public static async Task SuppressTransactionOpenAsync(this DbConnection connection, CancellationToken token) 13 | { 14 | Task openTask; 15 | using (new TransactionScope(TransactionScopeOption.Suppress)) 16 | { 17 | // Opt-out of using ambient transactions while opening the connection. 18 | // Disposing the transaction scope needs to happen in the same thread where it was created, 19 | // and that is why the await is done after the using finishes. 20 | openTask = connection.OpenAsync(token); 21 | } 22 | 23 | await openTask.ConfigureAwait(false); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Source/Semantic Logging Application Block/SemanticLogging/Formatters/PropertyNames.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information. 2 | 3 | namespace Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Formatters 4 | { 5 | internal static class PropertyNames 6 | { 7 | internal const string ProviderId = "ProviderId"; 8 | internal const string EventId = "EventId"; 9 | internal const string Keywords = "Keywords"; 10 | internal const string Level = "Level"; 11 | internal const string Message = "Message"; 12 | internal const string Opcode = "Opcode"; 13 | internal const string Task = "Task"; 14 | internal const string Version = "Version"; 15 | internal const string Payload = "Payload"; 16 | internal const string EventName = "EventName"; 17 | internal const string Timestamp = "Timestamp"; 18 | internal const string ActivityId = "ActivityId"; 19 | internal const string RelatedActivityId = "RelatedActivityId"; 20 | internal const string ProcessId = "ProcessId"; 21 | internal const string ThreadId = "ThreadId"; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Source/Cryptography Application Block/Security.Cryptography/Configuration/Fluent/IConfigureCryptography.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Cryptography Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System; 13 | using System.Collections.Generic; 14 | using System.Linq; 15 | using System.Text; 16 | using Microsoft.Practices.EnterpriseLibrary.Common; 17 | 18 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Fluent 19 | { 20 | /// 21 | /// Root fluent interface for building up caching configuration.
22 | ///
23 | public interface IConfigureCryptography : IFluentInterface 24 | { 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Source/Semantic Logging Application Block/SemanticLogging/Utility/XmlExtensions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information. 2 | 3 | using System; 4 | using System.Threading; 5 | using System.Xml.Linq; 6 | 7 | namespace Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Utility 8 | { 9 | /// 10 | /// Xml extensions for configuration extensibility support 11 | /// 12 | public static class XmlExtensions 13 | { 14 | /// 15 | /// XAttribute configuration extension to convert seconds to a TimeSpan format 16 | /// 17 | /// 18 | /// 19 | public static TimeSpan? ToTimeSpan(this XAttribute attribute) 20 | { 21 | int? bufferingIntervalInSeconds = (int?)attribute; 22 | if (!bufferingIntervalInSeconds.HasValue) 23 | { 24 | return (TimeSpan?)null; 25 | } 26 | 27 | return bufferingIntervalInSeconds.Value == -1 ? Timeout.InfiniteTimeSpan : TimeSpan.FromSeconds(bufferingIntervalInSeconds.Value); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Source/Data Access Application Block/Data/Oracle/IOraclePackage.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information. 2 | 3 | namespace Microsoft.Practices.EnterpriseLibrary.Data.Oracle 4 | { 5 | /// 6 | /// Represents the description of an Oracle package mapping. 7 | /// 8 | /// 9 | /// is used to specify how to transform store procedure names 10 | /// into package qualified Oracle stored procedure names. 11 | /// 12 | /// 13 | public interface IOraclePackage 14 | { 15 | /// 16 | /// When implemented by a class, gets the name of the package. 17 | /// 18 | /// 19 | /// The name of the package. 20 | /// 21 | string Name 22 | { get; } 23 | 24 | /// 25 | /// When implemented by a class, gets the prefix for the package. 26 | /// 27 | /// 28 | /// The prefix for the package. 29 | /// 30 | string Prefix 31 | { get; } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Source/Core/Common/Configuration/Design/OmitCustomAttributesPropertyAttribute.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Core 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System; 13 | using System.Collections.Generic; 14 | using System.Linq; 15 | using System.Text; 16 | 17 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Design 18 | { 19 | 20 | /// 21 | /// This attribute supports the Enterprise Library infrastructure and is not intended to be used directly from your code. 22 | /// 23 | [AttributeUsage(AttributeTargets.Class, AllowMultiple =false)] 24 | public class OmitCustomAttributesPropertyAttribute :Attribute 25 | { 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Source/Core/Common/Utility/IStringResolver.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Core 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System.Diagnostics.CodeAnalysis; 13 | 14 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Utility 15 | { 16 | /// 17 | /// Resolves string objects. 18 | /// 19 | public interface IStringResolver 20 | { 21 | /// 22 | /// Returns a string represented by the receiver. 23 | /// 24 | /// The string object. 25 | [SuppressMessage("Microsoft.Design", "CA1024", Justification = "May be computationally expensive.")] 26 | string GetString(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Source/Logging Application Block/Logging/Formatters/JsonFormatting.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Logging Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | 13 | namespace Microsoft.Practices.EnterpriseLibrary.Logging.Formatters 14 | { 15 | /// 16 | /// Specifies formatting options. 17 | /// 18 | public enum JsonFormatting 19 | { 20 | /// 21 | /// Specifies that no special formatting should be applied. This is the default. 22 | /// 23 | None, 24 | 25 | /// 26 | /// Specifies that child objects should be indented. 27 | /// 28 | Indented 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Source/Data Access Application Block/Data/Configuration/Fluent/IDatabaseConfigurationProviders.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Data Access Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using Microsoft.Practices.EnterpriseLibrary.Common; 13 | namespace Microsoft.Practices.EnterpriseLibrary.Data.Configuration.Fluent 14 | { 15 | /// 16 | /// Extension point for database providers to connect to the data configuration fluent-api. 17 | /// 18 | /// 19 | /// 20 | public interface IDatabaseConfigurationProviders : IFluentInterface 21 | { 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Source/Logging Application Block/Logging/Formatters/LogFormatter.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Logging Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | namespace Microsoft.Practices.EnterpriseLibrary.Logging.Formatters 13 | { 14 | /// 15 | /// Abstract implememtation of the interface. 16 | /// 17 | public abstract class LogFormatter : ILogFormatter 18 | { 19 | /// 20 | /// Formats a log entry and return a string to be outputted. 21 | /// 22 | /// Log entry to format. 23 | /// A string representing the log entry. 24 | public abstract string Format(LogEntry log); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Source/Logging Application Block/Logging/Formatters/ILogFormatter.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Logging Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | namespace Microsoft.Practices.EnterpriseLibrary.Logging.Formatters 13 | { 14 | /// 15 | /// Represents the interface for formatting log entry messsages. 16 | /// 17 | public interface ILogFormatter 18 | { 19 | /// 20 | /// Formats a log entry and return a string to be outputted. 21 | /// 22 | /// Log entry to format. 23 | /// String representing the log entry. 24 | string Format(LogEntry log); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Source/Data Access Application Block/Data/Configuration/Fluent/IDatabaseConfigurationProviderEntry.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Data Access Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using Microsoft.Practices.EnterpriseLibrary.Common; 13 | 14 | namespace Microsoft.Practices.EnterpriseLibrary.Data.Configuration.Fluent 15 | { 16 | /// 17 | /// This interface support the database configuration fluent interface. 18 | /// 19 | public interface IDatabaseConfigurationProviderEntry : IFluentInterface 20 | { 21 | /// 22 | /// Specify the type of database. 23 | /// 24 | IDatabaseConfigurationProviders ThatIs { get; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Source/Logging Application Block/Logging/CategoryFilterMode.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Logging Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | namespace Microsoft.Practices.EnterpriseLibrary.Logging 13 | { 14 | /// 15 | /// Represents the possible modes for client-side category filtering. 16 | /// 17 | public enum CategoryFilterMode 18 | { 19 | /// 20 | /// Allow all categories except those explicitly denied 21 | /// 22 | AllowAllExceptDenied, 23 | 24 | /// 25 | /// Deny all categories except those explicitly allowed 26 | /// 27 | DenyAllExceptAllowed 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Source/Logging Application Block/Logging/Configuration/Fluent/ITextFormatterBuilder.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Logging Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | 13 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Fluent 14 | { 15 | /// 16 | /// Fluent interface used to configure a instance. 17 | /// 18 | public interface ITextFormatterBuilder : IFormatterBuilder, IFluentInterface 19 | { 20 | /// 21 | /// 22 | /// 23 | /// 24 | /// 25 | IFormatterBuilder UsingTemplate(string template); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Source/Exception Handling Application Block/ExceptionHandling/Configuration/Fluent/IExceptionConfigurationReplaceWithProvider.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Exception Handling Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Fluent; 13 | using Microsoft.Practices.EnterpriseLibrary.ExceptionHandling; 14 | 15 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Fluent 16 | { 17 | /// 18 | /// This interface supports the fluent configuration of 19 | /// 20 | public interface IExceptionConfigurationReplaceWithProvider : IExceptionConfigurationWithMessage 21 | { 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Source/Validation Application Block/Validation/Validators/RangeBoundaryType.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Validation Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | namespace Microsoft.Practices.EnterpriseLibrary.Validation.Validators 13 | { 14 | /// 15 | /// Indicates how to interpret a range boundary. 16 | /// 17 | public enum RangeBoundaryType 18 | { 19 | /// 20 | /// Ignore the range boundary. 21 | /// 22 | Ignore = 0, 23 | 24 | /// 25 | /// Allow values equal to the boundary. 26 | /// 27 | Inclusive = 1, 28 | 29 | /// 30 | /// Reject values equal to the boundary. 31 | /// 32 | Exclusive = 2 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Examples/EnterpriseLibrary.Test.MySql/EnterpriseLibrary.Test.MySql/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Source/Logging Application Block/Logging/Configuration/Fluent/ILoggingConfigurationCategoryContd.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Logging Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | 13 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Fluent 14 | { 15 | /// 16 | /// Fluent interface that allows tracelisteners to be configured for a Category Source. 17 | /// 18 | public interface ILoggingConfigurationCategoryContd : ILoggingConfigurationContd, IFluentInterface 19 | { 20 | /// 21 | /// Entry point for attaching Trace Listeners to a Category Source. 22 | /// 23 | ILoggingConfigurationSendTo SendTo { get; } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Source/Exception Handling Application Block/ExceptionHandling/Configuration/Fluent/IExceptionConfigurationForExceptionTypeOrPostHandling.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Exception Handling Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Fluent 13 | { 14 | /// 15 | /// This interface supports the configuration of the Exception Handling Application Block. 16 | /// 17 | public interface IExceptionConfigurationForExceptionTypeOrPostHandling : 18 | IExceptionConfigurationGivenPolicyWithName, 19 | IExceptionConfigurationAddExceptionHandlers, 20 | IExceptionConfigurationThenDoPostHandlingAction 21 | { 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Examples/EnterpriseLibrary.Test.MySql/EnterpriseLibrary.Test.MySql.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.26730.3 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EnterpriseLibrary.Test.MySql", "EnterpriseLibrary.Test.MySql\EnterpriseLibrary.Test.MySql.csproj", "{9E62FA81-E728-4CB3-8F20-34978969A602}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {9E62FA81-E728-4CB3-8F20-34978969A602}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {9E62FA81-E728-4CB3-8F20-34978969A602}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {9E62FA81-E728-4CB3-8F20-34978969A602}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {9E62FA81-E728-4CB3-8F20-34978969A602}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {D84D8C79-1D73-48A7-BB49-B31E81E4BBC9} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /Source/Core/Common/Configuration/ICustomProviderData.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Core 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System; 13 | using System.Configuration; 14 | using System.Collections.Specialized; 15 | 16 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Configuration 17 | { 18 | /// 19 | /// Represents the configuration settings for a custom provider. 20 | /// 21 | public interface ICustomProviderData 22 | { 23 | /// 24 | /// Gets the name for the represented provider. 25 | /// 26 | string Name { get; } 27 | 28 | /// 29 | /// Gets the attributes for the represented provider. 30 | /// 31 | NameValueCollection Attributes { get; } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Source/Logging Application Block/Logging/Configuration/Fluent/ILoggingConfigurationStart.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Logging Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | 13 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Fluent 14 | { 15 | 16 | /// 17 | /// Fluent interface that allows global logging settings to be configured. 18 | /// 19 | public interface ILoggingConfigurationStart : ILoggingConfigurationContd, IFluentInterface 20 | { 21 | /// 22 | /// Returns an fluent interface that can be used to further configure logging settings. 23 | /// 24 | ILoggingConfigurationOptions WithOptions { get; } 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Source/Semantic Logging Application Block/SemanticLogging/Configuration/CustomFormatterElement.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information. 2 | 3 | using System.Xml.Linq; 4 | using Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Configuration; 5 | using Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Etw.Utility; 6 | using Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Formatters; 7 | 8 | namespace Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Etw.Configuration 9 | { 10 | internal class CustomFormatterElement : IFormatterElement 11 | { 12 | private readonly XName formatterName = XName.Get("customEventTextFormatter", Constants.Namespace); 13 | 14 | public bool CanCreateFormatter(XElement element) 15 | { 16 | return this.GetFormatterElement(element) != null; 17 | } 18 | 19 | public IEventTextFormatter CreateFormatter(XElement element) 20 | { 21 | return XmlUtil.CreateInstance(this.GetFormatterElement(element)); 22 | } 23 | 24 | private XElement GetFormatterElement(XElement element) 25 | { 26 | return element.Element(this.formatterName); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Source/Logging Application Block/Logging/TraceListeners/RollFileExistsBehavior.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Logging Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | namespace Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners 13 | { 14 | /// 15 | /// Defines the behavior when the roll file is created. 16 | /// 17 | public enum RollFileExistsBehavior 18 | { 19 | /// 20 | /// Overwrites the file if it already exists. 21 | /// 22 | Overwrite, 23 | /// 24 | /// Use a secuence number at the end of the generated file if it already exists. If it fails again then increment the secuence until a non existent filename is found. 25 | /// 26 | Increment 27 | }; 28 | } 29 | -------------------------------------------------------------------------------- /Source/Logging Application Block/Logging/Configuration/Fluent/ILoggingConfigurationCategoryStart.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Logging Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | 13 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Fluent 14 | { 15 | /// 16 | /// Fluent interface that allows settings to be configured for a Category Source. 17 | /// 18 | public interface ILoggingConfigurationCategoryStart : ILoggingConfigurationCategoryContd, IFluentInterface 19 | { 20 | /// 21 | /// Returns a fluent interface for further configuring a logging category. 22 | /// 23 | ILoggingConfigurationCategoryOptions WithOptions { get; } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Source/Validation Application Block/Validation/Validators/CompositionType.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Validation Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using Microsoft.Practices.EnterpriseLibrary.Validation.Validators; 13 | 14 | namespace Microsoft.Practices.EnterpriseLibrary.Validation 15 | { 16 | /// 17 | /// Specifies the kind of composition that is to be used when multiple validation attributes 18 | /// are supplied for a member info. 19 | /// 20 | public enum CompositionType 21 | { 22 | /// 23 | /// Use the . 24 | /// 25 | And, 26 | 27 | /// 28 | /// Use the . 29 | /// 30 | Or 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Source/Validation Application Block/Validation/Validators/HasSelfValidationAttribute.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Validation Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System; 13 | 14 | namespace Microsoft.Practices.EnterpriseLibrary.Validation.Validators 15 | { 16 | /// 17 | /// Indicates the target type defines self validation methods. 18 | /// 19 | /// 20 | /// Types without this attribute will not be scanned for self validation methods. 21 | /// 22 | /// 23 | /// 24 | [AttributeUsage(AttributeTargets.Class, Inherited = false)] 25 | public sealed class HasSelfValidationAttribute : Attribute 26 | { } 27 | } 28 | -------------------------------------------------------------------------------- /Source/Core/Common/Configuration/Storage/ConfigurationChangeWatcherPauser.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Core 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System; 13 | 14 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Storage 15 | { 16 | internal class ConfigurationChangeWatcherPauser : IDisposable 17 | { 18 | private readonly IConfigurationChangeWatcher watcher; 19 | 20 | public ConfigurationChangeWatcherPauser(IConfigurationChangeWatcher watcher) 21 | { 22 | this.watcher = watcher; 23 | if(watcher != null) watcher.StopWatching(); 24 | } 25 | 26 | public void Dispose() 27 | { 28 | if(watcher != null) watcher.StartWatching(); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Source/Semantic Logging Application Block/SemanticLogging/Utility/TextFormatterExtensions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information. 2 | 3 | using System.Globalization; 4 | using System.IO; 5 | using Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Formatters; 6 | 7 | namespace Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Utility 8 | { 9 | /// 10 | /// Extensions for . 11 | /// 12 | public static class EventTextFormatterExtensions 13 | { 14 | /// 15 | /// Formats the event as a string. 16 | /// 17 | /// The entry to format. 18 | /// The formatter to use. 19 | /// A formatted entry. 20 | public static string WriteEvent(this IEventTextFormatter formatter, EventEntry entry) 21 | { 22 | Guard.ArgumentNotNull(formatter, "formatter"); 23 | 24 | using (var writer = new StringWriter(CultureInfo.CurrentCulture)) 25 | { 26 | formatter.WriteEvent(entry, writer); 27 | return writer.ToString(); 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Source/Caching Application Block/Caching/Configuration/Unity/CachingBlockExtension.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Caching Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System; 13 | using Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Unity; 14 | using Microsoft.Practices.Unity; 15 | 16 | namespace Microsoft.Practices.EnterpriseLibrary.Caching.Configuration.Unity 17 | { 18 | /// 19 | /// A that registers the policies necessary 20 | /// to create instances described in the standard 21 | /// configuration file. 22 | /// 23 | [Obsolete] 24 | public class CachingBlockExtension : EnterpriseLibraryBlockExtension 25 | { 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Source/Core/Common/Configuration/Manageability/IRegistryAccessor.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Core 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System; 13 | 14 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Manageability 15 | { 16 | /// 17 | /// Provides access to the registry. 18 | /// 19 | /// 20 | /// This interface allows for unit testing without requiring access to the machine's registry. 21 | /// 22 | public interface IRegistryAccessor 23 | { 24 | /// 25 | /// Gets registry key HKCU. 26 | /// 27 | IRegistryKey CurrentUser { get; } 28 | 29 | /// 30 | /// Gets registry key HKLM. 31 | /// 32 | IRegistryKey LocalMachine { get; } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Source/Semantic Logging Application Block/SemanticLogging.TextFile/Sinks/RollInterval.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information. 2 | 3 | namespace Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Sinks 4 | { 5 | /// 6 | /// Defines the frequency when the file need to be rolled. 7 | /// 8 | public enum RollInterval 9 | { 10 | /// 11 | /// None Interval. 12 | /// 13 | None, 14 | 15 | /// 16 | /// Minute Interval. 17 | /// 18 | Minute, 19 | 20 | /// 21 | /// Hour interval. 22 | /// 23 | Hour, 24 | 25 | /// 26 | /// Day Interval. 27 | /// 28 | Day, 29 | 30 | /// 31 | /// Week Interval. 32 | /// 33 | Week, 34 | 35 | /// 36 | /// Month Interval. 37 | /// 38 | Month, 39 | 40 | /// 41 | /// Year Interval. 42 | /// 43 | Year, 44 | 45 | /// 46 | /// At Midnight. 47 | /// 48 | Midnight 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Source/Semantic Logging Application Block/SemanticLogging/Configuration/ISinkElement.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information. 2 | 3 | using System; 4 | using System.Xml.Linq; 5 | 6 | namespace Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Configuration 7 | { 8 | /// 9 | /// Represents the contract for a sink configuration element. 10 | /// 11 | public interface ISinkElement 12 | { 13 | /// 14 | /// Determines whether this instance can create the specified configuration element. 15 | /// 16 | /// The configuration element. 17 | /// 18 | /// True if this instance can create the specified element; otherwise, false. 19 | /// 20 | bool CanCreateSink(XElement element); 21 | 22 | /// 23 | /// Creates the instance for this sink. 24 | /// 25 | /// The configuration element. 26 | /// 27 | /// The observer instance. 28 | /// 29 | IObserver CreateSink(XElement element); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Source/Logging Application Block/Logging/Configuration/Fluent/IFormatterBuilder.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Logging Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using Microsoft.Practices.EnterpriseLibrary.Logging.Configuration; 13 | 14 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Fluent 15 | { 16 | /// 17 | /// Interface for builder classes used to configure instances. 18 | /// 19 | public interface IFormatterBuilder 20 | { 21 | /// 22 | /// Returns the instance that contains the configuration for an instance. 23 | /// 24 | FormatterData GetFormatterData(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Source/Core/Common/Configuration/ContainerModel/IContainerReconfiguringEventSource.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Core 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System; 13 | 14 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel 15 | { 16 | /// 17 | /// A interface describing objects that raise events when a 18 | /// container's type registrations need to updated due to 19 | /// a configuration source change. 20 | /// 21 | public interface IContainerReconfiguringEventSource 22 | { 23 | /// 24 | /// The event raised when a container must be reconfigured. 25 | /// 26 | event EventHandler ContainerReconfiguring; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Source/Logging Application Block/Logging/ExtraInformation/Helpers/IDebugUtils.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Logging Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System.Diagnostics; 13 | 14 | namespace Microsoft.Practices.EnterpriseLibrary.Logging.ExtraInformation.Helpers 15 | { 16 | /// 17 | /// Contract for accessing debug information. 18 | /// 19 | public interface IDebugUtils 20 | { 21 | /// 22 | /// Returns a text representation of the stack trace with source information if available. 23 | /// 24 | /// The source to represent textually. 25 | /// The textual representation of the stack. 26 | string GetStackTraceWithSourceInfo( StackTrace stackTrace ); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Source/Caching Application Block/Caching/Configuration/Fluent/ICachingConfiguration.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Caching Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System; 13 | using System.Collections.Generic; 14 | using System.Linq; 15 | using System.Text; 16 | using Microsoft.Practices.EnterpriseLibrary.Common.Configuration; 17 | using Microsoft.Practices.EnterpriseLibrary.Caching.Configuration; 18 | using Microsoft.Practices.EnterpriseLibrary.Caching.Properties; 19 | 20 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Fluent 21 | { 22 | /// 23 | /// Root fluent interface for building up caching configuration.
24 | ///
25 | public interface ICachingConfiguration : IFluentInterface 26 | { 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /Source/Core/Common/Configuration/IProtectedConfigurationSource.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Core 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System; 13 | using System.Collections.Generic; 14 | using System.Text; 15 | using System.Configuration; 16 | 17 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Configuration 18 | { 19 | /// 20 | /// 21 | public interface IProtectedConfigurationSource 22 | { 23 | /// 24 | /// 25 | /// 26 | /// 27 | /// 28 | void Add(string sectionName, ConfigurationSection configurationSection, string protectionProviderName); 29 | 30 | 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Source/Exception Handling Application Block/ExceptionHandling/Configuration/Fluent/IExceptionConfigurationGivenPolicyWithName.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Exception Handling Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Fluent 13 | { 14 | /// 15 | /// Defines an exception policy with a given name. 16 | /// 17 | public interface IExceptionConfigurationGivenPolicyWithName : IFluentInterface 18 | { 19 | /// 20 | /// Defines new policy with a given name. 21 | /// 22 | /// Name of policy 23 | /// 24 | IExceptionConfigurationForExceptionType GivenPolicyWithName(string name); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Source/Core/Common/Configuration/Design/PromoteCommandsAttribute.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Core 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System; 13 | using System.Collections.Generic; 14 | using System.Linq; 15 | using System.Text; 16 | 17 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Design 18 | { 19 | /// 20 | /// Attribute class that can be oved to offer a properties add-commands to the containing Element View Model.
21 | /// This can be usefull for properties that contain a collection of providers, of which the Element Collection View Model is not shown in the UI (User Interface). 22 | ///
23 | [AttributeUsage(AttributeTargets.Property, AllowMultiple=true)] 24 | public class PromoteCommandsAttribute : Attribute 25 | { 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Source/Data Access Application Block/Data/Configuration/Fluent/NpgsqlDatabaseConfigurationExtension.cs: -------------------------------------------------------------------------------- 1 | using Npgsql; 2 | 3 | namespace Microsoft.Practices.EnterpriseLibrary.Data.Configuration.Fluent { 4 | 5 | /// 6 | /// PostgreSql Server Database configuration options. 7 | /// 8 | public interface IDatabaseNpgsqlDatabaseConfiguration : IDatabaseDefaultConnectionString, IDatabaseConfigurationProperties { 9 | /// 10 | /// Define a connection string using the . 11 | /// 12 | /// 13 | /// 14 | IDatabaseConfigurationProperties WithConnectionString(NpgsqlConnectionStringBuilder builder); 15 | } 16 | 17 | internal class NpgsqlDatabaseConfigurationExtension : DatabaseConfigurationExtension, IDatabaseNpgsqlDatabaseConfiguration { 18 | 19 | public NpgsqlDatabaseConfigurationExtension(IDatabaseConfigurationProviders context) 20 | : base(context) { 21 | base.ConnectionString.ProviderName = DbProviderMapping.DefaultNpgsqlProviderName; 22 | } 23 | 24 | public IDatabaseConfigurationProperties WithConnectionString(NpgsqlConnectionStringBuilder builder) { 25 | return base.WithConnectionString(builder); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Source/Exception Handling Application Block/ExceptionHandling.Logging/Configuration/ExceptionHandlingLoggingDesigntime.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Exception Handling Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System; 13 | using System.Collections.Generic; 14 | using System.Linq; 15 | using System.Text; 16 | 17 | namespace Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.Configuration 18 | { 19 | internal class ExceptionHandlingLoggingDesigntime 20 | { 21 | public static class ValidatorTypes 22 | { 23 | public const string LogFormatterValidator = "Microsoft.Practices.EnterpriseLibrary.Configuration.Design.ViewModel.BlockSpecifics.Logging.LogFormatterValidator, Microsoft.Practices.EnterpriseLibrary.Configuration.DesignTime"; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Source/Data Access Application Block/Data/Configuration/Fluent/IDatabaseConfiguration.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Data Access Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using Microsoft.Practices.EnterpriseLibrary.Common; 13 | 14 | namespace Microsoft.Practices.EnterpriseLibrary.Data.Configuration.Fluent 15 | { 16 | /// 17 | /// Supports configuring the data connections via fluent-style interface. 18 | /// 19 | public interface IDatabaseConfiguration : IFluentInterface 20 | { 21 | /// 22 | /// Configure a named database. 23 | /// 24 | ///Name of database to configure 25 | /// 26 | IDatabaseConfigurationProperties ForDatabaseNamed(string databaseName); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Source/Core/Common/Utility/ConstantStringResolver.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Core 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Utility 13 | { 14 | /// 15 | /// Resolves strings by returning a constant value. 16 | /// 17 | public sealed class ConstantStringResolver : IStringResolver 18 | { 19 | /// 20 | /// Initializes a new instance of with a constant value. 21 | /// 22 | public ConstantStringResolver(string value) 23 | { 24 | this.value = value; 25 | } 26 | 27 | private readonly string value; 28 | 29 | string IStringResolver.GetString() 30 | { 31 | return this.value; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Source/Logging Application Block/Logging/Configuration/Fluent/ILoggingConfigurationSendTo.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Logging Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | 13 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Fluent 14 | { 15 | 16 | /// 17 | /// Fluent interface that allows tracelisteners to be configured. 18 | /// 19 | public interface ILoggingConfigurationSendTo : IFluentInterface 20 | { 21 | /// 22 | /// Creates a reference to an existing Trace Listener with a specific name. 23 | /// 24 | /// The name of the Trace Listener a reference should be made for. 25 | ILoggingConfigurationCategoryContd SharedListenerNamed(string listenerName); 26 | 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /Examples/EnterpriseLibrary.Test.MySql/EnterpriseLibrary.Test.MySql/DetouringMySqlFactory.cs: -------------------------------------------------------------------------------- 1 | using MySql.Data.MySqlClient; 2 | using System.Data.Common; 3 | 4 | namespace EnterpriseLibrary.Test.MySql 5 | { 6 | /// 7 | /// This is a unique Factory class for MySQL Connector/Net. 8 | /// This is to avoid bugs that exist in version 6.10. 9 | /// https://bugs.mysql.com/bug.php?id=88660 10 | /// 11 | /// This is a limited implementation that focuses on .NET Framework. (It does not support .NET Standard.) 12 | /// Also, it does not support Entity Framework. 13 | /// 14 | public class DetouringMySqlFactory : DbProviderFactory 15 | { 16 | public static DetouringMySqlFactory Instance = new DetouringMySqlFactory(); 17 | public override bool CanCreateDataSourceEnumerator => false; 18 | public override DbConnectionStringBuilder CreateConnectionStringBuilder() => new MySqlConnectionStringBuilder(); 19 | public override DbConnection CreateConnection() => new MySqlConnection(); 20 | public override DbCommandBuilder CreateCommandBuilder() => new MySqlCommandBuilder(); 21 | public override DbCommand CreateCommand() => new MySqlCommand(); 22 | public override DbParameter CreateParameter() => new MySqlParameter(); 23 | public override DbDataAdapter CreateDataAdapter() => new MySqlDataAdapter(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Source/Logging Application Block/Logging/Configuration/Fluent/ILoggingConfigurationCustomCategoryStart.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Logging Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | 13 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Fluent 14 | { 15 | /// 16 | /// Fluent interface that allows settings to be configured for a custom category source. 17 | /// 18 | public interface ILoggingConfigurationCustomCategoryStart : ILoggingConfigurationCategoryContd, IFluentInterface 19 | { 20 | /// 21 | /// Returns a fluent interface that can be used to further configure a custom category source. 22 | /// 23 | ILoggingConfigurationCustomCategoryOptions WithOptions 24 | { 25 | get; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Source/Core/Common/Configuration/Manageability/GroupPolicyNotificationRegistrationBuilder.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Core 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Manageability 13 | { 14 | /// 15 | /// Represents a builder for Group Policy notification registration. 16 | /// 17 | public class GroupPolicyNotificationRegistrationBuilder 18 | { 19 | /// 20 | /// Creates the registration. 21 | /// 22 | /// 23 | /// A object. 24 | /// 25 | public virtual GroupPolicyNotificationRegistration CreateRegistration() 26 | { 27 | return new GroupPolicyNotificationRegistration(); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Source/Data Access Application Block/Data/Configuration/Fluent/IDatabaseConfigurationProperties.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Data Access Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | namespace Microsoft.Practices.EnterpriseLibrary.Data.Configuration.Fluent 13 | { 14 | /// 15 | /// Database configuration properties that apply to all databases. 16 | /// 17 | /// This interface is intended to support a fluent-style configuration interface. 18 | public interface IDatabaseConfigurationProperties : IDatabaseConfigurationProviderEntry, IDatabaseConfiguration 19 | { 20 | /// 21 | /// Set this database as the default one in the configuration. 22 | /// 23 | /// 24 | IDatabaseConfigurationProperties AsDefault(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Source/Logging Application Block/Logging/ExtraInformation/IExtraInformationProvider.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Logging Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System.Collections.Generic; 13 | 14 | namespace Microsoft.Practices.EnterpriseLibrary.Logging.ExtraInformation 15 | { 16 | /// 17 | /// Defines a method to populate an with helpful diagnostic information. 18 | /// 19 | public interface IExtraInformationProvider 20 | { 21 | /// 22 | /// Populates an with helpful diagnostic information. 23 | /// 24 | /// Dictionary containing extra information used to initialize the instance 25 | void PopulateDictionary(IDictionary dict); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Source/Semantic Logging Application Block/SemanticLogging/Configuration/IFormatterElement.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information. 2 | 3 | using System.Xml.Linq; 4 | using Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Formatters; 5 | 6 | namespace Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Configuration 7 | { 8 | /// 9 | /// Represents the contract for creating formatters from configuration elements. 10 | /// 11 | public interface IFormatterElement 12 | { 13 | /// 14 | /// Determines whether this instance can create the specified configuration element. 15 | /// 16 | /// The configuration element. 17 | /// 18 | /// True if this instance can create formatter the specified element; otherwise, false. 19 | /// 20 | bool CanCreateFormatter(XElement element); 21 | 22 | /// 23 | /// Creates the instance. 24 | /// 25 | /// The configuration element. 26 | /// 27 | /// The formatter instance. 28 | /// 29 | IEventTextFormatter CreateFormatter(XElement element); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Source/Validation Application Block/Validation/Validators/ContainsCharacters.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Validation Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System; 13 | 14 | namespace Microsoft.Practices.EnterpriseLibrary.Validation.Validators 15 | { 16 | /// 17 | /// Represents the behavior of the . 18 | /// 19 | public enum ContainsCharacters 20 | { 21 | /// 22 | /// Indicates that validation is considered successful when at least one character in the 23 | /// character set is included in the validated value. 24 | /// 25 | Any, 26 | /// 27 | /// Indicates that validation is considered successful when at all the characters in the 28 | /// character set are included in the validated value. 29 | /// 30 | All 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /Source/Data Access Application Block/Data/Configuration/Fluent/MySqlConnectorDatabaseConfigurationExtension.cs: -------------------------------------------------------------------------------- 1 | using MySql.Data.MySqlClient; 2 | 3 | namespace Microsoft.Practices.EnterpriseLibrary.Data.Configuration.Fluent { 4 | 5 | /// 6 | /// MySql Server Database configuration options. 7 | /// 8 | public interface IDatabaseMySqlConnectorDatabaseConfiguration : IDatabaseDefaultConnectionString, IDatabaseConfigurationProperties { 9 | /// 10 | /// Define a connection string using the . 11 | /// 12 | /// 13 | /// 14 | IDatabaseConfigurationProperties WithConnectionString(MySqlConnectionStringBuilder builder); 15 | } 16 | 17 | internal class MySqlConnectorDatabaseConfigurationExtension : DatabaseConfigurationExtension, IDatabaseMySqlConnectorDatabaseConfiguration { 18 | 19 | public MySqlConnectorDatabaseConfigurationExtension(IDatabaseConfigurationProviders context) 20 | : base(context) { 21 | base.ConnectionString.ProviderName = DbProviderMapping.DefaultMySqlConnectorProviderName; 22 | } 23 | 24 | public IDatabaseConfigurationProperties WithConnectionString(MySqlConnectionStringBuilder builder) { 25 | return base.WithConnectionString(builder); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Source/Logging Application Block/Logging/Filters/ILogFilter.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Logging Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | 13 | namespace Microsoft.Practices.EnterpriseLibrary.Logging.Filters 14 | { 15 | /// 16 | /// Represents the interface for client-side message filters. 17 | /// 18 | public interface ILogFilter 19 | { 20 | /// 21 | /// Test to see if a message meets the criteria to be processed. 22 | /// 23 | /// Log entry to test. 24 | /// true if the message passes through the filter and should be distributed, false otherwise. 25 | bool Filter(LogEntry log); 26 | 27 | /// 28 | /// Gets the name of the log filter 29 | /// 30 | string Name { get; } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Source/Caching Application Block/Caching/CacheItemRemovedReason.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Caching Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | namespace Microsoft.Practices.EnterpriseLibrary.Caching 13 | { 14 | /// 15 | /// The reason that the cache item was removed. 16 | /// 17 | public enum CacheItemRemovedReason 18 | { 19 | /// 20 | /// The item has expired. 21 | /// 22 | Expired, 23 | 24 | /// 25 | /// The item was manually removed from the cache. 26 | /// 27 | Removed, 28 | 29 | /// 30 | /// The item was removed by the scavenger because it had a lower priority that any other item in the cache. 31 | /// 32 | Scavenged, 33 | 34 | /// 35 | /// Reserved. Do not use. 36 | /// 37 | Unknown = 9999 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Source/Data Access Application Block/Data/Configuration/Fluent/OdbcConfigurationExtension.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information. 2 | 3 | using System.Data.Odbc; 4 | 5 | namespace Microsoft.Practices.EnterpriseLibrary.Data.Configuration.Fluent 6 | { 7 | /// 8 | /// Odbc database configuration options. 9 | /// 10 | public interface IOdbcDatabaseConfiguration : IDatabaseDefaultConnectionString, IDatabaseConfigurationProperties 11 | { 12 | /// 13 | /// Define a connection string with the . 14 | /// 15 | /// 16 | /// 17 | IDatabaseConfigurationProperties WithConnectionString(OdbcConnectionStringBuilder builder); 18 | } 19 | 20 | 21 | internal class OdbcConfigurationExtension : DatabaseConfigurationExtension, IOdbcDatabaseConfiguration 22 | { 23 | public OdbcConfigurationExtension(IDatabaseConfigurationProviders context) : base(context) 24 | { 25 | base.ConnectionString.ProviderName = "System.Data.Odbc"; 26 | } 27 | 28 | public IDatabaseConfigurationProperties WithConnectionString(OdbcConnectionStringBuilder builder) 29 | { 30 | return base.WithConnectionString(builder); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Source/Data Access Application Block/Data/Configuration/Fluent/SqlCeDatabaseConfigurationExtension.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Data Access Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | namespace Microsoft.Practices.EnterpriseLibrary.Data.Configuration.Fluent 13 | { 14 | 15 | /// 16 | /// SqlCe database configuration options. 17 | /// 18 | public interface IDatabaseSqlCeDatabaseConfiguration : IDatabaseDefaultConnectionString, IDatabaseConfigurationProperties 19 | { } 20 | 21 | 22 | internal class SqlCeDatabaseConfigurationExtension : DatabaseConfigurationExtension, IDatabaseSqlCeDatabaseConfiguration 23 | { 24 | public SqlCeDatabaseConfigurationExtension(IDatabaseConfigurationProviders context) 25 | : base(context) 26 | { 27 | base.ConnectionString.ProviderName = "System.Data.SqlServerCe"; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Source/Logging Application Block/Logging/TraceListeners/EmailAuthenticationMode.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Logging Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | namespace Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners 13 | { 14 | /// 15 | /// This enumeration defines the options that the 16 | /// can use to authenticate to the STMP server. 17 | /// 18 | public enum EmailAuthenticationMode 19 | { 20 | /// 21 | /// No authentication 22 | /// 23 | None = 0, 24 | 25 | /// 26 | /// Use the Windows credentials for the current process 27 | /// 28 | WindowsCredentials, 29 | 30 | /// 31 | /// Pass a user name and password 32 | /// 33 | UserNameAndPassword 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Source/Data Access Application Block/Data/IParameterMapper.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Data Access Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System; 13 | using System.Collections.Generic; 14 | using System.Linq; 15 | using System.Text; 16 | using System.Data.Common; 17 | 18 | namespace Microsoft.Practices.EnterpriseLibrary.Data 19 | { 20 | /// 21 | /// Interface used to interpret parameters passed to an method 22 | /// and assign them to the that will be executed. 23 | /// 24 | public interface IParameterMapper 25 | { 26 | /// 27 | /// 28 | /// 29 | /// 30 | /// 31 | void AssignParameters(DbCommand command, object[] parameterValues); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Source/Semantic Logging Application Block/SemanticLogging.Database/GlobalSuppressions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information. 2 | 3 | // This file is used by Code Analysis to maintain SuppressMessage 4 | // attributes that are applied to this project. 5 | // Project-level suppressions either have no target or are given 6 | // a specific target and scoped to a namespace, type, member, etc. 7 | // 8 | // To add a suppression to this file, right-click the message in the 9 | // Code Analysis results, point to "Suppress Message", and click 10 | // "In Suppression File". 11 | // You do not need to add suppressions to this file manually. 12 | 13 | // suppressions for "few types" 14 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "Microsoft.Practices.EnterpriseLibrary.SemanticLogging", Justification = "As designed")] 15 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Sinks", Justification = "As designed")] 16 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Sinks.Database", Justification = "As designed")] 17 | -------------------------------------------------------------------------------- /Source/Exception Handling Application Block/ExceptionHandling/PostHandlingAction.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Exception Handling Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | namespace Microsoft.Practices.EnterpriseLibrary.ExceptionHandling 13 | { 14 | /// 15 | /// Determines what action should occur after an exception is handled by the configured exception handling chain. 16 | /// 17 | public enum PostHandlingAction 18 | { 19 | /// 20 | /// Indicates that no rethrow should occur. 21 | /// 22 | None = 0, 23 | /// 24 | /// Notify the caller that a rethrow is recommended. 25 | /// 26 | NotifyRethrow = 1, 27 | /// 28 | /// Throws the exception after the exception has been handled by all handlers in the chain. 29 | /// 30 | ThrowNewException = 2 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Source/Validation Application Block/Validation/Validators/DateTimeUnit.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Validation Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System; 13 | using System.Collections.Generic; 14 | using System.Text; 15 | 16 | namespace Microsoft.Practices.EnterpriseLibrary.Validation.Validators 17 | { 18 | /// 19 | /// Date time unit. 20 | /// 21 | public enum DateTimeUnit 22 | { 23 | /// 24 | /// No units. 25 | /// 26 | None, 27 | /// 28 | /// Seconds. 29 | /// 30 | Second, 31 | /// 32 | /// Minutes. 33 | /// 34 | Minute, 35 | /// 36 | /// Hours. 37 | /// 38 | Hour, 39 | /// 40 | /// Days. 41 | /// 42 | Day, 43 | /// 44 | /// Months. 45 | /// 46 | Month, 47 | /// 48 | /// Years. 49 | /// 50 | Year 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Source/Data Access Application Block/Data/Configuration/Fluent/IDatabaseProviderExtensionContext.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Data Access Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System.Configuration; 13 | using Microsoft.Practices.EnterpriseLibrary.Common.Configuration; 14 | 15 | namespace Microsoft.Practices.EnterpriseLibrary.Data.Configuration.Fluent 16 | { 17 | /// 18 | /// Provides extenson context for database provider extensions. 19 | /// 20 | public interface IDatabaseProviderExtensionContext 21 | { 22 | /// 23 | /// The current connetion string under construction in the fluent interface. 24 | /// 25 | ConnectionStringSettings ConnectionString { get; } 26 | 27 | /// 28 | /// Context of the current builder for the extension 29 | /// 30 | IConfigurationSourceBuilder Builder { get; } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Source/Core/Common/Configuration/ICloneableConfigurationElement.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Core 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System; 13 | using System.Collections.Generic; 14 | using System.Linq; 15 | using System.Text; 16 | using System.Configuration; 17 | 18 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Configuration 19 | { 20 | /// 21 | /// Interface used to implement custom clone behavior for a . 22 | /// 23 | /// 24 | public interface ICloneableConfigurationElement 25 | { 26 | /// 27 | /// Creates a deep clone of the current instance. 28 | /// 29 | /// 30 | /// A deep clone of the current instance. 31 | /// 32 | ConfigurationElement CreateFullClone(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Source/Core/Common/Configuration/Unity/EnterpriseLibraryBlockExtension.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Core 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using Microsoft.Practices.Unity; 13 | 14 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Unity 15 | { 16 | /// 17 | /// Base class for Enterprise Library Blocks' container extensions. 18 | /// 19 | public abstract class EnterpriseLibraryBlockExtension : UnityContainerExtension 20 | { 21 | /// 22 | /// Ensure that this container has been configured to resolve Enterprise Library 23 | /// objects. 24 | /// 25 | protected override void Initialize() 26 | { 27 | if(Container.Configure() == null) 28 | { 29 | Container.AddExtension(new EnterpriseLibraryCoreExtension(ConfigurationSourceFactory.Create())); 30 | } 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Source/Caching Application Block/Caching/CacheItemPriority.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Caching Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | namespace Microsoft.Practices.EnterpriseLibrary.Caching 13 | { 14 | /// 15 | /// Specifies the item priority levels. 16 | /// 17 | public enum CacheItemPriority 18 | { 19 | /// 20 | /// Should never be seen in nature. 21 | /// 22 | None = 0, 23 | /// 24 | /// Low priority for scavenging. 25 | /// 26 | Low = 1, 27 | /// 28 | /// Normal priority for scavenging. 29 | /// 30 | Normal, 31 | /// 32 | /// High priority for scavenging. 33 | /// 34 | High, 35 | /// 36 | /// Non-removable priority for scavenging. 37 | /// 38 | NotRemovable 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Source/Cryptography Application Block/Security.Cryptography/Instrumentation/NullSymmetricAlgorithmInstrumentationProvider.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Cryptography Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System; 13 | using System.Collections.Generic; 14 | using System.Linq; 15 | using System.Text; 16 | 17 | namespace Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.Instrumentation 18 | { 19 | /// 20 | public class NullSymmetricAlgorithmInstrumentationProvider : ISymmetricAlgorithmInstrumentationProvider 21 | { 22 | 23 | /// 24 | public void FireCyptographicOperationFailed(string message, Exception exception) 25 | { 26 | } 27 | 28 | /// 29 | public void FireSymmetricDecryptionPerformed() 30 | { 31 | } 32 | 33 | /// 34 | public void FireSymmetricEncryptionPerformed() 35 | { 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Source/Core/Common/Instrumentation/InstrumentationConsumerAttribute.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Core 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System; 13 | using System.Collections.Generic; 14 | using System.Text; 15 | 16 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation 17 | { 18 | /// 19 | /// Defines methods that are consuming instrumentation events. 20 | /// 21 | [AttributeUsage(AttributeTargets.Method, Inherited = false, AllowMultiple = true)] 22 | public sealed class InstrumentationConsumerAttribute : InstrumentationBaseAttribute 23 | { 24 | /// 25 | /// Initializes this instance with the instrumentation subject name being consumed. 26 | /// 27 | /// Subject name of the event being consumed. 28 | public InstrumentationConsumerAttribute(string subjectName) 29 | : base(subjectName) 30 | { 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Source/Core/Common/Instrumentation/InstrumentationProviderAttribute.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Core 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System; 13 | using System.Collections.Generic; 14 | using System.Text; 15 | 16 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation 17 | { 18 | /// 19 | /// Defines events that are producing instrumentation events. 20 | /// 21 | [AttributeUsage(AttributeTargets.Event, Inherited = false, AllowMultiple = false)] 22 | public sealed class InstrumentationProviderAttribute : InstrumentationBaseAttribute 23 | { 24 | /// 25 | /// Initializes this object with the instrumentation subject name being produced. 26 | /// 27 | /// Subect name of event being produced. 28 | public InstrumentationProviderAttribute(string subjectName) 29 | : base(subjectName) 30 | { 31 | 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Source/Core/Common/Utility/ServiceLocatorExtensions.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Core 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System; 13 | using Microsoft.Practices.ServiceLocation; 14 | 15 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Utility 16 | { 17 | /// 18 | /// Extension methods on for convenience. 19 | /// 20 | public static class ServiceLocatorExtensions 21 | { 22 | /// 23 | /// If the object implements then call it. 24 | /// 25 | /// The service locator to dispose, if possible. 26 | public static void Dispose(this IServiceLocator locator) 27 | { 28 | if (locator == null) return; 29 | 30 | var disposable = locator as IDisposable; 31 | if (disposable != null) 32 | { 33 | disposable.Dispose(); 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Source/Cryptography Application Block/Security.Cryptography/Configuration/Unity/CryptographyBlockExtension.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Cryptography Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System; 13 | using Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Unity; 14 | using Microsoft.Practices.Unity; 15 | 16 | namespace Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.Configuration.Unity 17 | { 18 | /// 19 | /// A that registers the policies necessary 20 | /// to create and instances described in the standard 21 | /// configuration file. 22 | /// 23 | /// This function is now performed by the . 24 | /// This extension is no longer necessary. 25 | [Obsolete] 26 | public class CryptographyBlockExtension : EnterpriseLibraryBlockExtension 27 | { 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Source/Cryptography Application Block/Security.Cryptography/Instrumentation/ISymmetricAlgorithmInstrumentationProvider.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Cryptography Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System; 13 | 14 | namespace Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.Instrumentation 15 | { 16 | /// 17 | /// 18 | /// 19 | public interface ISymmetricAlgorithmInstrumentationProvider 20 | { 21 | /// 22 | /// 23 | /// The message that describes the failure. 24 | /// The exception thrown during the failure. 25 | void FireCyptographicOperationFailed(string message, Exception exception); 26 | 27 | /// 28 | /// 29 | void FireSymmetricDecryptionPerformed(); 30 | 31 | /// 32 | /// 33 | void FireSymmetricEncryptionPerformed(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Source/Validation Application Block/Validation/Configuration/ValidatorDataCollection.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Validation Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using Microsoft.Practices.EnterpriseLibrary.Common.Configuration; 13 | using System.Configuration; 14 | 15 | namespace Microsoft.Practices.EnterpriseLibrary.Validation.Configuration 16 | { 17 | /// 18 | /// Represents a collection of validator configuration objects. 19 | /// 20 | /// 21 | [ConfigurationCollection(typeof(ValidatorData), AddItemName = "validator", ClearItemsName="clear", RemoveItemName="remove")] 22 | public class ValidatorDataCollection : NameTypeConfigurationElementCollection 23 | { 24 | /// 25 | /// Initializes a new instance of the class. 26 | /// 27 | public ValidatorDataCollection() 28 | { 29 | this.AddElementName = "validator"; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Source/Core/Common/Configuration/NonNegativeOrInfiniteTimeSpanValidatorAttribute.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Core 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System.Configuration; 13 | 14 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Configuration 15 | { 16 | /// 17 | /// Declaratively instructs the .NET Framework to perform time validation on a configuration property. This class cannot be inherited. 18 | /// 19 | public sealed class NonNegativeOrInfiniteTimeSpanValidatorAttribute : ConfigurationValidatorAttribute 20 | { 21 | /// 22 | /// Gets the validator attribute instance. 23 | /// 24 | /// The current . 25 | public override ConfigurationValidatorBase ValidatorInstance 26 | { 27 | get 28 | { 29 | return new NonNegativeOrInfiniteTimeSpanValidator(); 30 | } 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Source/Logging Application Block/Logging/Configuration/Fluent/ILoggingConfigurationExtension.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Logging Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using Microsoft.Practices.EnterpriseLibrary.Logging.Configuration; 13 | 14 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Fluent 15 | { 16 | /// 17 | /// Allows access to the internal configuration classes used to configure the logging application block. 18 | /// 19 | public interface ILoggingConfigurationExtension : IFluentInterface 20 | { 21 | /// 22 | /// Returns a fluent interface that can be used to configure global logging application block settings. 23 | /// 24 | ILoggingConfigurationOptions LoggingOptions { get; } 25 | 26 | /// 27 | /// Returns the that are being build up. 28 | /// 29 | LoggingSettings LoggingSettings { get; } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Source/Transient Fault Handling Application Block/TransientFaultHandling/ITransientErrorDetectionStrategy.cs: -------------------------------------------------------------------------------- 1 | #region license 2 | // ============================================================================== 3 | // Microsoft patterns & practices Enterprise Library 4 | // Transient Fault Handling Application Block 5 | // ============================================================================== 6 | // Copyright © Microsoft Corporation. All rights reserved. 7 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 8 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 9 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 10 | // FITNESS FOR A PARTICULAR PURPOSE. 11 | // ============================================================================== 12 | #endregion 13 | 14 | namespace Microsoft.Practices.EnterpriseLibrary.TransientFaultHandling 15 | { 16 | using System; 17 | 18 | /// 19 | /// Defines an interface that must be implemented by custom components responsible for detecting specific transient conditions. 20 | /// 21 | public interface ITransientErrorDetectionStrategy 22 | { 23 | /// 24 | /// Determines whether the specified exception represents a transient failure that can be compensated by a retry. 25 | /// 26 | /// The exception object to be verified. 27 | /// true if the specified exception is considered as transient; otherwise, false. 28 | bool IsTransient(Exception ex); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Source/Semantic Logging Application Block/SemanticLogging/Configuration/ParameterElement.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information. 2 | 3 | using System.Collections.Generic; 4 | using System.Xml.Linq; 5 | using Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Configuration; 6 | 7 | namespace Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Etw.Configuration 8 | { 9 | internal class ParameterElement 10 | { 11 | private static readonly XName ParametersName = XName.Get("parameters", Constants.Namespace); 12 | 13 | public string Name { get; set; } 14 | 15 | public string Type { get; set; } 16 | 17 | public string Value { get; set; } 18 | 19 | public IEnumerable Parameters { get; set; } 20 | 21 | internal static ParameterElement Read(XElement element) 22 | { 23 | return new ParameterElement() 24 | { 25 | Name = (string)element.Attribute("name"), 26 | Type = (string)element.Attribute("type"), 27 | Value = (string)element.Attribute("value"), 28 | Parameters = GetChildParameters(element) 29 | }; 30 | } 31 | 32 | private static IEnumerable GetChildParameters(XElement element) 33 | { 34 | foreach (var e in element.Elements(ParametersName).Elements()) 35 | { 36 | yield return ParameterElement.Read(e); 37 | } 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Source/Validation Application Block/Validation/Configuration/ValidatedTypeReferenceCollection.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Validation Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using Microsoft.Practices.EnterpriseLibrary.Common.Configuration; 13 | using System.Configuration; 14 | 15 | namespace Microsoft.Practices.EnterpriseLibrary.Validation.Configuration 16 | { 17 | /// 18 | /// Represents a collection of validation rulesets. 19 | /// 20 | /// 21 | [ConfigurationCollection(typeof(ValidatedTypeReference), AddItemName = "type", ClearItemsName = "clear", RemoveItemName = "remove")] 22 | public class ValidatedTypeReferenceCollection : NamedElementCollection 23 | { 24 | /// 25 | /// Initializes a new instance of the class. 26 | /// 27 | public ValidatedTypeReferenceCollection() 28 | { 29 | this.AddElementName = "type"; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Source/Core/Common/Instrumentation/IPerformanceCounterNameFormatter.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Core 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation 13 | { 14 | /// 15 | /// Provides a pluggable way to format the name given to a particular instance of a performance counter. 16 | /// Each instance of a performance counter in Enterprise Library is given a name of the format 17 | /// "Name prefix - counter name" 18 | /// 19 | public interface IPerformanceCounterNameFormatter 20 | { 21 | /// 22 | /// Creates the formatted instance name for a performance counter, providing the prefix for the 23 | /// instance. 24 | /// 25 | /// Performance counter name, as defined during installation of the counter 26 | /// Formatted instance name in form of "prefix - nameSuffix" 27 | string CreateName(string nameSuffix); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Source/Logging Application Block/Logging/Filters/ILogFilterErrorHandler.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Logging Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System; 13 | 14 | namespace Microsoft.Practices.EnterpriseLibrary.Logging.Filters 15 | { 16 | /// 17 | /// Contract for handling errors during evaluation of an . 18 | /// 19 | public interface ILogFilterErrorHandler 20 | { 21 | /// 22 | /// Perform any action to handle an error during checking. 23 | /// 24 | /// The exception raised during filter evaluation. 25 | /// The log entry being evaluated. 26 | /// The fiter that raised the exception. 27 | /// True if processing should continue, ignoring the failed filter, or 28 | /// false if the filter evaluation should be considered as failed. 29 | bool FilterCheckingFailed(Exception ex, LogEntry logEntry, ILogFilter filter); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Source/Semantic Logging Application Block/SemanticLogging/Configuration/CustomSinkElement.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information. 2 | 3 | using System; 4 | using System.Xml.Linq; 5 | using Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Configuration; 6 | using Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Etw.Utility; 7 | using Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Observable; 8 | using Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Utility; 9 | 10 | namespace Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Etw.Configuration 11 | { 12 | internal class CustomSinkElement : ISinkElement 13 | { 14 | private readonly XName sinkName = XName.Get("customSink", Constants.Namespace); 15 | 16 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Justification = "Validated with Guard class")] 17 | public bool CanCreateSink(XElement element) 18 | { 19 | Guard.ArgumentNotNull(element, "element"); 20 | 21 | return element.Name == this.sinkName; 22 | } 23 | 24 | public IObserver CreateSink(XElement element) 25 | { 26 | Guard.ArgumentNotNull(element, "element"); 27 | 28 | var subject = new EventEntrySubject(); 29 | var sink = XmlUtil.CreateInstance>(element); 30 | subject.Subscribe(sink); 31 | return subject; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Source/Core/Common/Utility/DelegateStringResolver.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Core 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System; 13 | 14 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Utility 15 | { 16 | /// 17 | /// Resolves strings by invoking a delegate and returning the resulting value. 18 | /// 19 | public sealed class DelegateStringResolver : IStringResolver 20 | { 21 | /// 22 | /// Initializes a new instance of with a delegate. 23 | /// 24 | /// The delegate to invoke when resolving a string. 25 | public DelegateStringResolver(Func resolverDelegate) 26 | { 27 | this.resolverDelegate = resolverDelegate; 28 | } 29 | 30 | private readonly Func resolverDelegate; 31 | 32 | string IStringResolver.GetString() 33 | { 34 | return this.resolverDelegate(); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Source/Logging Application Block/Logging/TraceListeners/RollInterval.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Logging Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | namespace Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners 13 | { 14 | /// 15 | /// Defines the frequency when the file need to be rolled. 16 | /// 17 | public enum RollInterval 18 | { 19 | /// 20 | /// None Interval 21 | /// 22 | None, 23 | /// 24 | /// Minute Interval 25 | /// 26 | Minute, 27 | /// 28 | /// Hour interval 29 | /// 30 | Hour, 31 | /// 32 | /// Day Interval 33 | /// 34 | Day, 35 | /// 36 | /// Week Interval 37 | /// 38 | Week, 39 | /// 40 | /// Month Interval 41 | /// 42 | Month, 43 | /// 44 | /// Year Interval 45 | /// 46 | Year, 47 | /// 48 | /// At Midnight 49 | /// 50 | Midnight 51 | }; 52 | } 53 | -------------------------------------------------------------------------------- /Source/Validation Application Block/Validation/Configuration/ValidatedMethodReferenceCollection.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Validation Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using Microsoft.Practices.EnterpriseLibrary.Common.Configuration; 13 | using System.Configuration; 14 | 15 | namespace Microsoft.Practices.EnterpriseLibrary.Validation.Configuration 16 | { 17 | /// 18 | /// Represents a collection of validated methods. 19 | /// 20 | /// 21 | [ConfigurationCollection(typeof(ValidatedMethodReference), AddItemName = "method", ClearItemsName = "clear", RemoveItemName = "remove")] 22 | public class ValidatedMethodReferenceCollection : NamedElementCollection 23 | { 24 | /// 25 | /// Initializes a new instance of the class. 26 | /// 27 | public ValidatedMethodReferenceCollection() 28 | { 29 | this.AddElementName = "method"; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Source/Validation Application Block/Validation/Configuration/ValidationRulesetDataCollection.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Validation Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System; 13 | using System.Configuration; 14 | using Microsoft.Practices.EnterpriseLibrary.Common.Configuration; 15 | 16 | namespace Microsoft.Practices.EnterpriseLibrary.Validation.Configuration 17 | { 18 | /// 19 | /// Represents a collection of validated properties. 20 | /// 21 | /// 22 | [ConfigurationCollection(typeof(ValidationRulesetData), AddItemName = "ruleset", ClearItemsName = "clear", RemoveItemName = "remove")] 23 | public class ValidationRulesetDataCollection : NamedElementCollection 24 | { 25 | /// 26 | /// Initializes a new instance of the class. 27 | /// 28 | public ValidationRulesetDataCollection() 29 | { 30 | this.AddElementName = "ruleset"; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Source/Core/Common/Configuration/EnumConverterWithExclusiveSuggestedValues.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Core 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System.ComponentModel; 13 | 14 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Configuration 15 | { 16 | /// 17 | /// Type converter used to work around enums with enums wrongly marked as "flags". 18 | /// 19 | public class EnumConverterWithExclusiveStandardValues : EnumConverter 20 | { 21 | /// 22 | /// Initializes a new instance of the class. 23 | /// 24 | public EnumConverterWithExclusiveStandardValues() 25 | : base(typeof(T)) 26 | { } 27 | 28 | /// 29 | /// Indicates where the standard values are exclusive. 30 | /// 31 | public override bool GetStandardValuesExclusive(ITypeDescriptorContext context) 32 | { 33 | return true; 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Source/Caching Application Block/Caching/ICacheOperations.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Caching Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System.Collections; 13 | 14 | namespace Microsoft.Practices.EnterpriseLibrary.Caching 15 | { 16 | /// 17 | /// Represents cache operations. 18 | /// 19 | public interface ICacheOperations 20 | { 21 | /// 22 | /// Gets the current cache state. 23 | /// 24 | /// 25 | Hashtable CurrentCacheState { get; } 26 | 27 | /// 28 | /// Removes a . 29 | /// 30 | /// The key of the item to remove. 31 | /// One of the values. 32 | void RemoveItemFromCache(string key, CacheItemRemovedReason removalReason); 33 | 34 | /// 35 | /// Returns the number of items contained in the cache. 36 | /// 37 | int Count { get; } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Source/Core/Common/Configuration/ContainerModel/NullContainerReconfiguringEventSource.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Core 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System; 13 | 14 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel 15 | { 16 | /// 17 | /// An implementation of that does 18 | /// nothing. Saves null checking everywhere. 19 | /// 20 | public class NullContainerReconfiguringEventSource : IContainerReconfiguringEventSource 21 | { 22 | #region IContainerReconfiguringEventSource Members 23 | 24 | /// 25 | /// The event raised when the configuration source changes. 26 | /// 27 | /// With this implementation the event is never raised. 28 | #pragma warning disable 67 // Event is never used 29 | public event EventHandler ContainerReconfiguring; 30 | #pragma warning restore 67 31 | #endregion 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Source/Data Access Application Block/Data/Configuration/Fluent/IDatabaseDefaultConnectionString.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Data Access Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System.Configuration; 13 | using System.Data.Common; 14 | using Microsoft.Practices.EnterpriseLibrary.Common; 15 | 16 | namespace Microsoft.Practices.EnterpriseLibrary.Data.Configuration.Fluent 17 | { 18 | /// 19 | /// Defines default connection string settings for fluent-style interface. 20 | /// 21 | public interface IDatabaseDefaultConnectionString : IFluentInterface 22 | { 23 | /// 24 | /// Connection string to use for this data source. 25 | /// 26 | /// The connection string. 27 | /// 28 | /// 29 | /// 30 | IDatabaseConfigurationProperties WithConnectionString(string connectionString); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Source/Logging Application Block/Logging/Configuration/Fluent/ILoggingConfigurationSendToExtention.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Logging Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using Microsoft.Practices.EnterpriseLibrary.Logging.Configuration; 13 | 14 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Fluent 15 | { 16 | /// 17 | /// Allows access to the configuration classes used to configure instances. 18 | /// 19 | public interface ILoggingConfigurationSendToExtension : ILoggingConfigurationExtension, IFluentInterface 20 | { 21 | /// 22 | /// Returns an interface that can be used to configure a logging category. 23 | /// 24 | ILoggingConfigurationCategoryContd LoggingCategoryContd { get; } 25 | 26 | /// 27 | /// Returns the logging category configuration currently being build up. 28 | /// 29 | TraceSourceData CurrentTraceSource { get; } 30 | 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Source/Cryptography Application Block/Security.Cryptography/Instrumentation/NullHashAlgorithmInstrumentationProvider.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Cryptography Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System; 13 | using System.Collections.Generic; 14 | using System.Linq; 15 | using System.Text; 16 | 17 | namespace Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.Instrumentation 18 | { 19 | /// 20 | public class NullHashAlgorithmInstrumentationProvider : IHashAlgorithmInstrumentationProvider 21 | { 22 | /// 23 | public void FireCyptographicOperationFailed(string message, Exception exception) 24 | { 25 | } 26 | 27 | /// 28 | public void FireHashComparisonPerformed() 29 | { 30 | } 31 | 32 | /// 33 | public void FireHashMismatchDetected() 34 | { 35 | } 36 | 37 | /// 38 | public void FireHashOperationPerformed() 39 | { 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Source/Transient Fault Handling Application Block/TransientFaultHandling.Configuration/Configuration/WellKnownRetryStrategies.cs: -------------------------------------------------------------------------------- 1 | #region license 2 | // ============================================================================== 3 | // Microsoft patterns & practices Enterprise Library 4 | // Transient Fault Handling Application Block 5 | // ============================================================================== 6 | // Copyright © Microsoft Corporation. All rights reserved. 7 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 8 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 9 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 10 | // FITNESS FOR A PARTICULAR PURPOSE. 11 | // ============================================================================== 12 | #endregion 13 | 14 | namespace Microsoft.Practices.EnterpriseLibrary.TransientFaultHandling.Configuration 15 | { 16 | using System; 17 | using System.Collections.Generic; 18 | 19 | internal static class WellKnownRetryStrategies 20 | { 21 | public const string Incremental = "incremental"; 22 | public const string Backoff = "exponentialBackoff"; 23 | public const string FixedInterval = "fixedInterval"; 24 | 25 | public static readonly Dictionary AllKnownRetryStrategies = new Dictionary() 26 | { 27 | { "incremental", typeof(IncrementalData) }, 28 | { "exponentialBackoff", typeof(ExponentialBackoffData) }, 29 | { "fixedInterval", typeof(FixedIntervalData) } 30 | }; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Source/Validation Application Block/Validation/Configuration/ValidatedPropertyReferenceCollection.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Validation Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using Microsoft.Practices.EnterpriseLibrary.Common.Configuration; 13 | using System.Configuration; 14 | 15 | namespace Microsoft.Practices.EnterpriseLibrary.Validation.Configuration 16 | { 17 | /// 18 | /// Represents a collection of validated properties. 19 | /// 20 | /// 21 | [ConfigurationCollection(typeof(ValidatedPropertyReference), AddItemName = "property", ClearItemsName = "clear", RemoveItemName = "remove")] 22 | public class ValidatedPropertyReferenceCollection : NamedElementCollection 23 | { 24 | /// 25 | /// Initializes a new instance of the class. 26 | /// 27 | public ValidatedPropertyReferenceCollection() 28 | { 29 | this.AddElementName = "property"; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Source/Core/Common/Configuration/Manageability/Adm/AdmTextPart.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Core 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System; 13 | 14 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Manageability.Adm 15 | { 16 | /// 17 | /// Represents a TEXT part in an ADM template. 18 | /// 19 | public class AdmTextPart : AdmPart 20 | { 21 | internal const String TextTemplate = "\t\t\tTEXT"; 22 | 23 | /// 24 | /// Initialize a new instance of the class. 25 | /// 26 | /// 27 | /// The name of the part. 28 | /// 29 | public AdmTextPart(String partName) 30 | : base(partName, null, null) {} 31 | 32 | /// 33 | /// Gest the template representing the type of the part. 34 | /// 35 | protected override string PartTypeTemplate 36 | { 37 | get { return TextTemplate; } 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Source/Policy Injection Application Block/PolicyInjection/Utilities/ServiceLocatorExtensions.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Core 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System; 13 | using Microsoft.Practices.ServiceLocation; 14 | 15 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Utility 16 | { 17 | /// 18 | /// Provides extension methods on for convenience. 19 | /// 20 | public static class ServiceLocatorExtensions 21 | { 22 | /// 23 | /// Disposes if it implements the interface. 24 | /// 25 | /// The service locator to dispose, if possible. 26 | public static void Dispose(this IServiceLocator locator) 27 | { 28 | if (locator == null) return; 29 | 30 | var disposable = locator as IDisposable; 31 | if (disposable != null) 32 | { 33 | disposable.Dispose(); 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Source/Caching Application Block/Caching/Expirations/NeverExpired.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Caching Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System; 13 | 14 | namespace Microsoft.Practices.EnterpriseLibrary.Caching.Expirations 15 | { 16 | /// 17 | /// This class reflects an expiration policy of never being expired. 18 | /// 19 | [Serializable] 20 | public class NeverExpired : ICacheItemExpiration 21 | { 22 | /// 23 | /// Always returns false 24 | /// 25 | /// False always 26 | public bool HasExpired() 27 | { 28 | return false; 29 | } 30 | 31 | /// 32 | /// Not used 33 | /// 34 | public void Notify() 35 | { 36 | } 37 | 38 | /// 39 | /// Not used 40 | /// 41 | /// Not used 42 | public void Initialize(CacheItem owningCacheItem) 43 | { 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Source/Logging Application Block/Logging/TraceListeners/CustomTraceListener.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Logging Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System.Diagnostics; 13 | using Microsoft.Practices.EnterpriseLibrary.Logging.Formatters; 14 | 15 | namespace Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners 16 | { 17 | /// 18 | /// Base class for custom trace listeners that support formatters. 19 | /// 20 | public abstract class CustomTraceListener : TraceListener 21 | { 22 | private ILogFormatter formatter; 23 | 24 | /// 25 | /// Initializes a new instance of the class. 26 | /// 27 | protected CustomTraceListener() 28 | { 29 | } 30 | 31 | /// 32 | /// Gets or sets the log entry formatter. 33 | /// 34 | public ILogFormatter Formatter 35 | { 36 | get { return this.formatter; } 37 | set { this.formatter = value; } 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Source/Validation Application Block/Validation/Configuration/ValidatedFieldReferenceCollection.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Validation Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using Microsoft.Practices.EnterpriseLibrary.Common.Configuration; 13 | using System.Configuration; 14 | using Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Design; 15 | 16 | namespace Microsoft.Practices.EnterpriseLibrary.Validation.Configuration 17 | { 18 | /// 19 | /// Represents a collection of validated fields. 20 | /// 21 | /// 22 | [ConfigurationCollection(typeof(ValidatedFieldReference), AddItemName = "field", ClearItemsName = "clear", RemoveItemName = "remove")] 23 | public class ValidatedFieldReferenceCollection : NamedElementCollection 24 | { 25 | /// 26 | /// Initializes a new instance of the class. 27 | /// 28 | public ValidatedFieldReferenceCollection() 29 | { 30 | this.AddElementName = "field"; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Source/Caching Application Block/Caching/Configuration/Fluent/IStoreInCustomStore.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Caching Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System; 13 | using System.Collections.Generic; 14 | using System.Linq; 15 | using System.Text; 16 | using Microsoft.Practices.EnterpriseLibrary.Common.Configuration; 17 | using Microsoft.Practices.EnterpriseLibrary.Caching.Configuration; 18 | using Microsoft.Practices.EnterpriseLibrary.Caching; 19 | 20 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Fluent 21 | { 22 | /// 23 | /// Fluent interface used to configure a custom instance. 24 | /// 25 | /// 26 | public interface IStoreInCustomStore : ICachingConfiguration, IFluentInterface 27 | { 28 | /// 29 | /// Returns a fluent interface that can be used to set up encryption for the current custom instance. 30 | /// 31 | IBackingStoreEncryptItemsUsing EncryptUsing { get; } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Source/Core/Common/Configuration/Manageability/IGroupPolicyWatcher.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Core 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System; 13 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Manageability 14 | { 15 | /// 16 | /// Defines a watcher for Group Policy. 17 | /// 18 | public interface IGroupPolicyWatcher : IDisposable 19 | { 20 | /// 21 | /// The event to update the policy. 22 | /// 23 | event GroupPolicyUpdateDelegate GroupPolicyUpdated; 24 | 25 | /// 26 | /// Starts watching Group Policy. 27 | /// 28 | void StartWatching(); 29 | 30 | /// 31 | /// Stops watching Group Policy. 32 | /// 33 | void StopWatching(); 34 | } 35 | 36 | /// 37 | /// The delegate used to update the Group Policy based on machine. 38 | /// 39 | /// The machine where Group Policy is updated. 40 | public delegate void GroupPolicyUpdateDelegate(bool machine); 41 | } 42 | -------------------------------------------------------------------------------- /Source/Cryptography Application Block/Security.Cryptography/Instrumentation/IHashAlgorithmInstrumentationProvider.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Cryptography Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System; 13 | 14 | namespace Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.Instrumentation 15 | { 16 | /// 17 | /// 18 | /// 19 | public interface IHashAlgorithmInstrumentationProvider 20 | { 21 | 22 | /// 23 | /// 24 | /// The message that describes the failure. 25 | /// The exception thrown during the failure. 26 | void FireCyptographicOperationFailed(string message, Exception exception); 27 | 28 | /// 29 | /// 30 | void FireHashComparisonPerformed(); 31 | 32 | /// 33 | /// 34 | void FireHashMismatchDetected(); 35 | 36 | /// 37 | /// 38 | void FireHashOperationPerformed(); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Source/Logging Application Block/Logging/Configuration/Fluent/ILoggingConfigurationFilterLogEnabled.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Logging Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | 13 | 14 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Fluent 15 | { 16 | /// 17 | /// Fluent interface used to configure a instance. 18 | /// 19 | /// 20 | /// 21 | public interface ILoggingConfigurationFilterLogEnabled : ILoggingConfigurationOptions, IFluentInterface 22 | { 23 | /// 24 | /// Specifies that all logging should be enabled.
25 | /// The default for the is that all logging is disabled. 26 | ///
27 | /// Fluent interface used to further configure the logging application block. 28 | /// 29 | /// 30 | ILoggingConfigurationOptions Enable(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Source/Logging Application Block/Logging/Configuration/Fluent/ILoggingConfigurationContd.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Logging Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Fluent 13 | { 14 | 15 | /// 16 | /// Fluent interface that allows log categories to be set up. 17 | /// 18 | public interface ILoggingConfigurationContd : IFluentInterface 19 | { 20 | /// 21 | /// Creates a Category Source in the configuration schema with the specified name. 22 | /// 23 | /// The name of the Category Source. 24 | /// Fluent interface that allows for this Category Source to be configured further. 25 | ILoggingConfigurationCustomCategoryStart LogToCategoryNamed(string categoryName); 26 | 27 | /// 28 | /// Returns an interface that can be used to configure special logging categories. 29 | /// 30 | ILoggingConfigurationSpecialSources SpecialSources { get; } 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /Source/Data Access Application Block/Data/IRowMapper.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Data Access Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System; 13 | using System.Collections.Generic; 14 | using System.Linq; 15 | using System.Text; 16 | using System.Data; 17 | 18 | namespace Microsoft.Practices.EnterpriseLibrary.Data 19 | { 20 | /// 21 | /// Represents the operation of mapping a to . 22 | /// 23 | /// The type this row mapper will be mapping to. 24 | /// 25 | public interface IRowMapper 26 | { 27 | /// 28 | /// When implemented by a class, returns a new based on . 29 | /// 30 | /// The to map. 31 | /// The instance of that is based on . 32 | TResult MapRow(IDataRecord row); 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Source/Validation Application Block/Validation/Validators/ComparisonOperator.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Validation Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System; 13 | using System.Collections.Generic; 14 | using System.Text; 15 | 16 | namespace Microsoft.Practices.EnterpriseLibrary.Validation.Validators 17 | { 18 | /// 19 | /// Represents the different comparison behaviors available for a . 20 | /// 21 | public enum ComparisonOperator 22 | { 23 | /// 24 | /// Comparison for equal. 25 | /// 26 | Equal, 27 | 28 | /// 29 | /// Comparison for not equal. 30 | /// 31 | NotEqual, 32 | 33 | /// 34 | /// Comparison for greater. 35 | /// 36 | GreaterThan, 37 | 38 | /// 39 | /// Comparison for greater or equal. 40 | /// 41 | GreaterThanEqual, 42 | 43 | /// 44 | /// Comparison for lesser. 45 | /// 46 | LessThan, 47 | 48 | /// 49 | /// Comparison for lesser or equal. 50 | /// 51 | LessThanEqual 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Source/Core/Common/Configuration/ContainerModel/InjectedProperty.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Core 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel 13 | { 14 | /// 15 | /// Represents a property injected in a . 16 | /// 17 | public class InjectedProperty 18 | { 19 | internal InjectedProperty(string propertyName, ParameterValue propertyValue) 20 | { 21 | this.PropertyName = propertyName; 22 | this.PropertyValue = propertyValue; 23 | } 24 | 25 | /// 26 | /// Gets the name of the injected property. 27 | /// 28 | public string PropertyName 29 | { 30 | get; 31 | private set; 32 | } 33 | 34 | /// 35 | /// Gets the describing the value injected through the property. 36 | /// 37 | public ParameterValue PropertyValue 38 | { 39 | get; 40 | private set; 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Source/Data Access Application Block/Data/UpdateBehavior.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Data Access Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | namespace Microsoft.Practices.EnterpriseLibrary.Data 13 | { 14 | /// 15 | /// Used with the Database.UpdateDataSet method. Provides control over behavior when the Data 16 | /// Adapter's update command encounters an error. 17 | /// 18 | public enum UpdateBehavior 19 | { 20 | /// 21 | /// No interference with the DataAdapter's Update command. If Update encounters 22 | /// an error, the update stops. Additional rows in the Datatable are uneffected. 23 | /// 24 | Standard, 25 | /// 26 | /// If the DataAdapter's Update command encounters an error, the update will 27 | /// continue. The Update command will try to update the remaining rows. 28 | /// 29 | Continue, 30 | /// 31 | /// If the DataAdapter encounters an error, all updated rows will be rolled back. 32 | /// 33 | Transactional 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Source/Data Access Application Block/Data/IResultSetMapper.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Data Access Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System; 13 | using System.Collections.Generic; 14 | using System.Linq; 15 | using System.Text; 16 | using System.Data; 17 | 18 | namespace Microsoft.Practices.EnterpriseLibrary.Data 19 | { 20 | /// 21 | /// Represents the operation of mapping a to an enumerable of . 22 | /// 23 | /// The element type this result set mapper will be mapping to. 24 | public interface IResultSetMapper 25 | { 26 | 27 | /// 28 | /// When implemented by a class, returns an enumerable of based on . 29 | /// 30 | /// The to map. 31 | /// The enurable of that is based on . 32 | IEnumerable MapSet(IDataReader reader); 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Source/Caching Application Block/Caching/BackingStoreImplementations/IStorageEncryptionProvider.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Caching Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | namespace Microsoft.Practices.EnterpriseLibrary.Caching.BackingStoreImplementations 13 | { 14 | /// 15 | /// Not intended for direct use. Provides symmetric encryption and decryption services 16 | /// to Isolated and Database backing stores. Allows this block to use 17 | /// Security.Cryptography without having a direct reference to that assembly. 18 | /// 19 | public interface IStorageEncryptionProvider 20 | { 21 | /// 22 | /// Encrypt backing store data. 23 | /// 24 | /// Clear bytes. 25 | /// Encrypted bytes. 26 | byte[] Encrypt(byte[] plaintext); 27 | 28 | /// 29 | /// Decrypt backing store data. 30 | /// 31 | /// Encrypted bytes. 32 | /// Decrypted bytes. 33 | byte[] Decrypt(byte[] ciphertext); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Source/Caching Application Block/Caching/ICacheItemExpiration.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Caching Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | namespace Microsoft.Practices.EnterpriseLibrary.Caching 13 | { 14 | /// 15 | /// Allows end users to implement their own cache item expiration schema. 16 | /// 17 | public interface ICacheItemExpiration 18 | { 19 | /// 20 | /// Specifies if item has expired or not. 21 | /// 22 | /// Returns true if the item has expired, otherwise false. 23 | bool HasExpired(); 24 | 25 | /// 26 | /// Called to tell the expiration that the CacheItem to which this expiration belongs has been touched by the user 27 | /// 28 | void Notify(); 29 | 30 | /// 31 | /// Called to give the instance the opportunity to initialize itself from information contained in the CacheItem. 32 | /// 33 | /// CacheItem that owns this expiration object 34 | void Initialize(CacheItem owningCacheItem); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Source/Core/Common/Configuration/ContainerModel/ConstantParameterValue.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Core 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System.Linq.Expressions; 13 | 14 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel 15 | { 16 | /// 17 | /// Represents an injected parameter value that can be determined at the time of container configuration. 18 | /// 19 | public class ConstantParameterValue : ParameterValue 20 | { 21 | /// 22 | /// Initializes a value parameter with the specified expression to be evaluated when providing the value parameter. 23 | /// 24 | /// The expression representing the value to provide to the parameter. 25 | internal ConstantParameterValue(Expression expression) 26 | : base(expression) 27 | { 28 | Value = Expression.Lambda(Expression).Compile().DynamicInvoke(); 29 | } 30 | 31 | /// 32 | /// The parameter value to inject. 33 | /// 34 | public object Value { get; private set;} 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Source/Core/Common/Configuration/Manageability/Adm/AdmDropDownListItem.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Core 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System; 13 | using System.Collections.Generic; 14 | 15 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Manageability.Adm 16 | { 17 | /// 18 | /// Represents an item in a drop down list. 19 | /// 20 | public struct AdmDropDownListItem 21 | { 22 | private String name; 23 | private String value; 24 | 25 | /// 26 | /// Initializes a new instance of the class. 27 | /// 28 | /// The item name. 29 | /// The item value. 30 | public AdmDropDownListItem(String name, String value) 31 | { 32 | this.name = name; 33 | this.value = value; 34 | } 35 | 36 | /// 37 | /// Gets the name of the item. 38 | /// 39 | public String Name 40 | { 41 | get { return name; } 42 | } 43 | 44 | /// 45 | /// Gets the value of the item. 46 | /// 47 | public String Value 48 | { 49 | get { return this.value; } 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Source/Core/Common/Instrumentation/InstrumentationBaseAttribute.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Core 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System; 13 | using System.Collections.Generic; 14 | using System.Text; 15 | 16 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation 17 | { 18 | /// 19 | /// Base class for attributes used to identify instrumentation producers or consumers. 20 | /// 21 | public class InstrumentationBaseAttribute : Attribute 22 | { 23 | string subjectName; 24 | 25 | /// 26 | /// Initializes this instance with the instrumentation subject name. 27 | /// 28 | /// Subject name being produced or consumed 29 | protected InstrumentationBaseAttribute(string subjectName) 30 | { 31 | if (String.IsNullOrEmpty(subjectName)) throw new ArgumentException("subjectName"); 32 | 33 | this.subjectName = subjectName; 34 | } 35 | 36 | /// 37 | /// Gets the subject name 38 | /// 39 | public string SubjectName { get { return subjectName; } } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Source/Core/Common/Instrumentation/NoPrefixNameFormatter.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Core 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System; 13 | using System.Collections.Generic; 14 | using System.Text; 15 | using Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation; 16 | 17 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation 18 | { 19 | /// 20 | /// Provides a pluggable way to format the name given to a particular instance of a performance counter. 21 | /// This class does no formatting, returning the provided name suffix as the counter name. 22 | /// 23 | public class NoPrefixNameFormatter : IPerformanceCounterNameFormatter 24 | { 25 | /// 26 | /// Returns the given as the created name. 27 | /// 28 | /// Performance counter name, as defined during installation of the counter 29 | /// Formatted instance name in form of "nameSuffix" 30 | public string CreateName(string nameSuffix) 31 | { 32 | return new PerformanceCounterInstanceName("", nameSuffix).ToString(); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Source/Core/Common/Configuration/GenericEnumeratorWrapper.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Core 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System; 13 | using System.Collections; 14 | using System.Collections.Generic; 15 | 16 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Configuration 17 | { 18 | /// 19 | /// Represents a genereic enumerator for the NamedElementCollection. 20 | /// 21 | internal class GenericEnumeratorWrapper : IEnumerator 22 | { 23 | private IEnumerator wrappedEnumerator; 24 | 25 | internal GenericEnumeratorWrapper(IEnumerator wrappedEnumerator) 26 | { 27 | this.wrappedEnumerator = wrappedEnumerator; 28 | } 29 | 30 | T IEnumerator.Current 31 | { 32 | get { return (T) this.wrappedEnumerator.Current; } 33 | } 34 | 35 | void IDisposable.Dispose() 36 | { 37 | this.wrappedEnumerator = null; 38 | } 39 | 40 | object IEnumerator.Current 41 | { 42 | get { return this.wrappedEnumerator.Current; } 43 | } 44 | 45 | bool IEnumerator.MoveNext() 46 | { 47 | return this.wrappedEnumerator.MoveNext(); 48 | } 49 | 50 | void IEnumerator.Reset() 51 | { 52 | this.wrappedEnumerator.Reset(); 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Source/Logging Application Block/Logging/Configuration/CustomTraceListenerDataHelper.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Logging Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System.Configuration; 13 | 14 | namespace Microsoft.Practices.EnterpriseLibrary.Logging.Configuration 15 | { 16 | internal class CustomTraceListenerDataHelper 17 | : BasicCustomTraceListenerDataHelper 18 | { 19 | private static readonly ConfigurationProperty formatterProperty = 20 | new ConfigurationProperty(CustomTraceListenerData.formatterNameProperty, 21 | typeof(string), 22 | null, // no reasonable default 23 | null, // use default converter 24 | null, // no validations 25 | ConfigurationPropertyOptions.None); 26 | 27 | internal CustomTraceListenerDataHelper(CustomTraceListenerData helpedCustomProviderData) 28 | : base(helpedCustomProviderData) 29 | { 30 | propertiesCollection.Add(formatterProperty); 31 | } 32 | 33 | protected override bool IsKnownPropertyName(string propertyName) 34 | { 35 | return base.IsKnownPropertyName(propertyName) 36 | || CustomTraceListenerData.formatterNameProperty.Equals(propertyName); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Source/Logging Application Block/Logging/Filters/LogFilter.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Logging Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | 13 | namespace Microsoft.Practices.EnterpriseLibrary.Logging.Filters 14 | { 15 | /// 16 | /// Abstract implementation of the interface. 17 | /// 18 | public abstract class LogFilter : ILogFilter 19 | { 20 | private string name; 21 | 22 | /// 23 | /// Initializes a new instance of . 24 | /// 25 | /// The name for the log filter. 26 | protected LogFilter(string name) 27 | { 28 | this.name = name; 29 | } 30 | 31 | /// 32 | /// Test to see if a message meets the criteria to be processed. 33 | /// 34 | /// Log entry to test. 35 | /// true if the message passes through the filter and should be logged, false otherwise. 36 | public abstract bool Filter(LogEntry log); 37 | 38 | /// 39 | /// Gets the name of the log filter 40 | /// 41 | public string Name 42 | { 43 | get { return name; } 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Source/Core/Common/Configuration/Design/TypeSelectorIncludes.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Core 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System; 13 | 14 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Design 15 | { 16 | /// 17 | /// Provides attributes for the filter of types. 18 | /// 19 | [Flags] 20 | public enum TypeSelectorIncludes 21 | { 22 | /// 23 | /// No filter are applied to types. 24 | /// 25 | None = 0x00, 26 | /// 27 | /// Inclue abstract types in the filter. 28 | /// 29 | AbstractTypes = 0x01, 30 | /// 31 | /// Inclue interfaces in the filter. 32 | /// 33 | Interfaces = 0x02, 34 | /// 35 | /// Inclue base types in the filter. 36 | /// 37 | BaseType = 0x04, 38 | /// 39 | /// Inclue non public types in the filter. 40 | /// 41 | NonpublicTypes = 0x08, 42 | /// 43 | /// Include all types in the filter. 44 | /// 45 | All = 0x0F 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Source/Logging Application Block/Logging/Configuration/Fluent/ILoggingConfigurationSpecialSources.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Logging Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | 13 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Fluent 14 | { 15 | 16 | /// 17 | /// Fluent interface used to configure pre defined logging categories. 18 | /// 19 | public interface ILoggingConfigurationSpecialSources : IFluentInterface 20 | { 21 | /// 22 | /// Returns an interface to configure the category source used for internal errors and warnings. 23 | /// 24 | ILoggingConfigurationCategoryStart LoggingErrorsAndWarningsCategory { get; } 25 | 26 | /// 27 | /// Returns an interface to configure the category source used to log messages that could not be processed 28 | /// 29 | ILoggingConfigurationCategoryStart UnprocessedCategory { get; } 30 | 31 | /// 32 | /// Returns an interface to configure the category source used to log all events. 33 | /// 34 | ILoggingConfigurationCategoryStart AllEventsCategory { get; } 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /Source/Validation Application Block/Validation/Validators/IgnoreNullsAttribute.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Validation Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System; 13 | 14 | namespace Microsoft.Practices.EnterpriseLibrary.Validation.Validators 15 | { 16 | /// 17 | /// Indicates that a value is to be allowed by the validator represented by the validation 18 | /// attributes for the language element this attribute is bound. 19 | /// 20 | /// 21 | [AttributeUsage(AttributeTargets.Property 22 | | AttributeTargets.Field 23 | | AttributeTargets.Method 24 | | AttributeTargets.Parameter, 25 | AllowMultiple = true, 26 | Inherited = false)] 27 | public sealed class IgnoreNullsAttribute : BaseValidationAttribute 28 | { 29 | private readonly Guid typeId = Guid.NewGuid(); 30 | 31 | /// 32 | /// Gets a unique identifier for this attribute. 33 | /// 34 | public override object TypeId 35 | { 36 | get 37 | { 38 | return this.typeId; 39 | } 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Source/Core/Common/Configuration/Manageability/NativeMethods.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Core 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System; 13 | using System.Runtime.InteropServices; 14 | using Microsoft.Win32.SafeHandles; 15 | 16 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Manageability 17 | { 18 | internal static class NativeMethods 19 | { 20 | [DllImport("userenv.dll", SetLastError = true, CharSet = CharSet.Auto)] 21 | [return: MarshalAs(UnmanagedType.Bool)] 22 | public static extern bool RegisterGPNotification(SafeWaitHandle hEvent, 23 | [MarshalAs(UnmanagedType.Bool)] bool bMachine); 24 | 25 | [DllImport("userenv.dll", SetLastError = true, CharSet = CharSet.Auto)] 26 | [return: MarshalAs(UnmanagedType.Bool)] 27 | public static extern bool UnregisterGPNotification(SafeWaitHandle hEvent); 28 | 29 | [DllImport("userenv.dll", SetLastError = true, CharSet = CharSet.Auto)] 30 | public static extern IntPtr EnterCriticalPolicySection([MarshalAs(UnmanagedType.Bool)] bool bMachine); 31 | 32 | [DllImport("userenv.dll", SetLastError = true, CharSet = CharSet.Auto)] 33 | [return: MarshalAs(UnmanagedType.Bool)] 34 | public static extern bool LeaveCriticalPolicySection(IntPtr handle); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Source/Cryptography Application Block/Security.Cryptography/ISymmetricCryptoProvider.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Cryptography Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | namespace Microsoft.Practices.EnterpriseLibrary.Security.Cryptography 13 | { 14 | /// 15 | /// A contract for any provider for configurable symmetric cryptographic implementations. 16 | /// 17 | public interface ISymmetricCryptoProvider 18 | { 19 | /// 20 | /// Encrypts a secret using a specified symmetric cryptography provider. 21 | /// 22 | /// The input for which you want to encrypt. 23 | /// The resulting cipher text. 24 | byte[] Encrypt(byte[] plaintext); 25 | 26 | /// 27 | /// Decrypts a cipher text using a specified symmetric cryptography provider. 28 | /// 29 | /// The cipher text for which you want to decrypt. 30 | /// The resulting plain text. 31 | byte[] Decrypt(byte[] ciphertext); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Source/Cryptography Application Block/Security.Cryptography/IHashProvider.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Cryptography Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | namespace Microsoft.Practices.EnterpriseLibrary.Security.Cryptography 13 | { 14 | /// 15 | /// A contract for any provider for configurable hash implementations. 16 | /// 17 | public interface IHashProvider 18 | { 19 | /// 20 | /// Computes the hash value of plain text. 21 | /// 22 | /// The input for which to compute the hash. 23 | /// The computed hash code. 24 | byte[] CreateHash(byte[] plaintext); 25 | 26 | /// 27 | /// Compares plain text input with a computed hash. 28 | /// 29 | /// The input for which you want to compare the hash to. 30 | /// The hash value for which you want to compare the input to. 31 | /// true if plainText hashed is equal to the hashedText. Otherwise, false. 32 | bool CompareHash(byte[] plaintext, byte[] hashedtext); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Source/Core/Common/Configuration/ContainerModel/IContainerConfigurator.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Core 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel 13 | { 14 | /// 15 | /// Implement this interface to create an object that can read a set 16 | /// of objects representing the current 17 | /// Enterprise Library configuration and configure a dependency injection 18 | /// container with that information. 19 | /// 20 | /// 21 | public interface IContainerConfigurator 22 | { 23 | /// 24 | /// Consume the set of objects and 25 | /// configure the associated container. 26 | /// 27 | /// Configuration source to read registrations from. 28 | /// that knows how to 29 | /// read the and return all relevant type registrations. 30 | void RegisterAll(IConfigurationSource configurationSource, ITypeRegistrationsProvider rootProvider); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Source/Cryptography Application Block/Security.Cryptography/Configuration/Manageability/CustomHashProviderDataManageabilityProvider.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Cryptography Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Manageability; 13 | using Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.Configuration.Manageability.Properties; 14 | 15 | namespace Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.Configuration.Manageability 16 | { 17 | /// 18 | /// Provides an implementation for that 19 | /// processes policy overrides, performing appropriate logging of 20 | /// policy processing errors. 21 | /// 22 | public class CustomHashProviderDataManageabilityProvider 23 | : CustomProviderDataManageabilityProvider 24 | { 25 | /// 26 | /// Initialize a new instance of the class. 27 | /// 28 | public CustomHashProviderDataManageabilityProvider() 29 | : base(Resources.HashProviderPolicyNameTemplate) 30 | { 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Source/Cryptography Application Block/Security.Cryptography/Configuration/Fluent/IEncryptUsingCustomHashProviderNamed.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Cryptography Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System; 13 | using System.Collections.Generic; 14 | using System.Linq; 15 | using System.Text; 16 | using Microsoft.Practices.EnterpriseLibrary.Security.Cryptography; 17 | using Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.Configuration; 18 | 19 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Fluent 20 | { 21 | /// 22 | /// Fluent interface used to configure a custom instance. 23 | /// 24 | /// 25 | public interface IEncryptUsingCustomHashProviderNamed : IConfigureCryptography, IFluentInterface 26 | { 27 | /// 28 | /// Specifies this custom should be the cryptography blocks default instance. 29 | /// 30 | /// Fluent interface to further configure cryptography settings. 31 | /// 32 | IConfigureCryptography SetAsDefault(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Source/Caching Application Block/Caching/Configuration/Fluent/ICachingConfigurationCustomCacheManager.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Caching Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System; 13 | using System.Collections.Generic; 14 | using System.Linq; 15 | using System.Text; 16 | using Microsoft.Practices.EnterpriseLibrary.Common.Configuration; 17 | using Microsoft.Practices.EnterpriseLibrary.Caching.Configuration; 18 | using Microsoft.Practices.EnterpriseLibrary.Caching.Properties; 19 | 20 | namespace Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Fluent 21 | { 22 | /// 23 | /// Fluent interface used to configure a custom cache manager. 24 | /// 25 | /// 26 | public interface ICachingConfigurationCustomCacheManager : ICachingConfiguration, IFluentInterface 27 | { 28 | /// 29 | /// Specifies the current custom cache manager as the default cache manager instance. 30 | /// 31 | /// Fluent interface that can be used to further configure this custom cache manager. 32 | /// 33 | ICachingConfigurationCustomCacheManager UseAsDefaultCache(); 34 | 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Source/Validation Application Block/Validation/IValidatorDescriptor.cs: -------------------------------------------------------------------------------- 1 | //=============================================================================== 2 | // Microsoft patterns & practices Enterprise Library 3 | // Validation Application Block 4 | //=============================================================================== 5 | // Copyright © Microsoft Corporation. All rights reserved. 6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY 7 | // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT 8 | // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 9 | // FITNESS FOR A PARTICULAR PURPOSE. 10 | //=============================================================================== 11 | 12 | using System; 13 | 14 | namespace Microsoft.Practices.EnterpriseLibrary.Validation 15 | { 16 | /// 17 | /// Represents the behavior to create a validator for a target type. 18 | /// 19 | public interface IValidatorDescriptor 20 | { 21 | /// 22 | /// Creates the respresented . 23 | /// 24 | /// The type of object that will be validated by the validator. 25 | /// The type of the object from which the value to validate is extracted. 26 | /// The to use for validators that 27 | /// require access to properties. 28 | /// Factory to use when building nested validators. 29 | /// The new . 30 | Validator CreateValidator(Type targetType, Type ownerType, MemberValueAccessBuilder memberValueAccessBuilder, ValidatorFactory validatorFactory); 31 | } 32 | } 33 | --------------------------------------------------------------------------------