Code:
/ FX-1434 / FX-1434 / 1.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
- PaginationProgressEventArgs.cs
- StyleSelector.cs
- RSAOAEPKeyExchangeDeformatter.cs
- XPathAncestorIterator.cs
- XmlDocumentFieldSchema.cs
- AssemblyName.cs
- AttributeSetAction.cs
- ArithmeticException.cs
- CompositeTypefaceMetrics.cs
- LogExtent.cs
- InvalidCastException.cs
- XmlSchemaAnnotation.cs
- XmlToDatasetMap.cs
- FieldCollectionEditor.cs
- DocumentCollection.cs
- TableChangeProcessor.cs
- TransactionsSectionGroup.cs
- MissingMethodException.cs
- TraceEventCache.cs
- TextDecorationLocationValidation.cs
- ChildDocumentBlock.cs
- ExecutorLocksHeldException.cs
- CacheForPrimitiveTypes.cs
- BuildProviderUtils.cs
- HttpHandlersInstallComponent.cs
- HttpRequest.cs
- WindowsSpinner.cs
- TypeSource.cs
- XmlArrayItemAttributes.cs
- LoadedOrUnloadedOperation.cs
- FixedSOMPageConstructor.cs
- TemplateInstanceAttribute.cs
- TransformerInfo.cs
- DataSourceSerializationException.cs
- DispatcherEventArgs.cs
- GridViewPageEventArgs.cs
- DesignBinding.cs
- SimpleApplicationHost.cs
- RangeValuePattern.cs
- DataRecordInternal.cs
- RepeaterItemCollection.cs
- ParentQuery.cs
- DivideByZeroException.cs
- ExceptionUtility.cs
- TreeNodeBinding.cs
- SafeCryptoKeyHandle.cs
- SystemParameters.cs
- EntityDataSourceContainerNameItem.cs
- RowTypePropertyElement.cs
- XmlAnyAttributeAttribute.cs
- TextElementAutomationPeer.cs
- MiniCustomAttributeInfo.cs
- AssemblyAssociatedContentFileAttribute.cs
- OdbcParameter.cs
- CodeEntryPointMethod.cs
- CfgParser.cs
- ContentHostHelper.cs
- WebColorConverter.cs
- SqlDelegatedTransaction.cs
- FixUp.cs
- InfoCardRSAPKCS1KeyExchangeDeformatter.cs
- DatagridviewDisplayedBandsData.cs
- DataObject.cs
- EnvironmentPermission.cs
- ICspAsymmetricAlgorithm.cs
- XmlBinaryReaderSession.cs
- DefaultPropertiesToSend.cs
- _Events.cs
- PropertyIDSet.cs
- DataGridViewCheckBoxColumn.cs
- FieldMetadata.cs
- DrawToolTipEventArgs.cs
- CodeExporter.cs
- PropertyConverter.cs
- HostedElements.cs
- AppliedDeviceFiltersEditor.cs
- InvalidContentTypeException.cs
- XmlValidatingReader.cs
- LongPath.cs
- MsmqAuthenticationMode.cs
- FontWeight.cs
- CodeArrayCreateExpression.cs
- SerialErrors.cs
- ProviderCollection.cs
- TreeView.cs
- ToolStripDesignerAvailabilityAttribute.cs
- FixedFlowMap.cs
- TimeEnumHelper.cs
- ContentType.cs
- DesignerTextViewAdapter.cs
- MeshGeometry3D.cs
- DataSourceHelper.cs
- SmiRecordBuffer.cs
- SimpleWebHandlerParser.cs
- InstallerTypeAttribute.cs
- FunctionNode.cs
- IteratorDescriptor.cs
- AssociatedControlConverter.cs
- CommonDialog.cs
- OutputCacheSettingsSection.cs