コード例 #1
0
 public WhiskerTrackerXml(ClipSettingsXml clipSettings, MouseFrameXml[] frames, UnitSettingsXml unitSettings, FrameRateSettingsXml frameRateSettings)
 {
     ClipSettings      = clipSettings;
     Frames            = frames;
     UnitSettings      = unitSettings;
     FrameRateSettings = frameRateSettings;
 }
コード例 #2
0
        private void SaveFile()
        {
            if (string.IsNullOrWhiteSpace(WorkingFile))
            {
                SaveFileAs();
                return;
            }

            MouseFrameXml[] frames = m_Frames.Values.Select(x => new MouseFrameXml(x.Model)).ToArray();

            UnitSettingsXml      unitSettings      = new UnitSettingsXml(GlobalSettings.GlobalSettings.UnitSettings);
            ClipSettingsXml      clipSettings      = new ClipSettingsXml(GlobalSettings.GlobalSettings.ClipSettings);
            FrameRateSettingsXml frameRateSettings = new FrameRateSettingsXml(GlobalSettings.GlobalSettings.FrameRateSettings);

            WhiskerTrackerXml filXml     = new WhiskerTrackerXml(clipSettings, frames, unitSettings, frameRateSettings);
            XmlSerializer     serializer = new XmlSerializer(typeof(WhiskerTrackerXml));

            using (StreamWriter writer = new StreamWriter(WorkingFile))
            {
                serializer.Serialize(writer, filXml);
            }
        }