コード例 #1
0
        internal void FileWalk(XFile file)
        {
            DateTime dt = System.IO.File.GetLastWriteTime(file.SourcePath);

            //System.Diagnostics.Trace.WriteLine("FileWalk " + file.FullPath);
            if (dt > file.LastWritten)
            {
                //System.Diagnostics.Trace.WriteLine("FileWalk dt changes, reading " + file.SourcePath);
                using (SourceWalker sw = new SourceWalker(file))
                {
                    //
                    try
                    {
                        var xTree = sw.Parse();
                        sw.BuildModel(xTree, false);
                        file.LastWritten = dt;
                        if (file.Project != null)
                        {
                            file.Project.FileWalkComplete?.Invoke(file);
                        }

                        //
                    }
                    catch (Exception)
                    {
                        // Push Exception away...
                        ;
                    }
                }
            }
        }
コード例 #2
0
 /// <summary>
 /// Block the running Thread until the file has been parsed
 /// </summary>
 public void WaitParsing()
 {
     if (!HasCode)
     {
         return;
     }
     //_parsedEvent.WaitOne();
     System.Diagnostics.Trace.WriteLine("-->> XFile.WaitParsing()");
     lock (_lock)
     {
         if (!Parsed)
         {
             //
             using (SourceWalker sw = new SourceWalker(this))
             {
                 try
                 {
                     var xTree = sw.Parse();
                     sw.BuildModel(xTree, false);
                     //
                 }
                 catch (Exception e)
                 {
                     Support.Debug("XFile.WaitParsing" + e.Message);
                 }
             }
         }
     }
     System.Diagnostics.Trace.WriteLine("<<-- XFile.WaitParsing()");
 }
コード例 #3
0
 public void GetLocals(string currentBuffer)
 {
     using (var xsWalker = new SourceWalker(this, currentBuffer))
     {
         var xTree = xsWalker.Parse();
         xsWalker.BuildModel(xTree, true);
     }
 }