private void SetMark(RecordMark mark) { if (this.SelectedRows.Count == 0) { string msg = string.Format(Translator.Instance.T("没有被选中的{0}. 您必须在下面的列表中先选择要标记的{0}."), this.StyleText); MessageBox.Show(msg, MotionPreference.Instance.MessageBoxCaption, MessageBoxButtons.OK, MessageBoxIcon.Information); return; } foreach (SourceGrid.Grid.GridRow row in this.SelectedRows) { IFileClass f = row.Tag as IFileClass; if (f != null) { try { f.Mark = mark; } catch (System.IO.IOException ioe) { string msg = ""; switch (this.Style) { case CameraBoardStyle.AVI: msg = string.Format(Translator.Instance.T("设置标记失败. (录像正在播放中, 您必须先停止录像的播放, 再对录像设置标记)\n详细信息:\n{0}"), ioe.Message); break; case CameraBoardStyle.PIC: msg = string.Format(Translator.Instance.T("设置标记失败.\n详细信息:\n{0}"), ioe.Message); break; } MessageBox.Show(msg, MotionPreference.Instance.MessageBoxCaption, MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (Exception ex) { string msg = string.Format(Translator.Instance.T("设置标记失败.\n详细信息:\n{0}"), ex.Message); MessageBox.Show(msg, MotionPreference.Instance.MessageBoxCaption, MessageBoxButtons.OK, MessageBoxIcon.Error); } } } }