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
- DataRelationPropertyDescriptor.cs
- Floater.cs
- GridSplitter.cs
- StylusPointDescription.cs
- TrustManagerPromptUI.cs
- DataSourceDesigner.cs
- QueryComponents.cs
- Enlistment.cs
- EntityProxyFactory.cs
- ListenerHandler.cs
- OdbcTransaction.cs
- FormsAuthenticationEventArgs.cs
- PeerContact.cs
- AttributeUsageAttribute.cs
- HttpRequestCacheValidator.cs
- ObjectDataSourceView.cs
- DataGridViewCellEventArgs.cs
- HashMembershipCondition.cs
- WindowsAuthenticationEventArgs.cs
- FontNameConverter.cs
- SBCSCodePageEncoding.cs
- GZipDecoder.cs
- OdbcException.cs
- TreeNode.cs
- MessageRpc.cs
- EventInfo.cs
- Polyline.cs
- TabletCollection.cs
- ToolStripSeparatorRenderEventArgs.cs
- BamlTreeMap.cs
- DispatcherEventArgs.cs
- EntityDataSource.cs
- PointAnimationUsingKeyFrames.cs
- CompileLiteralTextParser.cs
- OdbcStatementHandle.cs
- DataBindingCollectionEditor.cs
- ObjectStateManagerMetadata.cs
- ViewKeyConstraint.cs
- ControlAdapter.cs
- CapabilitiesUse.cs
- NamespaceTable.cs
- BuildProviderCollection.cs
- EventTask.cs
- XamlReaderConstants.cs
- DataGridColumnReorderingEventArgs.cs
- TypeUsageBuilder.cs
- PlainXmlSerializer.cs
- HttpModuleActionCollection.cs
- SHA256.cs
- ViewBox.cs
- CodeDelegateCreateExpression.cs
- XmlSchemaAnnotated.cs
- ItemList.cs
- DateTimeSerializationSection.cs
- WindowsScroll.cs
- HttpListenerContext.cs
- EventLogEntry.cs
- NgenServicingAttributes.cs
- DateTimeParse.cs
- TypeContext.cs
- SchemaDeclBase.cs
- HostingPreferredMapPath.cs
- ArithmeticLiteral.cs
- ResXResourceReader.cs
- InlineUIContainer.cs
- BuildDependencySet.cs
- PropertyRef.cs
- EventDriven.cs
- XmlSchemaDatatype.cs
- IItemContainerGenerator.cs
- PieceNameHelper.cs
- PingOptions.cs
- XsltOutput.cs
- CharacterHit.cs
- ErasingStroke.cs
- CodeArrayIndexerExpression.cs
- XslTransform.cs
- Marshal.cs
- COM2AboutBoxPropertyDescriptor.cs
- ContextMenu.cs
- SqlMetaData.cs
- RSAPKCS1SignatureDeformatter.cs
- filewebresponse.cs
- Help.cs
- UIElementAutomationPeer.cs
- SelectorAutomationPeer.cs
- NavigationPropertyEmitter.cs
- DrawingContextFlattener.cs
- PropertyCollection.cs
- OletxDependentTransaction.cs
- RolePrincipal.cs
- DataObjectAttribute.cs
- Bitmap.cs
- CodePageEncoding.cs
- OleDbCommand.cs
- UInt16.cs
- UIElementParagraph.cs
- ComplexPropertyEntry.cs
- RepeatInfo.cs
- ChangePassword.cs