Skip to content

Commit

Permalink
Cleanup, close application when finished if it was ran by drag and drop.
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperRiderTH committed May 2, 2018
1 parent 836674f commit f148b14
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
18 changes: 17 additions & 1 deletion WeebHyphens/Program.cs
Expand Up @@ -68,6 +68,8 @@ static void Main(string[] args)
System.IO.StreamReader readStream;
System.IO.StreamWriter writeStream;

bool DragAndDrop = false;

String ifilename = "";
String ofilename = "";

Expand All @@ -86,6 +88,13 @@ static void Main(string[] args)
if (args.Length == 1)
{
ifilename = args[0];
DragAndDrop = true;
}
else
{
Console.WriteLine("Too many arguments provided, press Enter to close.");
Console.ReadLine();
Environment.Exit(1);
}
}

Expand Down Expand Up @@ -179,7 +188,14 @@ static void Main(string[] args)
readStream.Close();
writeStream.Close();

Console.ReadLine();
if ( !DragAndDrop )
{
Console.WriteLine();
Console.WriteLine("Press Enter to close.");
Console.ReadLine();
}

Environment.Exit(0);

}

Expand Down
22 changes: 22 additions & 0 deletions WeebHyphens/WeebHyphens.csproj
Expand Up @@ -10,6 +10,21 @@
<AssemblyName>WeebHyphens</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<IsWebBootstrapper>false</IsWebBootstrapper>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand Down Expand Up @@ -43,5 +58,12 @@
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

0 comments on commit f148b14

Please sign in to comment.