示例#1
0
        void execButton_Click(object sender, EventArgs e)
        {
            try
            {
                UpdateResource();

                Button         execButton = (Button)sender;
                Scripts.Script execType   = SelectedResource.MyType.Executions[execButton.Name];

                Scripts.StepArgs stepArgs = new SNAP.Scripts.StepArgs(SelectedResource, execType);
                execType.Execute(stepArgs);
            }
            catch (FieldException)
            {
                /// ignore field exceptions, they are handled on a lower level
            }
            catch (Exception x)
            {
                Controller.ShowException(x);
            }
        }
        void execButton_Click(object sender, EventArgs e)
        {
            try
            {
                UpdateResource();

                Button execButton = (Button)sender;
                Scripts.Script execType = SelectedResource.MyType.Executions[execButton.Name];

                Scripts.StepArgs stepArgs = new SNAP.Scripts.StepArgs(SelectedResource, execType);
                execType.Execute(stepArgs);
            }
            catch (FieldException)
            {
                /// ignore field exceptions, they are handled on a lower level
            }
            catch (Exception x)
            {
                Controller.ShowException(x);
            }
        }