Пример #1
0
 public void DeleteArea(TekArea area)
 {
     if (area == null)
     {
         return;
     }
     Board.DeleteArea(area);
     UpdateArea(area);
 }
Пример #2
0
 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();
 }
Пример #3
0
        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);
        }
Пример #4
0
 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();
 }
Пример #5
0
        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);
        }
Пример #6
0
 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);
 }
Пример #7
0
        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]];
            }
        }
Пример #8
0
        // 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;
        }
Пример #9
0
        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);
        }