internal void AttemptActivate() { bool flag = false; if (this._requirements == null) { this._requirements = new RequirementValidator(this._manager, this._featureConnectorType); flag = true; } if (this._requirements.MeetsRequirements) { this._requirements.RequirementsChanged -= new EventHandler(this.OnRequirementsChanged); this._featureConnector = Activator.CreateInstance(this._featureConnectorType, new object[1] { (object)this._manager }) as IDisposable; } else { if (!flag) { return; } this._requirements.RequirementsChanged += new EventHandler(this.OnRequirementsChanged); } }
private void OnPolicyRequirementsChanged(object sender, EventArgs e) { RequirementValidator requirementValidator = (RequirementValidator)sender; if (!requirementValidator.MeetsRequirements) { return; } this.ActivatePolicy(this._policies[requirementValidator.Type]); }