public void RemoveAll() { object[] items = Cache.Values; for (int idx = 0; idx < items.Length; idx++) { DrawCurve drawCurve = (DrawCurve)items[idx]; drawCurve.Pane.CurveList.Remove(drawCurve.Curve); } this.Cache.Clear(); }
//TUAN - Update Curve Name in Pane when the pane name changed public void UpdateCurveWhenPaneNameChanged(string oldPane, string newPane) { object[] items = Cache.Values; for (int idx = 0; idx < items.Length; idx++) { DrawCurve drawCurve = (DrawCurve)items[idx]; if (drawCurve.PaneName == oldPane) { drawCurve.PaneName = newPane; } } }
public void RemoveByPane(string paneName) { object[] items = Cache.Values; for (int idx = 0; idx < items.Length; idx++) { DrawCurve drawCurve = (DrawCurve)items[idx]; if (drawCurve.PaneName != paneName) { continue; } Remove(drawCurve.CurveName); } }
public DrawCurve[] CurveInPane(string paneName) { DrawCurve[] list = new DrawCurve[0]; object[] items = Cache.Values; for (int idx = 0; idx < items.Length; idx++) { DrawCurve drawCurve = (DrawCurve)items[idx]; if (drawCurve.PaneName == paneName) { Array.Resize(ref list, list.Length + 1); list[list.Length - 1] = (DrawCurve)items[idx]; } } return(list); }
//Return curves that its name starts with [namePrefix] public DrawCurve[] FindAll(string namePrefix) { DrawCurve[] drawCurveList = new DrawCurve[0]; DrawCurve drawCurve; object[] items = Cache.Values; for (int idx = 0; idx < items.Length; idx++) { drawCurve = (DrawCurve)items[idx]; if (drawCurve.CurveName.StartsWith(namePrefix)) { Array.Resize(ref drawCurveList, drawCurveList.Length + 1); drawCurveList[drawCurveList.Length - 1] = drawCurve; } } return(drawCurveList); }
public DrawCurve[] CurveInPane(string paneName) { DrawCurve[] list = new DrawCurve[0]; object[] items = Cache.Values; for (int idx = 0; idx < items.Length; idx++) { DrawCurve drawCurve = (DrawCurve)items[idx]; if (drawCurve.PaneName == paneName) { Array.Resize(ref list, list.Length + 1); list[list.Length-1] = (DrawCurve)items[idx]; } } return list; }
//Return curves that its name starts with [namePrefix] public DrawCurve[] FindAll(string namePrefix) { DrawCurve[] drawCurveList = new DrawCurve[0]; DrawCurve drawCurve; object[] items = Cache.Values; for (int idx = 0; idx < items.Length; idx++) { drawCurve = (DrawCurve)items[idx]; if (drawCurve.CurveName.StartsWith(namePrefix)) { Array.Resize(ref drawCurveList, drawCurveList.Length + 1); drawCurveList[drawCurveList.Length - 1] = drawCurve; } } return drawCurveList; }