Example #1
0
        public static RoadmapStatus GetStatus(this IMitigation mitigation, out bool automatedCalculation)
        {
            var result = GetStatusFromProperties(mitigation);

            automatedCalculation = false;

            var tems = mitigation.GetThreatEventMitigations();

            if (!(tems?.Any() ?? false))
            {
                result = RoadmapStatus.NotAssessed;
            }

            if (result == RoadmapStatus.NotAssessed)
            {
                if (tems?.Any() ?? false)
                {
                    if (tems.All(x =>
                                 x.Status == MitigationStatus.Existing || x.Status == MitigationStatus.Implemented))
                    {
                        result = RoadmapStatus.NoActionRequired;
                        automatedCalculation = true;
                    }
                }
            }

            return(result);
        }
Example #2
0
        public RoadmapStatus GetStatus(IMitigation mitigation)
        {
            var result = GetStatusFromProperties(mitigation);

            var tems = mitigation.GetThreatEventMitigations()?.ToArray();

            if (!(tems?.Any() ?? false))
            {
                result = RoadmapStatus.NotAssessed;
            }

            if (result == RoadmapStatus.NotAssessed)
            {
                if (tems?.Any() ?? false)
                {
                    if (tems.All(x =>
                                 x.Status == MitigationStatus.Existing || x.Status == MitigationStatus.Implemented))
                    {
                        result = RoadmapStatus.NoActionRequired;
                    }
                }
            }

            return(result);
        }
Example #3
0
        private void LoadGrid([NotNull] IMitigation mitigation)
        {
            _grid.PrimaryGrid.Rows.Clear();
            _gridItemDetails.Item = null;

            var tems = mitigation.GetThreatEventMitigations();

            foreach (var tem in tems)
            {
                AddGridRow(tem);
            }
        }
Example #4
0
        private void LoadGrid([NotNull] IMitigation mitigation)
        {
            _grid.PrimaryGrid.Rows.Clear();

            if (_model == null)
            {
                _model = mitigation.Model;
            }

            var tems = mitigation.GetThreatEventMitigations();

            foreach (var tem in tems)
            {
                AddGridRow(tem);
            }
        }