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
- SqlDataSourceConfigureSelectPanel.cs
- VolatileEnlistmentState.cs
- ErrorWebPart.cs
- SchemaCollectionCompiler.cs
- printdlgexmarshaler.cs
- EncryptRequest.cs
- CodeCatchClause.cs
- DropShadowBitmapEffect.cs
- XmlSchemaObjectTable.cs
- CompareInfo.cs
- EventHandlersStore.cs
- WebSysDisplayNameAttribute.cs
- UserMapPath.cs
- DataListItem.cs
- SafeLibraryHandle.cs
- EditBehavior.cs
- ListBindableAttribute.cs
- EnlistmentState.cs
- Marshal.cs
- ObjectDisposedException.cs
- XXXOnTypeBuilderInstantiation.cs
- NetworkInterface.cs
- ServiceNameCollection.cs
- NameValueFileSectionHandler.cs
- CompilerLocalReference.cs
- ScrollItemPatternIdentifiers.cs
- RtfToXamlLexer.cs
- QuestionEventArgs.cs
- AcceptorSessionSymmetricMessageSecurityProtocol.cs
- PrimaryKeyTypeConverter.cs
- PaperSource.cs
- Rect3DValueSerializer.cs
- SyndicationSerializer.cs
- ConstraintCollection.cs
- EdgeModeValidation.cs
- PerformanceCounterPermissionEntryCollection.cs
- Parameter.cs
- TrackingSection.cs
- ArraySubsetEnumerator.cs
- CodeIdentifiers.cs
- WrapPanel.cs
- HttpVersion.cs
- VirtualDirectoryMappingCollection.cs
- XPathBuilder.cs
- FontConverter.cs
- SingleObjectCollection.cs
- WebPartHelpVerb.cs
- RefExpr.cs
- IRCollection.cs
- SpotLight.cs
- CapabilitiesUse.cs
- unsafenativemethodstextservices.cs
- CacheSection.cs
- DataGridColumnEventArgs.cs
- WebControl.cs
- TypeConverterMarkupExtension.cs
- ManageRequest.cs
- ListCollectionView.cs
- QueryRewriter.cs
- ExpressionBuilder.cs
- IndentedTextWriter.cs
- PropertyTabChangedEvent.cs
- GenericAuthenticationEventArgs.cs
- ReverseInheritProperty.cs
- AppDomainProtocolHandler.cs
- AutomationElementIdentifiers.cs
- ColorTransformHelper.cs
- FormViewCommandEventArgs.cs
- ConfigPathUtility.cs
- NotifyIcon.cs
- CompositeKey.cs
- Boolean.cs
- PointKeyFrameCollection.cs
- RestHandlerFactory.cs
- Converter.cs
- XmlChildNodes.cs
- EventLogReader.cs
- CultureTable.cs
- HMACSHA1.cs
- SqlConnectionManager.cs
- TcpAppDomainProtocolHandler.cs
- ReadOnlyDictionary.cs
- ProviderIncompatibleException.cs
- _WebProxyDataBuilder.cs
- ProxyWebPartConnectionCollection.cs
- CustomExpressionEventArgs.cs
- XomlDesignerLoader.cs
- EdmRelationshipNavigationPropertyAttribute.cs
- GridViewUpdatedEventArgs.cs
- GenericXmlSecurityToken.cs
- AdapterUtil.cs
- AccessKeyManager.cs
- PropertyInformation.cs
- ParameterRetriever.cs
- CriticalExceptions.cs
- CodeTypeParameterCollection.cs
- OdbcStatementHandle.cs
- ToolStripAdornerWindowService.cs
- DataBoundControlHelper.cs
- SecurityAttributeGenerationHelper.cs