SetData() public method

public SetData ( GenericQbItem item ) : void
item Nanook.QueenBee.Parser.GenericQbItem
return void
Ejemplo n.º 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;
            }
        }
Ejemplo n.º 2
0
        private void ScriptEditor_Load(object sender, EventArgs e)
        {
            if (this.DesignMode)
            {
                return;
            }

            try
            {
                _qbItem = (base.QbItem as QbItemScript);
                if (_qbItem == null)
                {
                    throw new Exception("Error");
                }

                eiItemQbKey.SetData(new GenericQbItem("Item QB Key", _qbItem.ItemQbKey, typeof(string), false, false, QbItemType.SectionScript, "ItemQbKey"));
                eiUnknown.SetData(new GenericQbItem("Unknown", _qbItem.Unknown, typeof(byte[]), false, false, QbItemType.SectionScript, "Unknown"));

                int w = (eiItemQbKey.LabelWidth > eiUnknown.LabelWidth ? eiItemQbKey.LabelWidth : eiUnknown.LabelWidth) + 6;
                eiItemQbKey.TextBoxLeft = w;
                eiUnknown.TextBoxLeft   = w;

                txtScript.Text = bytesToHexAsciiString(_qbItem.ScriptData);

                _preventUpdate = false;

                loadStringList();
            }
            catch (Exception ex)
            {
                base.ShowException("Script Load Item Error", ex);
            }
        }
Ejemplo n.º 3
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;
        }