public void SaveSetupPositions(List<MHSetupPosition> sps) { if (sps != null) { try { setupPositions = sps; FileHelper fWriter = new FileHelper(); fWriter.WriteAsXml<MHSetupPosition>(sps, Conf.GetSetting<string>("mhSetupFile")); } catch (Exception e) { Log.Fatal(e); } } }
private void OnDumpRequested(MsgDump obj) { FileHelper fWriter = new FileHelper(); if (obj.Key == "VM") { Log.DebugFormat("Try to write mapping to {0}", obj); List<ValueMapping> list = new List<ValueMapping>(); foreach (KeyValuePair<int, ValueMapping> entry in VirtualToDMXMapping) { list.Add(VirtualToDMXMapping[entry.Key]); } list.Add(VirtualToImgMapping); foreach (KeyValuePair<int, ValueMapping> entry in DMXToVirtualMapping) { list.Add(DMXToVirtualMapping[entry.Key]); } list.Add(ImgToVirtualMapping); fWriter.WriteAsXml<ValueMapping>(list, obj.Filename); } if (obj.Key == "VMSETUP") { List<KeyValuePair<int, List<DMXImgSetupMappingValue>>> list = new List<KeyValuePair<int, List<DMXImgSetupMappingValue>>>(); foreach (KeyValuePair<int, List<DMXImgSetupMappingValue>> item in DMXSetupValues) { list.Add(item); } List<KeyValuePair<int, Position>> list2 = new List<KeyValuePair<int, Position>>(); foreach (KeyValuePair<int, Position> pos in ImgSetupPositions) { list2.Add(pos); } try { fWriter.WriteAsXml<KeyValuePair<int, List<DMXImgSetupMappingValue>>>(list, obj.Filename); } catch (Exception e) { Log.Fatal(e); } try { fWriter.WriteAsXml<KeyValuePair<int, Position>>(list2, obj.Filename, true); } catch (Exception e) { Log.Fatal(e); } } }