/// <summary>
 /// Execute the action.
 /// </summary>
 /// <param name="element">Parameter to remove!</param>
 /// <param name="project">Project where the action must be executed.</param>
 /// <param name="system">System used to execute the digital commands.</param>
 public override void Execute(ElementBase element, Project project, Rwm.Otc.Systems.IDigitalSystem system)
 {
     try
     {
         if (project.Elements.ContainsKey(this.ElementID))
         {
             IAccessory accElement = project.Elements[this.ElementID] as IAccessory;
             if (accElement != null)
             {
                 accElement.SetAccessoryStatus(this.Status, true);
             }
         }
         else
         {
             Logger.LogWarning(this,
                               "Cannot execute SetAccessoryStatusAction #{0}: element #{1} not found in project",
                               this.ID, this.ElementID);
         }
     }
     catch (Exception ex)
     {
         Logger.LogError(this, ex);
         throw;
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Execute the action.
 /// </summary>
 /// <param name="element">Parameter to remove!</param>
 /// <param name="project">Project where the action must be executed.</param>
 /// <param name="system">System used to execute the digital commands.</param>
 public override void Execute(ElementBase element, Project project, Rwm.Otc.Systems.IDigitalSystem system)
 {
     try
     {
         OTCContext.Layout.SoundManager.PlaySound(this.SoundID, project);
     }
     catch (Exception ex)
     {
         Logger.LogError(this, ex);
         throw;
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// Execute the action.
 /// </summary>
 /// <param name="element">Parameter to remove!</param>
 /// <param name="project">Project where the action must be executed.</param>
 /// <param name="system">System used to execute the digital commands.</param>
 public override void Execute(ElementBase element, Project project, Rwm.Otc.Systems.IDigitalSystem system)
 {
     try
     {
         Route route = OTCContext.Layout.RouteManager.GetByID(this.RouteID);
         route.ActivateRoute(project);
     }
     catch (Exception ex)
     {
         Logger.LogError(this, ex);
         throw;
     }
 }
Exemplo n.º 4
0
 /// <summary>
 /// Execute the action.
 /// </summary>
 /// <param name="element">Parameter to remove!</param>
 /// <param name="project">Project where the action must be executed.</param>
 /// <param name="system">System used to execute the digital commands.</param>
 public virtual void Execute(ElementBase element, Project project, Rwm.Otc.Systems.IDigitalSystem system)
 {
     // Nothing to do here
 }