/// <summary> /// 解析按钮 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> /// <returns></returns> private void btnDecode_Click(object sender, EventArgs e) { StopWrite(); _isWriter = true; //写总文件 string totalFile = string.Format(@"total_" + _baseName + ".tl"); _totalFileStream = new FileStream(_dir + @"/" + totalFile, FileMode.OpenOrCreate); _totalWriteStream = new StreamWriter(_totalFileStream); _totalWriteStream.WriteLine("-------------开始------------"); //将视频文件与数据文件分别写入 _fileWriter = new MyWrite(_dir, _baseName); _fileWriter.OnWriteEnd += OnWriteEnd; _fileWriter.Start(); btnDecode.Text = "解析中..."; btnDecode.Enabled = false; btnClose.Enabled = false; btnReplay.Enabled = false; StartPlaying(); }
static void Main(string[] args) { MyClass t = new MyClass(); NonStatic myNonStatic = new NonStatic(t.Y); myNonStatic(); myNonStatic = MyClass.X; myNonStatic(); MyWrite myDelegate = new MyWrite(WriteLine); MyReadLine read = ReadLine; string str = read(); MyWrite write = WriteLine; write("myDelegate == WriteLine()"); write(str); write = Write; write("myDelegate == Write()"); write("a"); write("a"); write("a"); write("a"); WaitKey wait = ReadKey; wait(); }