void _ParamsView_ResetItems(IParamsView sender, ResetItemsEventArgs ea) { Type type = sender.GetType(); // push the changes to the bag. if (_Bags.ContainsKey(type.FullName)) { IParamBag bag = _Bags[type.FullName]; bag.Reset(ea.ItemNames); } else { MessageBox.Show(string.Format("Bag for {0} could not be retrieved to Reset()", type.Name)); } Log(string.Format("* ParamView Reset(): {0}", sender.GetType().Name)); foreach (string name in ea.ItemNames) { Log(string.Format(" {0}", name)); } LogBreak(); }
void _ParamsView_ApplyChanges(IParamsView sender, ApplyChangesEventArgs ea) { Type type = sender.GetType(); // push the changes to the bag. if (_Bags.ContainsKey(type.FullName)) { IParamBag bag = _Bags[type.FullName]; bag.ApplyChanges(ea.Changes); } else { MessageBox.Show(string.Format("Bag for {0} could not be retrieved to ApplyChanges()", type.Name)); } Log(string.Format("* ParamView Apply(): {0}", sender.GetType().Name)); foreach (KeyValuePair<string, object> kvp in ea.Changes) { Log(string.Format(" {0}: {1}", kvp.Key, (kvp.Value ?? "null"))); } LogBreak(); }