/// <summary> /// Copy constructor /// </summary> /// <param name="old">Another Shaft object</param> public Shaft(Shaft old) { if (old != null) { _up = new bool[old._up.Length]; for (var i = 0; i < _up.Length; i++) { _up[i] = old._up[i]; } } else { _up = new bool[1]; _up[0] = true; // Alternatively throw exception } System.Console.WriteLine("Shaft(old) called"); }
public WeaverForm() { InitializeComponent(); _pattern = new Pattern(8, 6, 2); Shaft s1 = new Shaft(8); _pattern.SetShaft(0, s1); _pattern.SetShaft(1, !s1); WarpThread w1 = new WarpThread(System.Drawing.Color.Red); _pattern.SetWarpThread(0, w1); _pattern.SetWarpThread(1, w1); _pattern.SetWarpThread(2, w1); _pattern.SetWarpThread(3, w1); w1.ThreadColor = System.Drawing.Color.White; _pattern.SetWarpThread(4, w1); _pattern.SetWarpThread(5, w1); _pattern.SetWarpThread(6, w1); _pattern.SetWarpThread(7, w1); _pattern.SetWaftThread(0, System.Drawing.Color.Green, 0); _pattern.SetWaftThread(1, System.Drawing.Color.Green, 1); _pattern.SetWaftThread(2, System.Drawing.Color.Green, 0); _pattern.SetWaftThread(3, System.Drawing.Color.White, 1); _pattern.SetWaftThread(4, System.Drawing.Color.White, 0); _pattern.SetWaftThread(5, System.Drawing.Color.White, 1); _sample = new Sample(); _sample.Pattern = _pattern; _sample.Visible = true; _sample.DisplayScale = 3; // SetStyle(ControlStyles.ResizeRedraw, true); }
public WaftThread(System.Drawing.Color color, Shaft shaft) { ThreadColor = color; Shaft = shaft; }
public void SetShaft(int index, Shaft shaft) { Shafts_[index] = shaft; }