private void parseMarkerValues(string strStarts, string strEnds) { //parse the labels and populate the percentages Log.Debug("GUITVProgressControl.parseMarkerValues() - parsing markers"); if (LabelMarkerStarts.Length > 0) { if (strStarts.Length > 0) { string[] strMarkerStarts = strStarts.Trim().Split(' '); MarkerStartsPercent.Clear(); for (int i = 0; i < strMarkerStarts.Length; i++) { try { MarkerStartsPercent.Add(float.Parse(strMarkerStarts[i])); } catch (Exception) {} if (MarkerStartsPercent[i] < 0 || MarkerStartsPercent[i] > 100) { MarkerStartsPercent[i] = 0; } } } } if (LabelMarkerEnds.Length > 0) { if (strEnds.Length > 0) { string[] strMarkerEnds = strEnds.Trim().Split(' '); MarkerEndsPercent.Clear(); for (int i = 0; i < strMarkerEnds.Length; i++) { try { MarkerEndsPercent.Add(float.Parse(strMarkerEnds[i])); } catch (Exception) {} if (MarkerEndsPercent[i] < 0 || MarkerEndsPercent[i] > 100) { MarkerEndsPercent[i] = 0; } } } } Log.Debug("GUITVProgressControl.parseMarkerValues() - found " + MarkerStartsPercent.Count); }
private void parseMarkerValues(string strStarts, string strEnds) { //parse the labels and populate the percentages Log.Debug("GUITVProgressControl.parseMarkerValues() - parsing markers"); if (!string.IsNullOrEmpty(LabelMarkerStarts)) { if (!string.IsNullOrEmpty(strStarts)) { string[] strMarkerStarts = strStarts.Trim().Split(' '); MarkerStartsPercent.Clear(); for (int i = 0; i < strMarkerStarts.Length; i++) { try { MarkerStartsPercent.Add(float.Parse(strMarkerStarts[i])); } catch (Exception ex) { Log.Warn("GUITVProgressControl: parseMarkerValues {0}", ex.Message); break; } if (MarkerStartsPercent.Count > i) { if (MarkerStartsPercent[i] < 0) { MarkerStartsPercent[i] = 0; } if (MarkerStartsPercent[i] > 100) { MarkerStartsPercent[i] = 100; } } } } } if (!string.IsNullOrEmpty(LabelMarkerEnds)) { if (!string.IsNullOrEmpty(strEnds)) { string[] strMarkerEnds = strEnds.Trim().Split(' '); MarkerEndsPercent.Clear(); for (int i = 0; i < strMarkerEnds.Length; i++) { try { MarkerEndsPercent.Add(float.Parse(strMarkerEnds[i])); } catch (Exception ex) { Log.Warn("GUITVProgressControl: parseMarkerValues {0}", ex.Message); break; } if (MarkerEndsPercent.Count > i) { if (MarkerEndsPercent[i] < 0) { MarkerEndsPercent[i] = 0; } if (MarkerEndsPercent[i] > 100) { MarkerEndsPercent[i] = 100; } } } } } Log.Debug("GUITVProgressControl.parseMarkerValues() - found " + MarkerStartsPercent.Count); }