void OnSearch(object sender, RoutedEventArgs e) { SearchEventArgs searchArgs = e as SearchEventArgs; foreach (string section in searchArgs.Sections) { string input = searchArgs.Keyword; string searchType = section; if (searchType == null) { MessageBox.Show("请选择搜索类型"); } else { PythonParse pps = new PythonParse(); Dictionary <string, Dictionary <int, List <int> > > monsterParse = pps.searchParse(input, searchType); if (monsterParse != null) { DrawComponent.canvas = MyDesignerCanvas; List <GroupBox> newGroupBoxList = DrawComponent.addMyGrid(monsterParse); AiBar.Children.Clear(); for (int i = 0; i < newGroupBoxList.Count; ++i) { AiBar.Children.Add(newGroupBoxList[i]); } } } } }
protected override void OnClick() { base.OnClick(); canvas.NewCanvas(); canvas.Print_Executed(AID); DrawComponent.ReWriteDesignerItemValue(canvas.monster, DrawComponent.monsterParam); }
public DesignerItem DrawExpResultOnCanvas() { Dictionary <int, string> protoType = new Dictionary <int, string>(); Dictionary <int, List <string> > param = new Dictionary <int, List <string> >(); protoType[0] = "Exp"; List <DesignerItem> itemList = DrawComponent.addNode("ConditionExpResult", protoType, param); return(itemList[0]); }
public DesignerItem DrawAndorOrExpOnCanvas(string protoName, string typeName, string expType) { DrawComponent.expComboBox = expType.Equals("and") ? andExp : orExp; if (DrawComponent.expComboBox.Count > 0) { Dictionary <int, string> protoType = new Dictionary <int, string>(); Dictionary <int, List <string> > param = new Dictionary <int, List <string> >(); protoType[0] = protoName; List <string> paramList1 = new List <string>(); paramList1.Add(DrawComponent.expComboBox.Count.ToString()); param[0] = paramList1; List <DesignerItem> itemList = DrawComponent.addNode(typeName, protoType, param); return(itemList[0]); } return(null); }
public List <DesignerItem> DrawTargetTriggersOnCanvas() { List <DesignerItem> itemList = DrawComponent.addNode("Target", targetDictionary, targetParamDictionary); return(itemList); }
public List <DesignerItem> DrawActionTriggersOnCanvas() { List <DesignerItem> itemList = DrawComponent.addNode("Action", actionDictionary, actionParamDictionary, actionTargetLinker); return(itemList); }
public DesignerItem DrawTriggerOnCanvas() { DesignerItem item = DrawComponent.DrawTriggerComponent(triggerName, triggerParamList); return(item); }
void addTextBlockOrTextBoxByType(ListView listView, string connectorName, string describe, string connectorType, DesignerItem item, string direction) { Grid listItem = new Grid(); listItem.Width = 80; listItem.Height = 25; if (connectorType == "SingleLinker" || connectorType == "MultiLinker") { TextBlock textBlock = new TextBlock(); textBlock.Text = connectorName; textBlock.TextAlignment = TextAlignment.Center; textBlock.Width = 80; textBlock.Height = 25; textBlock.ToolTip = describe; textBlock.HorizontalAlignment = direction == "left" ? (HorizontalAlignment.Left) : (HorizontalAlignment.Right); SolidColorBrush typeColor = decide.typeColor(connectorType); textBlock.Background = typeColor; listItem.Children.Add(textBlock); Connector co1 = new Connector(); DrawComponent.GetConnectorType(co1, item.ItemType, direction); co1.Orientation = direction == "left" ? (ConnectorOrientation.Left) : (ConnectorOrientation.Right); co1.DataType = GetDataType(connectorType); co1.Content = listItem; co1.HorizontalAlignment = HorizontalAlignment.Left; listView.Items.Add(co1); } else if (connectorType == "Combo") { ComboBox comboBox = new ComboBox(); comboBox.ItemsSource = comboData; comboBox.DisplayMemberPath = "Value"; comboBox.SelectedValuePath = "Id"; comboBox.Width = 80; comboBox.Height = 25; item.myCombo = comboBox; listView.Items.Add(comboBox); } else { MyTextBox textBox = new MyTextBox(connectorType); textBox.Text = connectorName; textBox.Property = connectorName; textBox.ParentListView = listView; textBox.ParentDesignerItem = item; //textBox.ParentDesignerItem = item; textBox.propertyValue = connectorName; textBox.TextAlignment = TextAlignment.Center; textBox.Width = 80; textBox.Height = 25; textBox.ToolTip = describe; if (connectorType != "OrderInteger") { item.outputValue.Add(textBox); } textBox.HorizontalAlignment = direction == "left" ? (HorizontalAlignment.Left) : (HorizontalAlignment.Right); SolidColorBrush typeColor = decide.typeColor(connectorType); textBox.Background = typeColor; Interaction.GetBehaviors(textBox).Add(new TextBoxEnterKeyUpdateBehavior()); listItem.Children.Add(textBox); Grid co2 = new Grid(); co2.Children.Add(listItem); co2.HorizontalAlignment = HorizontalAlignment.Left; listView.Items.Add(co2); } }