Skip to content

Commit

Permalink
Some more work
Browse files Browse the repository at this point in the history
  • Loading branch information
anderlli0053 committed Sep 18, 2022
1 parent 8b2d8ec commit ec1b4d1
Show file tree
Hide file tree
Showing 11 changed files with 367 additions and 39 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ bin/Debug/net6.0-windows/EmptyRecycleBin.deps.json
*.lock
bin/Debug/net6.0-windows/EmptyRecycleBin.runtimeconfig.json
*.cache
*.txt
obj/Debug/net6.0-windows/EmptyRecycleBin.designer.deps.json
obj/Debug/net6.0-windows/EmptyRecycleBin.AssemblyInfo.cs
obj/Debug/net6.0-windows/.NETCoreApp,Version=v6.0.AssemblyAttributes.cs
Expand All @@ -22,3 +21,5 @@ obj/Debug/net6.0-windows/EmptyRecycleBin.GlobalUsings.g.cs
obj/Debug/net6.0-windows/EmptyRecycleBin.GeneratedMSBuildEditorConfig.editorconfig
obj/Debug/net6.0-windows/EmptyRecycleBin.designer.runtimeconfig.json
obj/EmptyRecycleBin.csproj.nuget.dgspec.json
obj/Debug/net6.0-windows/EmptyRecycleBin.csproj.FileListAbsolute.txt
obj/Debug/net6.0-windows/EmptyRecycleBin.Properties.Resources.resources
43 changes: 43 additions & 0 deletions EmptyRecycleBin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,21 @@
<Description>A helper tool to one-click delete the contents of you PCs Recycle Bin and therefore gain some disk space</Description>
<Copyright>Andrew Poženel</Copyright>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
<FileVersion>1.1</FileVersion>
<AssemblyVersion>1.1</AssemblyVersion>
<PackageReleaseNotes>First work of the tool!
</PackageReleaseNotes>
<RepositoryType>git</RepositoryType>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/anderlli0053/EmptyRecycleBin.git</RepositoryUrl>
<PackageProjectUrl>https://github.com/anderlli0053/EmptyRecycleBin</PackageProjectUrl>
<PackageIcon>icon.png</PackageIcon>
<ApplicationIcon>icon.ico</ApplicationIcon>
<Title>Empty Recycle Bin</Title>
<Authors>Andrew Poženel</Authors>
<Product>Empty Recycle Bin</Product>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand All @@ -21,6 +36,15 @@
</PropertyGroup>

<ItemGroup>
<Content Include="icon.ico" />
</ItemGroup>

<ItemGroup>
<Compile Update="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Update="Properties\Settings.Designer.cs">
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<AutoGen>True</AutoGen>
Expand All @@ -29,10 +53,29 @@
</ItemGroup>

<ItemGroup>
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>

<ItemGroup>
<None Update="icon.png">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Update="LICENSE.txt">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Update="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<None Update="README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>

</Project>
31 changes: 31 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*************************************************************************/
/* Main.cs */
/*************************************************************************/
/* This file is part of: */
/* EmptyRecycleBin */
/* https://godotengine.org */
/*************************************************************************/
/* */
/* Copyright (c) 2021-2022 Andrew Poženel */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/

// Andrew Poženel AKA SloDevTeam
55 changes: 32 additions & 23 deletions Main.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 36 additions & 15 deletions Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@
using System.IO;
using System.Runtime.InteropServices;
using System.Windows.Forms;




using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Windows;
using System.Net;



Expand All @@ -58,15 +59,7 @@ enum RecycleFlags : int
}

[DllImport("Shell32.dll", CharSet = CharSet.Unicode)]
static extern uint SHEmptyRecycleBin(IntPtr hwnd, string pszRootPath, RecycleFlags dwFlags);








static extern uint SHEmptyRecycleBin(IntPtr hwnd, string? pszRootPath, RecycleFlags dwFlags);



Expand All @@ -75,6 +68,7 @@ public MAIN()
InitializeComponent();
}



private void DoExit_Click(object sender, EventArgs e)
{
Expand All @@ -95,12 +89,12 @@ private void DoEmpty_Click(object sender, EventArgs e)
{
// Execute the method with the required parameters
uint IsSuccess = SHEmptyRecycleBin(IntPtr.Zero, null, RecycleFlags.SHRB_NOCONFIRMATION);
MessageBox.Show("The recycle bin has been succesfully recycled !", "Clear recycle bin", MessageBoxButtons.OK, MessageBoxIcon.Information);
MessageBox.Show("The recycle bin has been succesfully emptied !", "Empty recycle bin", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception ex)
{
// Handle exceptions
MessageBox.Show("The recycle bin couldn't be recycled" + ex.Message, "Clear recycle bin", MessageBoxButtons.OK, MessageBoxIcon.Stop);
MessageBox.Show("The recycle bin couldn't be emptied" + ex.Message, "Empty recycle bin", MessageBoxButtons.OK, MessageBoxIcon.Stop);
}

}
Expand All @@ -115,5 +109,32 @@ private void MAIN_Load(object sender, EventArgs e)
{

}

private void LINK_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{


try
{
VisitLink();
}
catch (Exception ex)
{
MessageBox.Show("Unable to open link that was clicked!");
}

}

private void VisitLink()
{

System.Diagnostics.Process.Start("https://slo-dev-team.000webhostapp.com/");
LINK.LinkVisited = true;

//ProcessStartInfo sInfo = new ProcessStartInfo("https://slo-dev-team.000webhostapp.com/");
//Process.Start(sInfo);
}


}
}
Loading

0 comments on commit ec1b4d1

Please sign in to comment.