Пример #1
0
        /// <summary>
        /// Colours the header of a row according to the state of the element in the row if it is a decision
        /// </summary>
        /// <param name="i"></param>
        private void ColourForceHeader(int i)
        {
            DataGridViewRow row  = _forcesTable.Rows[i];
            string          guid = row.Cells[ForcesTableContext.ForceGUIDColumnIndex].Value.ToString();

            if (guid.Equals(ForcesTableContext.EmptyCellValue))
            {
                return;
            }
            IEARepository repository = EAFacade.EA.Repository;
            IEAElement    element    = repository.GetElementByGUID(guid);

            if (element == null || row.HeaderCell == null || !element.IsDecision())
            {
                return;
            }
            row.HeaderCell.Style.BackColor = RetrieveColorByState(element.Stereotype);
        }
Пример #2
0
 /// <summary>
 /// Add all elements that do not contain children
 /// </summary>
 /// <param name="node"></param>
 private void AddFromNode(TreeNode node)
 {
     if (node.Nodes.Count > 0)
     {
         foreach (TreeNode n in node.Nodes)
         {
             AddFromNode(n);
         }
     }
     else
     {
         IEARepository repository = EAFacade.EA.Repository;
         IEAElement    element    = repository.GetElementByGUID(node.ImageKey);
         if (element.IsDecision())
         {
             AddDecisionToDiagram(element);
         }
     }
 }