Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx35 / System.WorkflowServices / System / Workflow / Activities / ReceiveActivityValidator.cs / 1305376 / ReceiveActivityValidator.cs
//------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------
namespace System.Workflow.Activities
{
using System.ServiceModel;
using System.Reflection;
using System.Collections.Generic;
using System.Workflow.ComponentModel;
using System.Workflow.ComponentModel.Compiler;
class ReceiveActivityValidator : CompositeActivityValidator
{
public override ValidationErrorCollection Validate(
ValidationManager manager,
object obj)
{
ValidationErrorCollection validationErrors = base.Validate(manager, obj);
ReceiveActivity receiveActivity = obj as ReceiveActivity;
if (receiveActivity == null)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument("obj",
SR2.GetString(SR2.Error_ArgumentTypeInvalid, "obj", typeof(ReceiveActivity)));
}
ITypeProvider typeProvider = manager.GetService(typeof(ITypeProvider)) as ITypeProvider;
if (typeProvider == null)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(
SR2.GetString(SR2.General_MissingService, typeof(ITypeProvider).Name)));
}
if (receiveActivity.ServiceOperationInfo == null)
{
validationErrors.Add(
new ValidationError(
SR2.GetString(SR2.Error_Validation_OperationInfoNotSpecified, receiveActivity.Name),
WorkflowServicesErrorNumbers.Error_OperationInfoNotSpecified,
false,
"ServiceOperationInfo"));
}
else
{
// validate operation info
//
ValidationErrorCollection operationInfoValidationErrors =
ValidationHelper.ValidateOperationInfo(
receiveActivity,
receiveActivity.ServiceOperationInfo,
manager);
validationErrors.AddRange(operationInfoValidationErrors);
// do not validate parameter binding if the operation info is not valid
// we might generate noise and false positives.
//
if (operationInfoValidationErrors.Count == 0)
{
validationErrors.AddRange(
ValidationHelper.ValidateParameterBindings(receiveActivity, receiveActivity.ServiceOperationInfo,
receiveActivity.ParameterBindings, manager));
}
// validate the context token
//
validationErrors.AddRange(
ValidationHelper.ValidateContextToken(receiveActivity, receiveActivity.ContextToken, manager));
}
// Check if the validation for all service operations being implemented
// has been done previously.
// If it has been done once then ServiceOperationsImplementedValidationMarker
// will be on the context stack.
//
if (validationErrors.Count == 0 &&
manager.Context[typeof(ServiceOperationsImplementedValidationMarker)] == null)
{
Activity rootActivity = receiveActivity;
while (rootActivity.Parent != null)
{
rootActivity = rootActivity.Parent;
}
validationErrors.AddRange(
ValidationHelper.ValidateAllServiceOperationsImplemented(
manager,
rootActivity));
}
return validationErrors;
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- PropertyNames.cs
- ProcessModule.cs
- TemplateBaseAction.cs
- PrintDialog.cs
- ButtonColumn.cs
- EventDescriptor.cs
- PreviewPrintController.cs
- DataSourceUtil.cs
- ContainerParaClient.cs
- BookmarkNameHelper.cs
- PasswordPropertyTextAttribute.cs
- EventLog.cs
- ImageCodecInfo.cs
- MatrixTransform.cs
- MimeTypeMapper.cs
- COM2ICategorizePropertiesHandler.cs
- XhtmlBasicSelectionListAdapter.cs
- GraphicsContext.cs
- ReferencedCollectionType.cs
- remotingproxy.cs
- InvariantComparer.cs
- SqlParameter.cs
- Transform3DGroup.cs
- DSASignatureFormatter.cs
- Shape.cs
- Focus.cs
- XmlUtf8RawTextWriter.cs
- ResourceDisplayNameAttribute.cs
- XPathMessageFilter.cs
- MobileListItemCollection.cs
- thaishape.cs
- CTreeGenerator.cs
- WindowsAltTab.cs
- NativeMethodsCLR.cs
- HttpProcessUtility.cs
- PageTheme.cs
- RuntimeArgumentHandle.cs
- AttributeCallbackBuilder.cs
- XmlEventCache.cs
- SHA384Managed.cs
- ChannelManager.cs
- TypeConverterAttribute.cs
- BinaryMethodMessage.cs
- LifetimeServices.cs
- SessionViewState.cs
- SendSecurityHeaderElement.cs
- BindToObject.cs
- LassoHelper.cs
- TextParagraphCache.cs
- CalendarKeyboardHelper.cs
- ServicesExceptionNotHandledEventArgs.cs
- SharedConnectionInfo.cs
- ResumeStoryboard.cs
- DataControlButton.cs
- MessageSmuggler.cs
- WebBaseEventKeyComparer.cs
- ConfigurationManager.cs
- SchemaHelper.cs
- AnimationClock.cs
- RichTextBox.cs
- FileLevelControlBuilderAttribute.cs
- WindowHideOrCloseTracker.cs
- RegexInterpreter.cs
- Configuration.cs
- QueueProcessor.cs
- Scene3D.cs
- RewritingPass.cs
- DynamicValidatorEventArgs.cs
- PhysicalFontFamily.cs
- ContentFileHelper.cs
- GreaterThanOrEqual.cs
- ComplexBindingPropertiesAttribute.cs
- ClientRoleProvider.cs
- HttpServerVarsCollection.cs
- DragDeltaEventArgs.cs
- ListenerConnectionModeReader.cs
- SplitterPanelDesigner.cs
- SqlDataReaderSmi.cs
- ContainerFilterService.cs
- FormattedTextSymbols.cs
- DrawTreeNodeEventArgs.cs
- CodeObjectCreateExpression.cs
- ControlHelper.cs
- FormViewRow.cs
- MethodAccessException.cs
- FontFamilyValueSerializer.cs
- XmlNotation.cs
- WebDisplayNameAttribute.cs
- PerformanceCounterPermissionEntryCollection.cs
- ButtonChrome.cs
- SectionInput.cs
- X500Name.cs
- BufferedWebEventProvider.cs
- EventLogHandle.cs
- EntityAdapter.cs
- CompositeFontFamily.cs
- RestClientProxyHandler.cs
- SmiContextFactory.cs
- PropertySourceInfo.cs
- PageThemeCodeDomTreeGenerator.cs