public override bool Equals(Object obj) { //Check for null and compare run-time types. if (obj == null || GetType() != obj.GetType()) { return(false); } if (obj is CMSFilePath) { CMSFilePath p = (CMSFilePath)obj; return((this.TemplateFile.ToLower() == p.TemplateFile.ToLower()) && (this.SiteID == p.SiteID)); } else { return(false); } }
public static bool CheckFileExistence(string templateFileName) { var _tmplts = GetTmplateStatus(); CMSFilePath tmp = _tmplts.Where(x => x.TemplateFile.ToLowerInvariant() == templateFileName.ToLowerInvariant() && x.SiteID == Guid.Empty).FirstOrDefault(); if (tmp == null) { tmp = new CMSFilePath(templateFileName); _tmplts.Add(tmp); #if DEBUG Debug.WriteLine(" ================ " + DateTime.UtcNow.ToString() + " ================"); Debug.WriteLine("Grabbed file : CheckFileExistence(string templateFileName) " + templateFileName); #endif } SaveTmplateStatus(_tmplts); return(tmp.FileExists); }
public static bool CheckRequestedFileExistence(string templateFileName, Guid siteID) { var _tmplts = GetTmplateStatus(); CMSFilePath tmp = _tmplts.Where(x => x.TemplateFile.ToLower() == templateFileName.ToLower() && x.SiteID == siteID).FirstOrDefault(); if (tmp == null) { tmp = new CMSFilePath(templateFileName, siteID); _tmplts.Add(tmp); #if DEBUG Debug.WriteLine(" ================ " + DateTime.UtcNow.ToString() + " ================"); Debug.WriteLine("Grabbed file : CheckRequestedFileExistence(string templateFileName, Guid siteID) " + templateFileName); #endif } SaveTmplateStatus(_tmplts); return tmp.FileExists; }