예제 #1
0
        public void AddState(string id, bool isAccepting)
        {
            if (IsDuplicated(id))
            {
                throw new ArgumentException("State ID is duplicated.");
            }

            var state = new StateViewModel(id, isAccepting);

            states.Add(state);

            Node node = new Node(id);

            if (isAccepting)
            {
                node.Attr.Shape = Shape.DoubleCircle;
            }
            else
            {
                node.Attr.Shape = Shape.Circle;
            }
            graph.AddNode(node);

            if (InitialStateIndex == -1)
            {
                InitialStateIndex = 0;
            }
        }
예제 #2
0
        public void AddState(string id, bool isAccepting)
        {
            if (IsDuplicated(id))
                throw new ArgumentException("State ID is duplicated.");

            var state = new StateViewModel(id, isAccepting);
            states.Add(state);

            Node node = new Node(id);
            if (isAccepting)
                node.Attr.Shape = Shape.DoubleCircle;
            else
                node.Attr.Shape = Shape.Circle;
            graph.AddNode(node);

            if (InitialStateIndex == -1)
                InitialStateIndex = 0;
        }