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
- CompletionCallbackWrapper.cs
- NativeMethodsCLR.cs
- StateBag.cs
- ExtendedProtectionPolicyTypeConverter.cs
- DefaultProxySection.cs
- RuntimeResourceSet.cs
- RuntimeEnvironment.cs
- UserNamePasswordValidationMode.cs
- ViewStateException.cs
- SchemaCollectionPreprocessor.cs
- CodeParameterDeclarationExpression.cs
- OutputWindow.cs
- ProgressBarRenderer.cs
- AutomationPatternInfo.cs
- RecognizerBase.cs
- Ticks.cs
- ReadOnlyTernaryTree.cs
- SerializationInfoEnumerator.cs
- PersonalizationState.cs
- VisualStyleInformation.cs
- RangeValidator.cs
- StyleBamlTreeBuilder.cs
- ParenExpr.cs
- RouteTable.cs
- NameValueCollection.cs
- SoapWriter.cs
- SafeMemoryMappedFileHandle.cs
- MouseWheelEventArgs.cs
- SizeAnimationClockResource.cs
- RotateTransform3D.cs
- PagesSection.cs
- ZipIOBlockManager.cs
- PropagatorResult.cs
- DecodeHelper.cs
- ProcessModelSection.cs
- FastPropertyAccessor.cs
- RectangleHotSpot.cs
- XmlnsCache.cs
- MarkupCompilePass2.cs
- ColumnMapVisitor.cs
- EditorZoneBase.cs
- ResXDataNode.cs
- TreeView.cs
- BaseResourcesBuildProvider.cs
- TextServicesPropertyRanges.cs
- ClientBuildManagerTypeDescriptionProviderBridge.cs
- MasterPageCodeDomTreeGenerator.cs
- SHA256.cs
- XmlDataDocument.cs
- HttpListenerException.cs
- SignerInfo.cs
- SqlFunctionAttribute.cs
- DateTimeAutomationPeer.cs
- XmlMtomWriter.cs
- XmlMemberMapping.cs
- UniqueIdentifierService.cs
- SqlConnectionStringBuilder.cs
- ControlDesignerState.cs
- OracleParameterBinding.cs
- RegisteredHiddenField.cs
- ControlEvent.cs
- XsltLibrary.cs
- FormClosedEvent.cs
- IPAddressCollection.cs
- PassportIdentity.cs
- PageContent.cs
- CaseInsensitiveHashCodeProvider.cs
- HashUtility.cs
- LayeredChannelListener.cs
- HashHelper.cs
- ColumnMapProcessor.cs
- Predicate.cs
- GestureRecognitionResult.cs
- SerializationException.cs
- SqlCaseSimplifier.cs
- CommandHelpers.cs
- Storyboard.cs
- DecimalAnimationUsingKeyFrames.cs
- DataTableTypeConverter.cs
- ExceptionUtil.cs
- SerializationStore.cs
- CodeAccessPermission.cs
- SessionStateModule.cs
- AnnotationMap.cs
- SqlDesignerDataSourceView.cs
- EdmError.cs
- AccessDataSourceView.cs
- ShaperBuffers.cs
- VirtualizingPanel.cs
- EncryptedPackage.cs
- HotSpotCollectionEditor.cs
- SessionState.cs
- DiscoveryUtility.cs
- TableChangeProcessor.cs
- HttpPostLocalhostServerProtocol.cs
- DataGridViewDataConnection.cs
- AVElementHelper.cs
- KeyValueInternalCollection.cs
- FilteredDataSetHelper.cs
- InlineUIContainer.cs