Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / WinForms / Managed / System / WinForms / NumericUpDownAcceleration.cs / 1305376 / 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
- SQLGuidStorage.cs
- PageRouteHandler.cs
- XmlAttributeCache.cs
- Accessible.cs
- TraceRecords.cs
- DataConnectionHelper.cs
- Marshal.cs
- AspProxy.cs
- ListViewPagedDataSource.cs
- ConstructorNeedsTagAttribute.cs
- WindowsAltTab.cs
- RequestBringIntoViewEventArgs.cs
- HtmlProps.cs
- DataKeyPropertyAttribute.cs
- ListSourceHelper.cs
- TailPinnedEventArgs.cs
- TextBounds.cs
- NotConverter.cs
- SqlCharStream.cs
- WebPartDeleteVerb.cs
- ScopedKnownTypes.cs
- MeasurementDCInfo.cs
- VisualStyleInformation.cs
- AnnotationService.cs
- FrameSecurityDescriptor.cs
- DictionaryCustomTypeDescriptor.cs
- ConfigurationStrings.cs
- XmlSchemaResource.cs
- DebugView.cs
- DataTable.cs
- EventOpcode.cs
- ConfigurationElementCollection.cs
- externdll.cs
- TabletCollection.cs
- XmlBaseReader.cs
- ExpressionStringBuilder.cs
- FloaterParagraph.cs
- AsymmetricKeyExchangeDeformatter.cs
- AddInControllerImpl.cs
- FrameDimension.cs
- RoleManagerEventArgs.cs
- DoubleCollectionConverter.cs
- AgileSafeNativeMemoryHandle.cs
- CodeEventReferenceExpression.cs
- Site.cs
- OAVariantLib.cs
- GeneralTransform3DCollection.cs
- WebControl.cs
- LogAppendAsyncResult.cs
- DrawingContextWalker.cs
- XmlDesignerDataSourceView.cs
- CodeParameterDeclarationExpression.cs
- DeviceContext.cs
- InvalidWMPVersionException.cs
- ThemeDirectoryCompiler.cs
- BatchParser.cs
- BitmapEffectInput.cs
- CorrelationManager.cs
- TimeEnumHelper.cs
- DataSpaceManager.cs
- WindowsGraphicsCacheManager.cs
- ParameterBuilder.cs
- SamlAssertion.cs
- BuildProvider.cs
- CalendarDateRange.cs
- DataGridViewIntLinkedList.cs
- ValueQuery.cs
- FixedDocumentPaginator.cs
- TypeExtensionConverter.cs
- CacheAxisQuery.cs
- SessionEndingCancelEventArgs.cs
- DictionaryEditChange.cs
- ContextBase.cs
- IntSumAggregationOperator.cs
- RegexCharClass.cs
- PersonalizationStateInfo.cs
- XmlSchemaDatatype.cs
- Composition.cs
- EventEntry.cs
- MarkupObject.cs
- OracleSqlParser.cs
- AnimationClockResource.cs
- DBSchemaTable.cs
- AttributeCollection.cs
- PageContent.cs
- RelationshipEnd.cs
- __Filters.cs
- HttpServerVarsCollection.cs
- FilterQuery.cs
- XslException.cs
- ExpressionNode.cs
- storepermission.cs
- PropertyKey.cs
- TimelineGroup.cs
- CryptoApi.cs
- MexBindingBindingCollectionElement.cs
- RelatedPropertyManager.cs
- DataGridViewCheckBoxCell.cs
- CompModSwitches.cs
- BeginEvent.cs