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
- PathFigureCollectionConverter.cs
- ParsedAttributeCollection.cs
- XamlParser.cs
- GPPOINT.cs
- LinearGradientBrush.cs
- clipboard.cs
- TextDecoration.cs
- DatePickerTextBox.cs
- AccessControlEntry.cs
- EncoderParameters.cs
- StateMachine.cs
- CommandID.cs
- ProviderMetadataCachedInformation.cs
- DynamicILGenerator.cs
- ObjectDataSourceSelectingEventArgs.cs
- TableDetailsCollection.cs
- ReachNamespaceInfo.cs
- ReadOnlyDictionary.cs
- XmlCountingReader.cs
- CompositeFontParser.cs
- DesignerView.Commands.cs
- EntityKeyElement.cs
- ExclusiveTcpTransportManager.cs
- LoginUtil.cs
- SemaphoreSlim.cs
- DirectoryObjectSecurity.cs
- XsdBuilder.cs
- KeyFrames.cs
- XmlSchemaSimpleTypeRestriction.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- OleDbRowUpdatingEvent.cs
- HttpResponseInternalWrapper.cs
- BmpBitmapEncoder.cs
- ObjectHelper.cs
- PointAnimationUsingPath.cs
- IntellisenseTextBox.designer.cs
- ReflectionServiceProvider.cs
- ArrayEditor.cs
- COM2IVsPerPropertyBrowsingHandler.cs
- ArraySubsetEnumerator.cs
- WizardPanel.cs
- RefreshPropertiesAttribute.cs
- SecuritySessionFilter.cs
- CachingHintValidation.cs
- BindingList.cs
- ConfigurationManager.cs
- CompilationSection.cs
- WindowsFormsEditorServiceHelper.cs
- ApplicationSettingsBase.cs
- MemberMaps.cs
- ConfigurationStrings.cs
- RenamedEventArgs.cs
- ConnectionStringsExpressionBuilder.cs
- StringSource.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- KeyedCollection.cs
- XmlCharacterData.cs
- CompilerTypeWithParams.cs
- HtmlInputRadioButton.cs
- PropertyContainer.cs
- HtmlTable.cs
- PasswordTextNavigator.cs
- Assembly.cs
- EtwProvider.cs
- XmlBinaryReader.cs
- XPathBinder.cs
- ScrollData.cs
- WithParamAction.cs
- ConsoleEntryPoint.cs
- BitVector32.cs
- DataGridViewCellEventArgs.cs
- IODescriptionAttribute.cs
- CodeGen.cs
- ObjectDataSourceChooseTypePanel.cs
- HMACSHA384.cs
- ProfileBuildProvider.cs
- SafeSecurityHandles.cs
- PlainXmlSerializer.cs
- DBConnection.cs
- Attributes.cs
- safelinkcollection.cs
- UserControlAutomationPeer.cs
- ScopelessEnumAttribute.cs
- ImageSource.cs
- mactripleDES.cs
- StyleModeStack.cs
- sqlstateclientmanager.cs
- Win32.cs
- Assert.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- RemotingException.cs
- KeyboardEventArgs.cs
- SqlConnectionHelper.cs
- FamilyMapCollection.cs
- PartialTrustVisibleAssembly.cs
- ClientSideQueueItem.cs
- ObjectQuery_EntitySqlExtensions.cs
- SoapSchemaImporter.cs
- HyperlinkAutomationPeer.cs
- SoapAttributeAttribute.cs