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
- ScriptDescriptor.cs
- TextChangedEventArgs.cs
- IChannel.cs
- SqlColumnizer.cs
- OwnerDrawPropertyBag.cs
- WebPartManagerDesigner.cs
- ContextQuery.cs
- ReadWriteSpinLock.cs
- ColumnReorderedEventArgs.cs
- PolyLineSegmentFigureLogic.cs
- CodeConstructor.cs
- PrimitiveCodeDomSerializer.cs
- ClientUrlResolverWrapper.cs
- HttpConfigurationSystem.cs
- MenuBase.cs
- StandardCommands.cs
- LayoutSettings.cs
- CodeEventReferenceExpression.cs
- Encoding.cs
- EntityTypeEmitter.cs
- SqlOuterApplyReducer.cs
- RolePrincipal.cs
- WindowsBrush.cs
- CompilerLocalReference.cs
- LinearGradientBrush.cs
- __Filters.cs
- ZipIOBlockManager.cs
- SessionStateItemCollection.cs
- DelayDesigner.cs
- TaskDesigner.cs
- ServiceModelStringsVersion1.cs
- SettingsProviderCollection.cs
- ConfigurationElementCollection.cs
- Compensation.cs
- TextBox.cs
- VisualState.cs
- GridViewCancelEditEventArgs.cs
- WebColorConverter.cs
- ActiveXMessageFormatter.cs
- UriScheme.cs
- DesignerTransaction.cs
- SpellerStatusTable.cs
- WSHttpBinding.cs
- CriticalFinalizerObject.cs
- SchemaTableOptionalColumn.cs
- EditorPartChrome.cs
- BeginStoryboard.cs
- XmlElementAttributes.cs
- DataColumnSelectionConverter.cs
- MultipleViewPatternIdentifiers.cs
- ByteArrayHelperWithString.cs
- Style.cs
- GridViewColumnCollection.cs
- DocumentOrderQuery.cs
- SafeArrayTypeMismatchException.cs
- FileDetails.cs
- PrimitiveType.cs
- wgx_render.cs
- DesignColumn.cs
- HtmlHead.cs
- Trace.cs
- ProcessModuleCollection.cs
- WriteTimeStream.cs
- BaseCodePageEncoding.cs
- FormsAuthenticationConfiguration.cs
- DataPagerFieldCommandEventArgs.cs
- EmptyElement.cs
- RewritingValidator.cs
- ButtonAutomationPeer.cs
- EventManager.cs
- SiteMapNodeCollection.cs
- PaginationProgressEventArgs.cs
- SqlUDTStorage.cs
- CodeLinePragma.cs
- IOException.cs
- ProfileWorkflowElement.cs
- MaskedTextBox.cs
- COM2PictureConverter.cs
- AssemblySettingAttributes.cs
- PreloadedPackages.cs
- FlowDocumentReaderAutomationPeer.cs
- XappLauncher.cs
- PageStatePersister.cs
- CodeCatchClause.cs
- StateFinalizationDesigner.cs
- ALinqExpressionVisitor.cs
- TypeBuilderInstantiation.cs
- CodeSubDirectory.cs
- Vector3D.cs
- Storyboard.cs
- TargetInvocationException.cs
- AsymmetricSignatureFormatter.cs
- OutArgumentConverter.cs
- FrameworkElementFactoryMarkupObject.cs
- ExtendedTransformFactory.cs
- DataBindingCollection.cs
- TransactionCache.cs
- InheritanceContextChangedEventManager.cs
- DesignBindingPropertyDescriptor.cs
- RecommendedAsConfigurableAttribute.cs