Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- MonthCalendar.cs
- ObjectManager.cs
- Comparer.cs
- InstancePersistenceContext.cs
- PrintController.cs
- VerificationException.cs
- ProxyAttribute.cs
- MimeTextImporter.cs
- BigIntegerStorage.cs
- SqlAliaser.cs
- WCFModelStrings.Designer.cs
- DiscardableAttribute.cs
- ApplicationCommands.cs
- PartialClassGenerationTask.cs
- XPathQilFactory.cs
- PasswordBoxAutomationPeer.cs
- ConcurrentQueue.cs
- AutomationAttributeInfo.cs
- WebServiceErrorEvent.cs
- Activator.cs
- VerticalConnector.xaml.cs
- CachedPathData.cs
- TextBoxAutomationPeer.cs
- XmlDictionaryString.cs
- DataKeyArray.cs
- DependsOnAttribute.cs
- ImportRequest.cs
- ObjectListItemCollection.cs
- ConfigXmlText.cs
- ProfileParameter.cs
- DataServiceHost.cs
- DynamicValueConverter.cs
- EntitySqlQueryBuilder.cs
- ObjectCloneHelper.cs
- TableRowsCollectionEditor.cs
- TextTreeText.cs
- GetMemberBinder.cs
- ObjectAnimationBase.cs
- DataObjectFieldAttribute.cs
- SqlCacheDependency.cs
- GridViewRowPresenterBase.cs
- FixUpCollection.cs
- AccessDataSource.cs
- ProtocolsConfiguration.cs
- IDictionary.cs
- PagesSection.cs
- EncodingNLS.cs
- RuntimeArgumentHandle.cs
- ProviderSettingsCollection.cs
- FlowDocumentView.cs
- ModuleConfigurationInfo.cs
- BitmapSource.cs
- OleDbPermission.cs
- MetaModel.cs
- SignatureDescription.cs
- DataSourceCache.cs
- DataPagerCommandEventArgs.cs
- ProfileService.cs
- ScrollProperties.cs
- BitmapEffectInput.cs
- FieldToken.cs
- FacetChecker.cs
- GeneralTransform3DTo2D.cs
- WCFBuildProvider.cs
- TiffBitmapEncoder.cs
- ServiceNotStartedException.cs
- DuplicateWaitObjectException.cs
- ConfigurationLocationCollection.cs
- FileUpload.cs
- Assembly.cs
- Code.cs
- SQLByteStorage.cs
- XPathException.cs
- HttpProfileGroupBase.cs
- EncodingDataItem.cs
- Directory.cs
- CodeGeneratorOptions.cs
- SystemUnicastIPAddressInformation.cs
- XmlReflectionMember.cs
- MetadataArtifactLoaderFile.cs
- WinInet.cs
- URLIdentityPermission.cs
- ObjectDataSourceMethodEventArgs.cs
- ScaleTransform3D.cs
- XPathNodeList.cs
- HtmlLiteralTextAdapter.cs
- GetMemberBinder.cs
- Mappings.cs
- FormViewDeleteEventArgs.cs
- EventTrigger.cs
- SqlUserDefinedAggregateAttribute.cs
- DocumentViewer.cs
- ImportCatalogPart.cs
- SettingsProperty.cs
- StreamingContext.cs
- CommandHelpers.cs
- RoleManagerEventArgs.cs
- NetDataContractSerializer.cs
- DataGridViewControlCollection.cs
- HttpRequestContext.cs