VideoPlayerSharedLib.Command.ContainsParam C# (CSharp) Method

ContainsParam() public method

public ContainsParam ( string paramName ) : bool
paramName string
return bool
        public bool ContainsParam(string paramName)
        {
            bool result = false;
            if (Params != null)
            {
                foreach (Param param in Params)
                {
                    if (param.Name == paramName)
                    {
                        result = true;
                        break;
                    }
                }
            }
            return result;
        }

Usage Example

 public void Play(Command command)
 {
     if (command.ContainsParam("NodeId"))
     {
         Guid id;
         if (Guid.TryParse(command.GetParamValue("NodeId"), out id))
         {
             if (CurrentNode != null && CurrentNode.NodeId.Equals(id))
             {
                 HandleCurrentNodePlay(command); //the current playing node is the same one this play command came from
             }
             else
             {
                 HandleNonCurrentNodePlay(command, id); //it was a different node to the currently playing node that the command came from
             }
         }
         if (MediaPlayer.Source != null)
             MainUI.UrlControl.Data.Source = MediaPlayer.Source.ToString();
     }
 }
All Usage Examples Of VideoPlayerSharedLib.Command::ContainsParam