Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / WinForms / Managed / System / WinForms / NumericUpDownAcceleration.cs / 1 / NumericUpDownAcceleration.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Windows.Forms {
using System;
///
/// Comprises the information specifying how acceleration should be performed
/// on a Windows up-down control when the up/down button is pressed for certain
/// amount of time.
///
public class NumericUpDownAcceleration
{
private Int32 seconds; // Ideally we would use UInt32 but it is not CLS-compliant.
private Decimal increment; // Ideally we would use UInt32 but NumericUpDown uses Decimal values.
public NumericUpDownAcceleration(Int32 seconds, Decimal increment)
{
if (seconds < 0)
{
throw new ArgumentOutOfRangeException("seconds", seconds, SR.GetString(SR.NumericUpDownLessThanZeroError));
}
if (increment < Decimal.Zero)
{
throw new ArgumentOutOfRangeException("increment", increment, SR.GetString(SR.NumericUpDownLessThanZeroError));
}
this.seconds = seconds;
this.increment = increment;
}
///
/// Determines the amount of time for the UpDown control to wait to set the increment
/// step when holding the up/down button.
///
public Int32 Seconds
{
get
{
return this.seconds;
}
set
{
if (value < 0)
{
throw new ArgumentOutOfRangeException("seconds", value, SR.GetString(SR.NumericUpDownLessThanZeroError));
}
this.seconds = value;
}
}
///
/// Determines the amount to increment by.
///
public Decimal Increment {
get
{
return this.increment;
}
set
{
if (value < Decimal.Zero)
{
throw new ArgumentOutOfRangeException("increment", value, SR.GetString(SR.NumericUpDownLessThanZeroError));
}
this.increment = value;
}
}
}
}
// 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
- ButtonColumn.cs
- ColumnResizeUndoUnit.cs
- EntityClientCacheEntry.cs
- HwndSource.cs
- FormViewInsertedEventArgs.cs
- GridErrorDlg.cs
- storepermission.cs
- ArraySegment.cs
- TemporaryBitmapFile.cs
- ServiceReflector.cs
- DesignerDataView.cs
- AlternateView.cs
- ExceptionNotification.cs
- CodeTypeDeclarationCollection.cs
- SystemResources.cs
- Pkcs7Signer.cs
- DataGridViewToolTip.cs
- CustomExpression.cs
- XsltConvert.cs
- ExtensionElement.cs
- URI.cs
- PerspectiveCamera.cs
- XPathBuilder.cs
- CryptographicAttribute.cs
- DesignerDataStoredProcedure.cs
- TypeNameParser.cs
- Utils.cs
- AvTraceFormat.cs
- TextPatternIdentifiers.cs
- AliasExpr.cs
- ButtonAutomationPeer.cs
- WebPartTracker.cs
- HandlerBase.cs
- XmlCharCheckingReader.cs
- SchemaAttDef.cs
- HttpListenerRequestUriBuilder.cs
- CodeAttachEventStatement.cs
- TextBoxBase.cs
- CharacterMetricsDictionary.cs
- XmlAnyElementAttributes.cs
- _Semaphore.cs
- ping.cs
- AnimationTimeline.cs
- dbdatarecord.cs
- TextPointer.cs
- XmlParserContext.cs
- DataListItemCollection.cs
- RightsManagementEncryptionTransform.cs
- Bits.cs
- LiteralText.cs
- SqlDataReaderSmi.cs
- SqlCrossApplyToCrossJoin.cs
- Mappings.cs
- PathFigure.cs
- AudioStateChangedEventArgs.cs
- MultiBinding.cs
- TrustLevelCollection.cs
- AxisAngleRotation3D.cs
- EntityCommandExecutionException.cs
- ListItemCollection.cs
- WindowsIPAddress.cs
- XPathNodeList.cs
- QuaternionRotation3D.cs
- Visual3D.cs
- RawStylusSystemGestureInputReport.cs
- CodeCommentStatementCollection.cs
- ScriptReference.cs
- BatchStream.cs
- WebBaseEventKeyComparer.cs
- RelatedView.cs
- SystemSounds.cs
- InputScope.cs
- Membership.cs
- KerberosTicketHashIdentifierClause.cs
- EnumMemberAttribute.cs
- GridItemProviderWrapper.cs
- ArrayExtension.cs
- HostingEnvironmentException.cs
- CustomError.cs
- ScrollBar.cs
- CompilerErrorCollection.cs
- ExpressionBindingsDialog.cs
- XsltContext.cs
- Panel.cs
- CLRBindingWorker.cs
- RemotingServices.cs
- ConfigurationSettings.cs
- Image.cs
- BinaryObjectReader.cs
- DefaultValueAttribute.cs
- MessageQueueTransaction.cs
- ToolboxBitmapAttribute.cs
- SchemaDeclBase.cs
- _Win32.cs
- WebServiceFaultDesigner.cs
- MILUtilities.cs
- ElementMarkupObject.cs
- CallContext.cs
- ContextMarshalException.cs
- DiscoveryServerProtocol.cs