c# script support
python server support
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
{
|
||||
listView1 = new ListView();
|
||||
btnCancel = new MaterialSkin.Controls.MaterialRaisedButton();
|
||||
btnCreateNewRecipe = new MaterialSkin.Controls.MaterialRaisedButton();
|
||||
SuspendLayout();
|
||||
//
|
||||
// listView1
|
||||
@@ -62,11 +63,30 @@
|
||||
btnCancel.UseVisualStyleBackColor = true;
|
||||
btnCancel.Click += btnCancel_Click;
|
||||
//
|
||||
// btnCreateNewRecipe
|
||||
//
|
||||
btnCreateNewRecipe.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
btnCreateNewRecipe.Depth = 0;
|
||||
btnCreateNewRecipe.DrawBorder = true;
|
||||
btnCreateNewRecipe.Font = new Font("Segoe UI Semibold", 12F, FontStyle.Bold, GraphicsUnit.Point, 204);
|
||||
btnCreateNewRecipe.Icon = null;
|
||||
btnCreateNewRecipe.Location = new Point(8, 624);
|
||||
btnCreateNewRecipe.MouseState = MaterialSkin.MouseState.HOVER;
|
||||
btnCreateNewRecipe.Name = "btnCreateNewRecipe";
|
||||
btnCreateNewRecipe.Primary = false;
|
||||
btnCreateNewRecipe.Size = new Size(160, 48);
|
||||
btnCreateNewRecipe.TabIndex = 6;
|
||||
btnCreateNewRecipe.Text = "Create New Recipe";
|
||||
btnCreateNewRecipe.UseVisualStyleBackColor = true;
|
||||
btnCreateNewRecipe.Visible = false;
|
||||
btnCreateNewRecipe.Click += btnCreateNewRecipe_Click;
|
||||
//
|
||||
// RecipeSelectionDialog
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(962, 688);
|
||||
Controls.Add(btnCreateNewRecipe);
|
||||
Controls.Add(btnCancel);
|
||||
Controls.Add(listView1);
|
||||
MaximizeBox = false;
|
||||
@@ -81,5 +101,6 @@
|
||||
|
||||
private ListView listView1;
|
||||
private MaterialSkin.Controls.MaterialRaisedButton btnCancel;
|
||||
private MaterialSkin.Controls.MaterialRaisedButton btnCreateNewRecipe;
|
||||
}
|
||||
}
|
||||
@@ -1,22 +1,31 @@
|
||||
using MaterialSkin.Controls;
|
||||
using OpenCvSharp.XImgProc;
|
||||
using System.Text.RegularExpressions;
|
||||
using MaterialSkin.Core.Controls;
|
||||
using OpenCvSharp.Extensions;
|
||||
using VisionBuilder.UI.Common.ViewModel;
|
||||
using VisionBuilder.UI.Common.ViewModel.Classes;
|
||||
using VisionBuilder.UI.Common.ViewModel.Interfaces.UI;
|
||||
|
||||
namespace VisionBuilder.UI.Windows.Dialogs
|
||||
{
|
||||
public partial class RecipeSelectionDialog : MaterialForm
|
||||
{
|
||||
private readonly RecipeSelectionVM _recipeSelectionVm;
|
||||
|
||||
public RecipeSelectionDialog(RecipeSelectionVM recipeSelectionVm)
|
||||
private readonly IRecipeCreationTool _recipeCreationTool;
|
||||
|
||||
public RecipeSelectionDialog(RecipeSelectionVM recipeSelectionVm, IRecipeCreationTool recipeCreationTool)
|
||||
{
|
||||
_recipeSelectionVm = recipeSelectionVm;
|
||||
|
||||
_recipeCreationTool = recipeCreationTool;
|
||||
|
||||
InitializeComponent();
|
||||
ReloadRecipes();
|
||||
|
||||
if (!_recipeCreationTool.Enabled)
|
||||
{
|
||||
btnCreateNewRecipe.Visible = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void ReloadRecipes()
|
||||
@@ -38,11 +47,11 @@ namespace VisionBuilder.UI.Windows.Dialogs
|
||||
listView1.LargeImageList.Images.Add("plug", plug);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
recipes.ForEach(x =>
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
if (x.Image != null)
|
||||
@@ -53,7 +62,7 @@ namespace VisionBuilder.UI.Windows.Dialogs
|
||||
}
|
||||
else
|
||||
{
|
||||
listView1.Items.Add(x.RecipeName, x.RecipeName, "plug").Tag=x;
|
||||
listView1.Items.Add(x.RecipeName, x.RecipeName, "plug").Tag = x;
|
||||
}
|
||||
|
||||
});
|
||||
@@ -63,15 +72,23 @@ namespace VisionBuilder.UI.Windows.Dialogs
|
||||
{
|
||||
if (listView1.SelectedIndices.Count > 0)
|
||||
{
|
||||
_recipeSelectionVm.SelectedRecipe = (RecipeData)listView1.SelectedItems[0].Tag!;
|
||||
_recipeSelectionVm.SelectedRecipe = (RecipeData)listView1.SelectedItems[0].Tag!;
|
||||
}
|
||||
DialogResult = DialogResult.OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void btnCancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
DialogResult = DialogResult.Cancel;
|
||||
}
|
||||
|
||||
private void btnCreateNewRecipe_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (MaterialInputBox.Prompt("Create new recipe", "Recipe name", out var recipeName)==DialogResult.OK)
|
||||
{
|
||||
_recipeCreationTool.CreateRecipe(recipeName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
|
||||
Reference in New Issue
Block a user