コード例 #1
0
 public LabelSelectParameter(string paramName, bool multiSelect, SequenceSingleSelectParameter parent)
     : base(paramName)
 {
     Value       = new List <string>();
     Parent      = parent;
     MultiSelect = multiSelect;
 }
コード例 #2
0
        public override Panel CreatePanel(SequenceProcEnv environment)
        {
            Panel    ret   = new Panel();
            GroupBox group = new GroupBox();

            group.Text = this.ParamName;
            group.Dock = DockStyle.Fill;
            SequenceIndexSelectControl ctrl = new SequenceIndexSelectControl();

            ctrl.SelectionMode = SelectionMode.MultiExtended;
            if (Parent == null)
            {
                ctrl.SetItemsFromSequence(environment.SelectedSequence);
            }
            else
            {
                Parent.ValueChanged += new EventHandler((s, e) => {
                    SequenceSingleSelectParameter parent = s as SequenceSingleSelectParameter;
                    var sequence = parent.Value;
                    if (sequence != null)
                    {
                        ctrl.SetItemsFromSequence(sequence);
                    }
                });
            }
            if (this.Value != null && this.Value.Count > 0)
            {
                ctrl.SelectedIndices.Clear();
                foreach (int index in this.Value)
                {
                    if (index < 0 || index >= ctrl.Items.Count)
                    {
                        continue;
                    }
                    ctrl.SelectedIndices.Add(index);
                }
            }
            this.Value = new List <int>(ctrl.SelectedIndices.OfType <int>());
            ctrl.SelectedIndexChanged += new EventHandler((s, e) => {
                this.Value = new List <int>(ctrl.SelectedIndices.OfType <int>());
                DoValueChanged();
            });
            ctrl.Dock = DockStyle.Fill;
            group.Controls.Add(ctrl);
            ret.Controls.Add(group);
            ret.Height = 128;
            return(ret);
        }
コード例 #3
0
        public override Panel CreatePanel(SequenceProcEnv environment)
        {
            Panel    ret   = new Panel();
            GroupBox group = new GroupBox();

            group.Text = ParamName;
            group.Dock = DockStyle.Fill;
            BorderSelectionControl border = new BorderSelectionControl();

            border.SelectionMode = MultiSelect ? SelectionMode.MultiExtended : SelectionMode.One;
            if (Parent == null)
            {
                border.AttachBorder(environment.SelectedSequence.Borders);
            }
            else
            {
                var sequences = Parent.Value;
                if (sequences != null)
                {
                    border.AttachBorder(sequences.Borders);
                }
                Parent.ValueChanged += new EventHandler((s, e) => {
                    SequenceSingleSelectParameter parent = s as SequenceSingleSelectParameter;
                    var sequences2 = parent.Value;
                    if (sequences2 != null)
                    {
                        border.AttachBorder(sequences2.Borders);
                    }
                });
            }
            border.SelectRange(Value);

            border.SelectedIndexChanged += new EventHandler((s, e) => {
                var labels = new List <string>();
                foreach (var item in border.SelectedItems)
                {
                    labels.Add((string)item);
                }
                Value = labels;
                DoValueChanged();
            });
            border.Dock = DockStyle.Fill;
            group.Controls.Add(border);
            ret.Controls.Add(group);
            ret.Height = 160;
            return(ret);
        }
コード例 #4
0
        public override Panel CreatePanel(SequenceProcEnv environment)
        {
            Panel    ret   = new Panel();
            GroupBox group = new GroupBox();

            group.Text = ParamName;
            group.Dock = DockStyle.Fill;
            LabelReplaceControl border = new LabelReplaceControl();

            if (this.Parent == null)
            {
                border.AttachSequenceData(environment.SelectedSequence);
            }
            else
            {
                var sequences = this.Parent.Value;
                if (sequences != null)
                {
                    border.AttachSequenceData(sequences);
                }
                this.Parent.ValueChanged += new EventHandler((s, e) => {
                    SequenceSingleSelectParameter parent = s as SequenceSingleSelectParameter;
                    var sequences2 = parent.Value;
                    if (sequences2 != null)
                    {
                        border.AttachSequenceData(sequences2);
                    }
                });
            }
            border.AddReplaceMap(this.Value);

            border.ReplaceMapChanged += new EventHandler((s, e) => {
                this.Value = border.GetReplaceMap().Where(pair => pair.Key != pair.Value).ToDictionary(pair => pair.Key, pair => pair.Value);
                this.DoValueChanged();
            });
            border.Dock = DockStyle.Fill;
            group.Controls.Add(border);
            ret.Controls.Add(group);
            ret.Height = 360;
            return(ret);
        }
コード例 #5
0
        public override Panel CreatePanel(SequenceProcEnv environment)
        {
            Panel    ret   = new Panel();
            GroupBox group = new GroupBox();

            group.Text = ParamName;
            group.Dock = DockStyle.Fill;
            TargetSequenceIndexControl target = new TargetSequenceIndexControl();

            if (this.Parent == null)
            {
                target.AttachSequence(environment.SelectedSequence);
            }
            else
            {
                this.Parent.ValueChanged += new EventHandler((s, e) => {
                    SequenceSingleSelectParameter parent = s as SequenceSingleSelectParameter;
                    var sequence = parent.Value;
                    if (sequence != null)
                    {
                        target.AttachSequence(sequence);
                    }
                });
            }
            if (Value >= -1 && Value < target.ItemCount)
            {
                target.SelectedIndex = Value;
            }
            target.SelectedIndexChanged += new EventHandler((s, e) => {
                this.Value = target.SelectedIndex;
                this.DoValueChanged();
            });
            target.Dock = DockStyle.Fill;
            group.Controls.Add(target);
            ret.Controls.Add(group);
            ret.Height = 48;
            return(ret);
        }
コード例 #6
0
 public LabelReplaceParameter(string paramName, SequenceSingleSelectParameter parent)
     : base(paramName)
 {
     this.Parent = parent;
 }
コード例 #7
0
 public SequenceColumnMultiSelectParameter(string paramName, SequenceSingleSelectParameter parent)
     : base(paramName)
 {
     Value  = new List <int>();
     Parent = parent;
 }
コード例 #8
0
 public SequenceColumnSelectParameter(string paramName, SequenceSingleSelectParameter parent)
     : base(paramName)
 {
     this.Value  = 0;
     this.Parent = parent;
 }