Esempio n. 1
0
        }         // func GetInFileExtention

        private static string GetOutFileExtention(OdetteOutFileState state)
        {
            switch (state)
            {
            case OdetteOutFileState.Sent:
                return(".sent");

            case OdetteOutFileState.WaitEndToEnd:
                return(".we2e");

            case OdetteOutFileState.ReceivedEndToEnd:
                return(".re2e");

            case OdetteOutFileState.Finished:
                return(".done");

            default:
                throw new ArgumentException("Invalid state.");
            }
        }         // func GetInFileExtention
Esempio n. 2
0
        }         // func ChangeInFileStateAsync

        private static Task ChangeOutFileStateAsync(FileInfo fileInfo, OdetteOutFileState newState)
        {
            var fiNewFileName = Path.ChangeExtension(fileInfo.FullName, GetOutFileExtention(newState));

            return(Task.Run(() => fileInfo.MoveTo(fiNewFileName)));
        }         // func ChangeOutFileStateAsync
Esempio n. 3
0
 /// <summary>Builds the file name with state extention.</summary>
 /// <param name="file"></param>
 /// <param name="state"></param>
 /// <returns></returns>
 internal FileInfo CreateOutFileName(IOdetteFile file, OdetteOutFileState state)
 => new FileInfo(Path.Combine(directoryOut.FullName, GetFileName(file) + GetOutFileExtention(state)));
Esempio n. 4
0
		} // func ChangeInFileState

		private static void ChangeOutFileState(FileInfo fileInfo, OdetteOutFileState newState)
		{
			var fiNewFileName = Path.ChangeExtension(fileInfo.FullName, GetOutFileExtention(newState));
			fileInfo.MoveTo(fiNewFileName);
		} // func ChangeOutFileState
Esempio n. 5
0
		} // func CreateInFileName

		/// <summary>Builds the file name with state extention.</summary>
		/// <param name="file"></param>
		/// <param name="state"></param>
		/// <returns></returns>
		internal FileInfo CreateOutFileName(IOdetteFile file, OdetteOutFileState state)
		{
			return new FileInfo(Path.Combine(directoryOut.FullName, GetFileName(file) + GetOutFileExtention(state)));
		} // func CreateOutFileName
Esempio n. 6
0
		} // func GetInFileExtention

		private static string GetOutFileExtention(OdetteOutFileState state)
		{
			switch (state)
			{
				case OdetteOutFileState.Sent:
					return ".sent";
				case OdetteOutFileState.WaitEndToEnd:
					return ".we2e";
				case OdetteOutFileState.ReceivedEndToEnd:
					return ".re2e";
				default:
					throw new ArgumentException("Invalid state.");
			}
		} // func GetInFileExtention