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
- BezierSegment.cs
- ProfileInfo.cs
- SemanticValue.cs
- ListViewGroupConverter.cs
- Screen.cs
- _RequestLifetimeSetter.cs
- LoginStatusDesigner.cs
- Command.cs
- HashCodeCombiner.cs
- CircleEase.cs
- SoapInteropTypes.cs
- HtmlAnchor.cs
- ScrollBar.cs
- Oci.cs
- Vector3DConverter.cs
- InternalBufferOverflowException.cs
- Ray3DHitTestResult.cs
- ServiceModelActivationSectionGroup.cs
- CapabilitiesUse.cs
- XmlILIndex.cs
- PenThread.cs
- OleDbError.cs
- FamilyTypefaceCollection.cs
- EventRoute.cs
- Int16AnimationUsingKeyFrames.cs
- UiaCoreTypesApi.cs
- EnumConverter.cs
- HttpModuleActionCollection.cs
- TypeReference.cs
- MeasureItemEvent.cs
- sqlmetadatafactory.cs
- ChildrenQuery.cs
- XmlHelper.cs
- EntityTransaction.cs
- SecurityTokenSerializer.cs
- ResourceExpressionBuilder.cs
- XmlSerializerVersionAttribute.cs
- Splitter.cs
- PolyBezierSegment.cs
- CustomCategoryAttribute.cs
- AdornerPresentationContext.cs
- Walker.cs
- Parameter.cs
- ProfileEventArgs.cs
- WindowsAuthenticationEventArgs.cs
- EncodingNLS.cs
- FixedTextSelectionProcessor.cs
- ComponentConverter.cs
- DateTimeConverter.cs
- XmlException.cs
- MethodImplAttribute.cs
- XmlEnumAttribute.cs
- NamespaceQuery.cs
- SqlClientWrapperSmiStreamChars.cs
- DragAssistanceManager.cs
- ToolStripContentPanelRenderEventArgs.cs
- Point3DIndependentAnimationStorage.cs
- RegistryConfigurationProvider.cs
- LinkButton.cs
- ISO2022Encoding.cs
- TextCollapsingProperties.cs
- TextEditorCharacters.cs
- UnlockCardRequest.cs
- BinaryObjectWriter.cs
- SynchronizedRandom.cs
- DataSourceXmlElementAttribute.cs
- XPathSelectionIterator.cs
- SchemaSetCompiler.cs
- DragCompletedEventArgs.cs
- EditingMode.cs
- CheckPair.cs
- ObjectParameterCollection.cs
- NavigationPropertyEmitter.cs
- BrowserDefinition.cs
- InstanceNameConverter.cs
- RadioButtonBaseAdapter.cs
- CustomErrorCollection.cs
- _Semaphore.cs
- SqlConnectionPoolGroupProviderInfo.cs
- OracleTimeSpan.cs
- PropertyInformationCollection.cs
- FamilyMap.cs
- XPathNavigator.cs
- BinaryObjectReader.cs
- QualificationDataItem.cs
- ClientProxyGenerator.cs
- COM2ICategorizePropertiesHandler.cs
- Vector3DAnimation.cs
- diagnosticsswitches.cs
- Size3DConverter.cs
- PagesSection.cs
- arc.cs
- CapacityStreamGeometryContext.cs
- PersonalizationAdministration.cs
- WebBrowserBase.cs
- PositiveTimeSpanValidatorAttribute.cs
- RsaKeyIdentifierClause.cs
- MLangCodePageEncoding.cs
- OperationContractGenerationContext.cs
- MemberDescriptor.cs