Beispiel #1
0
        public bool fIsNewer(DepandanceData _oFile)
        {
            try{
                if (_oFile.sPath == "")  //not found
                {
                    return(true);
                }

                //  if (_oFile.dtModified == null) {
                if (!_oFile.bIsDateRead)
                {
                    _oFile.dtModified  = File.GetLastWriteTime(_oFile.sPath);
                    _oFile.bIsDateRead = true;
                }
                if (_oFile.dtModified > dtObjFile)
                {
                    // Debug.fTrace("Newer: " +_oFile.sPath   + ": " +_oFile.dtModified +  " : " + dtObjFile);
                    //        Output.Trace("\f54NewerFile: " + sPath + ":" +_oFile.sPath   + ": " +_oFile.dtModified +  " : " + dtObjFile);
                    bFileIsMoreRecent = true;
                    oMoreRecent       = _oFile;

                    fHaveNewerFile();
                    // bHaveNewerFile = true;
                    // return true;
                    return(true);
                }
            }catch  {
                fHaveNewerFile();
                // bHaveNewerFile = true;
                return(true);
            }
            return(false);
        }
Beispiel #2
0
        internal bool fAddDepandance(Depandance _oFrom, string _sFile)   //Return true if newer file
        //  Console.WriteLine("Check: " +_sFile );
        {
            if (!File.Exists(_sFile))
            {
                //  _oFrom.bHaveNewerFile = true;//Not exist, force recompilation
                _oFrom.fHaveNewerFile();//Not exist, force recompilation
                //Console.WriteLine("!File.Exists(_sFile): " +_sFile );
                return(true);
            }

            DepandanceData _oDep;

            if (!aDependance.ContainsKey(_sFile))
            {
                _oDep       = new DepandanceData();
                _oDep.sPath = _sFile;
                //    Console.WriteLine("Add: " + _sFile);
                aDependance.Add(_sFile, _oDep);
            }
            else
            {
                _oDep = aDependance[_sFile];
            }

            if (_oFrom.fIsNewer(_oDep))
            {
                return(true);
            }

            return(false);
        }