/// <summary> /// Return true if the given element parameter /// retrieved by get_Parameter( BuiltInParameter ) /// is contained in the element Parameters collection. /// Workaround to replace ParameterSet.Contains. /// Why does the following statement not work? /// return _parameter.Element.Parameters.Contains(_parameter); /// </summary> bool ContainedInCollection( Parameter p, ParameterSet set) { return(set .OfType <Parameter>() .Any(x => x.Id == p.Id)); }
/// <summary> /// Return true if the given element parameter /// retrieved by get_Parameter( BuiltInParameter ) /// is contained in the element Parameters collection. /// Workaround to replace ParameterSet.Contains. /// Why does the following statement not work? /// return _parameter.Element.Parameters.Contains(_parameter); /// </summary> bool ContainedInCollection( Parameter p, ParameterSet set ) { return set .OfType<Parameter>() .Any( x => x.Id == p.Id ); }