Exemplo n.º 1
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]);
            }
        }