示例#1
0
 private MethodTree(MethodTree parent, MethodNode[] methodNodeList, int rootIndex, String basePath)
     : base()
 {
     if (rootIndex == -1)
     {
         return;
     }
     else
     {
         int          currentIndex = rootIndex;
         MethodToCall method;
         ArrayList    childMethodArray = new ArrayList();
         while (currentIndex != -1)
         {
             if (methodNodeList[currentIndex].methodName.Length != 4)
             {
             }
             method = new MethodToCall
             {
                 Name  = methodNodeList[currentIndex].methodName,
                 Path  = basePath + "." + methodNodeList[currentIndex].methodName,
                 Index = methodNodeList[currentIndex].methodIndex
             };
             if (method.Name.Length == 4)
             {
                 childMethodArray.Add(method);
                 childMethodArray.Sort(new MethodComparerClass());
             }
             currentIndex = methodNodeList[currentIndex].next;
             if (currentIndex == rootIndex)
             {
                 break;
             }
         }
         for (int i = 0; i < childMethodArray.Count; i++)
         {
             this.Add(childMethodArray[i] as MethodToCall);
             int childIndex = methodNodeList[(childMethodArray[i] as MethodToCall).Index].child;
             if (childIndex != -1)
             {
                 (childMethodArray[i] as MethodToCall).Children = new MethodTree(this, methodNodeList, childIndex, (childMethodArray[i] as MethodToCall).Path);
             }
         }
     }
 }
示例#2
0
        public CallMethod()
        {
            InitializeComponent();
            acpiControl = (App.Current.MainWindow as MainWindow).acpiControl;
            acpiControl.GetMethodTree(ref methodNodeList);
            methodTree = new MethodTree(methodNodeList, acpiControl.GetRootIndex());
            treeViewMethod.ItemsSource   = methodTree;
            comboBoxArgument.ItemsSource = argumentList;
            Binding typeBinding = new Binding("Type");

            typeBinding.Source = currentArgument;
            comboBoxType.SetBinding(ComboBox.SelectedIndexProperty, typeBinding);
            Binding dataBinding = new Binding("Data");

            dataBinding.Source = currentArgument;
            textBoxData.SetBinding(TextBox.TextProperty, dataBinding);
            Binding selectedBinding = new Binding("SelectedIndex");

            selectedBinding.Source = argumentList;
            comboBoxArgument.SetBinding(ListBox.SelectedIndexProperty, selectedBinding);
            //currentArgument.Type = new ARGUMENT_TYPE();
            //currentArgument.Data = "";
        }
示例#3
0
 public MethodToCall()
 {
     path     = "";
     name     = "";
     children = null;
 }