Пример #1
0
        public void ExecuteRibbonAction(IThreatModel threatModel, [NotNull] IActionDefinition action)
        {
            switch (action.Name)
            {
            case "CreateDiagram":
                var diagram = threatModel.AddDiagram();
                PanelCreationRequired?.Invoke(this, diagram);
                ChangeRibbonActionStatus?.Invoke(this, "IterateDiagrams", true);
                break;

            case "IterateDiagrams":
                IteratePanels?.Invoke(this);
                break;

            case "ReorderDiagrams":
                using (var dialog = new DiagramSortDialog(threatModel))
                {
                    dialog.ShowDialog(Form.ActiveForm);
                }
                break;

            default:
                PanelShowRequired?.Invoke(this, null);
                break;
            }
        }
 public void ExecuteRibbonAction(IThreatModel threatModel, [NotNull] IActionDefinition action)
 {
     switch (action.Name)
     {
     case "CreatePanel":
         PanelCreationRequired?.Invoke(this, action.Tag as IIdentity);
         break;
     }
 }