Nanook.QueenBee.GenericQbEditItem.SetData C# (CSharp) Method

SetData() public method

public SetData ( GenericQbItem item ) : void
item Nanook.QueenBee.Parser.GenericQbItem
return void
        public void SetData(GenericQbItem item)
        {
            _gItem = item;

            txtValue.ReadOnly = item.ReadOnly;

            if (!GenericQbItem.IsTypeSupported(item.Type))
                throw new ArgumentOutOfRangeException(string.Format("{0} is not supported", _gItem.Type.FullName));

            btnConvert.Text = GenericQbItem.GetTypeName(_gItem.CurrentEditType);

            lbl.Text = _gItem.Name;

            txtValue.Text = _gItem.Value;
        }

Usage Example

Beispiel #1
0
        private void addEditItem(int spacing, ref int top, ref int lblWidth, ref bool hasEditable, GenericQbItem gi)
        {
            GenericQbEditItem ei;

            ei = new GenericQbEditItem();
            ei.SetData(gi);
            ei.Left   = 0;
            ei.Width  = this.ClientSize.Width;
            ei.Top    = top;
            top      += spacing;
            ei.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right;

            if (!hasEditable && !gi.ReadOnly)
            {
                hasEditable = true;
            }

            if (gi.UseQbItemType)
            {
                ei.ConvertTo(base.QbItemDataType);
            }
            //else
            //    ei.ConvertTo(base.EditType);

            this.Controls.Add(ei);

            if (ei.LabelWidth > lblWidth)
            {
                lblWidth = ei.LabelWidth;
            }
        }
All Usage Examples Of Nanook.QueenBee.GenericQbEditItem::SetData