コード例 #1
0
        public void AddScript(SmartScript script, bool listViewOnly = false, bool selectNewItem = false)
        {
            base.AddScript(script, listViewOnly, selectNewItem);

            if (Settings.Default.PhaseHighlighting && script.event_phase_mask != 0)
            {
                if (!_phaseColors.ContainsKey(script.event_phase_mask))
                {
                    if (_colors.Count == 0)
                    {
                        MessageBox.Show("There are not enough colors in the application because you are using too many different phasemasks.", "Not enough colors!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }

                    _phaseColors.Add(script.event_phase_mask, _colors.Pop());
                }

                _oListView.Refresh();
                ResizeColumns();
            }

            ListView.HideSelection = false;
            ListView.Focus();
            ListView.SelectObject(script);
            _oListView.Select();
            _oListView.SelectObject(script);
            _oListView.EnsureModelVisible(script);
        }