Exemple #1
0
        private void transitionDisplayControl_DisplayClosing(object ender, TransitionDisplayEventHandlerArgs e)
        {
            var returnFunctions = e.FunctionDictionary;
            var returnTransition = e.Transition;
            var returnType = e.ReturnButton;
            switch (returnType.Substring(0, 1).ToUpper())
            {

                case "A":
                case "U":
                    DataHelper.AddUpdateTransition(returnTransition);
                    DataHelper.AddUpdateTransitionFinctions(returnFunctions, returnTransition);
                    DataHelper.SaveChanges();
                    break;

                case "D":
                    DataHelper.DeleteTransition(returnTransition);
                    break;

                case "C":
                default:
                    break;

            }
        }
        private void button_Click(object sender, EventArgs e)
        {
            var button = (UltraButton) sender;
            
            if(button != null)
            {
                returnType = button.Text;
                switch (button.Text.Substring(0,1).ToUpper())
                {
                    case "A":
                    case "U":
                        returnTransition.TransitionName = txtTransitionName.Text;
                        returnTransition.Description = txtDescription.Text;
                        ddButton.Text = returnTransition.TransitionName;
                        BuildReturnFunctionDictionary();
                        break;

                    case "C":

                        break;
                    
                    case "D":

                        break;
                }
            }

            if(DisplayClosing != null)
            {
                var handlerArg = new TransitionDisplayEventHandlerArgs();
                handlerArg.FunctionDictionary = returnFunctions;
                handlerArg.Transition = returnTransition;
                handlerArg.ReturnButton = returnType;
                DisplayClosing(this, handlerArg);
            }
            ddButton.CloseUp();
        }