public void Remove(object value) { var index = IndexOf(value); if (value is Script) { var script = value as Script; if (Scripts.Contains(script)) { Scripts.Remove(script); OnScriptRemoved(script, index); } } else if (value is Brick) { foreach (var script in Scripts) { if (script.Bricks.Contains(value as Brick)) { script.Bricks.Remove(value as Brick); OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, value, index)); } } } }
public void AddScript(string scriptTag) { if (!Scripts.Contains(scriptTag)) { Scripts.Add(scriptTag); } SetToRequest(this); }
//_____________________________________________________________________________________________________________________________________________________________ private void AddScript(string name) { if (!File.Exists(name) || Scripts.Contains(name)) { return; } Scripts.Add(name); File.WriteAllLines(fullProjectFileName, Scripts.ToArray()); }
public bool Contains(object value) { if (Scripts.Contains(value as Script)) { return(true); } else { foreach (var script in Scripts) { if (script.Bricks.Contains(value as Brick)) { return(true); } } } return(false); }