Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Controls / BooleanToSelectiveScrollingOrientationConverter.cs / 1305600 / BooleanToSelectiveScrollingOrientationConverter.cs
//----------------------------------------------------------------------------
//
// Copyright (C) Microsoft Corporation. All rights reserved.
//
//---------------------------------------------------------------------------
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
namespace System.Windows.Controls
{
///
/// Converts Boolean to SelectiveScrollin----entation based on the given parameter.
///
[Localizability(LocalizationCategory.NeverLocalize)]
internal sealed class BooleanToSelectiveScrollin----entationConverter : IValueConverter
{
///
/// Convert Boolean to SelectiveScrollin----entation
///
/// Boolean
/// SelectiveScrollin----entation
/// SelectiveScrollin----entation that should be used when the Boolean is true
/// null
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is bool && parameter is SelectiveScrollin----entation)
{
var valueAsBool = (bool)value;
var parameterSelectiveScrollin----entation = (SelectiveScrollin----entation)parameter;
if (valueAsBool)
{
return parameterSelectiveScrollin----entation;
}
}
return SelectiveScrollin----entation.Both;
}
///
/// Not implemented
///
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
//----------------------------------------------------------------------------
//
// Copyright (C) Microsoft Corporation. All rights reserved.
//
//---------------------------------------------------------------------------
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
namespace System.Windows.Controls
{
///
/// Converts Boolean to SelectiveScrollin----entation based on the given parameter.
///
[Localizability(LocalizationCategory.NeverLocalize)]
internal sealed class BooleanToSelectiveScrollin----entationConverter : IValueConverter
{
///
/// Convert Boolean to SelectiveScrollin----entation
///
/// Boolean
/// SelectiveScrollin----entation
/// SelectiveScrollin----entation that should be used when the Boolean is true
/// null
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is bool && parameter is SelectiveScrollin----entation)
{
var valueAsBool = (bool)value;
var parameterSelectiveScrollin----entation = (SelectiveScrollin----entation)parameter;
if (valueAsBool)
{
return parameterSelectiveScrollin----entation;
}
}
return SelectiveScrollin----entation.Both;
}
///
/// Not implemented
///
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- NullableFloatSumAggregationOperator.cs
- BasicViewGenerator.cs
- HtmlElement.cs
- ViewValidator.cs
- DBDataPermissionAttribute.cs
- UnsafeNativeMethods.cs
- QueryResponse.cs
- PermissionToken.cs
- ComponentConverter.cs
- ExtendedProtectionPolicyTypeConverter.cs
- CookielessHelper.cs
- DesignerActionKeyboardBehavior.cs
- PathFigureCollection.cs
- DrawingContextWalker.cs
- OdbcInfoMessageEvent.cs
- Control.cs
- PropertyEmitterBase.cs
- SoundPlayer.cs
- GlyphingCache.cs
- PlainXmlWriter.cs
- AttachedPropertyMethodSelector.cs
- NavigationWindow.cs
- ConfigurationUtility.cs
- SQLBytes.cs
- Accessible.cs
- FontInfo.cs
- HtmlShimManager.cs
- OutputCacheSettings.cs
- XhtmlCssHandler.cs
- __ConsoleStream.cs
- UrlPath.cs
- BuildProviderCollection.cs
- Int32Storage.cs
- KeyNotFoundException.cs
- OpenFileDialog.cs
- InlinedLocationReference.cs
- DataDocumentXPathNavigator.cs
- AddressingProperty.cs
- WindowShowOrOpenTracker.cs
- EventLevel.cs
- Message.cs
- MenuItemStyleCollectionEditor.cs
- CalendarAutomationPeer.cs
- InputLanguageEventArgs.cs
- WindowsListViewItem.cs
- XmlSignificantWhitespace.cs
- DownloadProgressEventArgs.cs
- StringResourceManager.cs
- SamlAudienceRestrictionCondition.cs
- HtmlTableCell.cs
- XmlSignatureProperties.cs
- SelectionEditingBehavior.cs
- _SslStream.cs
- AxisAngleRotation3D.cs
- FormsAuthenticationUserCollection.cs
- ThreadLocal.cs
- CompositionCommandSet.cs
- ProcessHostMapPath.cs
- Int16Converter.cs
- TemplateControlParser.cs
- StandardOleMarshalObject.cs
- DataGridViewCellValueEventArgs.cs
- DataTableReader.cs
- VerificationAttribute.cs
- ClassData.cs
- SafeRightsManagementSessionHandle.cs
- OperationValidationEventArgs.cs
- DataComponentNameHandler.cs
- DictationGrammar.cs
- TreeNodeStyleCollection.cs
- BooleanSwitch.cs
- SafePipeHandle.cs
- AvTrace.cs
- ValidationPropertyAttribute.cs
- MobileRedirect.cs
- AndCondition.cs
- ContractInstanceProvider.cs
- XmlBinaryReader.cs
- SqlNotificationRequest.cs
- COM2FontConverter.cs
- SettingsPropertyValue.cs
- BindStream.cs
- TrackingStringDictionary.cs
- NameValuePair.cs
- PerformanceCounterPermission.cs
- StreamGeometry.cs
- DesignTimeVisibleAttribute.cs
- XmlBinaryReader.cs
- DefaultParameterValueAttribute.cs
- VectorCollectionConverter.cs
- MenuCommands.cs
- SimpleBitVector32.cs
- NameObjectCollectionBase.cs
- EditorZone.cs
- GridItemCollection.cs
- MetadataItem.cs
- PagesSection.cs
- RawStylusSystemGestureInputReport.cs
- unsafenativemethodstextservices.cs
- DeferredReference.cs