private void ChangeState(object row)
        {
            var script = (Script)row;

            if (script != null)
            {
                Helpers.Ui.SetStateColors(script);
                ProcessScript.ChangeScriptState(script);
                ProcessScript.SaveScriptToMaster(script);
            }
        }
Beispiel #2
0
 private void ChangeState(object row)
 {
     try
     {
         var script = (Script)row;
         if (script != null)
         {
             Helpers.Ui.SetStateColors(script);
             ProcessScript.ChangeScriptState(script);
             ProcessScript.SaveScriptToMaster(script);
         }
     }
     catch (Exception ex)
     {
         Log.Logger.Error($"{Constants.ChangeState}: {Constants.Message}: {ex.Message}\n " +
                          $"{Constants.StackTrace}: {ex.StackTrace}\n {Constants.InnerException}: {ex.InnerException}");
     }
 }
        private void ChangeState(object row)
        {
            var script = ((KeyValuePair <string, Script>)row).Value;

            if (script == null)
            {
                return;
            }
            Helpers.Ui.SetStateColors(script);
            ProcessScript.ChangeScriptState(script);

            var scriptToBeUpdated = ScriptsCollection.FirstOrDefault(s => s.Value.ScriptId.Equals(script.ScriptId)).Value;

            scriptToBeUpdated.Active            = script.Active;
            scriptToBeUpdated.Text              = script.Text;
            scriptToBeUpdated.RowColor          = script.RowColor;
            scriptToBeUpdated.ScriptStateAction = script.ScriptStateAction;
        }
Beispiel #4
0
        private void ChangeState(object row)
        {
            try
            {
                var script = ((KeyValuePair <string, Script>)row).Value;
                if (script == null)
                {
                    return;
                }
                Helpers.Ui.SetStateColors(script);
                ProcessScript.ChangeScriptState(script);

                var scriptToBeUpdated = ScriptsCollection.FirstOrDefault(s => s.Value.ScriptId.Equals(script.ScriptId)).Value;
                scriptToBeUpdated.Active            = script.Active;
                scriptToBeUpdated.Text              = script.Text;
                scriptToBeUpdated.RowColor          = script.RowColor;
                scriptToBeUpdated.ScriptStateAction = script.ScriptStateAction;
            }
            catch (Exception ex)
            {
                Log.Logger.Error($"{Constants.ChangeState}: {Constants.Message}: {ex.Message}\n " +
                                 $"{Constants.StackTrace}: {ex.StackTrace}\n {Constants.InnerException}: {ex.InnerException}");
            }
        }