Пример #1
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            if (lstEventActions.SelectedItems.Count == 1)
            {
                if (Item.Actions[lstEventActions.SelectedItems[0].Name]
                    is ActiveScriptAction)
                {
                    EventAction action =
                        Item.Actions[lstEventActions.SelectedItems[0].Name];

                    ActiveScriptAction scriptAction =
                        action as ActiveScriptAction;

                    if (scriptAction != null)
                    {
                        ScriptActionEditor editor =
                            new ScriptActionEditor(Item, true);
                        editor.SetActionName(scriptAction.Name);
                        editor.SetScriptFilePath(scriptAction.ScriptFileName);
                        editor.SetScriptingHost(scriptAction.ScriptHost);
                        editor.DisplayScriptText(scriptAction.ScriptFileName);
                        editor.SetActionLimit(
                            scriptAction.LimitInstances,
                            scriptAction.InstanceLimit);

                        editor.ShowDialog();
                    }
                }
            }
        }
Пример #2
0
        private void btnScriptAction_Click(object sender, EventArgs e)
        {
            ScriptActionEditor editor =
                new ScriptActionEditor(Item, false);

            editor.ShowDialog();
            UpdateItemActions();
        }