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
- CacheDependency.cs
- UnconditionalPolicy.cs
- DetailsView.cs
- XmlSchemaInfo.cs
- ScrollItemProviderWrapper.cs
- ViewPort3D.cs
- PageAsyncTaskManager.cs
- X509ScopedServiceCertificateElementCollection.cs
- ObjectRef.cs
- AlphaSortedEnumConverter.cs
- XmlElementAttribute.cs
- HashStream.cs
- TextInfo.cs
- FlowDecisionDesigner.xaml.cs
- WebPartTransformerAttribute.cs
- PathGradientBrush.cs
- GlobalItem.cs
- HttpHostedTransportConfiguration.cs
- QueryExpression.cs
- MergeEnumerator.cs
- CompoundFileDeflateTransform.cs
- Stylesheet.cs
- SchemaSetCompiler.cs
- SqlSupersetValidator.cs
- MenuItemBinding.cs
- GridSplitterAutomationPeer.cs
- MethodAccessException.cs
- Expressions.cs
- SmiEventSink_Default.cs
- TabItemAutomationPeer.cs
- JumpPath.cs
- BufferedGraphicsContext.cs
- StateWorkerRequest.cs
- OutgoingWebRequestContext.cs
- DeferredElementTreeState.cs
- WindowsFormsLinkLabel.cs
- ColumnTypeConverter.cs
- ExtensionQuery.cs
- AnonymousIdentificationSection.cs
- XomlCompilerParameters.cs
- PlacementWorkspace.cs
- ToolStripItemCollection.cs
- ToolStrip.cs
- ElementHostAutomationPeer.cs
- HtmlEmptyTagControlBuilder.cs
- XamlPathDataSerializer.cs
- FormsAuthenticationModule.cs
- RectConverter.cs
- FormCollection.cs
- ImageField.cs
- WindowsStartMenu.cs
- AnimatedTypeHelpers.cs
- FixedSOMPageElement.cs
- NetTcpBindingElement.cs
- Ticks.cs
- TextFragmentEngine.cs
- DataBindingCollectionEditor.cs
- MetaModel.cs
- SingleQueryOperator.cs
- Types.cs
- BooleanExpr.cs
- StateMachineWorkflowInstance.cs
- SymLanguageVendor.cs
- ParseChildrenAsPropertiesAttribute.cs
- SqlMethods.cs
- CommandField.cs
- TypeConverterAttribute.cs
- Comparer.cs
- XmlIterators.cs
- LayoutEditorPart.cs
- XmlCountingReader.cs
- ServiceConfigurationTraceRecord.cs
- PtsCache.cs
- MemberPath.cs
- AppModelKnownContentFactory.cs
- PageSetupDialog.cs
- ProxyHwnd.cs
- DecoderNLS.cs
- HwndSource.cs
- VisualStates.cs
- ThemeInfoAttribute.cs
- TypeGeneratedEventArgs.cs
- SoapCodeExporter.cs
- IImplicitResourceProvider.cs
- HttpModuleAction.cs
- Config.cs
- ValueProviderWrapper.cs
- COM2Enum.cs
- COSERVERINFO.cs
- Pair.cs
- DesignBindingPicker.cs
- GACIdentityPermission.cs
- ColumnReorderedEventArgs.cs
- VoiceChangeEventArgs.cs
- FixedBufferAttribute.cs
- FigureParagraph.cs
- XamlSerializer.cs
- ControlHelper.cs
- ManifestResourceInfo.cs
- DBConnection.cs