public void InitializeFeatures(Type type) { if (type == null) { throw new ArgumentNullException("type"); } if (type.IsPrimitive || type == typeof(string)) { return; } if (this._initializedTypes == null) { this._initializedTypes = new HashSet <Type>(); } if (this._initializedTypes.Contains(type)) { return; } this._initializedTypes.Add(type); foreach (Attribute attribute1 in this.GetFeatureAttributesForType(type)) { FeatureAttribute featureAttribute = attribute1 as FeatureAttribute; if (featureAttribute != null) { Type featureProviderType = featureAttribute.FeatureProviderType; if (!this._initializedTypes.Contains(featureProviderType)) { this._initializedTypes.Add(featureProviderType); foreach (Attribute attribute2 in this.GetFeatureConnectorAttributesForType(featureProviderType)) { FeatureConnectorAttribute connectorAttribute = attribute2 as FeatureConnectorAttribute; if (connectorAttribute != null) { Type featureConnectorType = connectorAttribute.FeatureConnectorType; if (!this._featureConnectors.ContainsKey(featureConnectorType)) { FeatureManager.FeatureConnectorEntry featureConnectorEntry = new FeatureManager.FeatureConnectorEntry(featureConnectorType, this); this._featureConnectors.Add(featureConnectorType, featureConnectorEntry); featureConnectorEntry.AttemptActivate(); } } } } if (this._knownFeatureProviders == null) { this._knownFeatureProviders = new HashSet <Type>(); } if (!this._knownFeatureProviders.Contains(featureProviderType)) { this._knownFeatureProviders.Add(featureProviderType); if (this.FeatureAvailable != null) { this.OnFeatureAvailable(new FeatureAvailableEventArgs(featureProviderType)); } } } } }
public override bool Equals(object obj) { if (obj == this) { return(true); } FeatureConnectorAttribute connectorAttribute = obj as FeatureConnectorAttribute; if (connectorAttribute != null) { return(connectorAttribute._featureConnectorType == this._featureConnectorType); } return(false); }