public void CanReadFileInfo() { var a = new XbimAssemblyInfo(typeof(IfcWall)); var dt = a.CompilationTime; Assert.AreNotEqual(dt, DateTime.MinValue); }
public bool IsOption(string s) { if (s == "/ver") { Console.WriteLine( XbimAssemblyInfo.AssemblyInformation(global::System.Reflection.Assembly.GetCallingAssembly())); DisplayVersion = true; return(true); } var m = Regex.Match(s, "/out:(.*)", RegexOptions.None); if (m.Success) { var dName = m.Groups[1].Value; var d = new DirectoryInfo(dName); if (d.Parent == null || !d.Parent.Exists) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("Error: Invalid parameter for /out option, directory cannot be created."); Console.ResetColor(); return(true); } if (!d.Exists) { d.Create(); } OutputdDirectory = new DirectoryInfo(dName); return(true); } m = Regex.Match(s, "/req:(.*)", RegexOptions.None); // ReSharper disable once InvertIf // more options might come. if (m.Success) { var fname = m.Groups[1].Value; if (!File.Exists(fname)) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("Error: Invalid parameter for /req option, file not found."); Console.ResetColor(); return(true); } if (!fname.EndsWith(".json", StringComparison.InvariantCultureIgnoreCase)) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("Error: Invalid parameter for /req option, file extension must be json."); Console.ResetColor(); return(true); } DpowRequirementFile = fname; return(true); } return(false); }
private static void DocumentSingleAssembly(Assembly a, StringBuilder sb) { if (!a.GetName().Name.ToLowerInvariant().Contains(@"xbim")) { return; } var xa = new XbimAssemblyInfo(a); var assemblyDescription = string.Format("{0}\t{1}\t{2}\t{3}\r\n", a.GetName().Name, xa.AssemblyVersion, xa.FileVersion, xa.CompilationTime); sb.Append(assemblyDescription); }
private void DocumentSingleAssembly(Assembly a, StringBuilder sb) { if (!a.GetName().Name.ToLowerInvariant().Contains(@"xbim")) { return; } var xa = new XbimAssemblyInfo(a); if (string.IsNullOrEmpty(a.Location)) { xa.OverrideLocation = MainWindow.GetAssemblyLocation(a); } var assemblyDescription = $"{a.GetName().Name}\t{xa.AssemblyVersion}\t{xa.FileVersion}\r\n"; sb.Append(assemblyDescription); }