Exemplo n.º 1
0
        /// <summary>
        /// A Command to be processed bu the plugin
        /// </summary>
        /// <param name="method"></param>
        public override void ProcessCommand(OSAEMethod method)
        {
            try
            {
                string script = "";

                int scriptId;
                if (int.TryParse(method.Parameter1, out scriptId))
                {
                    script = OSAEScriptManager.GetScript(method.Parameter1);
                }
                else
                {
                    script = OSAEScriptManager.GetScriptByName(method.Parameter1);
                }

                this.Log.Debug("running script: " + script);

                if (!string.IsNullOrEmpty(script))
                {
                    RunScript(script, method);
                }
            }
            catch (Exception exc)
            {
                this.Log.Error("Error Processing Command ", exc);
            }
        }
    protected void Page_PreRender(object sender, EventArgs e)
    {
        if (hdnSelectedRow.Text != "")
        {
            gvScripts.Rows[Int32.Parse(hdnSelectedRow.Text)].Attributes.Remove("onmouseout");
            gvScripts.Rows[Int32.Parse(hdnSelectedRow.Text)].Style.Add("background", "lightblue");
            txtName.Text = hdnSelectedScriptName.Text;
            ddlScriptProcessor.SelectedValue = gvScripts.DataKeys[Int32.Parse(hdnSelectedRow.Text)]["script_processor_name"].ToString();
            hdnScript.Value = OSAEScriptManager.GetScript(gvScripts.DataKeys[Int32.Parse(hdnSelectedRow.Text)]["script_id"].ToString());
            loadLinkage(gvScripts.DataKeys[Int32.Parse(hdnSelectedRow.Text)]["script_id"].ToString());
            lblCopyScript.Text   = OSAEScriptManager.GetScriptByName(hdnSelectedScriptName.Text);
            lblExportScript.Text = OSAEScriptManager.ExportScript(hdnSelectedScriptName.Text);
        }
        if (hdnSelectedEventScriptRow.Text != "")
        {
            gvEventScripts.Rows[Int32.Parse(hdnSelectedEventScriptRow.Text)].Attributes.Remove("onmouseout");
            gvEventScripts.Rows[Int32.Parse(hdnSelectedEventScriptRow.Text)].Style.Add("background", "lightblue");
        }

        if (hdnSelectedObjTypeEventScriptRow.Text != "")
        {
            gvObjTypeScripts.Rows[Int32.Parse(hdnSelectedObjTypeEventScriptRow.Text)].Attributes.Remove("onmouseout");
            gvObjTypeScripts.Rows[Int32.Parse(hdnSelectedObjTypeEventScriptRow.Text)].Style.Add("background", "lightblue");
        }
    }
        /// <summary>
        /// A Command to be processed bu the plugin
        /// </summary>
        /// <param name="method"></param>
        public override void ProcessCommand(OSAEMethod method)
        {
            try
            {
                string script = "";

                int scriptId;
                if (int.TryParse(method.Parameter1, out scriptId))
                {
                    script = OSAEScriptManager.GetScript(method.Parameter1);
                }
                else
                {
                    script = OSAEScriptManager.GetScriptByName(method.Parameter1);
                }

                logging.AddToLog("running script: " + script, false);

                if (!string.IsNullOrEmpty(script))
                {
                    RunScript(script, method);
                }
            }
            catch (Exception exc)
            {
                logging.AddToLog("Error Processing Command: " + exc.Message, true);
            }
        }