Exemple #1
0
        /// <summary>
        /// 运行程序。
        /// <param name="parameter">初始化运行参数</param>
        /// </summary>
        public void Run(object parameter)
        {
            Action param = new Action(null, parameter);

            do
            {
                param = CurrentNode.Action.Invoke(param.TargetParam);
                if (param.TargetName != null)
                {
                    _prevNode = CurrentNode;
                    var node = (NavigatableNode)SearchNode(param.TargetName);
                    if (node == null)
                    {
                        throw new ArgumentOutOfRangeException(nameof(param.TargetName));
                    }
                    _currentNode = node;
                }
                else
                {
                    break;
                }
            } while (true);
        }
Exemple #2
0
 public NavigatableTree(NavigatableNode rootNode) : base(rootNode)
 {
     _currentNode = rootNode;
 }