Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Services / Messaging / System / Messaging / ValidationUtility.cs / 1305376 / ValidationUtility.cs
namespace System.Messaging { using System; internal static class ValidationUtility { public static bool ValidateAccessControlEntryType(AccessControlEntryType value) { return (value >= AccessControlEntryType.Allow) && (value <= AccessControlEntryType.Revoke); } public static bool ValidateCryptographicProviderType(CryptographicProviderType value) { return (value >= CryptographicProviderType.None) && (value <= CryptographicProviderType.SttIss); } public static bool ValidateEncryptionAlgorithm(EncryptionAlgorithm value) { // // note that EncryptionAlgorithm has disjoined values // return (value == EncryptionAlgorithm.None) || (value == EncryptionAlgorithm.Rc2) || (value == EncryptionAlgorithm.Rc4); } public static bool ValidateEncryptionRequired(EncryptionRequired value) { return (value >= EncryptionRequired.None) && (value <=EncryptionRequired.Body); } public static bool ValidateHashAlgorithm(HashAlgorithm value) { // // note that HashAlgorithm has disjoined values // return (value == HashAlgorithm.None) || (value == HashAlgorithm.Md2) || (value == HashAlgorithm.Md4) || (value == HashAlgorithm.Md5) || (value == HashAlgorithm.Sha) || (value == HashAlgorithm.Mac); } public static bool ValidateMessageLookupAction(MessageLookupAction value) { // // note that MessageLookupAction has disjoined values // return (value == MessageLookupAction.Current) || (value == MessageLookupAction.Next) || (value == MessageLookupAction.Previous) || (value == MessageLookupAction.First) || (value == MessageLookupAction.Last); } public static bool ValidateMessagePriority(MessagePriority value) { return (value >= MessagePriority.Lowest) && (value <= MessagePriority.Highest); } public static bool ValidateMessageQueueTransactionType(MessageQueueTransactionType value) { // // note that MessageQueueTransactionType has disjoined values // return (value == MessageQueueTransactionType.None) || (value == MessageQueueTransactionType.Automatic) || (value == MessageQueueTransactionType.Single); } public static bool ValidateQueueAccessMode(QueueAccessMode value) { // // note that QueueAccessMode has disjoined values // return (value == QueueAccessMode.Send) || (value == QueueAccessMode.Peek) || (value == QueueAccessMode.Receive) || (value == QueueAccessMode.PeekAndAdmin) || (value == QueueAccessMode.ReceiveAndAdmin) || (value == QueueAccessMode.SendAndReceive); } public static bool ValidateTrusteeType(TrusteeType trustee) { return (trustee >= TrusteeType.Unknown) && (trustee <= TrusteeType.Computer); } } //class ValidationUtility } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. namespace System.Messaging { using System; internal static class ValidationUtility { public static bool ValidateAccessControlEntryType(AccessControlEntryType value) { return (value >= AccessControlEntryType.Allow) && (value <= AccessControlEntryType.Revoke); } public static bool ValidateCryptographicProviderType(CryptographicProviderType value) { return (value >= CryptographicProviderType.None) && (value <= CryptographicProviderType.SttIss); } public static bool ValidateEncryptionAlgorithm(EncryptionAlgorithm value) { // // note that EncryptionAlgorithm has disjoined values // return (value == EncryptionAlgorithm.None) || (value == EncryptionAlgorithm.Rc2) || (value == EncryptionAlgorithm.Rc4); } public static bool ValidateEncryptionRequired(EncryptionRequired value) { return (value >= EncryptionRequired.None) && (value <=EncryptionRequired.Body); } public static bool ValidateHashAlgorithm(HashAlgorithm value) { // // note that HashAlgorithm has disjoined values // return (value == HashAlgorithm.None) || (value == HashAlgorithm.Md2) || (value == HashAlgorithm.Md4) || (value == HashAlgorithm.Md5) || (value == HashAlgorithm.Sha) || (value == HashAlgorithm.Mac); } public static bool ValidateMessageLookupAction(MessageLookupAction value) { // // note that MessageLookupAction has disjoined values // return (value == MessageLookupAction.Current) || (value == MessageLookupAction.Next) || (value == MessageLookupAction.Previous) || (value == MessageLookupAction.First) || (value == MessageLookupAction.Last); } public static bool ValidateMessagePriority(MessagePriority value) { return (value >= MessagePriority.Lowest) && (value <= MessagePriority.Highest); } public static bool ValidateMessageQueueTransactionType(MessageQueueTransactionType value) { // // note that MessageQueueTransactionType has disjoined values // return (value == MessageQueueTransactionType.None) || (value == MessageQueueTransactionType.Automatic) || (value == MessageQueueTransactionType.Single); } public static bool ValidateQueueAccessMode(QueueAccessMode value) { // // note that QueueAccessMode has disjoined values // return (value == QueueAccessMode.Send) || (value == QueueAccessMode.Peek) || (value == QueueAccessMode.Receive) || (value == QueueAccessMode.PeekAndAdmin) || (value == QueueAccessMode.ReceiveAndAdmin) || (value == QueueAccessMode.SendAndReceive); } public static bool ValidateTrusteeType(TrusteeType trustee) { return (trustee >= TrusteeType.Unknown) && (trustee <= TrusteeType.Computer); } } //class ValidationUtility } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CorePropertiesFilter.cs
- XamlClipboardData.cs
- ProviderException.cs
- CacheEntry.cs
- UserNameSecurityTokenAuthenticator.cs
- TimerElapsedEvenArgs.cs
- ScriptResourceHandler.cs
- QilList.cs
- _emptywebproxy.cs
- ImageUrlEditor.cs
- GridViewDeletedEventArgs.cs
- SynchronizedCollection.cs
- COM2DataTypeToManagedDataTypeConverter.cs
- SafeNativeMethods.cs
- WebPartPersonalization.cs
- ComponentSerializationService.cs
- URLEditor.cs
- OutputCacheSection.cs
- EncodingInfo.cs
- CommaDelimitedStringAttributeCollectionConverter.cs
- DataTableClearEvent.cs
- DesignerHelpers.cs
- DWriteFactory.cs
- StatusBarDesigner.cs
- controlskin.cs
- DbConnectionInternal.cs
- hresults.cs
- InteropBitmapSource.cs
- ComPlusTraceRecord.cs
- IList.cs
- SessionParameter.cs
- PersonalizationStateInfo.cs
- XmlSchemaAnnotation.cs
- Constraint.cs
- _CacheStreams.cs
- DispatcherObject.cs
- FrugalList.cs
- OdbcDataAdapter.cs
- SoapAttributes.cs
- CategoryAttribute.cs
- SecurityElement.cs
- BasicCommandTreeVisitor.cs
- FontClient.cs
- EntityAdapter.cs
- ParamArrayAttribute.cs
- WindowsToolbarItemAsMenuItem.cs
- BitSet.cs
- MaxMessageSizeStream.cs
- EditingMode.cs
- SrgsNameValueTag.cs
- XmlComment.cs
- StringAnimationUsingKeyFrames.cs
- EventLog.cs
- DesignerAutoFormat.cs
- DataSourceControlBuilder.cs
- Style.cs
- TemplateXamlParser.cs
- WmlTextViewAdapter.cs
- ToolboxDataAttribute.cs
- HandlerFactoryCache.cs
- CodeLinePragma.cs
- GradientBrush.cs
- _SSPISessionCache.cs
- CommandHelpers.cs
- GrammarBuilderWildcard.cs
- ValidatorCompatibilityHelper.cs
- uribuilder.cs
- SmtpNegotiateAuthenticationModule.cs
- FileUtil.cs
- RoutedPropertyChangedEventArgs.cs
- DurableEnlistmentState.cs
- LicenseException.cs
- DataGridViewRowEventArgs.cs
- ReadOnlyHierarchicalDataSource.cs
- DiscriminatorMap.cs
- Collection.cs
- ValidatorUtils.cs
- UInt16Converter.cs
- XmlArrayItemAttributes.cs
- CompatibleComparer.cs
- CapacityStreamGeometryContext.cs
- GlobalizationSection.cs
- GetReadStreamResult.cs
- NumberFormatInfo.cs
- COM2ExtendedBrowsingHandler.cs
- StringOutput.cs
- SafeIUnknown.cs
- loginstatus.cs
- TextRunTypographyProperties.cs
- MultiDataTrigger.cs
- ColumnClickEvent.cs
- Error.cs
- _ContextAwareResult.cs
- HtmlCommandAdapter.cs
- SyndicationLink.cs
- BitmapImage.cs
- StatusBar.cs
- PreservationFileReader.cs
- CookieHandler.cs
- QueryContinueDragEvent.cs