public static SelectionRule GetRule(this IPropertiesContainer container) { SelectionRule result = null; if (container is IThreatModelChild child && child.Model is IThreatModel model) { var schemaManager = new AutoThreatGenPropertySchemaManager(model); var propertyType = schemaManager?.GetPropertyType(); if (propertyType != null) { var p = container.GetProperty(propertyType); if (p is IPropertyJsonSerializableObject jsonProperty) { if (jsonProperty.Value is SelectionRule rule) { result = rule; } } } } return(result); }
public MitigationSelectionRule([NotNull] SelectionRule rule) { Root = rule.Root; }