Code:
/ DotNET / DotNET / 8.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
- sitestring.cs
- Operand.cs
- SafeTimerHandle.cs
- ChtmlSelectionListAdapter.cs
- WebPartEditorOkVerb.cs
- ClientTarget.cs
- DataControlField.cs
- CommandBinding.cs
- DrawingImage.cs
- MinimizableAttributeTypeConverter.cs
- RecordBuilder.cs
- XPathPatternBuilder.cs
- WebPartTransformer.cs
- DirectoryInfo.cs
- WorkflowItemsPresenter.cs
- WSHttpSecurity.cs
- GraphicsState.cs
- DataColumnSelectionConverter.cs
- DateTimeFormatInfo.cs
- ToolStripContentPanel.cs
- Model3DCollection.cs
- ViewEventArgs.cs
- RepeaterItem.cs
- SmtpException.cs
- TimelineClockCollection.cs
- DataControlFieldCollection.cs
- EmptyReadOnlyDictionaryInternal.cs
- TextContainerChangeEventArgs.cs
- EncoderBestFitFallback.cs
- FontClient.cs
- AggregateNode.cs
- ListBindingConverter.cs
- ItemsChangedEventArgs.cs
- FilterQueryOptionExpression.cs
- LowerCaseStringConverter.cs
- MergeEnumerator.cs
- SerializationFieldInfo.cs
- DesignerVerbCollection.cs
- Propagator.Evaluator.cs
- MailBnfHelper.cs
- DiscoveryMessageSequenceGenerator.cs
- ComponentGuaranteesAttribute.cs
- TrackingParticipant.cs
- HandlerBase.cs
- X509Certificate.cs
- PropertyMetadata.cs
- KeyInstance.cs
- GroupQuery.cs
- StructuredTypeEmitter.cs
- PolyLineSegment.cs
- HttpEncoder.cs
- NativeMethods.cs
- UnsafeNativeMethods.cs
- GetParentChain.cs
- DispatcherTimer.cs
- WebBrowserContainer.cs
- ListControlDataBindingHandler.cs
- SqlBulkCopy.cs
- Misc.cs
- TextTabProperties.cs
- TransformGroup.cs
- DbgUtil.cs
- StagingAreaInputItem.cs
- XmlCompatibilityReader.cs
- SqlDataSourceEnumerator.cs
- ExclusiveNamedPipeTransportManager.cs
- NetCodeGroup.cs
- SqlServices.cs
- Unit.cs
- NameNode.cs
- SqlConnectionPoolGroupProviderInfo.cs
- RadioButton.cs
- MetadataSource.cs
- SerializationHelper.cs
- ObjectContextServiceProvider.cs
- SHA512Managed.cs
- BookmarkOptionsHelper.cs
- SelectionHighlightInfo.cs
- AncestorChangedEventArgs.cs
- IntegrationExceptionEventArgs.cs
- LOSFormatter.cs
- _Semaphore.cs
- PageContent.cs
- ExpressionNode.cs
- PtsCache.cs
- SafeNativeMethodsMilCoreApi.cs
- StringInfo.cs
- DataReaderContainer.cs
- ArgumentException.cs
- Baml2006KnownTypes.cs
- PathSegmentCollection.cs
- Timer.cs
- TextElementEnumerator.cs
- CheckBoxPopupAdapter.cs
- xamlnodes.cs
- CodeTypeDeclarationCollection.cs
- NameValuePermission.cs
- KeyNotFoundException.cs
- BuildResultCache.cs
- HashHelper.cs