public FormMain() { InitializeComponent(); solverPlugins.AddDll(System.IO.Path.GetFullPath("BeginnerSolver.dll")); solverPlugins.AddDll(System.IO.Path.GetFullPath("FridrichSolver.dll")); solverPlugins.AddDll(System.IO.Path.GetFullPath("TwoPhaseAlgorithmSolver.dll")); foreach (var solver in solverPlugins.GetAll()) { manageSolversToolStripMenuItem.DropDownItems.Add(solver.Name + " solver", null, (x, y) => currentSolver = solver); } if (solverPlugins.Count > 0) { currentSolver = solverPlugins[0]; } //foreach (string path in Properties.Settings.Default.PluginPaths) //{ // solverPlugins.AddDll(path); //} cubeModel.StartRender(); foreach (CubeFlag flag in Enum.GetValues(typeof(CubeFlag))) { if (flag != CubeFlag.None && flag != CubeFlag.XFlags && flag != CubeFlag.YFlags && flag != CubeFlag.ZFlags) comboBoxLayers.Items.Add(flag.ToString()); } listBoxQueue.DataSource = rotations; listBoxQueue.DisplayMember = "Name"; }
private void AddStepLabels(CubeSolver solver) { this.lblSolvingMethod.Text = solver.Name; // Start pos 15,62 int y = 62, x = 15; foreach (KeyValuePair<string, Tuple<Action, SolutionStepType>> step in solver.SolutionSteps) { Label l = new Label(); l.AutoSize = true; l.Font = new Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); l.Location = new Point(x, y); l.Name = string.Format("label{0}", step.Key); l.Text = step.Key; panel1.Controls.Add(l); PictureBox p = new PictureBox(); p.Location = new Point(200, y); p.Name = string.Format("pb{0}", step.Key); p.Size = new Size(17, 15); p.SizeMode = PictureBoxSizeMode.StretchImage; p.TabStop = false; panel1.Controls.Add(p); stepImgs.Add(p); l = new Label(); l.AutoSize = true; l.Font = new Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); l.Location = new Point(217, y); l.Name = string.Format("labelMoves{0}", step.Key); panel1.Controls.Add(l); stepLabels.Add(l); y += 18; } y += 10; this.lblTimeHeader.Location = new Point(10, y); y += 18; this.lblMovesHeader.Location = new Point(10, y); this.Size = new Size(338, y + 103); }
public DialogSolutionFinder(CubeSolver solver, Rubik rubik, Form parent = null) { this.solver = solver; this.InitializeComponent(); if (parent != null) { this.Owner = parent; this.StartPosition = FormStartPosition.CenterParent; } this.ShowInTaskbar = false; this.AddStepLabels(solver); solver.TrySolveAsync(rubik); solver.OnSolutionStepCompleted += this.solver_OnSolutionStepCompleted; solver.OnSolutionError += this.solver_OnSolutionError; this.stepLabels[this.currentIndex].Text = "In progress ..."; this.stepImgs[this.currentIndex].Image = Properties.Resources.refresh; }
//Parameter hernoemt om interferentie uit te sluiten met property private void AddStepLabels(CubeSolver solvr) { this.lblSolvingMethod.Text = solvr.Name; // Start pos 15,62 var y = 62; const int X = 15; foreach (var step in solvr.SolutionSteps) { var l = new Label { AutoSize = true, Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point, 0), Location = new Point(X, y), Name = $"label{step.Key}", Text = step.Key }; this.panel1.Controls.Add(l); var p = new PictureBox { Location = new Point(200, y), Name = $"pb{step.Key}", Size = new Size(17, 15), SizeMode = PictureBoxSizeMode.StretchImage, TabStop = false }; this.panel1.Controls.Add(p); this.stepImgs.Add(p); l = new Label { AutoSize = true, Font = new Font( "Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point, 0), Location = new Point(217, y), Name = $"labelMoves{step.Key}" }; this.panel1.Controls.Add(l); this.stepLabels.Add(l); y += 18; } y += 10; this.lblTimeHeader.Location = new Point(10, y); y += 18; this.lblMovesHeader.Location = new Point(10, y); this.Size = new Size(338, y + 103); }