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
- ColorTypeConverter.cs
- StyleSheetRefUrlEditor.cs
- IssuanceLicense.cs
- RoutedEventValueSerializer.cs
- ScriptRegistrationManager.cs
- CodeTryCatchFinallyStatement.cs
- TypeNameParser.cs
- ReadOnlyKeyedCollection.cs
- FileUpload.cs
- XmlEntityReference.cs
- BamlVersionHeader.cs
- HttpApplicationStateWrapper.cs
- Point4D.cs
- HyperLink.cs
- BindableTemplateBuilder.cs
- UserInitiatedRoutedEventPermission.cs
- ResourceProperty.cs
- EntitySqlQueryCacheKey.cs
- PageParser.cs
- InvalidPrinterException.cs
- Region.cs
- FamilyMap.cs
- ButtonStandardAdapter.cs
- TaiwanLunisolarCalendar.cs
- WebPartUtil.cs
- WebPartsPersonalizationAuthorization.cs
- _ConnectionGroup.cs
- StylusLogic.cs
- XmlTextReader.cs
- SoapInteropTypes.cs
- FigureParagraph.cs
- Compiler.cs
- SecurityTokenAttachmentMode.cs
- CommandEventArgs.cs
- BaseServiceProvider.cs
- FormViewUpdateEventArgs.cs
- xsdvalidator.cs
- Form.cs
- ElementAction.cs
- Stylus.cs
- SqlUdtInfo.cs
- SoundPlayerAction.cs
- XmlQualifiedNameTest.cs
- BaseValidator.cs
- DocumentReference.cs
- AttributeCollection.cs
- AnnotationAdorner.cs
- PrinterSettings.cs
- DataKeyArray.cs
- EmissiveMaterial.cs
- OrderedDictionaryStateHelper.cs
- TextWriterEngine.cs
- WebBrowserEvent.cs
- DateTimePicker.cs
- EventProviderClassic.cs
- LingerOption.cs
- AssemblyHash.cs
- DataViewSetting.cs
- VBIdentifierNameEditor.cs
- LowerCaseStringConverter.cs
- WindowsFormsSectionHandler.cs
- InvalidWMPVersionException.cs
- ImageMetadata.cs
- ExecutionContext.cs
- DocumentViewerAutomationPeer.cs
- PopOutPanel.cs
- MessageQueueCriteria.cs
- TypeUtil.cs
- BinaryUtilClasses.cs
- SymbolPair.cs
- DisplayInformation.cs
- HtmlTableCell.cs
- WindowsClientElement.cs
- TypeSystem.cs
- RegexWriter.cs
- StringUtil.cs
- Connector.xaml.cs
- InputLanguage.cs
- GridViewRowPresenter.cs
- Char.cs
- UrlMappingCollection.cs
- Matrix3D.cs
- BitmapCodecInfo.cs
- HtmlInputText.cs
- Span.cs
- DataGridViewLinkColumn.cs
- FileFormatException.cs
- DataGridViewCell.cs
- SlotInfo.cs
- ListItem.cs
- MessageBox.cs
- ContextStack.cs
- TdsParserSafeHandles.cs
- SerialStream.cs
- TextTreeFixupNode.cs
- SerializationInfo.cs
- SmiGettersStream.cs
- TextTreeExtractElementUndoUnit.cs
- DesignTimeParseData.cs
- SigningDialog.cs