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
- SingleStorage.cs
- WindowsListViewSubItem.cs
- SystemBrushes.cs
- WindowsSspiNegotiation.cs
- ObjectQueryExecutionPlan.cs
- RecommendedAsConfigurableAttribute.cs
- IndentedTextWriter.cs
- HttpListener.cs
- DrawingDrawingContext.cs
- ComplexPropertyEntry.cs
- Int32KeyFrameCollection.cs
- KernelTypeValidation.cs
- PromptEventArgs.cs
- EventLogPermissionEntryCollection.cs
- LZCodec.cs
- MetadataPropertyAttribute.cs
- ReflectionPermission.cs
- IdentifierCollection.cs
- ResourceProperty.cs
- basenumberconverter.cs
- ColorTransform.cs
- securestring.cs
- PageRanges.cs
- SessionStateItemCollection.cs
- WorkflowInstanceProxy.cs
- TablePattern.cs
- WindowsSolidBrush.cs
- CatalogZone.cs
- EditableLabelControl.cs
- HTMLTextWriter.cs
- RoleManagerModule.cs
- TreeViewAutomationPeer.cs
- CircleHotSpot.cs
- CodeCastExpression.cs
- DataGridViewCellMouseEventArgs.cs
- WebPartEditorCancelVerb.cs
- PolygonHotSpot.cs
- XPathDocumentNavigator.cs
- BaseTemplateBuildProvider.cs
- FixedLineResult.cs
- UserInitiatedRoutedEventPermissionAttribute.cs
- SessionParameter.cs
- XmlArrayItemAttributes.cs
- Repeater.cs
- Mappings.cs
- DispatcherHooks.cs
- ResourceProviderFactory.cs
- CodeCommentStatementCollection.cs
- NamespaceTable.cs
- SelfSignedCertificate.cs
- SelectedGridItemChangedEvent.cs
- BookmarkEventArgs.cs
- ResourceExpressionBuilder.cs
- ADMembershipProvider.cs
- AsymmetricSignatureDeformatter.cs
- WindowsToolbarAsMenu.cs
- MouseButtonEventArgs.cs
- NameObjectCollectionBase.cs
- MenuItemBinding.cs
- RichTextBox.cs
- _AuthenticationState.cs
- Evidence.cs
- OciLobLocator.cs
- TriState.cs
- CharEnumerator.cs
- TypeExtensionConverter.cs
- ReferentialConstraint.cs
- DataGridViewSelectedColumnCollection.cs
- ArraySortHelper.cs
- StructuralCache.cs
- GestureRecognitionResult.cs
- TextModifierScope.cs
- XmlNavigatorStack.cs
- ModelVisual3D.cs
- XmlCodeExporter.cs
- Root.cs
- DataTablePropertyDescriptor.cs
- ActivityCollectionMarkupSerializer.cs
- LogStore.cs
- ManagementObjectCollection.cs
- InlineCollection.cs
- ArgumentOutOfRangeException.cs
- SemaphoreSecurity.cs
- BulletDecorator.cs
- FontCacheLogic.cs
- OleServicesContext.cs
- EqualityComparer.cs
- SecurityTokenValidationException.cs
- ProfessionalColorTable.cs
- __FastResourceComparer.cs
- PageThemeBuildProvider.cs
- ResourceReferenceExpression.cs
- OptionUsage.cs
- OleDbCommand.cs
- SpeechRecognizer.cs
- FileUtil.cs
- WebPartRestoreVerb.cs
- HttpInputStream.cs
- InheritedPropertyDescriptor.cs
- Int16Converter.cs