using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.ComponentModel; using CaeGlobals; using DynamicTypeDescriptor; using CaeResults; namespace CPSO { [Serializable] public class ViewResultHistoryOutputFromEquation : ViewResultHistoryOutput { // Variables private ResultHistoryOutputFromEquation _historyOutput; // Properties public override string Name { get { return _historyOutput.Name; } set { _historyOutput.Name = value; } } // [Category("Data")] [OrderedDisplayName(1, 10, "Equation")] [Description("Example equation: =From_Field-1.DISP.ALL\r\n" + "To include a history component into the equation " + "refer to the component with its full name as " + "History_Output_Name.Field_Name.Component_Name. All names are case sensitive.")] [Id(2, 1)] public string Equation { get { return _historyOutput.Equation; } set { if (!value.Trim().StartsWith("=")) value = "=" + value; _historyOutput.Equation = value; } } // [Category("Data")] [OrderedDisplayName(2, 10, "User defined unit")] [Description("User defined unit for the history output equation value.")] [Id(3, 1)] public string Unit { get { return _historyOutput.Unit; } set { _historyOutput.Unit = value; } } // Constructors public ViewResultHistoryOutputFromEquation(ResultHistoryOutputFromEquation historyOutput) : base(historyOutput) { // The order is important _historyOutput = historyOutput; // Dictionary regionTypePropertyNamePairs = new Dictionary(); regionTypePropertyNamePairs.Add(RegionTypeEnum.None, nameof(SelectionHidden)); // SetBase(_historyOutput, regionTypePropertyNamePairs); DynamicCustomTypeDescriptor = ProviderInstaller.Install(this); } // Methods public override ResultHistoryOutput GetBase() { return _historyOutput; } public void PopulateDropDownLists() { Dictionary regionTypeListItemsPairs = new Dictionary(); regionTypeListItemsPairs.Add(RegionTypeEnum.None, new string[] { "None" }); base.PopulateDropDownLists(regionTypeListItemsPairs); // DynamicCustomTypeDescriptor dctd = DynamicCustomTypeDescriptor; dctd.GetProperty(nameof(RegionType)).SetIsBrowsable(false); dctd.GetProperty(nameof(SelectionHidden)).SetIsBrowsable(false); } private void UpdateVisibility() { } } }