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
- BufferedResponseStream.cs
- ExpressionPrefixAttribute.cs
- TypeUnloadedException.cs
- PortCache.cs
- MethodBuilderInstantiation.cs
- ToolStripPanelRenderEventArgs.cs
- MulticastOption.cs
- ISAPIRuntime.cs
- HWStack.cs
- ActivatedMessageQueue.cs
- IncrementalReadDecoders.cs
- ProviderMetadata.cs
- TriggerBase.cs
- InputProviderSite.cs
- HMACSHA256.cs
- DesignerCapabilities.cs
- OciLobLocator.cs
- AutomationPatternInfo.cs
- VisualProxy.cs
- AspNetSynchronizationContext.cs
- UInt16Converter.cs
- ClassDataContract.cs
- ToolTipAutomationPeer.cs
- WebBrowserDocumentCompletedEventHandler.cs
- UIPermission.cs
- AttachedPropertyBrowsableForChildrenAttribute.cs
- GridViewRow.cs
- NetDataContractSerializer.cs
- ThrowHelper.cs
- CompiledRegexRunnerFactory.cs
- Transform3DGroup.cs
- StubHelpers.cs
- DashStyles.cs
- OdbcParameterCollection.cs
- HttpListener.cs
- ListInitExpression.cs
- PreloadedPackages.cs
- wgx_sdk_version.cs
- MachineKeyConverter.cs
- CultureTableRecord.cs
- ParenthesizePropertyNameAttribute.cs
- PageBuildProvider.cs
- SocketInformation.cs
- ValidatorCollection.cs
- RC2.cs
- LineVisual.cs
- TreeViewItem.cs
- RootBrowserWindowAutomationPeer.cs
- ParagraphResult.cs
- PreProcessInputEventArgs.cs
- AsymmetricKeyExchangeFormatter.cs
- TextTreePropertyUndoUnit.cs
- MultiView.cs
- ObjectRef.cs
- DLinqTableProvider.cs
- ObjectListField.cs
- PageEventArgs.cs
- FtpRequestCacheValidator.cs
- ThreadAttributes.cs
- DurableOperationContext.cs
- StrongTypingException.cs
- ProgressBarBrushConverter.cs
- InvalidAsynchronousStateException.cs
- ConnectionDemuxer.cs
- Section.cs
- HttpRawResponse.cs
- diagnosticsswitches.cs
- LinkLabel.cs
- Win32.cs
- WindowsComboBox.cs
- ValidationContext.cs
- CultureInfo.cs
- GenericTypeParameterConverter.cs
- WinInetCache.cs
- OneOf.cs
- XmlSignatureProperties.cs
- MsmqHostedTransportConfiguration.cs
- DocumentPageTextView.cs
- GlobalizationAssembly.cs
- PtsHelper.cs
- InternalsVisibleToAttribute.cs
- DesignerActionKeyboardBehavior.cs
- TextTreeText.cs
- CorrelationValidator.cs
- TextTreeUndoUnit.cs
- XhtmlConformanceSection.cs
- BitmapMetadata.cs
- VisualBrush.cs
- Vars.cs
- ThreadInterruptedException.cs
- TTSEvent.cs
- ReflectionTypeLoadException.cs
- ListControlConvertEventArgs.cs
- SizeKeyFrameCollection.cs
- DataGridViewRowCancelEventArgs.cs
- RemotingConfiguration.cs
- FontFamilyValueSerializer.cs
- SafeNativeMemoryHandle.cs
- GridViewCancelEditEventArgs.cs
- FileDocument.cs