コード例 #1
0
        private void AddEffect(ImageEffect imageEffect, ImageEffectPreset preset = null)
        {
            pauseUpdate = true;

            ListViewItem lvi = new ListViewItem(imageEffect.GetType().GetDescription());

            lvi.Checked = imageEffect.Enabled;
            lvi.Tag     = imageEffect;

            if (lvEffects.SelectedIndices.Count > 0)
            {
                int index = lvEffects.SelectedIndices[lvEffects.SelectedIndices.Count - 1] + 1;
                lvEffects.Items.Insert(index, lvi);

                if (preset != null)
                {
                    preset.Effects.Insert(index, imageEffect);
                }
            }
            else
            {
                lvEffects.Items.Add(lvi);

                if (preset != null)
                {
                    preset.Effects.Add(imageEffect);
                }
            }

            lvi.EnsureVisible();
            lvi.Selected = true;

            pauseUpdate = false;
        }
コード例 #2
0
        private void AddEffect(ImageEffect imageEffect)
        {
            ListViewItem lvi = new ListViewItem(imageEffect.GetType().GetDescription());

            lvi.Checked = imageEffect.Enabled;
            lvi.Tag     = imageEffect;

            if (lvEffects.SelectedIndices.Count > 0)
            {
                lvEffects.Items.Insert(lvEffects.SelectedIndices[lvEffects.SelectedIndices.Count - 1] + 1, lvi);
            }
            else
            {
                lvEffects.Items.Add(lvi);
            }

            lvEffects.Focus();
            lvi.EnsureVisible();
            lvi.Selected = true;
        }
コード例 #3
0
ファイル: ImageEffectsForm.cs プロジェクト: raymondle/ShareX
        private void AddEffect(ImageEffect imageEffect)
        {
            ListViewItem lvi = new ListViewItem(imageEffect.GetType().GetDescription());
            lvi.Checked = imageEffect.Enabled;
            lvi.Tag = imageEffect;

            if (lvEffects.SelectedIndices.Count > 0)
            {
                lvEffects.Items.Insert(lvEffects.SelectedIndices[lvEffects.SelectedIndices.Count - 1] + 1, lvi);
            }
            else
            {
                lvEffects.Items.Add(lvi);
            }

            lvEffects.Focus();
            lvi.EnsureVisible();
            lvi.Selected = true;
        }