Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / WinForms / Managed / System / WinForms / SelectionRange.cs / 1 / 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. //------------------------------------------------------------------------------ // // 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
- FixedSOMPageElement.cs
- TransportContext.cs
- DiscoveryClientElement.cs
- CodeStatementCollection.cs
- KnownAssemblyEntry.cs
- SiteMapDataSource.cs
- TextFormatterHost.cs
- StorageMappingFragment.cs
- IndexedSelectQueryOperator.cs
- MailHeaderInfo.cs
- ImageMapEventArgs.cs
- InputReport.cs
- SoapWriter.cs
- CodeArrayCreateExpression.cs
- PeerContact.cs
- CustomAttribute.cs
- XPathEmptyIterator.cs
- CompiledQueryCacheEntry.cs
- ContainerAction.cs
- StatusBarDrawItemEvent.cs
- Authorization.cs
- MarshalDirectiveException.cs
- peersecuritysettings.cs
- ConfigXmlAttribute.cs
- PropertyDescriptorGridEntry.cs
- XmlDataSource.cs
- StylusPointCollection.cs
- CodeDomConfigurationHandler.cs
- SizeConverter.cs
- BamlResourceDeserializer.cs
- DataGridViewCellStyleConverter.cs
- ProfessionalColorTable.cs
- _LazyAsyncResult.cs
- FrameworkObject.cs
- WsatExtendedInformation.cs
- PageContent.cs
- TableAdapterManagerNameHandler.cs
- UnsafeNativeMethods.cs
- ObjectItemCachedAssemblyLoader.cs
- GridViewRowCollection.cs
- UserThread.cs
- MenuCommand.cs
- HighlightVisual.cs
- TempFiles.cs
- IndependentlyAnimatedPropertyMetadata.cs
- DocumentPaginator.cs
- ExtensionWindow.cs
- AmbientLight.cs
- PopupRootAutomationPeer.cs
- QuaternionAnimation.cs
- PopOutPanel.cs
- XmlQueryType.cs
- MatrixKeyFrameCollection.cs
- GeneralTransformGroup.cs
- EntityDataSourceStatementEditor.cs
- IndicCharClassifier.cs
- SqlNotificationRequest.cs
- ViewKeyConstraint.cs
- MDIControlStrip.cs
- ObjectDataSourceDisposingEventArgs.cs
- CompositeTypefaceMetrics.cs
- ActivitySurrogate.cs
- SqlConnectionHelper.cs
- PartialArray.cs
- PreviewPageInfo.cs
- LazyTextWriterCreator.cs
- ReferentialConstraint.cs
- ProxyAttribute.cs
- ClientTargetSection.cs
- WebZone.cs
- TypedColumnHandler.cs
- WindowProviderWrapper.cs
- SerializeAbsoluteContext.cs
- OutputCacheProfileCollection.cs
- ImpersonateTokenRef.cs
- ByeOperation11AsyncResult.cs
- DashStyles.cs
- HttpStaticObjectsCollectionWrapper.cs
- SoapProcessingBehavior.cs
- MenuItemStyle.cs
- SelectionBorderGlyph.cs
- HtmlInputButton.cs
- AdRotator.cs
- Composition.cs
- EnumBuilder.cs
- ProtocolsConfigurationEntry.cs
- SchemaMapping.cs
- CompositionAdorner.cs
- UnescapedXmlDiagnosticData.cs
- recordstatescratchpad.cs
- RectValueSerializer.cs
- IntPtr.cs
- MatrixTransform.cs
- UnsafeCollabNativeMethods.cs
- WebBrowser.cs
- Transform.cs
- _LocalDataStore.cs
- InlinedLocationReference.cs
- CaseCqlBlock.cs
- TargetParameterCountException.cs