コード例 #1
0
        private bool TemplateIsClonable(MasterPagePageTemplateDescriptor templateDescriptor)
        {
            string codebehindFile = templateDescriptor.CodeBehindFilePath;

            if (codebehindFile == null)
            {
                return(false);
            }

            string masterFile = templateDescriptor.FilePath;

            string codebehindFileReference = "\"" + Path.GetFileName(codebehindFile) + "\"";
            string templateId = templateDescriptor.Id.ToString();

            return(C1File.ReadAllText(codebehindFile).IndexOf(templateId, StringComparison.OrdinalIgnoreCase) > 0 &&
                   C1File.ReadAllText(masterFile).IndexOf(codebehindFileReference, StringComparison.OrdinalIgnoreCase) > 0);
        }
コード例 #2
0
 public MasterPagePageTemplateDeleter(MasterPagePageTemplateDescriptor templateDescriptor)
 {
     _templateDescriptor = templateDescriptor;
 }