Exemplo n.º 1
0
 public static void EditPointcut(int index, string returnValue, string pointcutName, string pointcutKind, string regex)
 {
     Pointcut newPointcut = new Pointcut();
     newPointcut = pointcuts[index];
     newPointcut.returnValue = returnValue;
     newPointcut.pointcutName = pointcutName;
     newPointcut.pointcutKind = pointcutKind;
     newPointcut.regex = regex;
 }
Exemplo n.º 2
0
        //public static List<string> pointcutNames;

        //public static void Pointcuts() {
        //    pointcuts = new List<Pointcut>();
        //}
        public static void AddPointcut(string returnValue, string pointcutName, string pointcutKind, string regex) {
            Pointcut newPointcut = new Pointcut();
            newPointcut.returnValue = returnValue;
            newPointcut.pointcutName = pointcutName;
            newPointcut.pointcutKind = pointcutKind;
            newPointcut.regex = regex;
            string pointcutString = returnValue + " pointcut " + pointcutName + "(): " + pointcutKind + "(" + regex + ");\n";
            newPointcut.pointcutString = pointcutString;
            pointcuts.Add(newPointcut);
        }
        private void editButton_Click(object sender, RoutedEventArgs e)
        {
            int index = pointCutComboBox.SelectedIndex;
            if (index == -1) return;
            addPoint ap = new addPoint();
            ap.Owner = this;
            
            Pointcut pointcut = new Pointcut();
            pointcut = Pointcuts.pointcuts[index];

            ap.pointCutTextBox.Text = pointcut.pointcutName;
            switch (pointcut.returnValue)
            {
                case "public": ap.returnValueCombox.SelectedIndex = 0;
                    break;
                case "private": ap.returnValueCombox.SelectedIndex = 1;
                    break;
            }
            switch (pointcut.pointcutKind)
            {
                case "Call": ap.pointCutKindCombox.SelectedIndex = 0;
                    break;
                case "Execution": ap.pointCutKindCombox.SelectedIndex = 1;
                    break;
                case "Target": ap.pointCutKindCombox.SelectedIndex = 2;
                    break;
                case "Args": ap.pointCutKindCombox.SelectedIndex = 3;
                    break;
                case "Within": ap.pointCutKindCombox.SelectedIndex = 4;
                    break;
                case "Cflow": ap.pointCutKindCombox.SelectedIndex = 5;
                    break;
            }
            ap.regexBox.Text = pointcut.regex;
            ap.Label.Content = "编辑 pointCut";
            ap.index = index;
            ap.ShowDialog();
            updata();
        }