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
- SeparatorAutomationPeer.cs
- bindurihelper.cs
- ControlHelper.cs
- TemplatePagerField.cs
- FontResourceCache.cs
- ContractTypeNameElement.cs
- ObjectListCommandsPage.cs
- TableHeaderCell.cs
- XmlSchemaValidationException.cs
- KernelTypeValidation.cs
- ScriptMethodAttribute.cs
- ToolStripMenuItemCodeDomSerializer.cs
- XPathConvert.cs
- NamespaceEmitter.cs
- SynthesizerStateChangedEventArgs.cs
- XmlWriter.cs
- XPathCompileException.cs
- WinOEToolBoxItem.cs
- DataGridViewColumnCollection.cs
- MembershipValidatePasswordEventArgs.cs
- ListViewAutomationPeer.cs
- SolidColorBrush.cs
- FileSystemWatcher.cs
- InputScope.cs
- DispatcherExceptionEventArgs.cs
- InheritanceContextChangedEventManager.cs
- FigureHelper.cs
- DecoderReplacementFallback.cs
- TimeSpan.cs
- RowToFieldTransformer.cs
- AlgoModule.cs
- StringWriter.cs
- DataGridViewImageColumn.cs
- HtmlTableCellCollection.cs
- SqlUDTStorage.cs
- EncodingTable.cs
- PreviewPrintController.cs
- PrintControllerWithStatusDialog.cs
- XmlIlVisitor.cs
- GC.cs
- EnvironmentPermission.cs
- TreeViewDesigner.cs
- XmlCustomFormatter.cs
- DLinqDataModelProvider.cs
- ErrorHandler.cs
- FactoryId.cs
- dataprotectionpermissionattribute.cs
- EventSinkActivityDesigner.cs
- WizardSideBarListControlItemEventArgs.cs
- EncoderReplacementFallback.cs
- documentsequencetextpointer.cs
- DataServiceContext.cs
- DiscoveryClientDuplexChannel.cs
- DiscoveryProxy.cs
- CursorEditor.cs
- XmlSchemaExporter.cs
- TimerEventSubscription.cs
- ToolStripSeparator.cs
- COM2TypeInfoProcessor.cs
- DataGridViewCellStyleContentChangedEventArgs.cs
- ListParagraph.cs
- PlatformCulture.cs
- ResourceWriter.cs
- StrongNameKeyPair.cs
- NameTable.cs
- RealizationDrawingContextWalker.cs
- RepeaterItemCollection.cs
- SemanticResolver.cs
- ObjectStateFormatter.cs
- SudsWriter.cs
- WebMessageFormatHelper.cs
- UnsafeNativeMethods.cs
- NamespaceQuery.cs
- DesignObjectWrapper.cs
- MethodInfo.cs
- StringConverter.cs
- PropertyChangedEventManager.cs
- ListViewDeleteEventArgs.cs
- EnvironmentPermission.cs
- RemotingConfiguration.cs
- WeakReference.cs
- PrtCap_Builder.cs
- RegexGroup.cs
- RadioButtonAutomationPeer.cs
- RoutedEventConverter.cs
- ChangeConflicts.cs
- SchemaContext.cs
- SQLChars.cs
- OleDbErrorCollection.cs
- WebZone.cs
- OutputCacheProfileCollection.cs
- COM2FontConverter.cs
- TemplateBindingExtensionConverter.cs
- BaseTemplateCodeDomTreeGenerator.cs
- CustomBindingElement.cs
- ImageListStreamer.cs
- SplineQuaternionKeyFrame.cs
- WebPartRestoreVerb.cs
- AlgoModule.cs
- SqlBuilder.cs