Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- BindingCompleteEventArgs.cs
- TryExpression.cs
- EtwTrace.cs
- ExecutionContext.cs
- DBCSCodePageEncoding.cs
- DrawingGroup.cs
- SchemaImporterExtensionElement.cs
- BooleanExpr.cs
- MultiDataTrigger.cs
- Activity.cs
- Rectangle.cs
- BitSet.cs
- EraserBehavior.cs
- RightsManagementEncryptionTransform.cs
- ToolStripSeparatorRenderEventArgs.cs
- PasswordTextContainer.cs
- ChangePassword.cs
- Composition.cs
- HandleCollector.cs
- TextBlock.cs
- StatusStrip.cs
- DynamicUpdateCommand.cs
- WindowsTooltip.cs
- IteratorDescriptor.cs
- ParserContext.cs
- ScriptBehaviorDescriptor.cs
- BitmapEffectvisualstate.cs
- XmlProcessingInstruction.cs
- cache.cs
- BrowsableAttribute.cs
- DataListItemCollection.cs
- SQLSingleStorage.cs
- JavaScriptString.cs
- HwndTarget.cs
- FunctionDetailsReader.cs
- ApplicationDirectoryMembershipCondition.cs
- BitmapMetadataBlob.cs
- DSASignatureDeformatter.cs
- KeyValuePairs.cs
- PipeConnection.cs
- MimeObjectFactory.cs
- HtmlTextArea.cs
- SecurityTokenAuthenticator.cs
- CategoryList.cs
- XsltContext.cs
- HtmlLabelAdapter.cs
- MultiBinding.cs
- RuntimeHandles.cs
- SchemaEntity.cs
- Margins.cs
- SharedUtils.cs
- PrimitiveSchema.cs
- WebPartAddingEventArgs.cs
- HyperLinkField.cs
- HashHelper.cs
- X509CertificateInitiatorServiceCredential.cs
- SerializationException.cs
- Journaling.cs
- HwndStylusInputProvider.cs
- EditorAttribute.cs
- TdsParserStaticMethods.cs
- IncomingWebRequestContext.cs
- SerializeAbsoluteContext.cs
- CachedFontFamily.cs
- Panel.cs
- BitmapEffectOutputConnector.cs
- DataBoundLiteralControl.cs
- TextTreePropertyUndoUnit.cs
- DeclaredTypeValidatorAttribute.cs
- DbMetaDataColumnNames.cs
- KeyBinding.cs
- DesigntimeLicenseContext.cs
- LinkArea.cs
- LocationSectionRecord.cs
- StatusBar.cs
- TypeDependencyAttribute.cs
- Validator.cs
- InputBinding.cs
- Debug.cs
- WriteStateInfoBase.cs
- CodeTypeParameterCollection.cs
- InstanceDataCollectionCollection.cs
- Msec.cs
- GregorianCalendar.cs
- ToolStripItemImageRenderEventArgs.cs
- PathHelper.cs
- oledbmetadatacolumnnames.cs
- HybridDictionary.cs
- Grid.cs
- AsyncDataRequest.cs
- UriTemplateMatch.cs
- GridView.cs
- SQLInt64.cs
- DateRangeEvent.cs
- TemplatePropertyEntry.cs
- Material.cs
- _ChunkParse.cs
- TextParagraphProperties.cs
- DataSourceViewSchemaConverter.cs
- FormsAuthenticationCredentials.cs