Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / System.Activities / System / Activities / Statements / Assign.cs / 1305376 / Assign.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.Activities.Statements { using System.Activities; using System.Collections.ObjectModel; using System.ComponentModel; using System.Runtime; public sealed class Assign : CodeActivity { public Assign() : base() { } [RequiredArgument] [DefaultValue(null)] public OutArgument To { get; set; } [RequiredArgument] [DefaultValue(null)] public InArgument Value { get; set; } protected override void CacheMetadata(CodeActivityMetadata metadata) { Collectionarguments = new Collection (); Type valueType = TypeHelper.ObjectType; if (this.Value != null) { valueType = this.Value.ArgumentType; } RuntimeArgument valueArgument = new RuntimeArgument("Value", valueType, ArgumentDirection.In, true); metadata.Bind(this.Value, valueArgument); Type toType = TypeHelper.ObjectType; if (this.To != null) { toType = this.To.ArgumentType; } RuntimeArgument toArgument = new RuntimeArgument("To", toType, ArgumentDirection.Out, true); metadata.Bind(this.To, toArgument); arguments.Add(valueArgument); arguments.Add(toArgument); metadata.SetArgumentsCollection(arguments); if (this.Value != null && this.To != null) { if (!TypeHelper.AreTypesCompatible(this.Value.ArgumentType, this.To.ArgumentType)) { metadata.AddValidationError(SR.TypeMismatchForAssign( this.Value.ArgumentType, this.To.ArgumentType, this.DisplayName)); } } } protected override void Execute(CodeActivityContext context) { this.To.Set(context, this.Value.Get(context)); } } public sealed class Assign : CodeActivity { public Assign() : base() { } [RequiredArgument] [DefaultValue(null)] public OutArgument To { get; set; } [RequiredArgument] [DefaultValue(null)] public InArgument Value { get; set; } protected override void CacheMetadata(CodeActivityMetadata metadata) { Collection arguments = new Collection (); RuntimeArgument valueArgument = new RuntimeArgument("Value", typeof(T), ArgumentDirection.In, true); metadata.Bind(this.Value, valueArgument); RuntimeArgument toArgument = new RuntimeArgument("To", typeof(T), ArgumentDirection.Out, true); metadata.Bind(this.To, toArgument); arguments.Add(valueArgument); arguments.Add(toArgument); metadata.SetArgumentsCollection(arguments); } protected override void Execute(CodeActivityContext context) { context.SetValue(this.To, this.Value.Get(context)); } } } // 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
- COM2IPerPropertyBrowsingHandler.cs
- Registry.cs
- SafeNativeMemoryHandle.cs
- ProcessRequestArgs.cs
- DecoderNLS.cs
- XmlSchemaImporter.cs
- MarkupProperty.cs
- MethodCallConverter.cs
- SelfIssuedAuthProofToken.cs
- DoubleLinkListEnumerator.cs
- PagesSection.cs
- UmAlQuraCalendar.cs
- SelectionEditor.cs
- DataGridViewRow.cs
- TypeToStringValueConverter.cs
- LazyInitializer.cs
- EntityCommandExecutionException.cs
- EraserBehavior.cs
- MdImport.cs
- ButtonChrome.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- CacheEntry.cs
- XmlSerializerFactory.cs
- EventLogPermission.cs
- CustomAssemblyResolver.cs
- MeasurementDCInfo.cs
- DataKeyCollection.cs
- ComNativeDescriptor.cs
- HuffCodec.cs
- Hashtable.cs
- ProcessExitedException.cs
- CounterNameConverter.cs
- documentsequencetextview.cs
- SqlPersonalizationProvider.cs
- EventlogProvider.cs
- GraphicsContext.cs
- ErrorView.xaml.cs
- SchemaNamespaceManager.cs
- TableLayoutPanelCellPosition.cs
- XmlSchemaCollection.cs
- MarshalDirectiveException.cs
- CFStream.cs
- FreezableDefaultValueFactory.cs
- BadImageFormatException.cs
- DeviceFiltersSection.cs
- CommonProperties.cs
- ScriptingSectionGroup.cs
- SafePEFileHandle.cs
- TemplateControl.cs
- PackagePart.cs
- UpdateCommand.cs
- XmlUtil.cs
- RootBrowserWindow.cs
- BoundPropertyEntry.cs
- HijriCalendar.cs
- ResourceReferenceExpressionConverter.cs
- SoapFormatter.cs
- DefaultTextStoreTextComposition.cs
- ReadOnlyAttribute.cs
- TerminateDesigner.cs
- ContentElement.cs
- BufferModeSettings.cs
- SafeNativeMethods.cs
- ListChangedEventArgs.cs
- TemplateParser.cs
- IpcClientManager.cs
- SvcMapFileSerializer.cs
- LocatorPart.cs
- XPathItem.cs
- PropertyKey.cs
- ValidationContext.cs
- SqlRowUpdatingEvent.cs
- PermissionSetEnumerator.cs
- Predicate.cs
- WebControl.cs
- DataRowExtensions.cs
- ChangesetResponse.cs
- CLSCompliantAttribute.cs
- HostedHttpContext.cs
- DataServiceQueryException.cs
- StyleModeStack.cs
- FontConverter.cs
- BoundPropertyEntry.cs
- ColumnReorderedEventArgs.cs
- BitmapMetadata.cs
- FileSystemWatcher.cs
- ObjectFullSpanRewriter.cs
- FacetDescription.cs
- SharedStatics.cs
- SplitterCancelEvent.cs
- WebScriptMetadataInstanceContextProvider.cs
- TextPattern.cs
- MinMaxParagraphWidth.cs
- InlineUIContainer.cs
- VarRemapper.cs
- bindurihelper.cs
- HwndTarget.cs
- IndexOutOfRangeException.cs
- DynamicMethod.cs
- IdentityModelStringsVersion1.cs