Пример #1
0
        public void AddElement(SBElement element)
        {
            bool changed = Elements.ContainsKey(element.GetId());

            Elements[element.GetId()] = element;

            if (changed)
            {
                ElementChangeEvent(element);
            }
            else
            {
                ElementAddEvent(element);
            }
        }
Пример #2
0
 public void RemoveElement(SBElement element)
 {
     if (Elements.Remove(element.GetId()))
     {
         ElementRemoveEvent(element);
     }
 }
Пример #3
0
 private void OnElementChanged(SBElement element)
 {
     foreach (DataGridViewRow row in containerElements.Rows)
     {
         if ((Guid)row.Cells["Id"].Value == element.GetId())
         {
             row.Cells["Elements"].Value = element.Name;
             break;
         }
     }
 }
Пример #4
0
 private void OnElementRemoved(SBElement element)
 {
     foreach (DataGridViewRow row in containerElements.Rows)
     {
         if ((Guid)row.Cells["Id"].Value == element.GetId())
         {
             containerElements.Rows.Remove(row);
             break;
         }
     }
 }
Пример #5
0
 private void OnElementAdded(SBElement element)
 {
     containerElements.Rows.Add(element.GetId(), element.Name);
 }