private void FillRowMark(IFileClass v, int pos) { string text = Translator.Instance.T("未读"); int ii = 0; switch (v.Mark) { case RecordMark.READ: text = Translator.Instance.T("已读"); ii = 1; break; case RecordMark.IMPORTANT: text = Translator.Instance.T("重要"); ii = 2; break; case RecordMark.UNREAD: default: text = Translator.Instance.T("未读"); ii = 0; break; } this.gridList[pos, 0] = new SourceGrid.Cells.Cell(text); this.gridList[pos, 0].Image = this.imageList.Images[ii]; }
private void UpdateCultureGrid() { foreach (SourceGrid.Grid.GridRow row in this.gridList.Rows) { IFileClass t = row.Tag as IFileClass; if (t != null) { switch (t.Mark) { case RecordMark.READ: this.gridList[row.Index, 0].Value = Translator.Instance.T("已读"); break; case RecordMark.IMPORTANT: this.gridList[row.Index, 0].Value = Translator.Instance.T("重要"); break; case RecordMark.UNREAD: default: this.gridList[row.Index, 0].Value = Translator.Instance.T("未读"); break; } } } }
private SourceGrid.Grid.GridRow Find(string fileName) { foreach (SourceGrid.Grid.GridRow row in gridList.Rows) { IFileClass f = row.Tag as IFileClass; if (f != null) { if (f.FileName.ToLower().Equals(fileName.ToLower())) { return(row); } } } return(null); }
private void Delete() { foreach (SourceGrid.Grid.GridRow row in this.SelectedRows) { IFileClass v = row.Tag as IFileClass; if (v != null) { if (this.BoardControl != null) { this.BoardControl.Remove(v); } v.Remove(); } } this.Count = this.gridList.RowsCount - 1; }
public bool Remove(IFileClass c) { foreach (Control t in this.CameraPanel.Controls) { IFileView v = t as IFileView; if (v != null && v.FileClass.ID.Equals(c.ID)) { if (t is IVideoView) { IVideoView x = t as IVideoView; x.Stop(); } this.CameraPanel.Controls.Remove(t); this.ShortcutRemove(t as IView); break; } } return(true); }
private void fileSystemWatcher_Renamed(object sender, RenamedEventArgs e) { IFileClass f = null; switch (this.Style) { case CameraBoardStyle.AVI: AVIClass v = new AVIClass(e.FullPath, null); f = v as IFileClass; break; case CameraBoardStyle.PIC: PICClass p = new PICClass(e.FullPath, null); f = p as IFileClass; break; } if (f != null && f.IsValid() && f.Owner != null) { SourceGrid.Grid.GridRow row = this.Find(e.OldFullPath); if (row == null) { row = this.Find(e.FullPath); if (row == null) { switch (this.Style) { case CameraBoardStyle.AVI: this.InsertGrid(f as AVIClass); break; case CameraBoardStyle.PIC: this.InsertGrid(f as PICClass); break; } return; } } IFileClass c = row.Tag as IFileClass; c.FileName = f.FileName; this.FillRowMark(c, row.Index); this.gridList.InvalidateCell(this.gridList[row.Index, 0]); } }
private void fileSystemWatcher_Deleted(object sender, System.IO.FileSystemEventArgs e) { foreach (SourceGrid.Grid.GridRow row in gridList.Rows) { IFileClass c = row.Tag as IFileClass; if (c != null) { if (e.FullPath.ToLower().Equals(c.FileName.ToLower())) { if (this.BoardControl != null) { this.BoardControl.Remove(c); } gridList.Rows.Remove(row.Index); this.Count = this.gridList.RowsCount - 1; break; } } } }
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); } } } }
private void Export() { folderBrowserDialog.Description = string.Format(Translator.Instance.T("请选择{0}导出目录"), this.StyleText); DialogResult r = folderBrowserDialog.ShowDialog(); if (DialogResult.OK == r && this.folderBrowserDialog.SelectedPath != null && this.folderBrowserDialog.SelectedPath.Length > 0) { foreach (SourceGrid.Grid.GridRow row in this.SelectedRows) { IFileClass i = row.Tag as IFileClass; if (i != null) { if (false == i.ExportToPath(this.folderBrowserDialog.SelectedPath)) { return; } } } } string msg = string.Format(Translator.Instance.T("数据导出执行完毕!\n导出目录: ({0})"), this.folderBrowserDialog.SelectedPath); MessageBox.Show(msg, MotionPreference.Instance.MessageBoxCaption, MessageBoxButtons.OK, MessageBoxIcon.Information); }
private SourceGrid.Grid.GridRow Find(IFileClass c) { return this.Find(c.FileName); }
public bool Remove(IFileClass c) { foreach (Control t in this.CameraPanel.Controls) { IFileView v = t as IFileView; if (v != null && v.FileClass.ID.Equals(c.ID)) { if (t is IVideoView) { IVideoView x = t as IVideoView; x.Stop(); } this.CameraPanel.Controls.Remove(t); this.ShortcutRemove(t as IView); break; } } return true; }
private SourceGrid.Grid.GridRow Find(IFileClass c) { return(this.Find(c.FileName)); }