コード例 #1
0
        private void DeleteFile(IFile file)
        {
            FileSystemFileBase baseFile = file as FileSystemFileBase;

            if (baseFile == null)
            {
                return;
            }

            string filePath = baseFile.SystemPath;

            try
            {
                C1File.Delete(filePath);
            }
            catch
            {
                LoggingService.LogWarning(typeof(DeleteXsltFunctionWorkflow).Name, "Failed to delete file '{0}'".FormatWith(filePath));
            }
        }
コード例 #2
0
            public void DeleteTemplate()
            {
                IFile file = IFileServices.GetFile <IPageTemplateFile>(_pageTemplate.PageTemplateFilePath);

                ProcessControllerFacade.FullDelete(_pageTemplate);

                if (file != null && file is FileSystemFileBase)
                {
                    FileSystemFileBase baseFile = file as FileSystemFileBase;
                    C1File.Delete(baseFile.SystemPath);

                    try
                    {
                        C1File.Delete(baseFile.SystemPath);
                    }
                    catch
                    {
                        LoggingService.LogWarning(LogTitle, "Failed to delete page template file: '{0}'".FormatWith(baseFile.SystemPath));
                    }
                }
            }