예제 #1
0
        /// <summary>
        /// Creates a new frame
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public FrameTreeNode createFrame(string name)
        {
            FrameTreeNode retVal;

            DataDictionary.Tests.Frame frame = (DataDictionary.Tests.Frame)DataDictionary.Generated.acceptor.getFactory().createFrame();
            frame.Name = name;
            Item.appendTests(frame);

            retVal = new FrameTreeNode(frame);
            Nodes.Add(retVal);
            SortSubNodes();

            return(retVal);
        }
        /// <summary>
        /// Extracts the test case in a new subsequence
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        public void Extract(object sender, EventArgs args)
        {
            MainWindow mainWindow = MainWindow;

            mainWindow.AllowRefresh = false;

            try
            {
                DataDictionary.Tests.SubSequence subSequence = (DataDictionary.Tests.SubSequence)DataDictionary.Generated.acceptor.getFactory().createSubSequence();
                subSequence.Name = Item.Name;

                FrameTreeNode       frameTreeNode  = Parent.Parent as FrameTreeNode;
                SubSequenceTreeNode newSubSequence = frameTreeNode.createSubSequence(subSequence);

                SubSequenceTreeNode subSequenceTreeNode = Parent as SubSequenceTreeNode;
                newSubSequence.AcceptCopy((BaseTreeNode)subSequenceTreeNode.Nodes[0]);
                newSubSequence.AcceptDrop(this);
            }
            finally
            {
                mainWindow.AllowRefresh = true;
                mainWindow.RefreshModel();
            }
        }