Exemplo n.º 1
0
        private void Add()
        {
            if (this.BoardControl != null)
            {
                foreach (SourceGrid.Grid.GridRow row in this.SelectedRows)
                {
                    switch (this.Style)
                    {
                    case CameraBoardStyle.AVI:
                        AVIClass v = row.Tag as AVIClass;
                        if (v.Mark == RecordMark.UNREAD || v.Mark == RecordMark.INVALID)
                        {
                            v.Mark = RecordMark.READ;
                        }
                        this.BoardControl.Add(v);
                        break;

                    case CameraBoardStyle.PIC:
                        PICClass p = row.Tag as PICClass;
                        if (p.Mark == RecordMark.UNREAD || p.Mark == RecordMark.INVALID)
                        {
                            p.Mark = RecordMark.READ;
                        }
                        this.BoardControl.Add(row.Tag as PICClass);
                        break;
                    }
                }
            }
        }
Exemplo n.º 2
0
        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();
            }
        }
Exemplo n.º 3
0
        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;
            }
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
 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);
 }
Exemplo n.º 6
0
 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;
 }
Exemplo n.º 7
0
        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;
            }
        }
Exemplo n.º 8
0
        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;
        }
Exemplo n.º 9
0
        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]);
            }
        }