|
@@ -9,10 +9,12 @@ using Newtonsoft.Json;
|
|
|
using Prism.Commands;
|
|
|
using Prism.Mvvm;
|
|
|
using System;
|
|
|
+using System.Collections;
|
|
|
using System.Collections.Generic;
|
|
|
using System.IO;
|
|
|
using System.Linq;
|
|
|
using System.Reflection;
|
|
|
+using System.Text;
|
|
|
using System.Threading;
|
|
|
using System.Windows;
|
|
|
using System.Windows.Controls;
|
|
@@ -29,6 +31,8 @@ using Venus_MainPages.Views;
|
|
|
using Venus_Themes.CustomControls;
|
|
|
using Venus_Themes.UserControls;
|
|
|
using WPF.Themes.UserControls;
|
|
|
+using Xceed.Wpf.Toolkit.Primitives;
|
|
|
+using Xceed.Wpf.Toolkit.PropertyGrid.Attributes;
|
|
|
|
|
|
namespace Venus_MainPages.ViewModels
|
|
|
{
|
|
@@ -257,6 +261,7 @@ namespace Venus_MainPages.ViewModels
|
|
|
CurrentRecipe = Recipe.Load(xmlRecipeData);
|
|
|
LoadHeadWrapPanel(headWrapPanel, CurrentRecipe);
|
|
|
LoadRecipe(CurrentRecipe);
|
|
|
+
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
@@ -452,8 +457,9 @@ namespace Venus_MainPages.ViewModels
|
|
|
Source = recipe.Header, // 数据源
|
|
|
Path = new PropertyPath(propertyInfo.Name), // 需绑定的数据源属性名
|
|
|
Mode = BindingMode.TwoWay, // 绑定模式
|
|
|
- UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged //触发器
|
|
|
+ UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged, //触发器
|
|
|
};
|
|
|
+
|
|
|
|
|
|
var propertyTypeName = propertyInfo.PropertyType.Name;
|
|
|
var propertyInfoName = propertyInfo.Name;
|
|
@@ -461,26 +467,63 @@ namespace Venus_MainPages.ViewModels
|
|
|
switch (propertyInfoName)
|
|
|
{
|
|
|
case "ChamberType":
|
|
|
- case "Type":
|
|
|
control = new ComboBox();
|
|
|
control.Height = 23;
|
|
|
control.SetBinding(ComboBox.SelectedItemProperty, binding);
|
|
|
ItemsControlHelper.SetEnumValuesToItemsSource(control, true);
|
|
|
break;
|
|
|
+ case "Type":
|
|
|
+ ComboBox cb = new ComboBox();
|
|
|
+ cb.SelectionChanged += ChangeUI;
|
|
|
+ control = cb;
|
|
|
+ control.Height = 23;
|
|
|
+ control.SetBinding(ComboBox.SelectedItemProperty, binding);
|
|
|
+ ItemsControlHelper.SetEnumValuesToItemsSource(control, true);
|
|
|
+ break;
|
|
|
case "ChuckRecipe":
|
|
|
+ string[] chucklist = new string[] {"" };
|
|
|
+ ArrayList arrayList = new ArrayList(chucklist.ToList());
|
|
|
+ IEnumerable<string> chlist= GetFilesNames(Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes", ModuleName)).ToList().Where(item => item.ToLower().Contains("chuck") && (item.ToLower().Contains("dechuck") == false));
|
|
|
+ foreach (var i in chlist)
|
|
|
+ {
|
|
|
+ arrayList.Add(i);
|
|
|
+ }
|
|
|
+ chucklist = (string[])arrayList.ToArray(typeof(string));
|
|
|
+ StringBuilder stringBuilder = new StringBuilder();
|
|
|
+ //输出
|
|
|
+ for (int i = 0; i < chucklist.Length; i++)
|
|
|
+ {
|
|
|
+ stringBuilder.Append(chucklist[i] + "\t");
|
|
|
+ }
|
|
|
+
|
|
|
control = new ComboBox()
|
|
|
{
|
|
|
- ItemsSource = GetFilesNames(Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes", ModuleName)).ToList().Where(item => item.ToLower().Contains("chuck")&& (item.ToLower().Contains("dechuck")==false))
|
|
|
+ ItemsSource = chucklist
|
|
|
};
|
|
|
control.Height = 23;
|
|
|
+ control.MinWidth = 100;
|
|
|
control.SetBinding(ComboBox.SelectedItemProperty, binding);
|
|
|
break;
|
|
|
case "DechuckRecipe":
|
|
|
+ string[] dechucklist = new string[] { "" };
|
|
|
+ ArrayList dearrayList = new ArrayList(dechucklist.ToList());
|
|
|
+ IEnumerable<string> delist = GetFilesNames(Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes", ModuleName)).ToList().Where(item => item.ToLower().Contains("dechuck"));
|
|
|
+ foreach (var i in delist)
|
|
|
+ {
|
|
|
+ dearrayList.Add(i);
|
|
|
+ }
|
|
|
+ dechucklist = (string[])dearrayList.ToArray(typeof(string));
|
|
|
+ StringBuilder destringBuilder = new StringBuilder();
|
|
|
+ for (int i = 0; i < dechucklist.Length; i++)
|
|
|
+ {
|
|
|
+ destringBuilder.Append(dechucklist[i] + "\t");
|
|
|
+ }
|
|
|
control = new ComboBox()
|
|
|
{
|
|
|
- ItemsSource= GetFilesNames(Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes", ModuleName)).ToList().Where(item=>item.ToLower().Contains("dechuck"))
|
|
|
- };
|
|
|
- control.Height = 23;
|
|
|
+ ItemsSource= dechucklist
|
|
|
+ };
|
|
|
+ control.Height = 23;
|
|
|
+ control.MinWidth = 100;
|
|
|
control.SetBinding(ComboBox.SelectedItemProperty, binding);
|
|
|
|
|
|
break;
|
|
@@ -539,6 +582,27 @@ namespace Venus_MainPages.ViewModels
|
|
|
HeadWrapPanel.Children.Add(control);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ private void ChangeUI(object sender, SelectionChangedEventArgs e)
|
|
|
+ {
|
|
|
+ var t = sender as ComboBox;
|
|
|
+ if (t.SelectedValue.ToString() == "Chuck" || t.SelectedValue.ToString() == "DeChuck")
|
|
|
+ {
|
|
|
+ headWrapPanel.Children[8].Visibility = Visibility.Collapsed;
|
|
|
+ headWrapPanel.Children[9].Visibility = Visibility.Collapsed;
|
|
|
+ headWrapPanel.Children[10].Visibility = Visibility.Collapsed;
|
|
|
+ headWrapPanel.Children[11].Visibility = Visibility.Collapsed;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ headWrapPanel.Children[8].Visibility = Visibility.Visible;
|
|
|
+ headWrapPanel.Children[9].Visibility = Visibility.Visible;
|
|
|
+ headWrapPanel.Children[10].Visibility = Visibility.Visible;
|
|
|
+ headWrapPanel.Children[11].Visibility = Visibility.Visible;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
private void MenuItemLeftInsert_Click(object sender, RoutedEventArgs e)
|
|
|
{
|
|
|
var t = ((sender as MenuItem).Parent as ContextMenu).PlacementTarget as TextBox;
|