Inheritance: System.Windows.Forms.Form
コード例 #1
0
        static void AddEventClicked(object sender, EventArgs e)
        {
            // add event, new event, add new event
            AddEventWindow addEventWindow = new AddEventWindow();

            if (addEventWindow.ShowDialog(MainGlueWindow.Self) == DialogResult.OK)
            {
                HandleAddEventOk(addEventWindow);
            }
        }
コード例 #2
0
        private static void HandleAddEventOk(AddEventWindow addEventWindow)
        {
            string resultName = addEventWindow.ResultName;
            IElement currentElement = EditorLogic.CurrentElement;

            #region Show message boxes if there is an error with the variable
            bool isInvalid = IsVariableInvalid(null, resultName, currentElement);

            #endregion

            if (!isInvalid)
            {
                EventResponseSave eventResponseSave = new EventResponseSave();
                eventResponseSave.EventName = resultName;

                eventResponseSave.SourceObject = addEventWindow.TunnelingObject;
                eventResponseSave.SourceObjectEvent = addEventWindow.TunnelingEvent;

                eventResponseSave.SourceVariable = addEventWindow.SourceVariable;
                eventResponseSave.BeforeOrAfter = addEventWindow.BeforeOrAfter;

                eventResponseSave.DelegateType = addEventWindow.ResultDelegateType;

                AddEventToElementAndSave(currentElement, eventResponseSave);
            }
        }
コード例 #3
0
        public static void ShowAddEventWindow(NamedObjectSave objectToTunnelInto)
        {
            AddEventWindow addEventWindow = new AddEventWindow();
            addEventWindow.DesiredEventType = CustomEventType.Tunneled;

            addEventWindow.TunnelingObject = objectToTunnelInto.InstanceName;;

            if (addEventWindow.ShowDialog(MainGlueWindow.Self) == DialogResult.OK)
            {
                HandleAddEventOk(addEventWindow);
            }

        }