Ejemplo n.º 1
0
        public ActionControl(Constants.ActionTypes actionType, string display = null)
        {
            _actionType = actionType;

            InitializeComponent();

            BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            Location    = new System.Drawing.Point(5, 5);
            Margin      = new System.Windows.Forms.Padding(5);
            Name        = "uiAction1";
            TabIndex    = 0;

            if (actionType == Constants.ActionTypes.Custom)
            {
                DisplayName = display.Trim();
            }
            else
            {
                DisplayName = Constants.ActionTypeDefaultDescription(actionType);
            }

            Size = new Size(154, 60);

            string imageLocation = string.Empty;

            switch (actionType)
            {
            case Constants.ActionTypes.Sql:
                imageLocation = Constants.Images.SqlActionIcon;
                break;

            case Constants.ActionTypes.Rest:
                imageLocation = Constants.Images.RestActionIcon;

                break;

            case Constants.ActionTypes.Assert:

                imageLocation = Constants.Images.AssertActionIcon;

                break;

            default:

                imageLocation = Constants.Images.CustomActionIcon;

                break;
            }
            pictureBox1.ImageLocation = imageLocation;

            //DoubleClick += (object sender1, EventArgs e1) =>
            //{

            //};
        }