Esempio n. 1
0
        private static void OnIsActiveChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ViCPUInfo       currCpu  = (ViCPUInfo)d;
            SolutionManager solution = currCpu.TheSolution;

            if (solution == null)
            {
                return;
            }

            if ((bool?)e.NewValue == true)
            {
                solution.LoopCPUs((cpu) =>
                {
                    if (cpu != currCpu && cpu.IsActive)
                    {
                        cpu.IsActive = false;
                    }
                    return(true);
                });
                //
                ProjectManager currProject = currCpu.CurrProject;
                currProject.IsActive = true;
                //
                foreach (var item in solution.Children)
                {
                    if (item != currProject && item is ProjectManager)
                    {
                        ProjectManager projectItem = item as ProjectManager;
                        if (projectItem.IsActive)
                        {
                            projectItem.IsActive = false;
                        }
                    }
                }
            }
        }