Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- GetParentChain.cs
- MetadataItem_Static.cs
- Splitter.cs
- FormViewActionList.cs
- ActivityInstanceReference.cs
- StaticContext.cs
- Variant.cs
- _SSPIWrapper.cs
- StatusBarDrawItemEvent.cs
- EntityDataSourceEntityTypeFilterItem.cs
- DetailsViewCommandEventArgs.cs
- RawStylusSystemGestureInputReport.cs
- uribuilder.cs
- DBParameter.cs
- RouteUrlExpressionBuilder.cs
- webclient.cs
- AdCreatedEventArgs.cs
- DuplicateWaitObjectException.cs
- AlternateViewCollection.cs
- DataObjectSettingDataEventArgs.cs
- BooleanFacetDescriptionElement.cs
- ConfigurationManagerInternalFactory.cs
- DataListItem.cs
- Model3DGroup.cs
- HttpProfileBase.cs
- Function.cs
- DateTimeFormatInfoScanner.cs
- DateTimeOffsetStorage.cs
- HyperLinkStyle.cs
- MessagePartSpecification.cs
- WebPartEditorApplyVerb.cs
- TimeSpanConverter.cs
- CharKeyFrameCollection.cs
- ChtmlLinkAdapter.cs
- GenerateScriptTypeAttribute.cs
- OletxEnlistment.cs
- Argument.cs
- GeneralTransformGroup.cs
- GridToolTip.cs
- ImageSourceValueSerializer.cs
- EventSinkHelperWriter.cs
- CodeAccessPermission.cs
- SchemaImporterExtensionsSection.cs
- TextPointerBase.cs
- CharUnicodeInfo.cs
- Pkcs9Attribute.cs
- LiteralSubsegment.cs
- Clock.cs
- Imaging.cs
- TextReader.cs
- HttpCookiesSection.cs
- TransactedReceiveScope.cs
- SqlDataSourceSelectingEventArgs.cs
- GridViewDeleteEventArgs.cs
- ThreadStateException.cs
- RadialGradientBrush.cs
- GridViewHeaderRowPresenter.cs
- DataSourceExpression.cs
- FrameworkPropertyMetadata.cs
- InvalidCastException.cs
- MiniConstructorInfo.cs
- DrawingImage.cs
- DataGridViewToolTip.cs
- OdbcStatementHandle.cs
- NullableFloatSumAggregationOperator.cs
- TransformerTypeCollection.cs
- EntityTypeBase.cs
- Compiler.cs
- SystemIcons.cs
- SharedRuntimeState.cs
- ObjectCacheSettings.cs
- HTMLTagNameToTypeMapper.cs
- RenderContext.cs
- SqlDuplicator.cs
- DataViewSettingCollection.cs
- CompiledRegexRunnerFactory.cs
- ExpressionBuilder.cs
- PackageProperties.cs
- Win32.cs
- ButtonBaseAdapter.cs
- DataGridTextBox.cs
- EventBuilder.cs
- OptimizedTemplateContent.cs
- SafeRegistryHandle.cs
- ImageUrlEditor.cs
- DataSourceSerializationException.cs
- BitmapEffect.cs
- DescendantBaseQuery.cs
- BitmapPalettes.cs
- PathSegment.cs
- DomainConstraint.cs
- ObjectViewEntityCollectionData.cs
- BlobPersonalizationState.cs
- FtpCachePolicyElement.cs
- TextPenaltyModule.cs
- SendingRequestEventArgs.cs
- MailAddress.cs
- SafeCertificateContext.cs
- WebServiceReceive.cs
- MenuItemAutomationPeer.cs