Esempio n. 1
0
        /// <summary>
        /// Adds the specified textbox item.
        /// </summary>
        /// <param name="item">The item.</param>
        /// <returns>The added textbox.</returns>
        public override object Add(TextEntryActionItem item)
        {
            var strip   = GetOrCreateStrip(item.GroupCaption);
            var textBox = new ToolStripTextBox(item.Key);

            if (item.Width != 0)
            {
                textBox.Width = item.Width;
            }

            textBox.TextChanged += (sender, args) =>
            {
                item.PropertyChanged -= TextEntryActionItemPropertyChanged;
                item.Text             = textBox.Text;
                item.PropertyChanged += TextEntryActionItemPropertyChanged;
            };
            strip?.Items.Add(textBox);

            item.PropertyChanged += TextEntryActionItemPropertyChanged;
            return(textBox);
        }
        /// <summary>
        /// Adds the specified textbox item.
        /// </summary>
        /// <param name="item">The item.</param>
        public override void Add(TextEntryActionItem item)
        {
            ToolStrip strip   = this.GetOrCreateStrip(item.GroupCaption);
            var       textBox = new ToolStripTextBox(item.Key);

            if (item.Width != 0)
            {
                textBox.Width = item.Width;
            }

            textBox.TextChanged += delegate
            {
                item.PropertyChanged -= TextEntryActionItem_PropertyChanged;
                item.Text             = textBox.Text;
                item.PropertyChanged += TextEntryActionItem_PropertyChanged;
            };
            if (strip != null)
            {
                strip.Items.Add(textBox);
            }

            item.PropertyChanged += TextEntryActionItem_PropertyChanged;
        }
Esempio n. 3
0
 /// <summary>
 /// Adds the specified textbox item.
 /// </summary>
 /// <param name="item">The item.</param>
 public abstract void Add(TextEntryActionItem item);
        /// <summary>
        /// Adds the specified textbox item.
        /// </summary>
        /// <param name="item">The item.</param>
        public override void Add(TextEntryActionItem item)
        {
            var strip = GetOrCreateStrip(item.GroupCaption);
            var textBox = new ToolStripTextBox(item.Key);
            if (item.Width != 0)
            {
                textBox.Width = item.Width;
            }

            textBox.TextChanged += delegate
                                       {
                                           item.PropertyChanged -= TextEntryActionItem_PropertyChanged;
                                           item.Text = textBox.Text;
                                           item.PropertyChanged += TextEntryActionItem_PropertyChanged;
                                       };
            if (strip != null)
            {
                strip.Items.Add(textBox);
            }

            item.PropertyChanged += TextEntryActionItem_PropertyChanged;
        }
Esempio n. 5
0
 public override void Add(TextEntryActionItem item)
 {
     var textBox = new TextBox {Name = item.Key};
     if (item.Width != 0)
     {
         textBox.Width = item.Width;
     }
     textBox.TextChanged += delegate
     {
         item.PropertyChanged -= TextEntryActionItem_PropertyChanged;
         item.Text = textBox.Text;
         item.PropertyChanged += TextEntryActionItem_PropertyChanged;
     };
     container.Controls.Add(textBox);
     item.PropertyChanged += TextEntryActionItem_PropertyChanged;
 }
Esempio n. 6
0
 /// <summary>
 /// Adds the specified textbox item.
 /// </summary>
 /// <param name="item">The item.</param>
 /// <returns>The added item.</returns>
 public abstract object Add(TextEntryActionItem item);
Esempio n. 7
0
 /// <summary>
 /// Adds the specified textbox item.
 /// </summary>
 /// <param name="item">The item.</param>
 public abstract void Add(TextEntryActionItem item);
Esempio n. 8
0
 public override void Add(TextEntryActionItem item)
 {
     TextBox textBox = new TextBox();
     textBox.Name = item.Key;
     if (item.Width != 0)
     {
         textBox.Width = item.Width;
     }
     textBox.TextChanged += delegate
     {
         item.PropertyChanged -= TextEntryActionItem_PropertyChanged;
         item.Text = textBox.Text;
         item.PropertyChanged += TextEntryActionItem_PropertyChanged;
     };
     //addLabel(item.ToolTipText);
     container.Controls.Add(textBox);
     item.PropertyChanged += TextEntryActionItem_PropertyChanged;
 }