Ejemplo n.º 1
0
 /// <summary>
 /// Displays the chosen event's parameters in the parameter panel.
 /// </summary>
 /// <param name="constructor">The event's constructor.</param>
 /// <param name="chooserMap">A mapping between a type to a function that instantiates a new chooser-control.</param>
 private void HandleEventChosen(Constructor constructor, 
                                Dictionary<Type, Func<IParamChooser>> chooserMap)
 {
     parameterPanel.ClearAllParameters();
     chosenEventConstructor = constructor;
     AddParameters(constructor.Parameters, chooserMap);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Posts an event.
 /// If the parameter-panel does not contain the event selected, it will display the event's
 /// parameters and not post the event.
 /// If the parameter-panel already displays this event's parameters of if the event does not require
 /// any parameters, posts the event immediatly using the launcher's own PostEvent method.
 /// </summary>
 /// <param name="constructor"></param>
 /// <param name="chooserMap"></param>
 /// <returns></returns>
 private bool PostEvent(Constructor constructor, 
                        Dictionary<Type, Func<IParamChooser>> chooserMap)
 {
     if (chosenEventConstructor == null)
         return false;
     else if (chosenEventConstructor != constructor)
     {
         HandleEventChosen(constructor, chooserMap);
         if (constructor.Parameters.Length  == 0)
             return true;
         return false;
     }
     else
         return true;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Creates a new dynamic event item.
 /// </summary>
 /// <param name="text">The label associated with this event-item.</param>
 /// <param name="constructor">The event's constructor.</param>
 public DynamicEventItem(string text, Constructor constructor)
 {
     Text = text;
     Constructor = constructor;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Creates a new dynamic event item.
 /// </summary>
 /// <param name="text">The label associated with this event-item.</param>
 /// <param name="constructor">The event's constructor.</param>
 public DynamicEventItem(string text, Constructor constructor)
 {
     Text        = text;
     Constructor = constructor;
 }