Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / Tools / System.Activities.Core.Presentation / System / Activities / Core / Presentation / NotConverter.cs / 1305376 / NotConverter.cs
//---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System.Activities.Core.Presentation { // Code borrowed from System.Activities.Presentation using System; using System.ComponentModel; using System.Windows; using System.Windows.Data; using System.Globalization; using System.Reflection; using System.Diagnostics.CodeAnalysis; //// Transform bool value using logical not. // [SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses")] internal sealed class NotConverter : IValueConverter { // IValueConverter Members public object Convert(object o, Type targetType, object parameter, CultureInfo culture) { return !(bool)o; } public object ConvertBack(object o, Type targetType, object parameter, CultureInfo culture) { return !AssureBool(o, false); } static bool AssureBool(object value, bool defaultIfNull) { if (value is bool?) { bool? nbValue = (bool?)value; if (nbValue.HasValue) { return nbValue.Value; } else { return defaultIfNull; } } return (bool)value; } } } // 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
- dataobject.cs
- ByteRangeDownloader.cs
- FlowLayoutPanel.cs
- SecurityHeaderLayout.cs
- SapiGrammar.cs
- HeaderUtility.cs
- selecteditemcollection.cs
- XslAstAnalyzer.cs
- AutomationPatternInfo.cs
- ButtonChrome.cs
- PipelineModuleStepContainer.cs
- DbConnectionPoolIdentity.cs
- ZipIOCentralDirectoryFileHeader.cs
- LambdaExpression.cs
- JsonObjectDataContract.cs
- DmlSqlGenerator.cs
- ClientSettingsStore.cs
- MdiWindowListStrip.cs
- Package.cs
- LoaderAllocator.cs
- CfgRule.cs
- ComponentDispatcherThread.cs
- RemoteWebConfigurationHost.cs
- MediaContextNotificationWindow.cs
- AggregateNode.cs
- DispatcherEventArgs.cs
- BitmapDownload.cs
- WindowsAuthenticationModule.cs
- ControlPropertyNameConverter.cs
- GradientBrush.cs
- InputLanguage.cs
- KeyValueConfigurationCollection.cs
- TextAction.cs
- AttributeUsageAttribute.cs
- WebHostedComPlusServiceHost.cs
- PackagingUtilities.cs
- RuleDefinitions.cs
- ExpressionLexer.cs
- EventDescriptorCollection.cs
- RelationshipNavigation.cs
- ResourceManager.cs
- RSAOAEPKeyExchangeDeformatter.cs
- DefaultAutoFieldGenerator.cs
- DataGridViewRowStateChangedEventArgs.cs
- Attributes.cs
- FontFamily.cs
- RecipientInfo.cs
- ConfigurationManagerInternal.cs
- ClosableStream.cs
- ComponentEditorForm.cs
- MatrixTransform.cs
- EntityProxyFactory.cs
- MD5CryptoServiceProvider.cs
- XmlValidatingReaderImpl.cs
- EventProviderWriter.cs
- ManagementObjectCollection.cs
- PageWrapper.cs
- Directory.cs
- WindowShowOrOpenTracker.cs
- EntityDataSourceState.cs
- XPathNavigatorKeyComparer.cs
- ScrollPattern.cs
- EFAssociationProvider.cs
- IntSecurity.cs
- sqlinternaltransaction.cs
- PersonalizationProvider.cs
- RelatedCurrencyManager.cs
- VectorCollectionValueSerializer.cs
- CryptoKeySecurity.cs
- DayRenderEvent.cs
- DeferredReference.cs
- XmlWrappingReader.cs
- WebBrowserNavigatedEventHandler.cs
- Grid.cs
- FixedDocument.cs
- IImplicitResourceProvider.cs
- WebScriptEnablingBehavior.cs
- ConfigurationSectionGroupCollection.cs
- RawTextInputReport.cs
- Camera.cs
- NewArrayExpression.cs
- ConstraintConverter.cs
- AsymmetricKeyExchangeFormatter.cs
- EntityModelBuildProvider.cs
- NodeLabelEditEvent.cs
- SrgsRule.cs
- ManagementPath.cs
- MenuTracker.cs
- SizeConverter.cs
- RTLAwareMessageBox.cs
- RuntimeConfig.cs
- _FixedSizeReader.cs
- OleDbConnectionInternal.cs
- DataGridViewComboBoxEditingControl.cs
- ContextMenuStripGroupCollection.cs
- MetadataException.cs
- XsltException.cs
- RouteParser.cs
- FontSourceCollection.cs
- TagPrefixAttribute.cs