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
- DataGridViewCellMouseEventArgs.cs
- Line.cs
- COM2EnumConverter.cs
- Configuration.cs
- SQLGuid.cs
- PasswordTextNavigator.cs
- Util.cs
- WindowsFormsHost.cs
- PointF.cs
- LinkTarget.cs
- ComplexType.cs
- MethodAccessException.cs
- CaseInsensitiveHashCodeProvider.cs
- DesignerTransactionCloseEvent.cs
- InputLanguage.cs
- AuthenticateEventArgs.cs
- NonClientArea.cs
- XsltCompileContext.cs
- HttpGetServerProtocol.cs
- PersonalizationStateInfoCollection.cs
- DataListItem.cs
- InputReportEventArgs.cs
- DataSourceHelper.cs
- TdsEnums.cs
- ClientUtils.cs
- TextTreeTextElementNode.cs
- PriorityRange.cs
- ComplexLine.cs
- AnnotationService.cs
- ClientSession.cs
- InteropBitmapSource.cs
- CheckPair.cs
- QilTypeChecker.cs
- DoubleLinkList.cs
- PolicyValidationException.cs
- DiagnosticTrace.cs
- MenuEventArgs.cs
- UserNameSecurityToken.cs
- FaultHandlingFilter.cs
- SettingsAttributes.cs
- Block.cs
- ListViewUpdatedEventArgs.cs
- XmlSchemaFacet.cs
- SearchForVirtualItemEventArgs.cs
- EnumerableRowCollection.cs
- FastEncoder.cs
- SelectionItemPattern.cs
- JsonQNameDataContract.cs
- ControlBuilderAttribute.cs
- FillBehavior.cs
- _Semaphore.cs
- SchemaElementLookUpTable.cs
- BezierSegment.cs
- HtmlInputPassword.cs
- MouseGestureConverter.cs
- VariableQuery.cs
- DefaultMemberAttribute.cs
- XPathArrayIterator.cs
- Accessors.cs
- ServiceManager.cs
- MsmqAuthenticationMode.cs
- Button.cs
- TrackBar.cs
- Decoder.cs
- IUnknownConstantAttribute.cs
- ExtenderControl.cs
- ByteStorage.cs
- ContextStaticAttribute.cs
- EncoderBestFitFallback.cs
- SpeechAudioFormatInfo.cs
- ReachVisualSerializer.cs
- FormViewPageEventArgs.cs
- DictionaryBase.cs
- MetafileHeader.cs
- BoundField.cs
- SettingsPropertyValue.cs
- SchemaNames.cs
- BasicHttpBindingCollectionElement.cs
- ScrollViewerAutomationPeer.cs
- ErrorWrapper.cs
- _RequestLifetimeSetter.cs
- TransactionState.cs
- NamedPipeAppDomainProtocolHandler.cs
- HtmlHead.cs
- ToolStripPanel.cs
- ToolStripPanelRenderEventArgs.cs
- LambdaCompiler.Binary.cs
- DesignerForm.cs
- DisableDpiAwarenessAttribute.cs
- TableRow.cs
- LayoutManager.cs
- WindowsListBox.cs
- basecomparevalidator.cs
- TransactionChannelFaultConverter.cs
- SiteMembershipCondition.cs
- SmiRequestExecutor.cs
- BookmarkResumptionRecord.cs
- UseAttributeSetsAction.cs
- SqlTriggerAttribute.cs
- WrappedIUnknown.cs