Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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.
//
//-----------------------------------------------------------------------------
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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- PerspectiveCamera.cs
- MenuItemBinding.cs
- ProcessThread.cs
- LiteralControl.cs
- SID.cs
- ProcessHostConfigUtils.cs
- IndependentAnimationStorage.cs
- SQLMembershipProvider.cs
- ServerTooBusyException.cs
- XmlLinkedNode.cs
- OleDbTransaction.cs
- TimeStampChecker.cs
- WebControlAdapter.cs
- Point.cs
- CollectionConverter.cs
- SocketElement.cs
- RawAppCommandInputReport.cs
- TemplateLookupAction.cs
- GlyphShapingProperties.cs
- SemanticTag.cs
- ProfileSettingsCollection.cs
- ValidationError.cs
- PeerTransportListenAddressValidator.cs
- SecurityManager.cs
- DataSourceHelper.cs
- SqlCommandSet.cs
- DataSysAttribute.cs
- _BasicClient.cs
- SelfIssuedAuthRSACryptoProvider.cs
- PanningMessageFilter.cs
- ClassImporter.cs
- WeakRefEnumerator.cs
- XmlElementAttribute.cs
- StringSource.cs
- OperationInvokerTrace.cs
- ConfigurationSectionGroupCollection.cs
- SiteMapHierarchicalDataSourceView.cs
- PropertyRecord.cs
- ButtonFlatAdapter.cs
- HtmlMeta.cs
- SortKey.cs
- EmptyQuery.cs
- Buffer.cs
- SQLBinaryStorage.cs
- DataList.cs
- Matrix3D.cs
- DataServiceQuery.cs
- BitmapCacheBrush.cs
- StructuredProperty.cs
- QueryProcessor.cs
- GcHandle.cs
- DateTimeValueSerializer.cs
- HideDisabledControlAdapter.cs
- RegexMatch.cs
- ClientBuildManagerCallback.cs
- SessionIDManager.cs
- RetrieveVirtualItemEventArgs.cs
- Table.cs
- ServiceMemoryGates.cs
- ResourceContainer.cs
- CorrelationManager.cs
- StringCollectionMarkupSerializer.cs
- WebPartDeleteVerb.cs
- DataGridAddNewRow.cs
- ACL.cs
- XmlAutoDetectWriter.cs
- NotImplementedException.cs
- InputDevice.cs
- Triplet.cs
- DataTemplateKey.cs
- RegexMatch.cs
- MonitoringDescriptionAttribute.cs
- IdentitySection.cs
- RtfControls.cs
- PartialCachingAttribute.cs
- SecurityTokenValidationException.cs
- RequestTimeoutManager.cs
- ManagementInstaller.cs
- SqlMetaData.cs
- WaveHeader.cs
- ProfileSection.cs
- Options.cs
- HtmlLink.cs
- DbgCompiler.cs
- BooleanKeyFrameCollection.cs
- Timer.cs
- VBCodeProvider.cs
- BaseParser.cs
- Camera.cs
- SafeCertificateStore.cs
- ParameterRetriever.cs
- WebConfigurationFileMap.cs
- CrossSiteScriptingValidation.cs
- XmlSerializerFactory.cs
- ImageMapEventArgs.cs
- PropertyTabAttribute.cs
- ActivationProxy.cs
- XmlUTF8TextReader.cs
- CodeAttributeArgument.cs
- XmlBuffer.cs