public virtual void LoadOption() { try { XElement option = GetOption(); RegisterRcpaComponent(); this.componentList.LoadFromXml(option); RcpaOptionAttributeUtils.LoadFromXml(this, option); this.componentList.ResetEnabledByPrecondition(); } catch (Exception ex) { Console.Error.WriteLine("Load option error : " + ex.Message); } OnAfterLoadOption(new EventArgs()); }
public virtual void SaveOption() { try { XElement option = GetOption(); XElement appSetting = option.Element("appSettings"); if (appSetting != null) { appSetting.Remove(); } this.componentList.RemoveFromXml(option); this.componentList.SaveToXml(option); RcpaOptionAttributeUtils.SaveToXml(this, option); option.Save(ConfigFileName); } catch (Exception ex) { Console.Error.WriteLine("Save option error : " + ex.Message); } }