// Helper functions for reading from xml files private Stimulus XMLReadStimulusParameters(XmlElement xmlStimulus) { Stimulus stim = new Stimulus(); int top = Convert.ToInt32(((XmlElement)xmlStimulus.GetElementsByTagName("top")[0]).InnerText); int left = Convert.ToInt32(((XmlElement)xmlStimulus.GetElementsByTagName("left")[0]).InnerText); int height = Convert.ToInt32(((XmlElement)xmlStimulus.GetElementsByTagName("height")[0]).InnerText); int width = Convert.ToInt32(((XmlElement)xmlStimulus.GetElementsByTagName("width")[0]).InnerText); string filename = ((XmlElement)xmlStimulus.GetElementsByTagName("location")[0]).InnerText; string name = ((XmlElement)xmlStimulus.GetElementsByTagName("name")[0]).InnerText; stim.SetStimulusName(name); stim.SetFilename(filename); stim.SetTop(top); stim.SetLeft(left); stim.SetHeight(height); stim.SetWidth(width); return(stim); }
// Helper functions for reading from xml files private Stimulus XMLReadStimulusParameters(XmlElement xmlStimulus) { Stimulus stim = new Stimulus(); int top = Convert.ToInt32(((XmlElement)xmlStimulus.GetElementsByTagName("top")[0]).InnerText); int left = Convert.ToInt32(((XmlElement)xmlStimulus.GetElementsByTagName("left")[0]).InnerText); int height = Convert.ToInt32(((XmlElement)xmlStimulus.GetElementsByTagName("height")[0]).InnerText); int width = Convert.ToInt32(((XmlElement)xmlStimulus.GetElementsByTagName("width")[0]).InnerText); string filename = ((XmlElement)xmlStimulus.GetElementsByTagName("location")[0]).InnerText; string name = ((XmlElement)xmlStimulus.GetElementsByTagName("name")[0]).InnerText; stim.SetStimulusName(name); stim.SetFilename(filename); stim.SetTop(top); stim.SetLeft(left); stim.SetHeight(height); stim.SetWidth(width); return stim; }