public Runner()
 {
     if (mInputDataPath == string.Empty)
         Input = new InputData();
     else
         Input = new InputData(mInputDataPath);
 }
 public Runner(string InputPath)
 {
     if (InputPath == string.Empty)
         Input = new InputData();
     else
         Input = new InputData(InputPath);
 }
        private void button1_Click(object sender, EventArgs e)
        {
            InputData input = new InputData();
            input.Description = "test des for input";

            InputDataSet ds = new InputDataSet();
            ds.InputParameters.AddParameter("key1", "v1");
            ds.InputParameters.AddParameter("key2", "v2");
            ds.InputParameters.AddParameter("key3", "v3");

            ds.ExpectedValues.AddParameter("expected1", "v4");
            ds.ExpectedValues.AddParameter("expected2", "v5");
            ds.Key = "ds key1";
            ds.Description = "des des1";
            input.AddInputDataSet(ds);

            InputDataSet ds2 = new InputDataSet();
            ds2.InputParameters.AddParameter("key1", "v1");
            ds2.InputParameters.AddParameter("key2", "v2");
            ds2.InputParameters.AddParameter("key3", "v3");

            ds2.ExpectedValues.AddParameter("expected1", "v4");
            ds2.ExpectedValues.AddParameter("expected2", "v5");
            ds2.Key = "ds key2";
            ds2.Description = "des des2";
            input.AddInputDataSet(ds2);

            MessageBox.Show(input.Export("c:/test.xml").ToString());
        }
        private void btnImport_Click(object sender, EventArgs e)
        {
            InputData input = new InputData(@"c:\a.xml");

            this.InputTree.ViewStyle = Infragistics.Win.UltraWinTree.ViewStyle.FreeForm ;

            foreach (InputDataSet ids in input.DataSets)
            {
                this.InsertDataSet(ids);
            }

            //this.InputTree.NodeLevelOverrides[0].ColumnSet = this.InputTree.ColumnSettings.ColumnSets["DataSet"];

            //foreach (InputDataSet ids in input.DataSets)
            //{
            //    UltraTreeNode dataset = this.InputTree.Nodes.Add(ids.Key);

            //    dataset.Cells[0].Value = ids.Key ;
            //    dataset.Cells[1].Value = ids.Description ;

            //    UltraTreeNode inputParameterNode = dataset.Nodes.Add();
            //    inputParameterNode.Text = "Input Parameters";

            //    List<Step> steps = ids.InputParameters.Steps;

            //    foreach (Step s in steps)
            //    {
            //        UltraTreeNode stepNode = inputParameterNode.Nodes.Add();
            //        stepNode.Override.ColumnSet = this.InputTree.ColumnSettings.ColumnSets["Step"];

            //        stepNode.Cells[0].Value = s.Name;

            //        foreach (Parameter p in s.Parameters)
            //        {
            //            UltraTreeNode paraNode = stepNode.Nodes.Add();

            //            paraNode.Override.ColumnSet = this.InputTree.ColumnSettings.ColumnSets["Parameter"];

            //            paraNode.Cells[0].Value = p.Key;
            //            paraNode.Cells[1].Value = p.Value;
            //        }
            //    }

            //    UltraTreeNode expectedResultNode = dataset.Nodes.Add();
            //    expectedResultNode.Text = "Expected Result";

            //    steps = ids.ExpectedValues.Steps;

            //    foreach (Step s in steps)
            //    {
            //        UltraTreeNode stepNode = expectedResultNode.Nodes.Add();
            //        stepNode.Override.ColumnSet = this.InputTree.ColumnSettings.ColumnSets["Step"];

            //        stepNode.Cells[0].Value = s.Name;

            //        foreach (Parameter p in s.Parameters)
            //        {
            //            UltraTreeNode paraNode = stepNode.Nodes.Add();

            //            paraNode.Override.ColumnSet = this.InputTree.ColumnSettings.ColumnSets["Parameter"];

            //            paraNode.Cells[0].Value = p.Key;
            //            paraNode.Cells[1].Value = p.Value;
            //        }
            //    }
            //}

            this.InputTree.ExpandAll();
        }
 private void button2_Click(object sender, EventArgs e)
 {
     InputData input = new InputData("c:/test.xml");
 }