Exemplo n.º 1
0
        private void OnStructureChange(object obj, StructureChangeType chType, bool isPropagated)
        {
            #region Rule #1. If a vertex loses or gains a predecessor, it invalidates all of its sucessors.
            if (StructureChangeTypeSvc.IsPreEdgeChange(chType))
            {
                if (obj is Vertex)
                {
                    Vertex    vertex     = (Vertex)obj;
                    ArrayList successors = new ArrayList();
                    successors.AddRange(vertex.GetSuccessors());
                    while (successors.Count > 0)
                    {
                        IHasValidity ihv = (IHasValidity)successors[0];
                        successors.RemoveAt(0);
                        if (ihv is Tasks.Task)
                        {
                            ((Tasks.Task)ihv).SelfValidState = false;
                        }
                        else
                        {
                            successors.AddRange(ihv.GetSuccessors());
                        }
                    }
                }
            }
            #endregion

            m_dirty = true;
        }
Exemplo n.º 2
0
 private void AddNode(IHasValidity ihv)
 {
     if (!m_htNodes.Contains(ihv))
     {
         ValidityNode vn = new ValidityNode(this, ihv);
         m_htNodes.Add(ihv, vn);
         IList list = ihv.GetSuccessors();
         if (list.Count > 0)
         {
             foreach (object obj in list)
             {
                 IHasValidity successor = (IHasValidity)obj;
                 AddNode(successor);
             }
         }
     }
     ihv.StructureChangeHandler += m_structureChangeListener;
 }
Exemplo n.º 3
0
 public ValidityNode(ValidationService validationService, IHasValidity mine)
 {
     m_nInvalidChildren     = 0;
     m_nInvalidPredecessors = 0;
     m_validationService    = validationService;
     m_mine = mine;
     m_mine.ValidationService = m_validationService;
     m_successors             = new ArrayList(mine.GetSuccessors());
     m_children     = new ArrayList(mine.GetChildren());
     m_predecessors = new ArrayList();
     if (m_mine is SimCore.IHasName)
     {
         m_name = ((SimCore.IHasName)m_mine).Name;
     }
     else
     {
         m_name = m_mine.GetType().ToString();
     }
 }