Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / System.Activities / System / Activities / AsyncCodeActivityContext.cs / 1305376 / AsyncCodeActivityContext.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.Activities { using System.Activities.Runtime; using System.Runtime; [Fx.Tag.XamlVisible(false)] public sealed class AsyncCodeActivityContext : CodeActivityContext { AsyncOperationContext asyncContext; internal AsyncCodeActivityContext(AsyncOperationContext asyncContext, ActivityInstance instance, ActivityExecutor executor) : base(instance, executor) { this.asyncContext = asyncContext; } public bool IsCancellationRequested { get { ThrowIfDisposed(); return this.CurrentInstance.IsCancellationRequested; } } public object UserState { get { ThrowIfDisposed(); return this.asyncContext.UserState; } set { ThrowIfDisposed(); this.asyncContext.UserState = value; } } public void MarkCanceled() { ThrowIfDisposed(); // This is valid to be called while aborting or while canceling if (!this.CurrentInstance.IsCancellationRequested && !this.asyncContext.IsAborting) { throw FxTrace.Exception.AsError(new InvalidOperationException(SR.MarkCanceledOnlyCallableIfCancelRequested)); } this.CurrentInstance.MarkCanceled(); } } } // 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
- AutomationPeer.cs
- StringUtil.cs
- ToolStripItemCollection.cs
- CommentAction.cs
- DoubleConverter.cs
- FragmentQuery.cs
- QueryStack.cs
- LocationFactory.cs
- Substitution.cs
- SkinIDTypeConverter.cs
- WarningException.cs
- RelationshipConstraintValidator.cs
- ErrorsHelper.cs
- FontStretches.cs
- Compiler.cs
- ParallelActivityDesigner.cs
- SrgsGrammar.cs
- MethodBuilderInstantiation.cs
- TypedElement.cs
- LinqMaximalSubtreeNominator.cs
- HwndSubclass.cs
- SQLChars.cs
- ImageIndexConverter.cs
- ImplicitInputBrush.cs
- ResourceCategoryAttribute.cs
- ButtonBaseAdapter.cs
- NotifyIcon.cs
- IfElseDesigner.xaml.cs
- GridViewColumnCollection.cs
- ObservableCollection.cs
- MemberProjectionIndex.cs
- XmlDictionaryWriter.cs
- NumericExpr.cs
- InfoCardListRequest.cs
- MarkupObject.cs
- TogglePatternIdentifiers.cs
- PrePostDescendentsWalker.cs
- TextOutput.cs
- SerialReceived.cs
- MobileCategoryAttribute.cs
- FormatterConverter.cs
- Reference.cs
- BoolExpressionVisitors.cs
- SubMenuStyleCollection.cs
- ListView.cs
- ThreadStartException.cs
- UnsafeNativeMethods.cs
- SvcMapFileLoader.cs
- ExceptionTranslationTable.cs
- MailWebEventProvider.cs
- InfoCardArgumentException.cs
- Baml2006ReaderFrame.cs
- TreeViewItem.cs
- RawMouseInputReport.cs
- XmlMemberMapping.cs
- Parser.cs
- RelationshipSet.cs
- PerfProviderCollection.cs
- ObjectReaderCompiler.cs
- ContentIterators.cs
- DecoderFallbackWithFailureFlag.cs
- XmlAttributeAttribute.cs
- MsmqIntegrationElement.cs
- EmptyControlCollection.cs
- ProfileService.cs
- HMAC.cs
- QuotedStringFormatReader.cs
- SafeThreadHandle.cs
- LinqDataSourceDisposeEventArgs.cs
- _LazyAsyncResult.cs
- ADRoleFactory.cs
- SqlHelper.cs
- LocatorPartList.cs
- EventSourceCreationData.cs
- CollaborationHelperFunctions.cs
- NotifyIcon.cs
- SmiMetaDataProperty.cs
- ToolStripSplitButton.cs
- Internal.cs
- SAPICategories.cs
- PolyBezierSegment.cs
- IdnMapping.cs
- WorkflowInspectionServices.cs
- CodeAssignStatement.cs
- DiagnosticTrace.cs
- LoadedOrUnloadedOperation.cs
- FormViewDeleteEventArgs.cs
- StructuredTypeInfo.cs
- ErrorWebPart.cs
- DataControlField.cs
- OdbcConnectionString.cs
- SqlAggregateChecker.cs
- ImageCodecInfo.cs
- BuildProvider.cs
- GeneralTransform2DTo3D.cs
- InternalConfigSettingsFactory.cs
- ActivityInterfaces.cs
- MyContact.cs
- SoapTypeAttribute.cs
- DataList.cs