public void SetErrorStatus(JobErrorStatus newErrorStatus)
        {
            errorStatus = newErrorStatus;

            RaisePropertyChangedEvent("StatusString");
            RaisePropertyChangedEvent("StatusColor");
        }
        private int ReadComposition()
        {
            job.LogText("Reading composition file " + JobPathHelper.GetProductCompositionPath(job));

            if (!File.Exists(JobPathHelper.GetProductCompositionPath(job)))
            {
                ErrorStatus = JobErrorStatus.JES_COMP_MISSING;
                return(-1);
            }
            CompLines = File.ReadAllLines(JobPathHelper.GetProductCompositionPath(job));
            return(CompLines.Select(item => Regex.Matches(item, " = Saver {").Count).Sum());
        }
        private void ModifyComposition()
        {
            ModifyAllTools();

            int outputCounter = ModifyOutputs();
            int motifCounter  = ModifyMotifs();

            if (job.CanReformat)
            {
                ModifyResizeTool();
            }

            if (!job.IsPreview && motifCounter < job.MotifList.Count)
            {
                ErrorStatus = JobErrorStatus.JES_COMP_MOD_MOTIF_LOADERS;
                return;
            }
        }
        private string GetOutputExtension()
        {
            string result = "";

            for (int i = 0; i < CompLines.Length; i++)
            {
                if (CompLines[i].Contains("OutputClips"))
                {
                    string line  = CompLines[i + 1];
                    int    start = line.LastIndexOf('.');
                    int    end   = line.LastIndexOf('\"');
                    if (start < 0 || end < 0)
                    {
                        ErrorStatus = JobErrorStatus.JES_COMP_MOD_OUTPUTS;
                        return("");
                    }
                    result = line.Substring(start + 1, end - start - 1);
                }
            }
            return("." + result);
        }