Example #1
0
        /// <summary>
        /// Receives our own property change events to update IsValid.
        /// </summary>
        void StandaloneTargetView_PropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            Debug.Assert(sender == this);

            if (e.PropertyName != "IsValid")
            {
                IsValid = ScriptPath.IndexOfAny(Path.GetInvalidPathChars()) == -1 &&
                          WorkingDirectory.IndexOfAny(Path.GetInvalidPathChars()) == -1 &&
                          (Path.IsPathRooted(ScriptPath) || Path.IsPathRooted(WorkingDirectory)) &&
                          File.Exists(Path.Combine(WorkingDirectory, ScriptPath)) &&
                          (WorkingDirectory == string.Empty || Directory.Exists(WorkingDirectory)) &&
                          (File.Exists(InterpreterPath));
            }
        }