Skip to content

Instantly share code, notes, and snippets.

@chuongmep
Created June 19, 2020 05:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chuongmep/1a47b5819f22cb8327354f1931d8b05c to your computer and use it in GitHub Desktop.
Save chuongmep/1a47b5819f22cb8327354f1931d8b05c to your computer and use it in GitHub Desktop.
public static Parameter GetElemParam(Element elem, string name)
{
return GetElemParam(elem, name, false);
}
public static Parameter GetElemParam(Element elem, string name, bool matchCase)
{
StringComparison comp = StringComparison.CurrentCultureIgnoreCase;
if (matchCase) comp = StringComparison.CurrentCulture;
foreach (Parameter p in elem.Parameters)
{
if (p.Definition.Name.Equals(name, comp)) return p;
}
return null;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment