Exemplo n.º 1
0
        public void Add([NotNull] ITrustBoundaryTemplate trustBoundaryTemplate)
        {
            if (trustBoundaryTemplate is IThreatModelChild child && child.Model != this)
            {
                throw new ArgumentException();
            }

            if (_trustBoundaryTemplates == null)
            {
                _trustBoundaryTemplates = new List <ITrustBoundaryTemplate>();
            }

            _trustBoundaryTemplates.Add(trustBoundaryTemplate);

            SetDirty();
            ChildCreated?.Invoke(trustBoundaryTemplate);
        }
        public ITrustBoundary AddTrustBoundary([Required] string name, ITrustBoundaryTemplate template)
        {
            ITrustBoundary result = new TrustBoundary(this, name)
            {
                _templateId = template?.Id ?? Guid.Empty
            };

            if (_groups == null)
            {
                _groups = new List <IGroup>();
            }
            _groups.Add(result);
            RegisterEvents(result);
            SetDirty();
            ChildCreated?.Invoke(result);

            return(result);
        }
 public TrustBoundaryTemplateRuleNode(ITrustBoundaryTemplate template)
 {
     this.Name = "Flow";
     this.TrustBoundaryTemplate = template?.Id ?? Guid.Empty;
 }