예제 #1
0
        public override Control GetEditor(out string bindPropName)
        {
            string text = "";

            if (PresentationValue != null)
            {
                if ((int)PresentationValue == -1)
                {
                    text = mUnitializedText;
                }
                else
                {
                    text = PresentationValue.ToString();
                }
            }
            else
            {
                text = "empty";
            }

            Label l = new Label();

            int idval;

            if (System.Int32.TryParse(text, out idval))
            {
                TriggerValue val;
                if (mTriggerNamespace.GetValues().TryGetValue(idval, out val))
                {
                    text = val.Name;
                }
            }
            l.Text = text;

            l.ForeColor = Color.Blue;
            if (text == mUnitializedText)
            {
                l.ForeColor = Color.Red;
            }
            bindPropName = "Text";
            l.AutoSize   = true;
            l.Margin     = new Padding(0);

            l.DragEnter += new DragEventHandler(l_DragEnter);
            l.DragDrop  += new DragEventHandler(l_DragDrop);
            l.AllowDrop  = true;
            return(l);


            //return base.GetEditor(out bindPropName);
        }
예제 #2
0
        public override Control GetEditor(out string bindPropName)
        {
            string text = "";

            if (PresentationValue != null)
            {
                if ((string)PresentationValue == "")
                {
                    PresentationValue = mUninitializedValue;
                }
                text = PresentationValue.ToString();
            }
            else
            {
                text = mUninitializedValue;
            }

            Label l = new Label();

            l.Text      = text;
            l.ForeColor = Color.Blue;
            if (text == mUninitializedValue)
            {
                l.ForeColor = Color.Red;
            }
            bindPropName = "Text";
            l.AutoSize   = true;
            l.Margin     = new Padding(0);

            l.DragEnter += new DragEventHandler(l_DragEnter);
            l.DragDrop  += new DragEventHandler(l_DragDrop);
            l.AllowDrop  = true;
            return(l);


            //return base.GetEditor(out bindPropName);
        }