示例#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;
                    }
                }
            }
        }
示例#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();
            }
        }
示例#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;
            }
        }
示例#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);
        }
示例#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);
 }
示例#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;
 }
示例#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;
            }
        }
示例#8
0
文件: PICView.cs 项目: unixcrh/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;
        }
示例#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]);
            }
        }