public void updata() { pointCutList.Clear(); List<Pointcut> List = new List<Pointcut>(); List = Pointcuts.pointcuts; for (int i = 0; i < List.Count; i++) { PointCutInfo pc = new PointCutInfo(); pc.ID = i; pc.Name = List[i].pointcutName; pointCutList.Add(pc); } }
private void acceptButton_Click(object sender, RoutedEventArgs e) { PointCutInfo pccb = new PointCutInfo(); pccb = (PointCutInfo)pointCutComboBox.SelectedItem; ComboBoxItem kcb = new ComboBoxItem(); kcb = (ComboBoxItem)kindComboBox.SelectedItem; string code = textBox.Text; //string code = System.Windows.Markup.XamlWriter.Save(richTextBox.Document); if (index == -1) Advices.AddAdvice(kcb.Content.ToString(), pccb.Name, code); else Advices.EditAdvice(index, kcb.Content.ToString(), pccb.Name, code); this.Close(); }
public addAdvice() { this.InitializeComponent(); pointCutList.Clear(); this.pointCutComboBox.ItemsSource = pointCutList; this.pointCutComboBox.DisplayMemberPath = "Name"; this.pointCutComboBox.SelectedValuePath = "ID"; List<Pointcut> List = new List<Pointcut>(); List = Pointcuts.pointcuts; for (int i = 0; i < List.Count; i++) { PointCutInfo pc = new PointCutInfo(); ; pc.ID = i; pc.Name = List[i].pointcutName; pointCutList.Add(pc); } // 在此点之下插入创建对象所需的代码。 }