Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- ListBox.cs
- PeerChannelFactory.cs
- ErrorStyle.cs
- Console.cs
- IdentityReference.cs
- WorkflowEnvironment.cs
- Message.cs
- InvalidWorkflowException.cs
- XmlCharCheckingWriter.cs
- HttpListener.cs
- Decorator.cs
- XmlArrayAttribute.cs
- AspNetSynchronizationContext.cs
- ErrorRuntimeConfig.cs
- PropertyRef.cs
- WebPartsPersonalizationAuthorization.cs
- LocalValueEnumerator.cs
- PatternMatcher.cs
- BatchWriter.cs
- PhysicalAddress.cs
- webeventbuffer.cs
- _RequestCacheProtocol.cs
- Block.cs
- Command.cs
- NativeMethods.cs
- Int32Storage.cs
- ToolboxBitmapAttribute.cs
- XmlSiteMapProvider.cs
- RenamedEventArgs.cs
- DrawingBrush.cs
- OneToOneMappingSerializer.cs
- util.cs
- ToolTipAutomationPeer.cs
- DataTemplate.cs
- DetailsViewModeEventArgs.cs
- TextParagraph.cs
- SelectionWordBreaker.cs
- GlobalProxySelection.cs
- ConstructorNeedsTagAttribute.cs
- ImageIndexConverter.cs
- MetaTable.cs
- DataPagerCommandEventArgs.cs
- XmlIlGenerator.cs
- HMACRIPEMD160.cs
- LinqDataSourceHelper.cs
- BindingCompleteEventArgs.cs
- RoutedCommand.cs
- GeometryDrawing.cs
- XmlChildEnumerator.cs
- Environment.cs
- Range.cs
- WinEventHandler.cs
- ObjectMaterializedEventArgs.cs
- XamlPointCollectionSerializer.cs
- AutomationAttributeInfo.cs
- SqlDependencyUtils.cs
- SqlBinder.cs
- RangeValidator.cs
- SoapHeaders.cs
- SystemWebSectionGroup.cs
- GlyphTypeface.cs
- WebServiceErrorEvent.cs
- TextAdaptor.cs
- ToolStripOverflowButton.cs
- TabControl.cs
- SQLUtility.cs
- ReferencedCollectionType.cs
- BaseDataList.cs
- _RequestLifetimeSetter.cs
- InvalidDataException.cs
- ImportContext.cs
- WindowsRebar.cs
- TableParaClient.cs
- XmlWrappingReader.cs
- PopupEventArgs.cs
- BadImageFormatException.cs
- WCFBuildProvider.cs
- AppSettingsExpressionBuilder.cs
- AppModelKnownContentFactory.cs
- CharConverter.cs
- Mappings.cs
- CategoryList.cs
- DataIdProcessor.cs
- IPHostEntry.cs
- CountdownEvent.cs
- Effect.cs
- Point3DCollectionConverter.cs
- EqualityComparer.cs
- XPathParser.cs
- EditorOptionAttribute.cs
- SecurityContextSecurityTokenResolver.cs
- SinglePageViewer.cs
- MediaSystem.cs
- DataTable.cs
- WebBrowser.cs
- WebPartConnectionsConnectVerb.cs
- MenuItemBinding.cs
- MultiSelector.cs
- HttpHandlerAction.cs
- EncoderParameter.cs