/// <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>
		/// Raises the ExternalInterfaceCall event, indicating that a call has come from Flash Player.
		/// </summary>
		/// <param name="e">The event arguments related to the event being raised.</param>
		protected virtual object OnExternalInterfaceCall(ExternalInterfaceCallEventArgs e)
		{
			if (ExternalInterfaceCall != null)
			{
				return ExternalInterfaceCall(this, e);
			}
			return null;
		}
 /// <summary>
 /// Raises the ExternalInterfaceCall event, indicating that a call has come from Flash Player.
 /// </summary>
 /// <param name="e">The event arguments related to the event being raised.</param>
 protected virtual object OnExternalInterfaceCall(ExternalInterfaceCallEventArgs e)
 {
     if (ExternalInterfaceCall != null)
     {
         return(ExternalInterfaceCall(this, e));
     }
     return(null);
 }
Esempio n. 4
0
 /// <summary>
 /// Parse calls from flash application
 /// </summary>
 private object proxy_ExternalInterfaceCall(object sender, ExternalInterfaceCallEventArgs e)
 {
     switch (e.FunctionCall.FunctionName)
     {
         case "setStPosition":
             setStPosition((double)e.FunctionCall.Arguments[0], (double)e.FunctionCall.Arguments[1]);
             return null;
         case "setFnPosition":
             setFnPosition((double)e.FunctionCall.Arguments[0], (double)e.FunctionCall.Arguments[1]);
             return null;
     }
     return null;
 }
 /// <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>
 /// Raises the ExternalInterfaceCall event, indicating that a call has come from Flash Player.
 /// </summary>
 /// <param name="e">The event arguments related to the event being raised.</param>
 protected virtual object OnExternalInterfaceCall(ExternalInterfaceCallEventArgs e)
 {
     try
     {
         if (ExternalInterfaceCall != null)
         {
             return(ExternalInterfaceCall(this, e));
         }
         return(null);
     }
     catch (Exception ex)
     {
         Logger.DEBUG_TRACE("OnExternalInterfaceCall Exception:" + ex.Message + "\n");
         return(null);
     }
 }
Esempio n. 7
0
 /// <summary>
 /// Called by the proxy when an ActionScript ExternalInterface call
 /// is made by the SWF
 /// </summary>
 /// <param name="sender">The object raising the event</param>
 /// <param name="e">The event arguments associated with the event</param>
 /// <returns>The response to the function call.</returns>
 private object proxy_ExternalInterfaceCall(object sender, ExternalInterfaceCallEventArgs e)
 {
     switch (e.FunctionCall.FunctionName)
     {
         case "isReady":
             return isReady();
         case "setSWFIsReady":
             setSWFIsReady();
             return null;
         case "createImage":
             createImage((string)e.FunctionCall.Arguments[0]);
             return null;
         default:
             return null;
     }
 }
        object proxy_ExternalInterfaceCall(object sender, ExternalInterfaceCallEventArgs e)
        {
            /// We don't know yet? :D
            string function = e.FunctionCall.FunctionName;
            object[] args = Array.ConvertAll(e.FunctionCall.Arguments, (o) => o.ToString());
            //string call = String.Format("HttpSimpleStream Called : {0}({1})", function, String.Join(",", args));
            //Console.WriteLine(call);

            if (cachedMethods.ContainsKey(function))
                cachedMethods[function].Invoke(this, args); /// Oh the irony that this is actually very easy.

            return null;
        }
 private object proxy_ExternalInterfaceCall(object sender, ExternalInterfaceCallEventArgs e)
 {
     switch (e.FunctionCall.FunctionName)
     {
         case "sendToJavaScript":
             CallFromFlash(e.FunctionCall.Arguments);
             break;
         default:
             return null;
     }
     return null;
 }
Esempio n. 10
0
 /// <summary>
 /// Called by the proxy when an ActionScript ExternalInterface call
 /// is made by the SWF
 /// </summary>
 /// <param name="sender">The object raising the event</param>
 /// <param name="e">The event arguments associated with the event</param>
 /// <returns>The response to the function call.</returns>
 private object proxy_ExternalInterfaceCall(object sender, ExternalInterfaceCallEventArgs e)
 {
     switch (e.FunctionCall.FunctionName)
     {
         case "isReady":
             return isReady();
         case "setSWFIsReady":
             setSWFIsReady();
             return null;
         case "SchemaRecieved":
             SchemaRecieved((string)e.FunctionCall.Arguments[0]);
             return null;
         case "SelectedEntityChanged":
             SelectedEntityChanged((string)e.FunctionCall.Arguments[0]);
             return null;
         case "statusChange":
             //statusChange();
             return null;
         default:
             return null;
     }
 }
Esempio n. 11
0
 private object proxy_ExternalInterfaceCall(object sender, ExternalInterfaceCallEventArgs e)
 {
     return null;
 }
Esempio n. 12
0
        object proxy_ExternalInterfaceCall(object sender, ExternalInterfaceCallEventArgs e)
        {
            //MessageBox.Show(e.FunctionCall.FunctionName);
            IList args = e.FunctionCall.Arguments[0] as IList;
            while (args[0] is IList)
                args = args[0] as IList;

            if (e.FunctionCall.FunctionName != "proxy_chama_desktop_executar")
            {
                System.Windows.Forms.MessageBox.Show("não tratado fname == "+e.FunctionCall.FunctionName);
            }

            string comando = args[0] as string;

            //Console.Beep(4000,300);

            /**
             * no caso da web, se o proxy estiver aberto, o desktop também estará
             * no caso do desktop, se o proxy estiver aberto, a web talvez não estará
             * */
            switch (comando)
            {
                case "ping":
                    proxyPingouDesktop();
                    break;
                case "web_chama_desktop_enviatef":
                    this.eventoEscreveArquivoTEF.Invoke(bool.Parse(args[1].ToString()), args[2].ToString(), args[3].ToString());
                    break;
                case "web_chama_desktop_envianfe":
                    this.eventoEscreveArquivoNFE.Invoke(args[1].ToString(), args[2].ToString());
                    break;
                case "web_chama_desktop_envianfe_xml":
                    this.eventoEscreveArquivoNFExml.Invoke(int.Parse(args[1].ToString()), int.Parse(args[2].ToString()),args[3].ToString(), args[4].ToString());
                    break;
                case "web_chama_desktop_imprime_danfe":
                    this.eventoImprimeDanfe.Invoke(Convert.ToString(args[1]));
                    break;
                case "web_chama_desktop_envianfe_prefeitura":
                    this.eventoEscreveArquivoDMS.Invoke(int.Parse(args[1].ToString()), args[2].ToString());
                    break;
                case "web_chama_desktop_imprime_etiquetas":
                    this.eventoImprimeEtiquetas(int.Parse(args[1].ToString()));
                    break;
                case "web_chama_desktop_constroipdf":
                    this.eventoEscreveArquivoPDF.Invoke(int.Parse(args[1].ToString()), int.Parse(args[2].ToString()), int.Parse(args[3].ToString()), args[4].ToString());
                    break;
                case "web_chama_desktop_baixa_listaCasamento":
                    this.eventoBaixaListaCasamento.Invoke(Convert.ToInt32(args[1].ToString()));
                    break;
                case "web_chama_desktop_baixa_duplicata":
                    this.eventoBaixaDuplicata.Invoke(int.Parse(args[1].ToString()), int.Parse(args[2].ToString()), args[3].ToString(), args[4].ToString());
                    break;
                case "web_chama_desktop_baixa_inventario":
                    this.eventoBaixaInventario.Invoke(int.Parse(args[1].ToString()), int.Parse(args[2].ToString()), args[3].ToString(), double.Parse(args[4].ToString()), args[5].ToString(), args[6].ToString(), bool.Parse(args[7].ToString()), args[8].ToString());
                    break;
                case "web_chama_desktop_baixa_relCliente":
                    this.eventoBaixaRelatorioCliente.Invoke(int.Parse(args[1].ToString()), int.Parse(args[2].ToString()));
                    break;
                case "web_chama_desktop_baixa_relParcialBalanco":
                    this.eventoBaixaRelatorioParcialBalanco.Invoke(int.Parse(args[1].ToString()));
                    break;
                case "web_chama_desktop_baixa_carne":
                    this.eventoBaixaCarne.Invoke(int.Parse(args[1].ToString()));
                    break;
                case "web_chama_desktop_baixa_relOrdemServico":
                    this.eventoBaixaRelatorioOrdemServico.Invoke(Convert.ToInt32(args[1]), Convert.ToInt32(args[2]));
                    break;
                case "web_chama_desktop_baixa_relatorio":
                    this.eventoBaixaRelatorio.Invoke(Convert.ToInt32(args[1]), Convert.ToString(args[2]), Convert.ToString(args[3]));
                    break;
                case "web_chama_desktop_login_rvmangueiras":
                    this.eventoLoginRVMangueias.Invoke(Convert.ToInt32(args[1].ToString()));
                    break;
                case "web_chama_desktop_processo":
                    //System.Windows.Forms.MessageBox.Show(comando, "tratei");
                    System.Diagnostics.Process.Start(args[1].ToString(), args[2].ToString());
                    //this.eventoIniciaProcesso.Invoke(args[1].ToString(), args[2].ToString());
                    break;
                default:
                    System.Windows.Forms.MessageBox.Show(comando, "MÉTODO NÃO TRATADO");
                    break;
            }
            return null;
        }
Esempio n. 13
0
        object _proxy_ExternalInterfaceCall(object sender, ExternalInterfaceCallEventArgs e)
        {
            if (e.FunctionCall.FunctionName.ToLower().Equals("click"))
            {
                MouseButtons btn;

                try
                {
                    btn = MouseButtons.Left;
                    int      numOfClicked = 1;
                    int      x            = 0;
                    int      y            = 0;
                    int      delta        = 0;
                    Object[] args         = e.FunctionCall.Arguments;

                    if (args.Length > 0)
                    {
                        String mouseKey = ((String)args[0]).ToLower();
                        switch (mouseKey)
                        {
                        case "left":
                            btn = MouseButtons.Left;
                            break;

                        case "right":
                            btn = MouseButtons.Right;
                            break;

                        case "middle":
                            btn = MouseButtons.Middle;
                            break;

                        case "both":
                            btn = MouseButtons.Left | MouseButtons.Right;
                            break;

                        case "xbutton1":
                            btn = MouseButtons.XButton1;
                            break;

                        case "xbutton2":
                            btn = MouseButtons.XButton2;
                            break;

                        case "delta":
                            btn = MouseButtons.None;
                            break;

                        default:
                            btn = MouseButtons.Left;
                            break;
                        }
                    }
                    if (args.Length > 1)
                    {
                        numOfClicked = (Int32)(double)args[1];
                    }
                    if (args.Length > 2)
                    {
                        x = (int)(double)args[2];
                    }
                    if (args.Length > 3)
                    {
                        y = (int)((double)args[3]);
                    }
                    if (args.Length > 4)
                    {
                        delta = (Int32)((double)args[4]);
                    }


                    Console.Write(Click);
                    if (Click != null)
                    {
                        Click(this, new MouseEventArgs(btn, numOfClicked, x, y, delta));
                    }
                }
                catch (Exception ex)
                {
                    throw new Exception("exception occured!:" + ex.Message);
                }
            }
            if (U_FlashFuncCallBack != null)
            {
                return(U_FlashFuncCallBack(sender, e.FunctionCall));
            }
            else
            {
                return(null);
            }
        }
		/// <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>
 /// Raises the ExternalInterfaceCall event, indicating that a call has come from Flash Player.
 /// </summary>
 /// <param name="e">The event arguments related to the event being raised.</param>
 protected virtual object OnExternalInterfaceCall(ExternalInterfaceCallEventArgs e)
 {
     try
     {
         if (ExternalInterfaceCall != null)
         {
             return ExternalInterfaceCall(this, e);
         }
         return null;
     }
     catch (Exception ex)
     {
         Logger.DEBUG_TRACE("OnExternalInterfaceCall Exception:" + ex.Message + "\n");
         return null;
     }
 }
 /// <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");
     }
 }