public static void Main(string[] args) { Console.WriteLine("Hello World!"); GDMLParse myParser = new GDMLParse(); //Test String based adding Console.WriteLine("Testing Adding Graphs."); myParser.addGraph("Bob", "Line"); myParser.addGraph("Yearly Returns", "Bar"); GraphObject newGraph = new GraphObject("New Graph", "MixedBarLine"); myParser.addGraph(newGraph); myParser.listGraphs(); Console.WriteLine("Testing Deletion"); myParser.removeGraph("Bob"); myParser.listGraphs(); Console.WriteLine(); Console.WriteLine("Test calling out an object and adjusting it before putting it back."); GraphObject editMe = myParser.returnGraph("Yearly Returns"); editMe.Type = "Donut"; Console.WriteLine("Set Yearly Return type to Donut."); myParser.listGraphs(); Console.Write("Press any key to continue . . . "); Console.ReadKey(true); //Harmless comment, second }
/// <summary> /// Allows for the adding of a Graph Object directly to the list. /// </summary> /// <param name="go"></param> public void addGraph(GraphObject go) { if(ListOfGraphs == null){ ListOfGraphs = new List<GraphObject>(); } ListOfGraphs.Add(go); }
/// <summary> /// Allows the adding of a new graph to the internal list /// </summary> /// <param name="name">Name of the Graph</param> /// <param name="type">Type of the Graph</param> public void addGraph(String name, String type) { //Initialize list of graphs if(ListOfGraphs == null){ ListOfGraphs = new List<GraphObject>(); } GraphObject newGraph = new GraphObject(name, type); addGraph(newGraph); }