Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- FileDialog.cs
- LOSFormatter.cs
- TogglePattern.cs
- XmlSchemaAny.cs
- TableDetailsCollection.cs
- Dynamic.cs
- X509CertificateClaimSet.cs
- GradientStopCollection.cs
- Span.cs
- Shared.cs
- QueueException.cs
- PropertyMapper.cs
- WindowsListViewItemStartMenu.cs
- SrgsOneOf.cs
- SemaphoreSecurity.cs
- SHA1CryptoServiceProvider.cs
- JoinSymbol.cs
- _UncName.cs
- WebZoneDesigner.cs
- ConsoleCancelEventArgs.cs
- DelimitedListTraceListener.cs
- FormViewUpdateEventArgs.cs
- MatrixValueSerializer.cs
- PipelineModuleStepContainer.cs
- AutomationEventArgs.cs
- CryptoApi.cs
- SqlBuilder.cs
- DataGridViewImageCell.cs
- SortQuery.cs
- CrossContextChannel.cs
- DrawingGroup.cs
- GenericFlowSwitchHelper.cs
- Paragraph.cs
- BatchWriter.cs
- GetMemberBinder.cs
- NativeMethods.cs
- _SslSessionsCache.cs
- DynamicDiscoveryDocument.cs
- SqlTopReducer.cs
- PlaceHolder.cs
- TrustLevelCollection.cs
- ScrollProperties.cs
- IconConverter.cs
- RootProfilePropertySettingsCollection.cs
- HttpFileCollection.cs
- EntitySqlQueryCacheEntry.cs
- TransactionWaitAsyncResult.cs
- TreeNode.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- RenderOptions.cs
- TargetException.cs
- StringValueSerializer.cs
- ExpressionDumper.cs
- MaterialCollection.cs
- ChannelSinkStacks.cs
- PoisonMessageException.cs
- DataGridRowClipboardEventArgs.cs
- ParameterCollection.cs
- WindowsSpinner.cs
- DataGridTextBoxColumn.cs
- AttributeXamlType.cs
- XamlClipboardData.cs
- ControlCollection.cs
- BaseTemplateParser.cs
- XmlAttributeCache.cs
- IssuedTokenParametersEndpointAddressElement.cs
- SQLDateTime.cs
- Int64.cs
- SetterBaseCollection.cs
- OleDbParameterCollection.cs
- HtmlTable.cs
- FilterQuery.cs
- VisualProxy.cs
- PrePostDescendentsWalker.cs
- CodeIdentifiers.cs
- HttpBrowserCapabilitiesBase.cs
- SecurityManager.cs
- XPathExpr.cs
- SqlLiftIndependentRowExpressions.cs
- GZipDecoder.cs
- OdbcDataAdapter.cs
- CachedTypeface.cs
- EmbeddedMailObjectCollectionEditor.cs
- FrugalList.cs
- IteratorAsyncResult.cs
- PageThemeCodeDomTreeGenerator.cs
- UniqueConstraint.cs
- SqlUtils.cs
- ViewCellSlot.cs
- Walker.cs
- DataGridCellsPresenter.cs
- TextEditorSelection.cs
- ObjectViewEntityCollectionData.cs
- OleDbFactory.cs
- FontClient.cs
- TypedDataSetSchemaImporterExtension.cs
- HtmlTableCell.cs
- AttributeCollection.cs
- Vector3D.cs
- SemaphoreSecurity.cs