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
- FieldAccessException.cs
- BamlResourceDeserializer.cs
- TypeSystemProvider.cs
- Console.cs
- MergeFailedEvent.cs
- SpellerError.cs
- JsonUriDataContract.cs
- __TransparentProxy.cs
- WebPageTraceListener.cs
- RegexFCD.cs
- NavigateUrlConverter.cs
- Rect3DConverter.cs
- UInt16.cs
- AspNetHostingPermission.cs
- ListParagraph.cs
- ListViewCommandEventArgs.cs
- WmlObjectListAdapter.cs
- DataGridViewImageColumn.cs
- Compress.cs
- SchemaSetCompiler.cs
- HTMLTagNameToTypeMapper.cs
- AsyncOperationLifetimeManager.cs
- DataPointer.cs
- CompilerCollection.cs
- OleDbDataReader.cs
- ClientSession.cs
- MatrixAnimationUsingPath.cs
- HttpEncoderUtility.cs
- BoolExpression.cs
- KoreanLunisolarCalendar.cs
- StaticTextPointer.cs
- TagPrefixAttribute.cs
- HandledMouseEvent.cs
- JsonReader.cs
- CoreSwitches.cs
- UTF8Encoding.cs
- RegexCode.cs
- TextBoxView.cs
- DoubleCollection.cs
- COM2IDispatchConverter.cs
- ActivityPreviewDesigner.cs
- ClientBase.cs
- ResXResourceSet.cs
- AutoGeneratedField.cs
- UpdatePanelTrigger.cs
- LazyTextWriterCreator.cs
- xmlfixedPageInfo.cs
- DiscriminatorMap.cs
- HyperLink.cs
- MutexSecurity.cs
- PixelFormat.cs
- XmlAnyElementAttributes.cs
- SqlError.cs
- LogManagementAsyncResult.cs
- OleDbTransaction.cs
- DataFormats.cs
- TypeElement.cs
- Scalars.cs
- CompilerHelpers.cs
- ConversionValidationRule.cs
- DelayLoadType.cs
- CancellationTokenRegistration.cs
- TypographyProperties.cs
- XmlUnspecifiedAttribute.cs
- CatalogZone.cs
- DbProviderFactory.cs
- ListDictionaryInternal.cs
- __ConsoleStream.cs
- TextBlockAutomationPeer.cs
- MergePropertyDescriptor.cs
- ListManagerBindingsCollection.cs
- AccessedThroughPropertyAttribute.cs
- WebPartConnection.cs
- ReachDocumentReferenceCollectionSerializer.cs
- DynamicRenderer.cs
- MenuStrip.cs
- EmbeddedMailObjectCollectionEditor.cs
- ClientOptions.cs
- RenderData.cs
- WebSysDisplayNameAttribute.cs
- XmlReflectionImporter.cs
- XmlSchemaInclude.cs
- ProofTokenCryptoHandle.cs
- NativeObjectSecurity.cs
- ContentElement.cs
- EncryptedReference.cs
- NamespaceQuery.cs
- QuotedPrintableStream.cs
- ClientEventManager.cs
- BStrWrapper.cs
- PerformanceCounterPermissionEntry.cs
- GrabHandleGlyph.cs
- WindowsFormsHost.cs
- ProfileGroupSettingsCollection.cs
- ProviderConnectionPoint.cs
- StrokeIntersection.cs
- HttpRuntime.cs
- StaticSiteMapProvider.cs
- TriState.cs
- Condition.cs