File tree Expand file tree Collapse file tree 8 files changed +56
-5
lines changed
GrabWindows10LockScreenPictures Expand file tree Collapse file tree 8 files changed +56
-5
lines changed Original file line number Diff line number Diff line change 1- <Project Sdk =" Microsoft.NET.Sdk" >
1+ <Project Sdk =" Microsoft.NET.Sdk" >
22
33 <PropertyGroup >
44 <OutputType >WinExe</OutputType >
5- <TargetFramework >net5.0-windows </TargetFramework >
5+ <TargetFramework >net5.0-windows10.0.17763.0 </TargetFramework >
66 <UseWPF >true</UseWPF >
77 <AssemblyName >Grab Windows 10 Lock Screen Pictures</AssemblyName >
8+ <ApplicationIcon >Data\lion_icon.ico</ApplicationIcon >
89 </PropertyGroup >
910
11+ <ItemGroup >
12+ <None Remove =" Data\buffelo.png" />
13+ <None Remove =" Data\lion.png" />
14+ <None Remove =" Data\lionicon.ico" />
15+ <None Remove =" Data\lion_icon.ico" />
16+ </ItemGroup >
17+
1018 <ItemGroup >
1119 <PackageReference Include =" System.Drawing.Common" Version =" 5.0.2" />
20+ <PackageReference Include =" Microsoft.Toolkit.Uwp.Notifications" Version =" 7.0.1" />
21+ </ItemGroup >
22+
23+ <ItemGroup >
24+ <Content Include =" Data\buffelo.png" >
25+ <CopyToOutputDirectory >Always</CopyToOutputDirectory >
26+ </Content >
27+ <Content Include =" Data\lion.png" >
28+ <CopyToOutputDirectory >Always</CopyToOutputDirectory >
29+ </Content >
30+ <Resource Include =" Data\lion_icon.ico" >
31+ <CopyToOutputDirectory >Never</CopyToOutputDirectory >
32+ </Resource >
33+ </ItemGroup >
34+
35+ <ItemGroup >
36+ <Resource Include =" Data\lionicon.ico" >
37+ <CopyToOutputDirectory >Never</CopyToOutputDirectory >
38+ </Resource >
1239 </ItemGroup >
1340
1441</Project >
Original file line number Diff line number Diff line change 1+ using Microsoft . Toolkit . Uwp . Notifications ;
2+ using System ;
3+ using System . IO ;
4+
5+ namespace GrabWindows10LockScreenPictures . Helpers {
6+ public class PopTheToast {
7+ public static void PopIt ( string notifText ) =>
8+ new ToastContentBuilder ( )
9+ . AddText ( "Grab Windows 10 Lock Screen Pictures" )
10+ . AddText ( ! string . IsNullOrWhiteSpace ( notifText ) ? notifText : "Script has run with an unknown result." )
11+ . AddHeroImage ( new Uri ( "file:///" + Path . GetFullPath ( "Data/buffelo.png" ) ) )
12+ . AddAppLogoOverride ( new Uri ( "file:///" + Path . GetFullPath ( "Data/lion.png" ) ) , ToastGenericAppLogoCrop . Circle )
13+ . AddAttributionText ( "Via GWLSP" )
14+ . Show ( toast => toast . ExpirationTime = DateTime . Now . AddMinutes ( 10 ) ) ;
15+ }
16+ }
Original file line number Diff line number Diff line change 1- using System . Drawing ;
1+ using GrabWindows10LockScreenPictures . Helpers ;
2+ using System ;
3+ using System . Drawing ;
24using System . IO ;
35using System . Linq ;
46
@@ -9,8 +11,14 @@ static void Main(string[] args) {
911 string assetsOthers = @"C:\Users\others\AppData\Local\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets" ;
1012 string saved = @"C:\Users\user\Pictures\Spotlight Images" ;
1113
12- GetPics ( assetsAryeh , saved ) ;
13- GetPics ( assetsOthers , saved ) ;
14+ try {
15+ GetPics ( assetsAryeh , saved ) ;
16+ GetPics ( assetsOthers , saved ) ;
17+
18+ PopTheToast . PopIt ( "All images were successfully saved." ) ;
19+ } catch ( Exception ex ) {
20+ PopTheToast . PopIt ( "An error occurred: " + ex . Message ) ;
21+ }
1422 }
1523
1624 static void GetPics ( string assets , string saved ) {
You can’t perform that action at this time.
0 commit comments