diff --git a/uml4net.Extensions/PropertyExtensions.cs b/uml4net.Extensions/PropertyExtensions.cs index e103ef83..adb55ee2 100644 --- a/uml4net.Extensions/PropertyExtensions.cs +++ b/uml4net.Extensions/PropertyExtensions.cs @@ -109,7 +109,7 @@ public static bool QueryIsBool(this IProperty property) throw new ArgumentNullException(nameof(property)); } - return property?.Type?.Name?.IndexOf("bool", StringComparison.InvariantCultureIgnoreCase) >= 0; + return property.Type?.Name?.IndexOf("bool", StringComparison.InvariantCultureIgnoreCase) >= 0; } /// @@ -472,19 +472,10 @@ public static bool TryQueryRedefinedByProperty(this IProperty property, IClass c throw new ArgumentNullException(nameof(context)); } - var properties = context.QueryAllProperties(); + redefinedByProperty = context.QueryAllProperties() + .FirstOrDefault(prop => prop.RedefinedProperty.Any(x => x.XmiId == property.XmiId)); - foreach (var prop in properties) - { - if (prop.RedefinedProperty.Any(x => x.XmiId == property.XmiId)) - { - redefinedByProperty = prop; - return true; - } - } - - redefinedByProperty = null; - return false; + return redefinedByProperty != null; } } } diff --git a/uml4net.HandleBars/ClassHelper.cs b/uml4net.HandleBars/ClassHelper.cs index 5af9bd20..dc5f168e 100644 --- a/uml4net.HandleBars/ClassHelper.cs +++ b/uml4net.HandleBars/ClassHelper.cs @@ -110,35 +110,6 @@ public static void RegisterClassHelper(this IHandlebars handlebars) return nonRedefinedProperties; }); - handlebars.RegisterHelper("Class.QueryAllContainedNonDerivedNonRedefinedProperties", (context, parameters) => - { - if (!(context.Value is IClass @class)) - { - throw new ArgumentException("supposed to be IClass"); - } - - var properties = @class.QueryAllProperties() - .Where(x => x.IsComposite) - .Where(x => !x.IsDerived) - .OrderBy(x => x.Name) - .ToList(); - - var nonRedefinedProperties = properties.ToList(); - - foreach (var property in properties) - { - foreach (var redefinedProperty in property.RedefinedProperty) - { - if (nonRedefinedProperties.Contains(redefinedProperty)) - { - nonRedefinedProperties.Remove(redefinedProperty); - } - } - } - - return nonRedefinedProperties; - }); - handlebars.RegisterHelper("Class.QueryAllNonDerivedProperties", (context, parameters) => { if (!(context.Value is IClass @class)) diff --git a/uml4net/Extend/ActionExtensions.cs b/uml4net/Extend/ActionExtensions.cs index edaec263..55df6914 100644 --- a/uml4net/Extend/ActionExtensions.cs +++ b/uml4net/Extend/ActionExtensions.cs @@ -51,10 +51,11 @@ public static IClassifier QueryContext(this IAction action) /// The subject /// /// - /// + /// The ordered set of InputPins representing the inputs to the Action. /// public static IContainerList QueryInput(this IAction action) { + throw new NotSupportedException(); }