private static void SetupErrorPropertiesNeedingCache(FdoCache cache)
{
ErrorReporter.AddProperty("ProjectName", cache.ProjectId.Name);
ErrorReporter.AddProperty("ProjectHandle", cache.ProjectId.Handle);
ErrorReporter.AddProperty("Server", cache.ProjectId.ServerName);
ErrorReporter.AddProperty("ProjectObjectCount",
cache.ServiceLocator.GetInstance<ICmObjectRepository>().Count.ToString());
if (cache.ProjectId.IsLocal && File.Exists(cache.ProjectId.Path))
{
FileInfo info = new FileInfo(cache.ProjectId.Path);
ErrorReporter.AddProperty("ProjectModified", info.LastWriteTime.ToString());
ErrorReporter.AddProperty("ProjectFileSize", info.Length.ToString());
}
else
{
ErrorReporter.AddProperty("ProjectModified", "unknown--probably not a local file");
ErrorReporter.AddProperty("ProjectFileSize", "unknown--probably not a local file");
}
}