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
- ToolStripItem.cs
- GridViewCommandEventArgs.cs
- SchemaNotation.cs
- AmbientValueAttribute.cs
- RouteValueDictionary.cs
- UnsettableComboBox.cs
- Region.cs
- FormViewUpdatedEventArgs.cs
- SemaphoreSecurity.cs
- EnumCodeDomSerializer.cs
- CodeExporter.cs
- RenderCapability.cs
- SmtpCommands.cs
- QuaternionAnimation.cs
- DataRelationPropertyDescriptor.cs
- PerfCounters.cs
- IconHelper.cs
- Debug.cs
- RawUIStateInputReport.cs
- StringValidator.cs
- AddressHeaderCollectionElement.cs
- Rijndael.cs
- PolygonHotSpot.cs
- AbandonedMutexException.cs
- GridViewPageEventArgs.cs
- TypeGeneratedEventArgs.cs
- DocumentSchemaValidator.cs
- FacetEnabledSchemaElement.cs
- IndependentAnimationStorage.cs
- DeviceContexts.cs
- MetadataItemEmitter.cs
- ClassValidator.cs
- DefaultAuthorizationContext.cs
- objectquery_tresulttype.cs
- UnionCodeGroup.cs
- XmlSchemaElement.cs
- CTreeGenerator.cs
- WebPartMenuStyle.cs
- DataGridItemEventArgs.cs
- Partitioner.cs
- MultiAsyncResult.cs
- PrintPreviewDialog.cs
- DataServiceResponse.cs
- OdbcCommandBuilder.cs
- SocketElement.cs
- BinarySecretSecurityToken.cs
- XamlReader.cs
- SizeIndependentAnimationStorage.cs
- WhileDesigner.xaml.cs
- EdmPropertyAttribute.cs
- DataControlField.cs
- SqlMethodTransformer.cs
- Image.cs
- RolePrincipal.cs
- RenderingEventArgs.cs
- InfoCardAsymmetricCrypto.cs
- IdleTimeoutMonitor.cs
- EntityDataSourceContextCreatedEventArgs.cs
- PanelContainerDesigner.cs
- CompensationHandlingFilter.cs
- ListBase.cs
- ScriptResourceAttribute.cs
- ObjectDataSourceSelectingEventArgs.cs
- Internal.cs
- NGCUIElementCollectionSerializerAsync.cs
- LinqDataSourceValidationException.cs
- NGCPageContentCollectionSerializerAsync.cs
- CapabilitiesAssignment.cs
- DataListItemEventArgs.cs
- WmpBitmapDecoder.cs
- __ComObject.cs
- DependencyPropertyKey.cs
- AssociationSetEnd.cs
- TCEAdapterGenerator.cs
- CssTextWriter.cs
- XmlDictionary.cs
- _SslState.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- XPathChildIterator.cs
- XmlArrayItemAttributes.cs
- SQLInt64Storage.cs
- SqlInfoMessageEvent.cs
- BitmapCodecInfoInternal.cs
- ToolStripRendererSwitcher.cs
- AliasedSlot.cs
- Metafile.cs
- FlowDocumentScrollViewer.cs
- MessageQueuePermissionEntryCollection.cs
- CaseInsensitiveComparer.cs
- FontWeights.cs
- wmiprovider.cs
- NoPersistScope.cs
- PingReply.cs
- TimeSpan.cs
- LocationUpdates.cs
- WebPartAddingEventArgs.cs
- ObjectViewListener.cs
- ServiceReference.cs
- TextRunProperties.cs
- LinkConverter.cs