Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / WinForms / Managed / System / WinForms / FeatureSupport.cs / 1 / FeatureSupport.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Windows.Forms { using System.Configuration.Assemblies; using System.Diagnostics; using System; using System.Reflection; using System.Security; using System.Security.Permissions; ////// /// public abstract class FeatureSupport : IFeatureSupport { ///Provides ///methods for retrieving feature information from the /// current system. /// /// public static bool IsPresent(string featureClassName, string featureConstName) { return IsPresent(featureClassName, featureConstName, new Version(0, 0, 0, 0)); } ///Determines whether any version of the specified feature /// is installed in the system. This method is ///. /// /// public static bool IsPresent(string featureClassName, string featureConstName, Version minimumVersion) { object featureId = null; IFeatureSupport featureSupport = null; //APPCOMPAT: If Type.GetType() throws, we want to return //null to preserve Everett behavior. Type c = null; try { c = Type.GetType(featureClassName); } catch (ArgumentException) {} if (c != null) { FieldInfo fi = c.GetField(featureConstName); if (fi != null) { featureId = fi.GetValue(null); } } if (featureId != null && typeof(IFeatureSupport).IsAssignableFrom(c)) { featureSupport = (IFeatureSupport) SecurityUtils.SecureCreateInstance(c); if (featureSupport != null) { return featureSupport.IsPresent(featureId, minimumVersion); } } return false; } ///Determines whether the specified or newer version of the specified feature is /// installed in the system. This method is ///. /// /// public static Version GetVersionPresent(string featureClassName, string featureConstName) { object featureId = null; IFeatureSupport featureSupport = null; //APPCOMPAT: If Type.GetType() throws, we want to return //null to preserve Everett behavior. Type c = null; try { c = Type.GetType(featureClassName); } catch (ArgumentException) {} if (c != null) { FieldInfo fi = c.GetField(featureConstName); if (fi != null) { featureId = fi.GetValue(null); } } if (featureId != null) { featureSupport = (IFeatureSupport) SecurityUtils.SecureCreateInstance(c); if (featureSupport != null) { return featureSupport.GetVersionPresent(featureId); } } return null; } ///Gets the version of the specified feature that is available on the system. ////// /// public virtual bool IsPresent(object feature) { return IsPresent(feature, new Version(0, 0, 0, 0)); } ///Determines whether any version of the specified feature /// is installed in the system. ////// /// public virtual bool IsPresent(object feature, Version minimumVersion) { Version ver = GetVersionPresent(feature); if (ver != null) { return ver.CompareTo(minimumVersion) >= 0; } return false; } ///Determines whether the specified or newer version of the /// specified feature is installed in the system. ////// /// public abstract Version GetVersionPresent(object feature); } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.When overridden in a derived class, gets the version of the specified /// feature that is available on the system. ///
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ToolStripSplitButton.cs
- Timeline.cs
- XhtmlConformanceSection.cs
- FlowLayoutPanelDesigner.cs
- figurelength.cs
- HttpCacheVary.cs
- PeerCollaboration.cs
- PeerInvitationResponse.cs
- HelpInfo.cs
- TreeViewDesigner.cs
- FakeModelItemImpl.cs
- CheckedPointers.cs
- ExpandoObject.cs
- HierarchicalDataBoundControl.cs
- ListViewItemMouseHoverEvent.cs
- Propagator.cs
- CodeDomDesignerLoader.cs
- XmlStreamStore.cs
- updatecommandorderer.cs
- TextComposition.cs
- SafeThemeHandle.cs
- ISAPIRuntime.cs
- DataObjectFieldAttribute.cs
- SelectedGridItemChangedEvent.cs
- ProtocolsConfigurationEntry.cs
- ProcessManager.cs
- Transaction.cs
- BuilderInfo.cs
- HMAC.cs
- ObjectItemAttributeAssemblyLoader.cs
- SemaphoreSecurity.cs
- PropertyMappingExceptionEventArgs.cs
- GridViewItemAutomationPeer.cs
- DESCryptoServiceProvider.cs
- LocatorPartList.cs
- SecurityChannel.cs
- Highlights.cs
- LineVisual.cs
- DistributedTransactionPermission.cs
- UIElementParaClient.cs
- CuspData.cs
- GifBitmapDecoder.cs
- JoinTreeNode.cs
- WinInet.cs
- BitmapEffectRenderDataResource.cs
- DocumentViewer.cs
- WebPartVerbsEventArgs.cs
- IPGlobalProperties.cs
- ListBoxItemAutomationPeer.cs
- NumberSubstitution.cs
- DateTimeConverter.cs
- RenderCapability.cs
- DecimalStorage.cs
- CaseExpr.cs
- WebSysDefaultValueAttribute.cs
- IImplicitResourceProvider.cs
- CollectionDataContract.cs
- WebPartDescriptionCollection.cs
- FilteredSchemaElementLookUpTable.cs
- ToolboxItemCollection.cs
- DbProviderSpecificTypePropertyAttribute.cs
- ModifierKeysValueSerializer.cs
- TimeSpanSecondsConverter.cs
- Point.cs
- ViewStateException.cs
- EntityDataSourceValidationException.cs
- SoapIgnoreAttribute.cs
- XslAst.cs
- ContentFileHelper.cs
- EntityStoreSchemaFilterEntry.cs
- BamlTreeUpdater.cs
- ImageUrlEditor.cs
- Semaphore.cs
- WebRequestModuleElement.cs
- InfoCardCryptoHelper.cs
- EllipseGeometry.cs
- XDRSchema.cs
- StandardBindingOptionalReliableSessionElement.cs
- RedBlackList.cs
- StateInitializationDesigner.cs
- DbConnectionPoolGroupProviderInfo.cs
- BlockUIContainer.cs
- DigitShape.cs
- RectValueSerializer.cs
- IndentTextWriter.cs
- ChooseAction.cs
- ManipulationPivot.cs
- RevocationPoint.cs
- SqlSelectClauseBuilder.cs
- EntryPointNotFoundException.cs
- ToolStripDropDownMenu.cs
- odbcmetadatacolumnnames.cs
- QualifiedCellIdBoolean.cs
- PasswordRecovery.cs
- Logging.cs
- Matrix3DStack.cs
- PagesSection.cs
- PathFigureCollectionValueSerializer.cs
- AQNBuilder.cs
- DataGridColumnHeadersPresenter.cs