Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / WinForms / Managed / System / WinForms / SelectionRange.cs / 1305376 / SelectionRange.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Windows.Forms { using System.Runtime.Serialization.Formatters; using System.Diagnostics; using System; using System.Globalization; using System.Drawing; using System.Windows.Forms; using System.ComponentModel; using System.IO; using Microsoft.Win32; ////// /// This is a class that represents the date selection range of a MonthCalendar control. /// [ TypeConverterAttribute(typeof(SelectionRangeConverter)) ] public sealed class SelectionRange { ////// /// The lower limit of the selection range. /// private DateTime start = DateTime.MinValue.Date; ////// /// The upper limit of the selection range. /// private DateTime end = DateTime.MaxValue.Date; ////// /// Create a new SelectionRange object with the range [null, null]. /// public SelectionRange() { } ////// /// Create a new SelectionRange object with the given range. /// public SelectionRange(DateTime lower, DateTime upper) { //NOTE: simcooke: we explicitly DO NOT want to throw an exception here - just silently // swap them around. This is because the win32 control can return non- // normalized ranges. // We use lower.Date and upper.Date to remove any time component // if (lower < upper) { start = lower.Date; end = upper.Date; } else { start = upper.Date; end = lower.Date; } } ////// /// Create a new SelectionRange object given an existing SelectionRange object. /// public SelectionRange(SelectionRange range) { this.start = range.start; this.end = range.end; } ////// /// Returns the ending time of this range. /// public DateTime End { get { return end; } set { end = value.Date; } } ////// /// Starting time of this range /// public DateTime Start { get { return start; } set { start = value.Date; } } ////// /// Returns a string representation for this control. /// ///public override string ToString() { return "SelectionRange: Start: " + start.ToString() + ", End: " + end.ToString(); } } } // 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
- MediaTimeline.cs
- RuleDefinitions.cs
- TabletCollection.cs
- FontResourceCache.cs
- DocumentViewerConstants.cs
- DataTemplateKey.cs
- Operators.cs
- SchemaObjectWriter.cs
- WindowsEditBoxRange.cs
- ListViewGroup.cs
- XmlWriterTraceListener.cs
- ZipIOExtraFieldElement.cs
- IncrementalReadDecoders.cs
- SizeConverter.cs
- FileLevelControlBuilderAttribute.cs
- GlobalId.cs
- LazyTextWriterCreator.cs
- WeakKeyDictionary.cs
- ErrorFormatter.cs
- OletxTransactionManager.cs
- DataAdapter.cs
- DirectoryNotFoundException.cs
- TextRenderer.cs
- IgnoreDeviceFilterElementCollection.cs
- XmlSchemaIdentityConstraint.cs
- mediaeventshelper.cs
- ThicknessAnimationBase.cs
- _PooledStream.cs
- WaitHandle.cs
- SystemIcmpV4Statistics.cs
- ContentElementAutomationPeer.cs
- SignatureGenerator.cs
- AnnotationResource.cs
- EllipseGeometry.cs
- ToolStripDropDown.cs
- TextEndOfLine.cs
- UIElement3DAutomationPeer.cs
- RecognitionEventArgs.cs
- InlineObject.cs
- PTManager.cs
- XmlElement.cs
- ReadOnlyNameValueCollection.cs
- FormViewModeEventArgs.cs
- IndicCharClassifier.cs
- SetStoryboardSpeedRatio.cs
- DynamicRouteExpression.cs
- BrowserDefinition.cs
- StorageAssociationTypeMapping.cs
- ComplexObject.cs
- SafeNativeMethodsOther.cs
- AppSecurityManager.cs
- PrintingPermissionAttribute.cs
- BasicHttpMessageSecurity.cs
- SingleResultAttribute.cs
- Subset.cs
- StatusBarPanelClickEvent.cs
- PropertyInformation.cs
- QueryTreeBuilder.cs
- ClientEventManager.cs
- InheritanceAttribute.cs
- MDIControlStrip.cs
- DiscoveryExceptionDictionary.cs
- SqlIdentifier.cs
- ResizeGrip.cs
- XPathNodeHelper.cs
- DigitShape.cs
- EnumMember.cs
- ControlFilterExpression.cs
- _BufferOffsetSize.cs
- IISMapPath.cs
- Rotation3DKeyFrameCollection.cs
- AbstractSvcMapFileLoader.cs
- StatusBarItem.cs
- ComponentCollection.cs
- Point.cs
- ChtmlPhoneCallAdapter.cs
- Effect.cs
- ElementAction.cs
- FileDataSourceCache.cs
- UrlParameterWriter.cs
- PageSetupDialog.cs
- QilChoice.cs
- SystemColors.cs
- SqlTypeConverter.cs
- MatrixTransform.cs
- CodeLinePragma.cs
- RequestBringIntoViewEventArgs.cs
- TaskExtensions.cs
- Activation.cs
- UrlMappingCollection.cs
- RadioButton.cs
- HttpContextWrapper.cs
- ObjectReferenceStack.cs
- AxHost.cs
- SingleConverter.cs
- CapabilitiesSection.cs
- SpanIndex.cs
- SurrogateSelector.cs
- ClientSession.cs
- DataGridViewHeaderCell.cs