Esempio n. 1
0
        private void fsTimer_Tick(object sender, System.EventArgs e)
        {
            lock (fileSystemEvents)
            {
                while (fileSystemEvents.Count != 0)
                {
                    System.IO.FileSystemEventArgs fs = fileSystemEvents.Values.FirstOrDefault();
                    fileSystemEvents.Remove(fs.FullPath);
                    {
                        Controller.AppendLog(fs.Name + " changed");
                        string    relativePath = GetRelativePath(fs.FullPath);
                        Data.File file         = GetItem(relativePath) as Data.File;
                        if (file == null)
                        {
                            return;
                        }
                        Data.ITextFile textFile = file as Data.ITextFile;
                        if (textFile == null)
                        {
                            return;
                        }
                        if (textFile.Dirty)
                        {
                            Controller.AppendLog(fs.FullPath + " conflict!");
                        }
                        else
                        {
                            DateTime lastWriteTime = System.IO.File.GetLastWriteTime(fs.FullPath);
                            if (textFile.LoadedFileLastWriteTime != lastWriteTime)
                            {
                                textFile.LoadFormFile();
                                textFile.Update();
                            }
                        }
                    }
                }
//                fsTimer.Enabled = false;
            }
        }
Esempio n. 2
0
 public override void Selected()
 {
     Data.ITextFile textFile = FileItem as Data.ITextFile;
     codeEditor.Controller.NavigatePanel.GetContextMenuStrip().Items["openWithExploererTsmi"].Visible = true;
     //            ViewControl.ViewController.
 }