public void loadXML(string fileName, bool bOnlyGlobalSettings) { try { //textBox1.Text = fileName; List <LightXML> saveThelocalLights = mLightSet.mLights; //XmlSerializer s = new XmlSerializer(typeof(lightSetXML), new Type[] { }); //Stream st = File.OpenRead(fileName); //mLightSet = (lightSetXML)s.Deserialize(st); //st.Close(); mLightSet = SimGlobals.getSimMain().LoadScenarioLights(fileName, !bOnlyGlobalSettings); if (bOnlyGlobalSettings == true) { mLightSet.mLights = saveThelocalLights; } this.betterPropertyGrid1.SelectedObject = mLightSet; } catch (System.Exception ex) { CoreGlobals.getErrorManager().OnException(ex); } }
public void loadXML(string fileName) { try { textBox1.Text = fileName; //XmlSerializer s = new XmlSerializer(typeof(lightSetXML), new Type[] { }); //Stream st = File.OpenRead(fileName); //mLightSet = (lightSetXML)s.Deserialize(st); //st.Close(); mLightSet = SimGlobals.getSimMain().LoadScenarioLights(fileName, true); this.betterPropertyGrid1.SelectedObject = mLightSet; } catch (System.Exception ex) { CoreGlobals.getErrorManager().OnException(ex); } }