/// <summary>
        /// Called when Flash Player raises the FlashCallEvent (when an External Interface call
        /// is made by ActionScript)
        /// </summary>
        /// <param name="sender">The object raising the event</param>
        /// <param name="e">The arguments for the event</param>
        private void _flashControl_FlashCall(object sender, _IShockwaveFlashEvents_FlashCallEvent e)
        {
            ExternalInterfaceCall          functionCall = ExternalInterfaceSerializer.DecodeInvoke(e.request);
            ExternalInterfaceCallEventArgs eventArgs    = new ExternalInterfaceCallEventArgs(functionCall);
            object response = OnExternalInterfaceCall(eventArgs);

            _flashControl.SetReturnValue(ExternalInterfaceSerializer.EncodeResult(response));
        }
 /// <summary>
 /// Called when Flash Player raises the FlashCallEvent (when an External Interface call
 /// is made by ActionScript)
 /// </summary>
 /// <param name="sender">The object raising the event</param>
 /// <param name="e">The arguments for the event</param>
 private void _flashControl_FlashCall(object sender, _IShockwaveFlashEvents_FlashCallEvent e)
 {
     try
     {
         ExternalInterfaceCall          functionCall = ExternalInterfaceSerializer.DecodeInvoke(e.request);
         ExternalInterfaceCallEventArgs eventArgs    = new ExternalInterfaceCallEventArgs(functionCall);
         object response = OnExternalInterfaceCall(eventArgs);
         _flashControl.SetReturnValue(ExternalInterfaceSerializer.EncodeResult(response));
     }
     catch (Exception ex)
     {
         Logger.DEBUG_TRACE("_flashControl_FlashCall Exception:" + ex.Message + "\n");
     }
 }
        /// <summary>
        /// Decodes a function call from Flash.
        /// </summary>
        /// <param name="xml">The XML string representing the function call.</param>
        /// <returns>An ExternalInterfaceCall object representing the function call.</returns>
        public static ExternalInterfaceCall DecodeInvoke(string xml)
        {
            XmlTextReader reader = new XmlTextReader(xml, XmlNodeType.Document, null);

            reader.Read();

            string functionName          = reader.GetAttribute("name");
            ExternalInterfaceCall result = new ExternalInterfaceCall(functionName);

            reader.ReadStartElement("invoke");
            reader.ReadStartElement("arguments");

            while (reader.NodeType != XmlNodeType.EndElement && reader.Name != "arguments")
            {
                result.AddArgument(ReadElement(reader));
            }

            reader.ReadEndElement();
            reader.ReadEndElement();

            return(result);
        }
        /// <summary> 
        /// Decodes a function call from Flash. 
        /// </summary> 
        /// <param name="xml">The XML string representing the function call.</param> 
        /// <returns>An ExternalInterfaceCall object representing the function call.</returns> 
        public static ExternalInterfaceCall DecodeInvoke(string xml)
        {
            XmlTextReader reader = new XmlTextReader(xml, XmlNodeType.Document, null);

            reader.Read();

            string functionName = reader.GetAttribute("name");
            ExternalInterfaceCall result = new ExternalInterfaceCall(functionName);

            reader.ReadStartElement("invoke");
            reader.ReadStartElement("arguments");

            while (reader.NodeType != XmlNodeType.EndElement && reader.Name != "arguments")
            {
                result.AddArgument(ReadElement(reader));
            }

            reader.ReadEndElement();
            reader.ReadEndElement();

            return result;
        }
 public ExternalInterfaceCallEventArgs(ExternalInterfaceCall functionCall)
     : base()
 {
     _functionCall = functionCall;
 }
 public ExternalInterfaceCallEventArgs(ExternalInterfaceCall functionCall)
     : base()
 {
     _functionCall = functionCall;
 }