Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / InterOp / OperatingSystemVersionCheck.cs / 1305600 / OperatingSystemVersionCheck.cs
//---------------------------------------------------------------------------- // // Copyright (C) Microsoft Corporation. All rights reserved. // //--------------------------------------------------------------------------- using System; namespace System.Windows.Interop { ////// Performs a simple check of the current operating system version. /// Use this class to determine whether version specific features should /// be enabled. /// internal static class OperatingSystemVersionCheck { internal static bool IsVersionOrLater(OperatingSystemVersion version) { // int major; int minor; PlatformID platform = PlatformID.Win32NT; switch (version) { case OperatingSystemVersion.Windows7: major = 6; minor = 1; break; case OperatingSystemVersion.WindowsVista: major = 6; minor = 0; break; case OperatingSystemVersion.WindowsXPSP2: default: major = 5; minor = 1; break; } OperatingSystem os = Environment.OSVersion; return (os.Platform == platform) && (((os.Version.Major == major) && (os.Version.Minor >= minor)) || (os.Version.Major > major)); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //---------------------------------------------------------------------------- // // Copyright (C) Microsoft Corporation. All rights reserved. // //--------------------------------------------------------------------------- using System; namespace System.Windows.Interop { ////// Performs a simple check of the current operating system version. /// Use this class to determine whether version specific features should /// be enabled. /// internal static class OperatingSystemVersionCheck { internal static bool IsVersionOrLater(OperatingSystemVersion version) { // int major; int minor; PlatformID platform = PlatformID.Win32NT; switch (version) { case OperatingSystemVersion.Windows7: major = 6; minor = 1; break; case OperatingSystemVersion.WindowsVista: major = 6; minor = 0; break; case OperatingSystemVersion.WindowsXPSP2: default: major = 5; minor = 1; break; } OperatingSystem os = Environment.OSVersion; return (os.Platform == platform) && (((os.Version.Major == major) && (os.Version.Minor >= minor)) || (os.Version.Major > major)); } } } // 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
- Journal.cs
- BooleanKeyFrameCollection.cs
- DiscoveryReferences.cs
- SrgsToken.cs
- IgnoreFileBuildProvider.cs
- SkinBuilder.cs
- UnsafeNativeMethods.cs
- XmlTextEncoder.cs
- ContentElement.cs
- FontStyles.cs
- ConnectionOrientedTransportBindingElement.cs
- GridItemProviderWrapper.cs
- ServiceModelActivationSectionGroup.cs
- BridgeDataReader.cs
- RotateTransform.cs
- WindowsListView.cs
- Queue.cs
- XPathBinder.cs
- StylusPointProperty.cs
- GCHandleCookieTable.cs
- RevocationPoint.cs
- LayoutInformation.cs
- DefaultAssemblyResolver.cs
- MenuItemAutomationPeer.cs
- SoapAttributeAttribute.cs
- Int32Animation.cs
- Int64KeyFrameCollection.cs
- ConstructorBuilder.cs
- FunctionDescription.cs
- FrameworkElementAutomationPeer.cs
- HtmlInputSubmit.cs
- TraceSection.cs
- InstancePersistenceCommand.cs
- SAPIEngineTypes.cs
- PointConverter.cs
- AutoSizeComboBox.cs
- DataViewSetting.cs
- WorkflowInstanceProvider.cs
- TreeViewImageIndexConverter.cs
- ArgIterator.cs
- LocationUpdates.cs
- ApplyTemplatesAction.cs
- PopupEventArgs.cs
- XmlDataSource.cs
- OperationCanceledException.cs
- Permission.cs
- UnsafeCollabNativeMethods.cs
- ExecutedRoutedEventArgs.cs
- XmlHierarchicalEnumerable.cs
- BufferAllocator.cs
- CaseKeyBox.ViewModel.cs
- WindowHideOrCloseTracker.cs
- TextAnchor.cs
- SoapEnumAttribute.cs
- OleDbEnumerator.cs
- SafeNativeMethods.cs
- ProcessModule.cs
- CatalogPartCollection.cs
- GridViewCancelEditEventArgs.cs
- SchemaContext.cs
- StringFunctions.cs
- StandardToolWindows.cs
- DragDeltaEventArgs.cs
- PolicyChain.cs
- LocalizableResourceBuilder.cs
- SessionIDManager.cs
- MessageDecoder.cs
- UInt16Converter.cs
- ResolvedKeyFrameEntry.cs
- Identity.cs
- WorkflowEnvironment.cs
- GradientBrush.cs
- DrawListViewSubItemEventArgs.cs
- _ListenerRequestStream.cs
- SmtpCommands.cs
- QilLoop.cs
- NestedContainer.cs
- HitTestDrawingContextWalker.cs
- XmlSchemaAny.cs
- RubberbandSelector.cs
- Terminate.cs
- ResourceBinder.cs
- MutexSecurity.cs
- UserNamePasswordValidationMode.cs
- Identifier.cs
- AmbiguousMatchException.cs
- CounterSample.cs
- brushes.cs
- HwndSourceKeyboardInputSite.cs
- DetailsViewUpdatedEventArgs.cs
- SerializableAttribute.cs
- Vector3DAnimation.cs
- OdbcConnectionOpen.cs
- WindowHideOrCloseTracker.cs
- CultureInfoConverter.cs
- PenLineCapValidation.cs
- DefaultMemberAttribute.cs
- AutomationEvent.cs
- CompositeCollection.cs
- ISFTagAndGuidCache.cs