Exemple #1
0
        public ProcessInput()
        {
            InitializeComponent();
            processes = new List <Tuple <int, int> >();

            uiClass     = new UIBindClass();
            DataContext = uiClass;
        }
        // Editing the Dropdown and the Utilization Label
        public void AddInfoToWindow(List <PeriodicProcess> _p, float Utilization)
        {
            UIBindClass uiClass = new UIBindClass();

            DataContext     = uiClass;
            uiClass.cbItems = new ObservableCollection <ComboBoxItem>();

            var cbItem = new ComboBoxItem {
                IsEnabled = false, Content = "PN\tBT\tPT", Background = new SolidColorBrush(Color.FromRgb(0, 0, 0))
            };

            uiClass.SelectedcbItem = cbItem;
            uiClass.cbItems.Add(cbItem);
            for (int i = 0; i < _p.Count; i++)
            {
                cbItem = new ComboBoxItem {
                    IsHitTestVisible = false, Content = "P" + (_p[i].Number + 1) + "\t" + (_p[i].ExecutionTime) + "\t" + (_p[i].Period), Background = new SolidColorBrush(_p[i].color)
                };
                uiClass.cbItems.Add(cbItem);
            }
            uiClass.lblUtil         = new Label();
            uiClass.lblUtil.Content = "Utilization: " + Utilization.ToString("0.00") + "%";
        }