// // Copyright © The University of Queensland, 2012-2014. All rights reserved. // // License: //-------------------------------------------------------------------------------- namespace Analyses { using System; /// /// Analysis element. /// abstract public class AnalysisElement { /// /// Gets or sets the property prefix. /// /// The property prefix. protected string PropertyPrefix { get; set; } /// /// The element. /// protected TElement element; /// /// Initializes a new instance of the class. /// protected AnalysisElement() { this.PropertyPrefix = string.Empty; } /// /// Initializes a new instance of the class. /// /// Property prefix. protected AnalysisElement(string propertyPrefix) { this.PropertyPrefix = propertyPrefix; } /// /// Gets or sets the element. /// /// The element. public virtual TElement Element { get { return this.element; } set { this.element = value; } } /// E. public static implicit operator TElement(AnalysisElement e) { return e.Element; } /// /// Register the specified analysis. /// /// Analysis. public abstract void Register(BaseAnalysis analysis); /// /// Registers the property. /// /// Analysis. /// Name. /// Action. protected void RegisterProperty(BaseAnalysis analysis, string name, Action action) { analysis.ElementArgRegistry.Add(this.PropertyPrefix + name, action); } } }