提交 e6b13965 编写于 作者: J Jason Malinowski

Make a bunch of helper methods static that don't need instance state

上级 c834544d
...@@ -103,7 +103,7 @@ protected override Assembly LoadImpl(string fullPath) ...@@ -103,7 +103,7 @@ protected override Assembly LoadImpl(string fullPath)
return base.LoadImpl(shadowCopyPath); return base.LoadImpl(shadowCopyPath);
} }
private string CopyFileAndResources(string fullPath, string assemblyDirectory) private static string CopyFileAndResources(string fullPath, string assemblyDirectory)
{ {
string fileNameWithExtension = Path.GetFileName(fullPath); string fileNameWithExtension = Path.GetFileName(fullPath);
string shadowCopyPath = Path.Combine(assemblyDirectory, fileNameWithExtension); string shadowCopyPath = Path.Combine(assemblyDirectory, fileNameWithExtension);
...@@ -137,7 +137,7 @@ private string CopyFileAndResources(string fullPath, string assemblyDirectory) ...@@ -137,7 +137,7 @@ private string CopyFileAndResources(string fullPath, string assemblyDirectory)
return shadowCopyPath; return shadowCopyPath;
} }
private void CopyFile(string originalPath, string shadowCopyPath) private static void CopyFile(string originalPath, string shadowCopyPath)
{ {
var directory = Path.GetDirectoryName(shadowCopyPath); var directory = Path.GetDirectoryName(shadowCopyPath);
Directory.CreateDirectory(directory); Directory.CreateDirectory(directory);
...@@ -147,7 +147,7 @@ private void CopyFile(string originalPath, string shadowCopyPath) ...@@ -147,7 +147,7 @@ private void CopyFile(string originalPath, string shadowCopyPath)
ClearReadOnlyFlagOnFile(new FileInfo(shadowCopyPath)); ClearReadOnlyFlagOnFile(new FileInfo(shadowCopyPath));
} }
private void ClearReadOnlyFlagOnFiles(string directoryPath) private static void ClearReadOnlyFlagOnFiles(string directoryPath)
{ {
DirectoryInfo directory = new DirectoryInfo(directoryPath); DirectoryInfo directory = new DirectoryInfo(directoryPath);
...@@ -157,7 +157,7 @@ private void ClearReadOnlyFlagOnFiles(string directoryPath) ...@@ -157,7 +157,7 @@ private void ClearReadOnlyFlagOnFiles(string directoryPath)
} }
} }
private void ClearReadOnlyFlagOnFile(FileInfo fileInfo) private static void ClearReadOnlyFlagOnFile(FileInfo fileInfo)
{ {
try try
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册