Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / System.Activities / System / Activities / Statements / FlowDecision.cs / 1305376 / FlowDecision.cs
//------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------
namespace System.Activities.Statements
{
using System;
using System.Activities;
using System.Activities.Expressions;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq.Expressions;
using System.Windows.Markup;
public sealed class FlowDecision : FlowNode
{
public FlowDecision()
{
}
public FlowDecision(Expression> condition)
: this()
{
if (condition == null)
{
throw FxTrace.Exception.ArgumentNull("condition");
}
this.Condition = new LambdaValue(condition);
}
public FlowDecision(Activity condition)
: this()
{
if (condition == null)
{
throw FxTrace.Exception.ArgumentNull("condition");
}
this.Condition = condition;
}
[DefaultValue(null)]
public Activity Condition
{
get;
set;
}
[DefaultValue(null)]
[DependsOn("Condition")]
public FlowNode True
{
get;
set;
}
[DefaultValue(null)]
[DependsOn("True")]
public FlowNode False
{
get;
set;
}
internal override void OnOpen(Flowchart owner, NativeActivityMetadata metadata)
{
if (this.Condition == null)
{
metadata.AddValidationError(SR.FlowDecisionRequiresCondition(owner.DisplayName));
}
}
internal override void GetConnectedNodes(IList connections)
{
if (True != null)
{
connections.Add(True);
}
if (False != null)
{
connections.Add(False);
}
}
internal override void GetChildActivities(ICollection children)
{
if (Condition != null)
{
children.Add(Condition);
}
}
internal bool Execute(NativeActivityContext context, CompletionCallback onConditionCompleted)
{
context.ScheduleActivity(Condition, onConditionCompleted);
return false;
}
}
}
// 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
- EnvelopedPkcs7.cs
- DriveInfo.cs
- MatrixCamera.cs
- Visual3D.cs
- WorkflowTimerService.cs
- TraceHandlerErrorFormatter.cs
- WinCategoryAttribute.cs
- HitTestResult.cs
- CheckBox.cs
- DescendantBaseQuery.cs
- ValueUtilsSmi.cs
- ADMembershipUser.cs
- HttpResponseHeader.cs
- GridViewColumnCollectionChangedEventArgs.cs
- PersistChildrenAttribute.cs
- securitycriticaldataClass.cs
- PixelFormatConverter.cs
- TabItem.cs
- XhtmlBasicControlAdapter.cs
- DependsOnAttribute.cs
- ConstraintManager.cs
- CompilationUtil.cs
- GridViewRowPresenter.cs
- ProcessHostFactoryHelper.cs
- CachedBitmap.cs
- XmlIlTypeHelper.cs
- COM2FontConverter.cs
- DocumentPaginator.cs
- DataControlFieldTypeEditor.cs
- DataGridViewUtilities.cs
- DataFormat.cs
- RealizedColumnsBlock.cs
- Model3D.cs
- SoapServerMessage.cs
- FontFamilyIdentifier.cs
- Cursors.cs
- DependencyObjectPropertyDescriptor.cs
- HttpCookie.cs
- DataGridDefaultColumnWidthTypeConverter.cs
- TextParaLineResult.cs
- InternalResources.cs
- XmlEventCache.cs
- EntityReference.cs
- HtmlImage.cs
- XmlDownloadManager.cs
- DataReceivedEventArgs.cs
- EmptyStringExpandableObjectConverter.cs
- HttpModuleActionCollection.cs
- ButtonBaseDesigner.cs
- BitmapSource.cs
- GZipStream.cs
- OracleRowUpdatedEventArgs.cs
- ControlIdConverter.cs
- FrameworkName.cs
- InsufficientMemoryException.cs
- SQLInt32.cs
- GenericAuthenticationEventArgs.cs
- PropertyNames.cs
- ScriptResourceInfo.cs
- CodeDelegateCreateExpression.cs
- ComProxy.cs
- ScrollItemPattern.cs
- IdentityReference.cs
- EditorPartChrome.cs
- RedirectionProxy.cs
- ProfilePropertyMetadata.cs
- TypeUtil.cs
- ReceiveMessageContent.cs
- ServiceContractListItemList.cs
- DelayedRegex.cs
- InstanceValue.cs
- Converter.cs
- ReadOnlyDictionary.cs
- DictionaryContent.cs
- SecurityKeyIdentifier.cs
- SettingsPropertyNotFoundException.cs
- TextEffectCollection.cs
- RowSpanVector.cs
- GetCryptoTransformRequest.cs
- Form.cs
- BrowserCapabilitiesFactory35.cs
- RawStylusInputReport.cs
- CrossSiteScriptingValidation.cs
- UpdateEventArgs.cs
- TreeNodeEventArgs.cs
- RegistryKey.cs
- MailWebEventProvider.cs
- PersianCalendar.cs
- ExpressionConverter.cs
- FactoryId.cs
- VersionConverter.cs
- HtmlInputRadioButton.cs
- TextServicesCompartment.cs
- Table.cs
- MouseGesture.cs
- DataServiceQuery.cs
- HeaderedItemsControl.cs
- SchemaTypeEmitter.cs
- DataGridViewCellConverter.cs
- Internal.cs