AdjustBuildRevision, FlexMsgBx, Formats, LBWordLib, VlnStatus, RoAccessToSql, TablePicker, VG
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Forms;
|
||||
@@ -35,31 +33,7 @@ namespace AdjustBuildRevision
|
||||
outline = Regex.Replace(line, @"([0-9]*)\.([0-9]*)\.([0-9]*)\.([0-9]*)""\)", DateTime.Now.ToString("2.4.yyMM.dHH") + "\")");
|
||||
else
|
||||
outline = Regex.Replace(line, @"([0-9]*)\.([0-9]*)\.([0-9]*)\.([0-9]*)""\)", DateTime.Now.ToString("2.3.yyMM.dHH") + "\")");
|
||||
// if (outline != line)
|
||||
// {
|
||||
// Console.WriteLine("Before: '{0}'", line);
|
||||
// Console.WriteLine("After: '{0}'", outline);
|
||||
// lines[i] = outline;
|
||||
// changed = true;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// Console.WriteLine("No change: '{0}'", line);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
//if (changed)
|
||||
//{
|
||||
// if (!fi.IsReadOnly) fi.IsReadOnly = false;
|
||||
// StreamWriter sw = fi.CreateText();
|
||||
// foreach (string line in lines)
|
||||
// sw.WriteLine(line);
|
||||
// sw.Close();
|
||||
// string line = lines[i];
|
||||
// string outline = line;
|
||||
// if (line.Contains("AssemblyVersion") || line.Contains("AssemblyFileVersion"))
|
||||
// {
|
||||
//outline = Regex.Replace(line, @"([0-9]*)\.([0-9]*)\.([0-9]*)\.([0-9]*)""\)", DateTime.Now.ToString("1.1.yyMM.dHH") + "\")");
|
||||
|
||||
if (outline != line)
|
||||
{
|
||||
Console.WriteLine("Before: '{0}'", line);
|
||||
@@ -84,7 +58,7 @@ namespace AdjustBuildRevision
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("File " + fi.FullName + " does not exist");
|
||||
MessageBox.Show($"File {fi.FullName} does not exist");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -93,10 +67,6 @@ namespace AdjustBuildRevision
|
||||
}
|
||||
}
|
||||
|
||||
//private static DateTime GetLatestDateTime(string path)
|
||||
//{
|
||||
// return GetLatestDateTime(new DirectoryInfo(path));
|
||||
//}
|
||||
private static DateTime GetLatestDateTime(DirectoryInfo di, DateTime dtCheck)
|
||||
{
|
||||
DateTime dtMax = dtCheck;
|
||||
@@ -104,24 +74,14 @@ namespace AdjustBuildRevision
|
||||
foreach(FileInfo myFile in myFiles)
|
||||
{
|
||||
DateTime dt = myFile.LastWriteTime;
|
||||
//if (dt > dtCheck)
|
||||
//{
|
||||
//Console.WriteLine("\"File\"\t\"{0}\"\t\"{1}\"\t{2}\t{3}",myFile.FullName,dt.ToString("1.1.yyMM.dHH"),dt,dtCheck);
|
||||
if(dtMax < dt) dtMax = dt;
|
||||
//}
|
||||
if(dtMax < dt) dtMax = dt;
|
||||
}
|
||||
DirectoryInfo[] myFolders = di.GetDirectories();
|
||||
foreach (DirectoryInfo diChild in myFolders)
|
||||
{
|
||||
DateTime dtChild = GetLatestDateTime(diChild,dtCheck);
|
||||
//if (dtChild > dtCheck)
|
||||
//{
|
||||
//Console.WriteLine("\"SubFolder\"\t\"{0}\"\t\"{1}\"\t{2}\t{3}", diChild.FullName, dtChild.ToString("1.1.yyMM.dHH"),dtChild,dtCheck);
|
||||
if(dtChild > dtMax) dtMax = dtChild;
|
||||
//}
|
||||
if(dtChild > dtMax) dtMax = dtChild;
|
||||
}
|
||||
//if(dtMax > dtCheck)
|
||||
// Console.WriteLine("\"Folder\"\t\"{0}\"\t\"{1}\"", di.FullName, dtMax.ToString("1.1.yyMM.dHH"));
|
||||
return dtMax;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user