public virtual void Init(Requirement r, Dictionary<string, object> meta) { Tag = new TagInfo {Req = r, Meta = meta}; Text = meta.GetStringFromMetadata(r.Name) ?? string.Empty; Anchor = AnchorStyles.Left | AnchorStyles.Right; AutoSize = false; TextChanged += (a, b) => { TagInfo m = (TagInfo) Tag; m.Meta[r.Name] = Text; }; }
public virtual void Init(Requirement r, Dictionary<string, object> meta) { this.Text = r.Name; Anchor = AnchorStyles.Left | AnchorStyles.Right; AutoSize = false; Font = new Font("Segoe UI", 10); this.TextAlign=ContentAlignment.MiddleCenter; Click += (a, b) => { System.Diagnostics.Process.Start((string) r.Options[0]); }; }
public virtual void Init(Requirement r, Dictionary<string, object> meta) { Tag = new TagInfo { Req = r, Meta = meta }; Checked = meta.GetBoolFromMetadata(r.Name) ?? false; Anchor = AnchorStyles.Left | AnchorStyles.Right; AutoSize = false; CheckedChanged += (a, b) => { TagInfo m = (TagInfo)Tag; m.Meta[m.Req.Name] = Checked; }; }
public virtual void Init(Requirement r, Dictionary<string, object> meta) { Minimum = 0; Maximum = int.MaxValue; Tag = new TagInfo { Req = r, Meta = meta }; Value = (meta.GetIntFromMetadata(r.Name) ?? 0); Anchor = AnchorStyles.Left | AnchorStyles.Right; AutoSize = false; ValueChanged += (a, b) => { TagInfo m = (TagInfo)Tag; m.Meta[r.Name] = (int)Value; }; }
public virtual void Init(Requirement r, Dictionary<string, object> meta) { Tag = new TagInfo { Req = r, Meta = meta }; foreach (string op in r.Options) Items.Add(op); Anchor = AnchorStyles.Left | AnchorStyles.Right; AutoSize = false; DropDownStyle=ComboBoxStyle.DropDownList; SelectedIndexChanged += (a, b) => { if (SelectedIndex != -1) { TagInfo m = (TagInfo)Tag; m.Meta[r.Name] = (string) SelectedItem; } }; string def = meta.GetStringFromMetadata(r.Name); if (r.Options.Contains(def)) { SelectedIndex = r.Options.IndexOf(def); } }
public virtual void Init(Requirement r, Dictionary<string, object> meta) { Tag = new TagInfo { Req = r, Meta = meta }; Anchor = AnchorStyles.Left | AnchorStyles.Right; AutoSize = false; Button but = new Button {Text = "...", Size = new Size(24, 23), Dock=DockStyle.Right}; TextBox txt = new TextBox { Text = meta.GetStringFromMetadata(r.Name) ?? string.Empty, Anchor = AnchorStyles.Left | AnchorStyles.Right, Size = new Size(10, 20), Location = new Point(0, 2) }; txt.TextChanged += (a, b) => { TagInfo m = (TagInfo)Tag; m.Meta[m.Req.Name] = Text; }; but.Click+=(a,b)=> { FolderBrowserDialog dialog=new FolderBrowserDialog(); if (Directory.Exists(txt.Text)) dialog.SelectedPath = txt.Text; DialogResult dl = dialog.ShowDialog(); if (dl == DialogResult.OK) { if (Directory.Exists(dialog.SelectedPath)) txt.Text = dialog.SelectedPath; } }; Panel fill = new Panel { Dock = DockStyle.Fill, Anchor = AnchorStyles.Left | AnchorStyles.Top, Size = new Size(10, 24) }; fill.Controls.Add(txt); Panel spacer = new Panel { Size = new Size(10, 24), Dock = DockStyle.Right }; Controls.Add(fill); Controls.Add(spacer); Controls.Add(but); }
public override void Init(Requirement r, Dictionary<string, object> meta) { base.Init(r,meta); PasswordChar = '*'; }