public void DeleteArea(TekArea area) { if (area == null) { return; } Board.DeleteArea(area); UpdateArea(area); }
private void ExportArea(TekArea area, StreamWriter wr) { wr.Write(AREAFORMAT1); foreach (TekField field in area.Fields) { wr.Write(AREAFORMAT2, field.Row, field.Col); } wr.WriteLine(); }
private TekArea CopyArea(TekArea area) { TekArea result = new TekArea(area.AreaNum); foreach (TekField field in area.Fields) { result.AddField(Fields[field.Row, field.Col]); } return(result); }
private void UpdateArea(TekArea area) { _view.SetAreaColors(Board); foreach (TekField field in area.Fields) { TekFieldView view = _view.GetField(field.Row, field.Col); _view.SetPanelColors(view); _view._SetBorders(view); } _view.Refresh(); }
public TekArea DefineArea(List <TekField> list) { TekArea result = new TekArea(Areas.Count()); foreach (TekField f in list) { result.AddField(f); } Areas.Add(result); return(result); }
public void DeleteArea(TekArea area) { foreach (TekField field in area.Fields) { field.Area = null; } foreach (TekField field in area.Fields) { field.SetInfluencers(); } Areas.Remove(area); }
public void SetPanelColors(TekFieldView panel) { TekArea area = panel.Field.Area; if (area == null) { panel.NormalColor = NoAreaColor; panel.SelectedColor = NoAreaSelectedColor; } else { panel.NormalColor = AreaColors[AreaColorIndex[area.AreaNum]]; panel.SelectedColor = SelectedAreaColors[AreaColorIndex[area.AreaNum]]; } }
// notes are set automatically to the values in PossibleValues - ExcludedValues public TekField(int arow, int acol) { _row = arow; _col = acol; _value = 0; Initial = false; Neighbours = new List <TekField>(); Influencers = new List <TekField>(); PossibleValues = new List <int>(); for (int i = 1; i <= Const.MAXTEK; i++) { PossibleValues.Add(i); } ExcludedValues = new List <int>(); Notes = new List <int>(); Area = null; AutoNotes = false; }
public TekArea SelectArea(int row, int col) { TekFieldView view = _view.GetField(row, col); Selector.CurrentMode = TekSelect.SelectMode.smMultiple; Selector.MultiselectFieldView.Clear(); if (view == null) { return(null); } TekArea area = view.Field.Area; if (area == null) { return(null); } foreach (TekField field in area.Fields) { Selector.SelectCurrentField(_view.GetField(field.Row, field.Col)); } _view.Refresh(); return(area); }