コード例 #1
0
ファイル: NodeReader.cs プロジェクト: vbra/Videofy
        public NodeReader(string path, IPipe output, WorkMonitor Monitor) : base(null, output /*,null*/)
        {
            if (!File.Exists(path))
            {
                throw new Exception("File does not exists: " + path);
            }
            reader = new FileStream(path, FileMode.Open);
            var fi = new FileInfo(path);

            Monitor.TotalWork = (int)fi.Length;
            this.Monitor      = Monitor;
        }
コード例 #2
0
ファイル: NodeWriter.cs プロジェクト: vbra/Videofy
        public NodeWriter(string path, long size, IPipe input, WorkMonitor Monitor) : base(input, null)
        {
            //if (!File.Exists(path)) throw new Exception("File does not exists: " + path);
            this.size = size;
            if (File.Exists(path))
            {
                string temp = Path.GetDirectoryName(path)
                              + @"\"
                              + Path.GetFileNameWithoutExtension(path)
                              + "({0})"
                              + Path.GetExtension(path);

                int i = 1;
                do
                {
                    path = String.Format(temp, i);
                    i++;
                } while (File.Exists(path));
            }
            writer            = new FileStream(path, FileMode.Create);
            Monitor.TotalWork = (int)size;
            this.Monitor      = Monitor;
        }
コード例 #3
0
ファイル: ChainManager.cs プロジェクト: vbra/Videofy
 public ChainManager()
 {
     _tokenSource = new CancellationTokenSource();
     Monitor      = new WorkMonitor();
     token        = new NodeToken();
 }