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
- CatalogZone.cs
- PathStreamGeometryContext.cs
- DataGridViewHitTestInfo.cs
- Rule.cs
- PersistChildrenAttribute.cs
- ColumnCollection.cs
- CodeTypeDeclarationCollection.cs
- SplineKeyFrames.cs
- CompositionAdorner.cs
- TextEditorMouse.cs
- ImageList.cs
- XsdDateTime.cs
- ReadOnlyCollection.cs
- DataControlCommands.cs
- SQLByte.cs
- XmlException.cs
- GroupDescription.cs
- Shape.cs
- CompiledQuery.cs
- FormatterConverter.cs
- SynchronizationScope.cs
- SqlVersion.cs
- MembershipPasswordException.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- CellConstant.cs
- ILGenerator.cs
- QuaternionRotation3D.cs
- WebPartTracker.cs
- BitmapEffect.cs
- Base64Encoder.cs
- BitSet.cs
- XPathExpr.cs
- WizardSideBarListControlItem.cs
- EventRecord.cs
- Empty.cs
- Label.cs
- ScrollData.cs
- RawUIStateInputReport.cs
- BindingNavigator.cs
- ShapingEngine.cs
- SqlConnectionStringBuilder.cs
- DefaultAsyncDataDispatcher.cs
- FixedElement.cs
- StatusBarPanelClickEvent.cs
- BehaviorDragDropEventArgs.cs
- BufferedMessageData.cs
- StickyNote.cs
- FreezableOperations.cs
- DemultiplexingClientMessageFormatter.cs
- Atom10FormatterFactory.cs
- ToolStripTemplateNode.cs
- UpDownBase.cs
- SecurityKeyIdentifier.cs
- CombinedGeometry.cs
- SamlAssertion.cs
- NetworkStream.cs
- GroupItem.cs
- Transactions.cs
- CodeMemberField.cs
- SpanIndex.cs
- TextServicesHost.cs
- translator.cs
- MultiBindingExpression.cs
- EnvironmentPermission.cs
- SystemTcpStatistics.cs
- AnimationTimeline.cs
- WebBrowserHelper.cs
- MultiTrigger.cs
- Point3D.cs
- MultitargetingHelpers.cs
- CornerRadius.cs
- SimpleHandlerFactory.cs
- LabelDesigner.cs
- DataObjectSettingDataEventArgs.cs
- DoubleAnimationUsingKeyFrames.cs
- MissingMemberException.cs
- PagesSection.cs
- TransportChannelFactory.cs
- UpdatePanelTriggerCollection.cs
- PageTheme.cs
- SortQueryOperator.cs
- BitmapCacheBrush.cs
- SessionParameter.cs
- IndentTextWriter.cs
- ClientRoleProvider.cs
- TextStore.cs
- SimpleType.cs
- ListItemConverter.cs
- AuthorizationContext.cs
- StorageAssociationTypeMapping.cs
- HttpClientProtocol.cs
- BamlTreeUpdater.cs
- DocumentCollection.cs
- DataPointer.cs
- JournalEntryStack.cs
- DBPropSet.cs
- SoapMessage.cs
- TransformerTypeCollection.cs
- ExtensionFile.cs
- HttpProfileGroupBase.cs