Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / WinForms / Managed / System / WinForms / FeatureSupport.cs / 1305376 / 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.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
- AnimationClockResource.cs
- _SecureChannel.cs
- BooleanFacetDescriptionElement.cs
- PLINQETWProvider.cs
- OpenTypeMethods.cs
- Vector3D.cs
- DataBoundLiteralControl.cs
- ValidationSummary.cs
- TypeSystemHelpers.cs
- DataGridItemEventArgs.cs
- GridViewRowEventArgs.cs
- Operator.cs
- DataGridCell.cs
- AutoResizedEvent.cs
- ThreadAttributes.cs
- ContentTextAutomationPeer.cs
- TextRangeEditLists.cs
- DotExpr.cs
- LazyTextWriterCreator.cs
- WeakKeyDictionary.cs
- TimeSpanStorage.cs
- WebBrowsableAttribute.cs
- CommandEventArgs.cs
- TextEncodedRawTextWriter.cs
- StrokeCollection2.cs
- TranslateTransform.cs
- ObjectStateManagerMetadata.cs
- Socket.cs
- XmlReflectionMember.cs
- ToolboxItemFilterAttribute.cs
- AuthorizationRuleCollection.cs
- coordinatorfactory.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- DataGridViewDesigner.cs
- PassportAuthenticationEventArgs.cs
- UnlockCardRequest.cs
- PipelineModuleStepContainer.cs
- WorkflowElementDialog.cs
- TemplateInstanceAttribute.cs
- XPathMessageFilterElementCollection.cs
- TraceSection.cs
- XmlChoiceIdentifierAttribute.cs
- QilVisitor.cs
- FtpCachePolicyElement.cs
- TopClause.cs
- _IPv4Address.cs
- SplitContainer.cs
- EventLogger.cs
- XmlSchemaFacet.cs
- EpmCustomContentWriterNodeData.cs
- QueryAccessibilityHelpEvent.cs
- ThrowOnMultipleAssignment.cs
- SimpleMailWebEventProvider.cs
- BitStream.cs
- TextPenaltyModule.cs
- MulticastNotSupportedException.cs
- _ConnectOverlappedAsyncResult.cs
- XmlSortKeyAccumulator.cs
- PrimitiveType.cs
- DataListCommandEventArgs.cs
- SingleAnimation.cs
- CryptographicAttribute.cs
- TextAdaptor.cs
- XmlNodeReader.cs
- TransactionBehavior.cs
- DataObjectFieldAttribute.cs
- GenericTextProperties.cs
- ListenerChannelContext.cs
- NamedPermissionSet.cs
- Math.cs
- CannotUnloadAppDomainException.cs
- SqlDataSource.cs
- SoapBinding.cs
- BinaryQueryOperator.cs
- RegexMatch.cs
- KeysConverter.cs
- XmlAttributeOverrides.cs
- WindowsSolidBrush.cs
- RadioButtonBaseAdapter.cs
- StringPropertyBuilder.cs
- CompilerCollection.cs
- XPathNodeList.cs
- XmlDigitalSignatureProcessor.cs
- MsiStyleLogWriter.cs
- TypeInitializationException.cs
- HttpVersion.cs
- EntityDataSourceWizardForm.cs
- ping.cs
- InheritanceContextChangedEventManager.cs
- CodeDirectionExpression.cs
- NativeMethods.cs
- SliderAutomationPeer.cs
- SecurityManager.cs
- BitmapEffectInputData.cs
- SoapExtensionTypeElementCollection.cs
- JsonWriterDelegator.cs
- StringOutput.cs
- ReturnType.cs
- TypeDelegator.cs
- SymLanguageVendor.cs