예제 #1
0
        private void ConflictsUpdated()
        {
            foreach (DataGridViewRow row in ModList.Rows)
            {
                var    module = ((GUIMod)row.Tag);
                string value;

                if (Conflicts != null && Conflicts.TryGetValue(module, out value))
                {
                    var conflict_text = value;
                    foreach (DataGridViewCell cell in row.Cells)
                    {
                        cell.ToolTipText = conflict_text;
                    }
                    if (row.DefaultCellStyle.BackColor != Color.LightCoral)
                    {
                        row.DefaultCellStyle.BackColor = Color.LightCoral;
                        ModList.InvalidateRow(row.Index);
                    }
                }
                else
                {
                    if (row.DefaultCellStyle.BackColor != Color.Empty)
                    {
                        foreach (DataGridViewCell cell in row.Cells)
                        {
                            cell.ToolTipText = null;
                        }

                        row.DefaultCellStyle.BackColor = Color.Empty;
                        ModList.InvalidateRow(row.Index);
                    }
                }
            }
        }
예제 #2
0
파일: Main.cs 프로젝트: majortoruqe/CKAN
        private void ConflictsUpdated()
        {
            if (Conflicts == null)
            {
                // Clear status bar if no conflicts
                AddStatusMessage("");
            }
            foreach (DataGridViewRow row in ModList.Rows)
            {
                GUIMod module = (GUIMod)row.Tag;
                string value;

                if (Conflicts != null && Conflicts.TryGetValue(module, out value))
                {
                    string conflict_text = value;
                    foreach (DataGridViewCell cell in row.Cells)
                    {
                        cell.ToolTipText = conflict_text;
                    }

                    if (row.DefaultCellStyle.BackColor != Color.LightCoral)
                    {
                        row.DefaultCellStyle.BackColor = Color.LightCoral;
                        ModList.InvalidateRow(row.Index);
                    }
                }
                else if (row.DefaultCellStyle.BackColor != Color.Empty)
                {
                    foreach (DataGridViewCell cell in row.Cells)
                    {
                        cell.ToolTipText = null;
                    }

                    row.DefaultCellStyle.BackColor = Color.Empty;
                    ModList.InvalidateRow(row.Index);
                }
            }
        }