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
- FilterableAttribute.cs
- DataGridViewCellValueEventArgs.cs
- ExceptionUtility.cs
- DtrList.cs
- AsyncInvokeOperation.cs
- GridViewRowPresenterBase.cs
- System.Data_BID.cs
- SortedList.cs
- BitmapEffectDrawingContextWalker.cs
- XmlSchemaSimpleTypeList.cs
- RuleSetDialog.Designer.cs
- SynchronizedPool.cs
- CodeVariableReferenceExpression.cs
- ApplicationSettingsBase.cs
- DbProviderConfigurationHandler.cs
- ScrollBar.cs
- SqlNodeAnnotation.cs
- ReadOnlyHierarchicalDataSource.cs
- SafeNativeMethods.cs
- Compiler.cs
- WebPartDescriptionCollection.cs
- CroppedBitmap.cs
- StorageAssociationTypeMapping.cs
- BigIntegerStorage.cs
- ApplicationCommands.cs
- SmiEventSink.cs
- EmptyStringExpandableObjectConverter.cs
- WindowsImpersonationContext.cs
- TraceSection.cs
- clipboard.cs
- UpdateCommand.cs
- newitemfactory.cs
- DataGridColumnHeaderCollection.cs
- AttachedProperty.cs
- ManifestSignatureInformation.cs
- RotateTransform3D.cs
- PropertyRecord.cs
- ScriptBehaviorDescriptor.cs
- EntityTypeEmitter.cs
- StrongNameSignatureInformation.cs
- PersonalizationProviderHelper.cs
- EntityDesignerDataSourceView.cs
- EntitySqlException.cs
- FormatException.cs
- Function.cs
- TableCellCollection.cs
- BuiltInExpr.cs
- StrongNameIdentityPermission.cs
- LazyInitializer.cs
- TypeUtils.cs
- TraceSource.cs
- XmlSchemaAnyAttribute.cs
- TransformedBitmap.cs
- StorageEntityTypeMapping.cs
- SmiContext.cs
- CheckBoxList.cs
- PackageController.cs
- CodePropertyReferenceExpression.cs
- PanelStyle.cs
- InputLangChangeRequestEvent.cs
- FormViewRow.cs
- WebControlParameterProxy.cs
- BindingUtils.cs
- ToolStripLocationCancelEventArgs.cs
- DataServiceQueryProvider.cs
- TextTreeTextBlock.cs
- ListParaClient.cs
- AssemblyAssociatedContentFileAttribute.cs
- TraversalRequest.cs
- DoubleStorage.cs
- StringSorter.cs
- ManagementDateTime.cs
- WebCategoryAttribute.cs
- AppearanceEditorPart.cs
- ComPlusSynchronizationContext.cs
- cache.cs
- DesignerSerializerAttribute.cs
- NameGenerator.cs
- InternalControlCollection.cs
- DefaultValidator.cs
- XmlReflectionMember.cs
- UpdatePanelControlTrigger.cs
- UnicodeEncoding.cs
- ParserContext.cs
- CharConverter.cs
- QilReference.cs
- ControlType.cs
- StdValidatorsAndConverters.cs
- TreeNodeStyleCollection.cs
- AccessibleObject.cs
- NullExtension.cs
- TypeValidationEventArgs.cs
- RadioButton.cs
- Transform3D.cs
- ProcessThreadCollection.cs
- PerfService.cs
- RectangleHotSpot.cs
- BamlCollectionHolder.cs
- DataRelationPropertyDescriptor.cs
- FontCacheLogic.cs