Inheritance: IFileClass
コード例 #1
0
ファイル: PICView.cs プロジェクト: zhuangyy/Motion
        public PICView(PICClass c)
        {
            InitializeComponent();
            MotionPreference.Instance.UpdateUI(this);

            //this.pictureBox.SizeMode = PictureBoxSizeMode.StretchImage;
            this.mPhoto = c;
            Bitmap b = new Bitmap(c.FileName);
            if (b != null)
            {
                this.mBitmap = new Bitmap(b.Width, b.Height);
                Graphics g = Graphics.FromImage(this.mBitmap);
                g.DrawImage(b, 0, 0, b.Width, b.Height);
                g.Dispose();
            }
            this.Title = this.mPhoto.Title;
        }
コード例 #2
0
ファイル: RecordList.cs プロジェクト: zhuangyy/Motion
 private void FillRow(PICClass v, int pos)
 {
     this.FillRowMark(v, pos);
     if (v.Owner == null)
     {
         this.gridList[pos, 1] = new SourceGrid.Cells.Cell(Translator.Instance.T("**未知摄像头**"));
     }
     else
     {
         this.gridList[pos, 1] = new SourceGrid.Cells.Cell(v.Owner.FullName);
     }
     this.gridList[pos, 2] = new SourceGrid.Cells.Cell(v.TimeStamp);
     this.gridList[pos, 3] = new SourceGrid.Cells.Cell(v.FileSize);
     this.gridList.Rows[pos].Tag = v;
 }
コード例 #3
0
ファイル: RecordList.cs プロジェクト: zhuangyy/Motion
        private void InsertGrid(PICClass v)
        {
            lock (this.gridList)
            {
                this.gridList.Rows.Insert(1);

                this.FillRow(v, 1);

                this.Count = this.gridList.RowsCount - 1;
                this.gridList.AutoSizeCells();
            }
        }
コード例 #4
0
ファイル: RecordList.cs プロジェクト: zhuangyy/Motion
        private void FillGrid(PICClass v)
        {
            lock (this.gridList)
            {
                int pos = this.gridList.RowsCount;
                this.gridList.RowsCount++;

                this.FillRow(v, pos);

                this.Count = this.gridList.RowsCount - 1;
            }
        }
コード例 #5
0
ファイル: RecordList.cs プロジェクト: zhuangyy/Motion
 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]);
     }
 }
コード例 #6
0
ファイル: RecordList.cs プロジェクト: zhuangyy/Motion
 private void fileSystemWatcher_Created(object sender, FileSystemEventArgs e)
 {
     switch (this.Style)
     {
         case CameraBoardStyle.PIC:
             PICClass c = new PICClass(e.FullPath, null);
             if (c.IsValid() && c.Owner != null)
             {
                 this.InsertGrid(c);
             }
             break;
         case CameraBoardStyle.AVI:
             break;
     }
 }
コード例 #7
0
ファイル: CameraBoard.cs プロジェクト: zhuangyy/Motion
 public bool Remove(PICClass c)
 {
     foreach (Control t in this.CameraPanel.Controls)
     {
         PICView v = t as PICView;
         if (v != null && v.PICClass.FileName.Equals(c.FileName))
         {
             this.CameraPanel.Controls.Remove(v.Me);
             this.ShortcutRemove(v);
             break;
         }
     }
     return true;
 }
コード例 #8
0
ファイル: CameraBoard.cs プロジェクト: zhuangyy/Motion
 public PICView Add(PICClass c)
 {
     if (c == null)
     {
         return null;
     }
     PICView v = new PICView(c);
     v.ViewRatio = this.ViewRatio;
     v.VisibleChanged += new EventHandler(this.IView_VisibleChanged);
     this.CameraPanel.Controls.Add(v);
     this.ShortcutAdd(v);
     return v;
 }