Esempio n. 1
0
        public override IEnumerable <TreeNodeInfo> GetTreeNodeInfos()
        {
            yield return(RiskeerTreeNodeInfoFactory.CreateFailureMechanismStateContextTreeNodeInfo <CalculationsStateFailureMechanismContext>(
                             CalculationsStateFailureMechanismChildNodeObjects,
                             CalculationsStateFailureMechanismContextMenuStrip));

            yield return(RiskeerTreeNodeInfoFactory.CreateRegistrationStateContextTreeNodeInfo <RegistrationStateFailureMechanismContext>(
                             RegistrationStateFailureMechanismEnabledChildNodeObjects,
                             RegistrationStateFailureMechanismDisabledChildNodeObjects,
                             RegistrationStateFailureMechanismEnabledContextMenuStrip,
                             RegistrationStateFailureMechanismDisabledContextMenuStrip));

            yield return(RiskeerTreeNodeInfoFactory.CreateCalculationGroupContextTreeNodeInfo <ClosingStructuresCalculationGroupContext>(
                             CalculationGroupContextChildNodeObjects,
                             CalculationGroupContextContextMenuStrip,
                             CalculationGroupContextOnNodeRemoved));

            yield return(RiskeerTreeNodeInfoFactory.CreateCalculationContextTreeNodeInfo <ClosingStructuresCalculationScenarioContext>(
                             CalculationContextChildNodeObjects,
                             CalculationContextContextMenuStrip,
                             CalculationContextOnNodeRemoved,
                             CalculationType.Probabilistic));

            yield return(new TreeNodeInfo <ClosingStructuresFailureMechanismSectionResultContext>
            {
                Text = context => RiskeerCommonFormsResources.FailureMechanism_AssessmentResult_DisplayName,
                Image = context => RiskeerCommonFormsResources.FailureMechanismSectionResultIcon,
                ContextMenuStrip = (nodeData, parentData, treeViewControl) => Gui.Get(nodeData, treeViewControl)
                                   .AddOpenItem()
                                   .Build()
            });

            yield return(new TreeNodeInfo <ClosingStructuresContext>
            {
                Text = context => RiskeerCommonFormsResources.StructuresCollection_DisplayName,
                Image = context => RiskeerCommonFormsResources.GeneralFolderIcon,
                ForeColor = context => context.WrappedData.Any() ? Color.FromKnownColor(KnownColor.ControlText) : Color.FromKnownColor(KnownColor.GrayText),
                ChildNodeObjects = context => context.WrappedData.Cast <object>().ToArray(),
                ContextMenuStrip = (nodeData, parentData, treeViewControl) => Gui.Get(nodeData, treeViewControl)
                                   .AddImportItem()
                                   .AddUpdateItem()
                                   .AddSeparator()
                                   .AddCollapseAllItem()
                                   .AddExpandAllItem()
                                   .AddSeparator()
                                   .AddPropertiesItem()
                                   .Build()
            });

            yield return(new TreeNodeInfo <ClosingStructure>
            {
                Text = structure => structure.Name,
                Image = structure => RiskeerCommonFormsResources.StructuresIcon,
                ContextMenuStrip = (structure, parentData, treeViewControl) => Gui.Get(structure, treeViewControl)
                                   .AddPropertiesItem()
                                   .Build()
            });

            yield return(new TreeNodeInfo <ClosingStructuresInputContext>
            {
                Text = inputContext => RiskeerCommonFormsResources.FailureMechanism_Inputs_DisplayName,
                Image = inputContext => RiskeerCommonFormsResources.GenericInputOutputIcon,
                ContextMenuStrip = (nodeData, parentData, treeViewControl) => Gui.Get(nodeData, treeViewControl)
                                   .AddPropertiesItem()
                                   .Build()
            });

            yield return(new TreeNodeInfo <ClosingStructuresScenariosContext>
            {
                Text = context => RiskeerCommonFormsResources.Scenarios_DisplayName,
                Image = context => RiskeerCommonFormsResources.ScenariosIcon,
                ContextMenuStrip = (nodeData, parentData, treeViewControl) => Gui.Get(nodeData, treeViewControl)
                                   .AddOpenItem()
                                   .Build()
            });
        }
Esempio n. 2
0
        public override IEnumerable <TreeNodeInfo> GetTreeNodeInfos()
        {
            yield return(RiskeerTreeNodeInfoFactory.CreateFailureMechanismStateContextTreeNodeInfo <HydraulicLoadsStateFailureMechanismContext>(
                             HydraulicLoadsStateFailureMechanismChildNodeObjects,
                             HydraulicLoadsStateFailureMechanismContextMenuStrip));

            yield return(RiskeerTreeNodeInfoFactory.CreateRegistrationStateContextTreeNodeInfo <RegistrationStateFailureMechanismContext>(
                             RegistrationStateFailureMechanismEnabledChildNodeObjects,
                             RegistrationStateFailureMechanismDisabledChildNodeObjects,
                             RegistrationStateFailureMechanismEnabledContextMenuStrip,
                             RegistrationStateFailureMechanismDisabledContextMenuStrip));

            yield return(new TreeNodeInfo <WaveImpactAsphaltCoverFailureMechanismSectionResultContext>
            {
                Text = context => RiskeerCommonFormsResources.FailureMechanism_AssessmentResult_DisplayName,
                Image = context => RiskeerCommonFormsResources.FailureMechanismSectionResultIcon,
                ContextMenuStrip = (nodeData, parentData, treeViewControl) => Gui.Get(nodeData, treeViewControl)
                                   .AddOpenItem()
                                   .Build()
            });

            yield return(RiskeerTreeNodeInfoFactory.CreateCalculationGroupContextTreeNodeInfo <WaveImpactAsphaltCoverCalculationGroupContext>(
                             CalculationGroupContextChildNodeObjects,
                             CalculationGroupContextContextMenuStrip,
                             CalculationGroupContextOnNodeRemoved));

            yield return(RiskeerTreeNodeInfoFactory.CreateCalculationContextTreeNodeInfo <WaveImpactAsphaltCoverWaveConditionsCalculationContext>(
                             WaveConditionsCalculationContextChildNodeObjects,
                             WaveConditionsCalculationContextContextMenuStrip,
                             WaveConditionsCalculationContextOnNodeRemoved,
                             CalculationType.Hydraulic));

            yield return(new TreeNodeInfo <EmptyWaveImpactAsphaltCoverOutput>
            {
                Text = emptyOutput => RiskeerCommonFormsResources.CalculationOutput_DisplayName,
                Image = emptyOutput => RiskeerCommonFormsResources.GeneralOutputIcon,
                ForeColor = emptyOutput => Color.FromKnownColor(KnownColor.GrayText),
                ContextMenuStrip = (nodeData, parentData, treeViewControl) => Gui.Get(nodeData, treeViewControl)
                                   .AddPropertiesItem()
                                   .Build()
            });

            yield return(new TreeNodeInfo <WaveImpactAsphaltCoverWaveConditionsOutput>
            {
                Text = emptyOutput => RiskeerCommonFormsResources.CalculationOutput_DisplayName,
                Image = emptyOutput => RiskeerCommonFormsResources.GeneralOutputIcon,
                ContextMenuStrip = (nodeData, parentData, treeViewControl) => Gui.Get(nodeData, treeViewControl)
                                   .AddPropertiesItem()
                                   .Build()
            });

            yield return(new TreeNodeInfo <WaveImpactAsphaltCoverWaveConditionsInputContext>
            {
                Text = context => RiskeerCommonFormsResources.Calculation_Input,
                Image = context => RiskeerCommonFormsResources.GenericInputOutputIcon,
                ContextMenuStrip = (nodeData, parentData, treeViewControl) => Gui.Get(nodeData, treeViewControl)
                                   .AddOpenItem()
                                   .AddSeparator()
                                   .AddPropertiesItem()
                                   .Build()
            });
        }