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
- RegexWriter.cs
- __Error.cs
- UserInitiatedNavigationPermission.cs
- Rotation3DKeyFrameCollection.cs
- LineServicesRun.cs
- _KerberosClient.cs
- CustomMenuItemCollection.cs
- OrderByExpression.cs
- RawUIStateInputReport.cs
- Matrix3DStack.cs
- _NTAuthentication.cs
- OLEDB_Util.cs
- VisualStyleInformation.cs
- TypeBuilder.cs
- AlphabetConverter.cs
- DeferredSelectedIndexReference.cs
- ExpressionPrefixAttribute.cs
- ToolStripSplitButton.cs
- securitycriticaldata.cs
- HeaderElement.cs
- PixelFormats.cs
- PageSetupDialog.cs
- PointLight.cs
- JavaScriptSerializer.cs
- ImageResources.Designer.cs
- IBuiltInEvidence.cs
- DataGridViewRowHeaderCell.cs
- ActivityXRefConverter.cs
- TypographyProperties.cs
- OracleMonthSpan.cs
- RegexBoyerMoore.cs
- EnumBuilder.cs
- StylusPointPropertyInfoDefaults.cs
- Size.cs
- Command.cs
- EncryptedKey.cs
- SoapDocumentMethodAttribute.cs
- GridViewColumnCollection.cs
- Math.cs
- PathData.cs
- FormatterServices.cs
- ReplyAdapterChannelListener.cs
- ZipIOFileItemStream.cs
- MediaTimeline.cs
- DataSetMappper.cs
- BuiltInPermissionSets.cs
- MetadataPropertyvalue.cs
- XmlHierarchicalEnumerable.cs
- SamlConditions.cs
- ServiceModelEnumValidator.cs
- RowSpanVector.cs
- WebPartConnection.cs
- ComplexTypeEmitter.cs
- BrowserDefinition.cs
- QilFactory.cs
- TableAutomationPeer.cs
- IsolatedStoragePermission.cs
- ActiveXSite.cs
- OutputCacheProfileCollection.cs
- DoWorkEventArgs.cs
- PointF.cs
- HttpDateParse.cs
- DesignerActionVerbList.cs
- LinqTreeNodeEvaluator.cs
- ConcurrentQueue.cs
- TimelineClockCollection.cs
- ExplicitDiscriminatorMap.cs
- XPathNodeList.cs
- WebResponse.cs
- QueryCacheKey.cs
- SessionEndedEventArgs.cs
- PersonalizationAdministration.cs
- ConnectionString.cs
- SrgsDocument.cs
- MethodRental.cs
- VersionPair.cs
- HttpHandlersSection.cs
- CollectionViewProxy.cs
- FixedSchema.cs
- UpdatePanelTriggerCollection.cs
- SerializationAttributes.cs
- OleDbWrapper.cs
- ByteStreamMessageEncoderFactory.cs
- FontResourceCache.cs
- MobileControlsSectionHelper.cs
- TdsParserSessionPool.cs
- Msec.cs
- Timer.cs
- SignatureHelper.cs
- IApplicationTrustManager.cs
- AdjustableArrowCap.cs
- RefreshEventArgs.cs
- XhtmlTextWriter.cs
- IPEndPoint.cs
- LinkClickEvent.cs
- Journaling.cs
- DictionaryBase.cs
- ShapingWorkspace.cs
- BindingSource.cs
- EncryptedPackageFilter.cs