Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / Tools / System.Activities.Presentation / System / Activities / Presentation / View / TypeToArgumentTypeConverter.cs / 1305376 / TypeToArgumentTypeConverter.cs
//---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System.Activities.Presentation.View { using System.Diagnostics; using System.Globalization; using System.Windows.Data; using System.Activities.Presentation.Model; using System.Runtime; // This converter converts from InArgument, OutArgument , Activity to T // this does not support convert back. internal sealed class TypeToArgumentTypeConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { object convertedValue = null; Type type = value as Type; if (type != null) { if (type.GetGenericArguments().Length > 0) { convertedValue = type.GetGenericArguments()[0]; } } return convertedValue; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { throw FxTrace.Exception.AsError(new NotSupportedException()); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System.Activities.Presentation.View { using System.Diagnostics; using System.Globalization; using System.Windows.Data; using System.Activities.Presentation.Model; using System.Runtime; // This converter converts from InArgument , OutArgument , Activity to T // this does not support convert back. internal sealed class TypeToArgumentTypeConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { object convertedValue = null; Type type = value as Type; if (type != null) { if (type.GetGenericArguments().Length > 0) { convertedValue = type.GetGenericArguments()[0]; } } return convertedValue; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { throw FxTrace.Exception.AsError(new NotSupportedException()); } } } // 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
- Converter.cs
- _IPv4Address.cs
- SiteMapNode.cs
- AssociationSet.cs
- XmlSerializerAssemblyAttribute.cs
- NativeMethods.cs
- RemoteHelper.cs
- RadialGradientBrush.cs
- DbConnectionPoolOptions.cs
- FixedDocumentPaginator.cs
- EditorAttribute.cs
- MetadataUtil.cs
- Compiler.cs
- FigureHelper.cs
- XmlILConstructAnalyzer.cs
- ResourceKey.cs
- CodeAccessPermission.cs
- GeometryCollection.cs
- ComponentDispatcherThread.cs
- ExpressionConverter.cs
- ApplicationServicesHostFactory.cs
- SizeChangedEventArgs.cs
- InputLangChangeRequestEvent.cs
- Int32RectValueSerializer.cs
- ValueTypeFixupInfo.cs
- NativeMethods.cs
- ScriptControlDescriptor.cs
- DbInsertCommandTree.cs
- NameScopePropertyAttribute.cs
- TaskExtensions.cs
- FileSystemInfo.cs
- DataRowChangeEvent.cs
- GridItemProviderWrapper.cs
- XmlDataSourceNodeDescriptor.cs
- VectorAnimation.cs
- CompositeFontParser.cs
- ImageClickEventArgs.cs
- AttachedPropertyMethodSelector.cs
- GB18030Encoding.cs
- UnconditionalPolicy.cs
- CheckBoxField.cs
- AssemblyAttributesGoHere.cs
- Encoder.cs
- TypefaceMap.cs
- NoPersistProperty.cs
- XmlSchemaAttribute.cs
- WebBrowserDesigner.cs
- ListViewContainer.cs
- CompatibleComparer.cs
- Vector3DValueSerializer.cs
- SqlVisitor.cs
- EffectiveValueEntry.cs
- PrintPageEvent.cs
- XmlSchemaNotation.cs
- HyperLinkStyle.cs
- TrackingParticipant.cs
- ConfigXmlDocument.cs
- ThrowHelper.cs
- PermissionSet.cs
- StringReader.cs
- StrongNameMembershipCondition.cs
- HtmlToClrEventProxy.cs
- DataTableMappingCollection.cs
- SiteMapPath.cs
- ToolstripProfessionalRenderer.cs
- BamlTreeNode.cs
- BigInt.cs
- FormParameter.cs
- HttpClientCertificate.cs
- ByteStorage.cs
- FactoryRecord.cs
- CompatibleComparer.cs
- _NTAuthentication.cs
- DataGridViewSelectedColumnCollection.cs
- StylusButton.cs
- SmtpLoginAuthenticationModule.cs
- FixUp.cs
- SqlParameter.cs
- RecommendedAsConfigurableAttribute.cs
- validationstate.cs
- HGlobalSafeHandle.cs
- DynamicResourceExtension.cs
- MessageQueueEnumerator.cs
- HttpHandlerAction.cs
- FileEnumerator.cs
- SimplePropertyEntry.cs
- HMACSHA512.cs
- GridViewColumnHeaderAutomationPeer.cs
- ConfigXmlText.cs
- PageCodeDomTreeGenerator.cs
- SingleAnimationBase.cs
- EnumValidator.cs
- ContentType.cs
- StatusBar.cs
- AggregatePushdown.cs
- SQLBinary.cs
- GenericsInstances.cs
- OrderedDictionary.cs
- ColumnResizeUndoUnit.cs
- KeyValuePairs.cs