public static int IncrementUsage(this ElementDefinition ed) { if (ed == null) { return(0); } if (ed.HasAnnotation <PropertyUsage>()) { return(ed.Annotation <PropertyUsage>().Increment()); } else { ed.SetAnnotation(new PropertyUsage() { UsageCount = 1 }); return(1); } }
/// <summary> /// Return the annotated reference to the associated <see cref="ElementDefinition"/> instance /// in the <see cref="StructureDefinition.Snapshot"/> component, if it exists, or <c>null</c> otherwise. /// </summary> internal static ElementDefinition GetSnapshotElementAnnotation(this ElementDefinition ed) => ed?.Annotation <SnapshotElementDefinitionAnnotation>()?.SnapshotElement;