示例#1
0
        void sw_Changed(StFileEventArgs e)
        {
            string text = e.Time.ToString("HH:mm:ss.fff") + "[" + e.ChangeType + "]\t";

            if (e is StFileRenamedEventArgs)
            {
                StFileRenamedEventArgs e1 = e as StFileRenamedEventArgs;
                text += e1.OldFullPath + " 重命名为 " + e1.FullPath;
            }
            else
            {
                text += e.FullPath;
            }
            this.SuspendLayout();

            this.textBox16.Update();
            //this.textBox16.Text += "\r\n" + text;
            this.textBox16.AppendText("\r\n" + text);
            this.textBox16.SelectionStart = this.textBox16.Text.Length;
            this.textBox16.ScrollToCaret();
            this.ResumeLayout(false);

            if (this.textBox18.Enabled)
            {
                string outPath = StDirectory.CurrentAppDirectory + this.textBox18.Text;
                outPath = outPath.Replace("{YYYY}", (DateTime.Now.Year + "").PadLeft(4, '0'));
                outPath = outPath.Replace("{MM}", (DateTime.Now.Month + "").PadLeft(2, '0'));
                outPath = outPath.Replace("{DD}", (DateTime.Now.Day + "").PadLeft(2, '0'));
                StFile.AppendAllText(outPath, "\r\n" + text);
            }
        }
示例#2
0
 bool sw_Erro(StFileEventArgs e, Exception erro)
 {
     return(false);
 }