public void CreateJavaScript(StringCollection sb, StringCollection parameters, string returnReceiver)
 {
     if (!(parameters != null && parameters.Count > 0))
     {
         bool babort = this.IsAbort;
         //why abort event handling? if a return isused in an event handler, it should stop all levels of goto's
         if (_ownerAction != null)
         {
             EventHandlerMethod ehm = _ownerAction.ActionHolder as EventHandlerMethod;
             if (ehm != null)
             {
                 babort = true;
             }
         }
         if (babort)
         {
             sb.Add("JsonDataBinding.AbortEvent = true;\r\n");
         }
     }
     sb.Add(Indentation.GetIndent());
     sb.Add("return");
     if (parameters != null && parameters.Count > 0)
     {
         sb.Add(" ");
         sb.Add(parameters[0]);
     }
     sb.Add(";\r\n");
 }
        private void miEditActions_Click(object sender, EventArgs e)
        {
            MethodDiagramViewer mv = this.DiagramViewer;

            if (mv != null)
            {
                AB_AssignActions eaAct = this.ActionObject as AB_AssignActions;
                if (eaAct != null)
                {
                    MethodDesignerHolder holder = mv.DesignerHolder;
                    if (holder != null)
                    {
                        EventHandlerMethod m = eaAct.GetHandlerMethod();
                        if (m == null)
                        {
                            MessageBox.Show(mv.FindForm(), "Action data for event handler method not found. You may delete the action and re-create the action.", "Edit action", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        }
                        else
                        {
                            m.Edit(eaAct.BranchId, this.Bounds, holder.Loader, this.FindForm());
                        }
                    }
                }
            }
        }
 public EventHandlerMethod GetHandlerMethod()
 {
     loadEventAction();
     if (_eventAction != null)
     {
         HandlerMethodID    hmid;
         EventHandlerMethod ehm = null;
         if (_eventAction.TaskIDList.Count > 0)
         {
             hmid = _eventAction.TaskIDList[0] as HandlerMethodID;
             if (hmid != null)
             {
                 ehm = hmid.HandlerMethod;
             }
         }
         if (ehm == null)
         {
             hmid = new HandlerMethodID();
             ehm  = new EventHandlerMethod(_eventAction.RootPointer);
             hmid.HandlerMethod = ehm;
             _eventAction.TaskIDList.Clear();
             _eventAction.TaskIDList.Add(hmid);
         }
         return(ehm);
     }
     return(null);
 }
 public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
 {
     if (context != null && context.Instance != null && provider != null)
     {
         IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
         if (edSvc != null)
         {
             ActionAttachEvent aae = context.Instance as ActionAttachEvent;
             if (aae != null)
             {
                 ClassPointer root = aae.Class;
                 if (root != null)
                 {
                     ILimnorDesignerLoader loader = root.GetCurrentLoader();
                     if (loader != null)
                     {
                         EventHandlerMethod ehm = aae.GetHandlerMethod();
                         if (ehm != null)
                         {
                             DlgMethod dlg = ehm.GetEditDialog(Rectangle.Empty, loader);
                             dlg.DisableAnimate();
                             if (edSvc.ShowDialog(dlg) == System.Windows.Forms.DialogResult.OK)
                             {
                                 ehm.OnFinishEdit(aae.ActionId, loader);
                             }
                         }
                     }
                 }
             }
         }
     }
     return(value);
 }
 public void SetRightHandQuicklyClosed(EventHandlerMethod methodName)
 {
     //throw new NotImplementedException();
     gestureQuicklyClosed1.GestureRecognized += new EventHandler(methodName);
     gestureQuicklyClosed2.GestureRecognized += new EventHandler(methodName);
     gestureQuicklyClosed3.GestureRecognized += new EventHandler(methodName);
     gestureQuicklyClosed4.GestureRecognized += new EventHandler(methodName);
 }
 public void SetRightHandQuicklyClosed(EventHandlerMethod methodName)
 {
     //throw new NotImplementedException();
     gestureQuicklyClosed1.GestureRecognized += new EventHandler(methodName);
     gestureQuicklyClosed2.GestureRecognized += new EventHandler(methodName);
     gestureQuicklyClosed3.GestureRecognized += new EventHandler(methodName);
     gestureQuicklyClosed4.GestureRecognized += new EventHandler(methodName);
 }
        protected override void OnSetImage()
        {
            EventHandlerMethod em = Method as EventHandlerMethod;

            if (em != null)
            {
                if (em.ForAllTypes)
                {
                    SetIconImage(Resources._methodActionForAll.ToBitmap());
                    return;
                }
            }
            SetIconImage(Resources._methodAction.ToBitmap());
        }
        private void mi_edit(object sender, EventArgs e)
        {
            EventPath ep = this.Parent as EventPath;

            if (ep != null)
            {
                UInt32             abId = 0;
                EventHandlerMethod ehm  = _method as EventHandlerMethod;
                if (ehm != null)
                {
                    abId = ehm.ActionBranchId;
                }
                _method.Edit(abId, ep.RectangleToScreen(this.Bounds), ep.Panes.Loader, this.FindForm());
            }
        }
        public void LoadMethod(MethodClass method, EnumParameterEditType parameterEditType)
        {
            if (holder.MainDiagramViewer.ParentEditor == null)
            {
                method.SetEditContext();
            }
            holder.LoadMethod(method, parameterEditType);
            EventHandlerMethod ehm = method as EventHandlerMethod;

            if (ehm != null)
            {
                this.Text = string.Format(System.Globalization.CultureInfo.InvariantCulture,
                                          Resources.TitleEditEventMethod, ehm.Event.Name, method.MethodName);
            }
            else
            {
                this.Text = string.Format(System.Globalization.CultureInfo.InvariantCulture,
                                          Resources.TitleEditMethod, method.MethodName);
            }
        }
Exemple #10
0
 public static void SetDynamicEventHandlerLineColor(PortCollection pc)
 {
     foreach (LinkLineNodePort p in pc)
     {
         LinkLineNodeInPort ip = p as LinkLineNodeInPort;
         if (ip != null)
         {
             ComponentIconEventhandle ieh = ip.PortOwner as ComponentIconEventhandle;
             if (ieh != null)
             {
                 EventHandlerMethod ehm = ieh.Method as EventHandlerMethod;
                 if (ehm != null)
                 {
                     UInt32 actId = ehm.GetDynamicActionId();
                     if (actId != 0)
                     {
                         ip.SetLineColor(Color.Yellow);
                     }
                 }
             }
         }
         else
         {
             EventPortOutExecuteMethod op = p as EventPortOutExecuteMethod;
             if (op != null)
             {
                 EventHandlerMethod ehm = op.Method as EventHandlerMethod;
                 if (ehm != null)
                 {
                     UInt32 actId = ehm.GetDynamicActionId();
                     if (actId != 0)
                     {
                         op.SetLineColor(Color.Yellow);
                     }
                 }
             }
         }
     }
 }
 public void SetRightHandClosed(EventHandlerMethod methodName)
 {
     //throw new NotImplementedException();
     //add listener
     gestureClosed.GestureRecognized += new EventHandler(methodName);
 }
 public void OnDeleteEventMethod(EventHandlerMethod method)
 {
     _objExplorer.OnDeleteEventMethod(method);
 }
 /// <summary>
 /// Adds a <see cref="EventHandlerMethod{THandlerType, TTEventType}"/> to be called when events of type <typeparamref name="TTEventType"/> are received.
 /// </summary>
 /// <typeparam name="TTEventType">The type of event to handle.</typeparam>
 /// <param name="method">The method to call when events of type <typeparamref name="TTEventType"/> are received.</param>
 /// <returns>The <see cref="EventHandlerInstanceBuilder{THandlerType, TEventType}"/> for continued building.</returns>
 public EventHandlerFactoryBuilder <THandlerType, TEventType> Handle <TTEventType>(EventHandlerMethod <THandlerType, TTEventType> method)
     where TTEventType : TEventType
 {
     _builder.Handle <TTEventType>((@event, context) => method(_factory(), @event, context));
     return(this);
 }
Exemple #14
0
 /// <summary>
 /// Adds a <see cref="EventHandlerMethod{THandlerType, TTEventType}"/> to be called when events of type <typeparamref name="TTEventType"/> are received.
 /// </summary>
 /// <typeparam name="TTEventType">The type of event to handle.</typeparam>
 /// <param name="method">The method to call when events of type <typeparamref name="TTEventType"/> are received.</param>
 /// <returns>The <see cref="EventHandlerInstanceBuilder{THandlerType, TEventType}"/> for continued building.</returns>
 public EventHandlerInstanceBuilder <THandlerType, TEventType> Handle <TTEventType>(EventHandlerMethod <THandlerType, TTEventType> method)
     where TTEventType : TEventType
 {
     _builder.Handle <TTEventType>((@event, context) => method(_instance, @event, context));
     return(this);
 }
Exemple #15
0
 public void OnDeleteEventMethod(EventHandlerMethod method)
 {
 }
 public void setRightHandQuicklyOpen(EventHandlerMethod methodName)
 {
     //throw new NotImplementedException();
     gestureQuicklyOpen.GestureRecognized += new EventHandler(methodName);
 }
 public void setRightHandQuicklyOpen(EventHandlerMethod methodName)
 {
     //throw new NotImplementedException();
     gestureQuicklyOpen.GestureRecognized += new EventHandler(methodName);
 }
 public void SetRightHandClosed(EventHandlerMethod methodName)
 {
     //throw new NotImplementedException();
     //add listener
     gestureClosed.GestureRecognized += new EventHandler(methodName);
 }