Beispiel #1
0
        public static Files openFile(string filePath, AccessType openType)
        {
            Files newFile = null;
            switch (openType)
            {
                case AccessType.READ:
                    newFile = new ReadFile();
                    newFile.filePath = filePath;
                    break;
                case AccessType.WRITE:
                    break;
                case AccessType.APPEND:
                    newFile = new AppendFile();
                    newFile.filePath = filePath;
                    break;
                default:
                    break;
            }

            if (newFile == null)
                throw new NullReferenceException("File could not be opened");

            return newFile;
        }
Beispiel #2
0
 private Debug(string logFilePath)
 {
     this.logFilePath = logFilePath;
     logFile = (Manager.AppendFile)Manager.Files.openFile(logFilePath, Manager.Files.AccessType.APPEND);
     logMessageQueue = new Queue<string>();
 }