Example #1
0
 private void btnDraw_Click(object sender, EventArgs e)
 {
     try
     {
         SimpleWeaver weaver = GetWeaver();
         weaver.AlertUnusedHarnesses(dgvHarnesses);
         weaver.Draw(splitContainer1.Panel2);
     }
     catch (Exception exc)
     {
         MessageBox.Show(exc.Message);
     }
 }
Example #2
0
        private void LoadWeaverOptions(SimpleWeaver weaver)
        {
            cbWarpColor.SetItem(new ColorOption(weaver.WarpColor));
            cbWeftColor.SetItem(new ColorOption(weaver.WeftColor));
            nudSquareSize.Value        = weaver.SquareSize;
            chkDrawCoordinates.Checked = weaver.DrawCoordinates;
            tbHarnessOrder.Text        = weaver.HarnessOrder;

            BindingSource bs   = new BindingSource();
            var           list = new BindingList <SimpleWeaver.Harness>(weaver?.Harnesses ?? new List <SimpleWeaver.Harness>());

            list.AllowNew           = true;
            bs.DataSource           = list;
            dgvHarnesses.DataSource = bs;
        }