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
- EntityDataSourceChangingEventArgs.cs
- HostingPreferredMapPath.cs
- ZoneIdentityPermission.cs
- TextSerializer.cs
- TextEffectCollection.cs
- OpenFileDialog.cs
- BamlReader.cs
- Error.cs
- Helper.cs
- PriorityQueue.cs
- Base64Encoder.cs
- ReaderWriterLockWrapper.cs
- DocumentXPathNavigator.cs
- ClientSettingsProvider.cs
- SelectionItemProviderWrapper.cs
- Attributes.cs
- MonthChangedEventArgs.cs
- NTAccount.cs
- WebBrowserDesigner.cs
- ControlBindingsCollection.cs
- DataControlFieldTypeEditor.cs
- ScopelessEnumAttribute.cs
- PersistStreamTypeWrapper.cs
- CanonicalFormWriter.cs
- RuleSettings.cs
- TypeGeneratedEventArgs.cs
- FormViewRow.cs
- PassportPrincipal.cs
- DataGridViewColumn.cs
- ScrollItemPattern.cs
- KnownBoxes.cs
- SQLInt16.cs
- SHA384.cs
- BaseProcessor.cs
- BufferedResponseStream.cs
- _KerberosClient.cs
- BindableTemplateBuilder.cs
- XmlSchemaSimpleContent.cs
- StatusBarPanel.cs
- XmlDataSourceNodeDescriptor.cs
- OutputCacheProfileCollection.cs
- ProviderSettingsCollection.cs
- CodePageUtils.cs
- EditorZone.cs
- DocumentSchemaValidator.cs
- LineBreak.cs
- XmlSchemaParticle.cs
- PhonemeConverter.cs
- SerializeAbsoluteContext.cs
- DesignerMetadata.cs
- CompilerHelpers.cs
- NullableDecimalSumAggregationOperator.cs
- DependencyProperty.cs
- DataGridViewCellParsingEventArgs.cs
- GlyphCollection.cs
- DictionaryManager.cs
- DataGridRow.cs
- SerTrace.cs
- BaseResourcesBuildProvider.cs
- KeyValueConfigurationElement.cs
- ServiceDescriptionContext.cs
- Int32.cs
- TextViewBase.cs
- RoutedPropertyChangedEventArgs.cs
- ChangeProcessor.cs
- TableItemPattern.cs
- CompilerScope.Storage.cs
- CommandEventArgs.cs
- SystemIcmpV4Statistics.cs
- SerializationTrace.cs
- FlowDocumentFormatter.cs
- ListControl.cs
- Comparer.cs
- LocalIdKeyIdentifierClause.cs
- SqlUtils.cs
- Wizard.cs
- GeneratedView.cs
- SecurityElement.cs
- NetMsmqSecurity.cs
- GridViewDeleteEventArgs.cs
- MatrixTransform.cs
- OdbcPermission.cs
- GridViewEditEventArgs.cs
- grammarelement.cs
- MetadataItemEmitter.cs
- ClientSession.cs
- TimeSpanOrInfiniteConverter.cs
- FlowLayoutPanelDesigner.cs
- VirtualizedCellInfoCollection.cs
- LambdaCompiler.Binary.cs
- WebConfigurationFileMap.cs
- mediaeventargs.cs
- PasswordBox.cs
- GlobalEventManager.cs
- WindowAutomationPeer.cs
- TextRange.cs
- PriorityQueue.cs
- HttpResponseBase.cs
- SafeRightsManagementPubHandle.cs
- WebServiceMethodData.cs