/// <summary> /// Remove item from view. /// </summary> /// <param name="v"></param> public void RemoveItem(FormatValue v) { FormatValues.Add(v); FormatWrapper.Remove(v); // Recolorized! int i = 0; foreach (var s in FormatValues) { s.BackgroundColor = (i % 2 == 0) ? Colors.LightGray : Colors.White; i++; } }
/// <summary> /// Add new format. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void NewFormat_Clicked(object sender, EventArgs e) { var tmp = FormatValue.CreateFormatValue(this, (FormatValues.Count % 2 == 0) ? Colors.LightGray : Colors.White); FormatValues.Add(tmp); FormatWrapper.PackStart(tmp); int i = 0; foreach (var s in FormatValues) { s.BackgroundColor = (i % 2 == 0) ? Colors.LightGray : Colors.White; i++; } }
/// <summary> /// Refresh occurences. /// </summary> private void RefreshOccurencies() { FormatGuide.Active = true; FormatValues.Clear(); FormatWrapper.Clear(); // Iterate occurencies foreach (var p in Occurences) { var tmp = new FormatValue(p, this, (FormatValues.Count % 2 == 0) ? Colors.LightGray : Colors.White); FormatValues.Add(tmp); FormatWrapper.PackStart(tmp); } }