Skip to content

Instantly share code, notes, and snippets.

@chuongmep
Last active June 19, 2020 04:46
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/a9bfc9d7ced24ea3baebc3d4c0665fb4 to your computer and use it in GitHub Desktop.
Save chuongmep/a9bfc9d7ced24ea3baebc3d4c0665fb4 to your computer and use it in GitHub Desktop.
/// <summary>
/// Get or Create Shared Parameters Group
/// </summary>
/// <param name="defFile"></param>
/// <param name="grpName"></param>
/// <returns></returns>
public static DefinitionGroup GetOrCreateSharedParamsGroup(DefinitionFile defFile, string grpName)
{
try // generic
{
DefinitionGroup defGrp = defFile.Groups.get_Item(grpName);
if (null == defGrp) defGrp = defFile.Groups.Create(grpName);
return defGrp;
}
catch (Exception ex)
{
MessageBox.Show($"ERROR: Failed to get or create Shared Params Group: {ex.Message}");
return null;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment