Exemplo n.º 1
0
 public void populateProcessorsGrid(List <ProcessorModel> processors)
 {
     for (int i = 0; i < processors.Count; i++)
     {
         if (processorsGrid.ColumnDefinitions.Count <= i)
         {
             processorsGrid.ColumnDefinitions.Add(new ColumnDefinition());
         }
         ProcessorView processorView = new ProcessorView();
         processorView.processorNumber.Text = processors[i].Number.ToString();
         processorView.SetValue(Grid.ColumnProperty, processors[i].Number);
         if (processors[i].IsStopped)
         {
             Brush redBrush = new SolidColorBrush(Colors.LightCoral);
             processorView.processorFrame.Fill = redBrush;
         }
         processorsGrid.Children.Add(processorView);
         processorsList.Add(processorView);
     }
 }
Exemplo n.º 2
0
        private Point getProcessorLocation(ProcessorView processor)
        {
            Point processorLocation = processor.TranslatePoint(new Point(0, 0), arrowPaintingArea);

            return(new Point(processorLocation.X + processor.ActualWidth / 2, processorLocation.Y + processor.ActualHeight / 2));
        }