Ejemplo n.º 1
0
        private void GroupEquipmentStatusClick(object sender, RoutedEventArgs e)
        {
            Panel activePanel;
            var   newStatus = (EquipmentStatus)((MenuItem)sender).Tag;

            if (wrapGroupPanel.Children.Count > 0)
            {
                activePanel = wrapGroupPanel;
            }
            else
            {
                activePanel = noWrapGroupPanel;
            }

            foreach (var element in activePanel.Children)
            {
                if (element.GetType() == typeof(Equipment))
                {
                    ((Equipment)element).GroupEquipmentStatusChange(newStatus);
                }
            }

            if (newStatus == EquipmentStatus.Operational)
            {
                EquipmentStatusScrollingMarquee.RemoveEquipmentStatusText(adminHeader.Text + ": " + groupEquipmentStatus);
            }
            else
            {
                var form = new EquipmentStatusNoteForm();
                form.ShowDialog();

                if (form.Note != null)
                {
                    if (groupEquipmentStatus != null)
                    {
                        EquipmentStatusScrollingMarquee.RemoveEquipmentStatusText(adminHeader.Text + ": " + groupEquipmentStatus);
                    }

                    EquipmentStatusScrollingMarquee.AddEquipmentStatusText(adminHeader.Text + ": " + form.Note);
                    groupEquipmentStatus = form.Note;
                }
            }

            operationalMenuItem.IsChecked = newStatus == EquipmentStatus.Operational;
            degradedMenuItem.IsChecked    = newStatus == EquipmentStatus.Degraded;
            unscheduledMenuItem.IsChecked = newStatus == EquipmentStatus.Down;
        }
Ejemplo n.º 2
0
        private void AddEditEquipmentStatusNote()
        {
            var form = new EquipmentStatusNoteForm();

            form.ShowDialog();

            if (form.Note != null)
            {
                if (equipmentStatusBackground.ToolTip.ToString() != null)
                {
                    EquipmentStatusScrollingMarquee.RemoveEquipmentStatusText(EquipmentName + TAG_DELIMITER + equipmentStatusBackground.ToolTip.ToString());
                }

                EquipmentStatusScrollingMarquee.AddEquipmentStatusText(EquipmentName + TAG_DELIMITER + form.Note);
                equipmentStatusBackground.ToolTip = form.Note;
            }
        }