Beispiel #1
0
        public static bool TempFileExists(string fPath)
        {
            if (!IsFileValid(fPath))
            {
                return(false);
            }

            BaseFileIOStrategy loader = GetValidIOStrategy(fPath);

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

            return(loader.TempExists(fPath));
        }
Beispiel #2
0
        public static MemoryStream Load(string fPath)
        {
            if (IsFileValid(fPath))
            {
                return(null);
            }

            BaseFileIOStrategy loader = GetValidIOStrategy(fPath);

            if (loader == null)
            {
                return(null);
            }
            Helpers.D.Log("FileIO.Load: {0}", fPath);
            return(loader.Load(fPath));
        }
Beispiel #3
0
        public static void SaveDocument(ViewModels.DocumentViewModel document)
        {
            if (document == null)
            {
                return;
            }

            // Default file type is 'PDF' if none provided in docName (ext was omited)
            string ext = "";

            if (string.IsNullOrEmpty(ParseExtension(document.DocName)))
            {
                ext = ".PDF";
            }

            BaseFileIOStrategy strategy = GetValidIOStrategy(document.DocName + ext);

            if (strategy == null)
            {
                return;
            }

            strategy.SaveDocument(document);
        }