Skip to content

Commit 4f4cf1e

Browse files
update: changed SimpleFileHandler.ProjectToLocation assembly to executing assembly
1 parent d276b9a commit 4f4cf1e

File tree

1 file changed

+4
-28
lines changed

1 file changed

+4
-28
lines changed

SimpleFileHandler.cs

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -22,40 +22,16 @@ public static void Append(string FilePath, string Content)
2222
}
2323

2424
[MethodImpl(MethodImplOptions.NoInlining)]
25-
public static void ProjectToLocation(Assembly CallingAssembly, string FileName)
25+
public static void ProjectToLocation(Assembly ExecutingAssembly, string FileName)
2626
{
27-
try
28-
{
29-
Console.WriteLine(CallingAssembly.EntryPoint.DeclaringType.Namespace);
30-
}
31-
catch (Exception exception)
32-
{
33-
Console.WriteLine(exception.Message);
34-
}
35-
try
36-
{
37-
Console.WriteLine(Assembly.GetCallingAssembly().EntryPoint.DeclaringType.Namespace);
38-
}
39-
catch (Exception exception)
40-
{
41-
Console.WriteLine(exception.Message);
42-
}
43-
try
44-
{
45-
Console.WriteLine(Assembly.GetEntryAssembly().EntryPoint.DeclaringType.Namespace);
46-
}
47-
catch (Exception exception)
48-
{
49-
Console.WriteLine(exception.Message);
50-
}
5127
try
5228
{
5329
if (!Path.GetDirectoryName(FileName).Equals(string.Empty) && !Directory.Exists(Path.GetDirectoryName(FileName)))
5430
{
5531
Directory.CreateDirectory(Path.GetDirectoryName(FileName));
5632
}
5733
FileStream ProjectFileStream = File.Create(FileName);
58-
Assembly.GetExecutingAssembly().GetManifestResourceStream(CallingAssembly.EntryPoint.DeclaringType.Namespace + "." + Path.GetFileName(FileName)).CopyTo(ProjectFileStream);
34+
ExecutingAssembly.GetManifestResourceStream(ExecutingAssembly.EntryPoint.DeclaringType.Namespace + "." + Path.GetFileName(FileName)).CopyTo(ProjectFileStream);
5935
ProjectFileStream.Close();
6036
}
6137
catch (Exception exception)
@@ -66,7 +42,7 @@ public static void ProjectToLocation(Assembly CallingAssembly, string FileName)
6642
}
6743

6844
[MethodImpl(MethodImplOptions.NoInlining)]
69-
public static void ProjectToLocation(Assembly CallingAssembly, string FileName, string FilePath)
45+
public static void ProjectToLocation(Assembly ExecutingAssembly, string FileName, string FilePath)
7046
{
7147
try
7248
{
@@ -75,7 +51,7 @@ public static void ProjectToLocation(Assembly CallingAssembly, string FileName,
7551
Directory.CreateDirectory(FilePath);
7652
}
7753
FileStream ProjectFileStream = File.Create(Path.Combine(FilePath, Path.GetFileName(FileName)));
78-
Assembly.GetExecutingAssembly().GetManifestResourceStream(CallingAssembly.EntryPoint.DeclaringType.Namespace + "." + Path.GetFileName(FileName)).CopyTo(ProjectFileStream);
54+
ExecutingAssembly.GetManifestResourceStream(ExecutingAssembly.EntryPoint.DeclaringType.Namespace + "." + Path.GetFileName(FileName)).CopyTo(ProjectFileStream);
7955
ProjectFileStream.Close();
8056
}
8157
catch

0 commit comments

Comments
 (0)