-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Welcome to ModernNotify's 2nd major update! What's new: - New control panel design. - Weather forecast, depending on the location of the computer. - A panel of pinned applications, for quick launch. - Sync application settings with your account. (All computers where the application is installed and you are logged into your account will have the same personalization settings) What's changed: - Added media control buttons to the player. - The application information page has not been improved much. - Other bug fixes and improvements. Thank you for being with us for 2 years! Your Unesell Studio 💕 Date of development: 08/31/2022.
- Loading branch information
Showing
625 changed files
with
38,005 additions
and
8,020 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file removed
BIN
-36.6 KB
.vs/ModernNotify/FileContentIndex/64296ba8-02da-4150-a906-596a2c007f44.vsidx
Binary file not shown.
Binary file removed
BIN
-56.6 KB
.vs/ModernNotify/FileContentIndex/6cf542ee-e0c3-48c2-bc97-006c212754bb.vsidx
Binary file not shown.
Binary file added
BIN
+326 KB
.vs/ModernNotify/FileContentIndex/6e965a80-67a0-43ef-819c-e7c4196e4ba0.vsidx
Binary file not shown.
Binary file removed
BIN
-279 KB
.vs/ModernNotify/FileContentIndex/c0d4c355-4627-4454-9fd3-98ce733a836c.vsidx
Binary file not shown.
Binary file removed
BIN
-72 KB
.vs/ModernNotify/FileContentIndex/c1a17190-94a3-447c-84c7-a67023fae5c9.vsidx
Binary file not shown.
Binary file added
BIN
+43.1 KB
.vs/ModernNotify/FileContentIndex/ca615e5b-b689-462b-9a9e-5b2b413955c6.vsidx
Binary file not shown.
Binary file added
BIN
+45.1 KB
.vs/ModernNotify/FileContentIndex/cb0a1605-2425-4a11-9df7-b06efaa4cf6a.vsidx
Binary file not shown.
Binary file added
BIN
+62 KB
.vs/ModernNotify/FileContentIndex/dec518a0-0653-4dba-b304-11f29521931f.vsidx
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<Window x:Class="ModernNotyfi.Other_Page.LauncherEdit" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:local="clr-namespace:ModernNotyfi.Other_Page" | ||
mc:Ignorable="d" | ||
xmlns:wpfui="clr-namespace:WPFUI.Controls;assembly=WPFUI" | ||
xmlns:wpfuiCommon="clr-namespace:WPFUI.Common;assembly=WPFUI" | ||
Title="Редактирование панели быстрого доступа" | ||
Style="{StaticResource UiWindow}" | ||
WindowStyle="None" | ||
WindowStartupLocation="CenterScreen" | ||
Icon="/icons/App_Color.png" Background="#F21B1B1B" MinHeight="300" MinWidth="512" Height="248" Width="422"> | ||
<Grid Margin="0,0,10,10"> | ||
<wpfui:TitleBar | ||
FontFamily="/icons/Fonts/#Google Sans Medium" | ||
Title="Редактирование панели быстрого доступа" | ||
Icon="pack://application:,,,/icons/App_Color.png" | ||
Grid.Row="0" Margin="0,0,-9,0"/> | ||
|
||
<wpfui:Card Margin="20,51,208,10" Padding="0,0,0,0"> | ||
<ListBox SelectionMode="Single" Foreground="{DynamicResource Button.Static.Background}" ItemsSource="{Binding ItemsApp}" x:Name="Apps_List" Background="{x:Null}" Margin="0,0,0,-2" SelectionChanged="App_Delete" BorderBrush="{x:Null}"> | ||
<ListBox.ItemTemplate> | ||
<DataTemplate> | ||
<StackPanel Orientation="Horizontal"> | ||
<Image Source="{Binding Image}" MaxWidth="20" MaxHeight="20" Margin="0,0,10,0"/> | ||
<TextBlock Foreground="{DynamicResource Button.Static.Background}" Text="{Binding Name}"/> | ||
</StackPanel> | ||
</DataTemplate> | ||
</ListBox.ItemTemplate> | ||
</ListBox> | ||
</wpfui:Card> | ||
<Button Style="{StaticResource AccentButtonStyle}" Content="Добавить файл" HorizontalAlignment="Right" Margin="0,56,10,0" VerticalAlignment="Top" Padding="10,6,10,6" Width="185" Height="33" Click="AddApp"/> | ||
<Label FontFamily="/icons/Fonts/#Google Sans Medium" Content="Как добавить:
Нажмите кнопку "Добавить" и
выберите приложение,
которое хотите поместить
в быстрый доступ.

Как удалить:
Для удаления выберите
приложение из списка слево
и подтвердите удаление." Margin="0,103,0,0" VerticalAlignment="Top" Height="187" HorizontalAlignment="Right" Width="195"/> | ||
<Label x:Name="NoApps" FontFamily="/icons/Fonts/#Google Sans Medium" Content="Нет приложений" Margin="98,153,286,112" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/> | ||
</Grid> | ||
</Window> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,209 @@ | ||
using IWshRuntimeLibrary; | ||
using NAudio.Wave; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Collections.ObjectModel; | ||
using System.ComponentModel; | ||
using System.Drawing; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Management; | ||
using System.Runtime.InteropServices; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows; | ||
using System.Windows.Controls; | ||
using System.Windows.Data; | ||
using System.Windows.Documents; | ||
using System.Windows.Input; | ||
using System.Windows.Interop; | ||
using System.Windows.Media; | ||
using System.Windows.Media.Imaging; | ||
using System.Windows.Shapes; | ||
using Windows.Devices.Bluetooth; | ||
using Windows.Devices.Enumeration; | ||
using Windows.UI.WindowManagement; | ||
using Woof.SystemEx; | ||
|
||
namespace ModernNotyfi.Other_Page | ||
{ | ||
/// <summary> | ||
/// Логика взаимодействия для DebugWindow.xaml | ||
/// </summary> | ||
public partial class LauncherEdit : Window, INotifyPropertyChanged | ||
{ | ||
public event PropertyChangedEventHandler PropertyChanged; | ||
|
||
private void OnPropertyChanged(string propertyName) | ||
{ | ||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); | ||
} | ||
|
||
private ObservableCollection<ItemModel> items; | ||
public ObservableCollection<ItemModel> Items | ||
{ | ||
get { return items; } | ||
set | ||
{ | ||
if (items != value) | ||
{ | ||
items = value; | ||
OnPropertyChanged(nameof(Items)); | ||
} | ||
} | ||
} | ||
|
||
public ObservableCollection<ItemModel> ItemsApp { get; set; } = new ObservableCollection<ItemModel>(); | ||
|
||
public LauncherEdit() | ||
{ | ||
InitializeComponent(); | ||
DataContext = this; | ||
|
||
WPFUI.Appearance.Background.Apply(this, WPFUI.Appearance.BackgroundType.Mica); | ||
UpdateList(); | ||
} | ||
|
||
public void UpdateList() | ||
{ | ||
string shortcutsFolderPath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "shortcuts"); | ||
if (!Directory.Exists(shortcutsFolderPath)) | ||
{ | ||
Directory.CreateDirectory(shortcutsFolderPath); | ||
} | ||
|
||
string[] shortcutFiles = Directory.GetFiles(shortcutsFolderPath); | ||
foreach (string shortcutFilePath in shortcutFiles) | ||
{ | ||
ImageSource imageSource = null; | ||
|
||
FileInfo fileInfo = new FileInfo(shortcutFilePath); | ||
|
||
if (fileInfo.Extension.ToLower() == ".lnk") | ||
{ | ||
string targetPath = GetShortcutTarget(shortcutFilePath); | ||
BitmapSource iconSource = GetFileIcon(targetPath); | ||
|
||
if (iconSource != null) | ||
{ | ||
imageSource = iconSource; | ||
} | ||
} | ||
|
||
ItemsApp.Add(new ItemModel(fileInfo.Name.Replace(".lnk", ""), imageSource, fileInfo.FullName)); | ||
} | ||
|
||
if (ItemsApp.Count > 0){ | ||
NoApps.Visibility = Visibility.Collapsed; | ||
} | ||
else{ | ||
NoApps.Visibility = Visibility.Visible; | ||
} | ||
} | ||
|
||
private string GetShortcutTarget(string shortcutFilePath) | ||
{ | ||
WshShell shell = new WshShell(); | ||
IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut(shortcutFilePath); | ||
string targetPath = shortcut.TargetPath; | ||
Marshal.ReleaseComObject(shortcut); | ||
Marshal.ReleaseComObject(shell); | ||
return targetPath; | ||
} | ||
|
||
private BitmapSource GetFileIcon(string filePath) | ||
{ | ||
if (System.IO.File.Exists(filePath)) | ||
{ | ||
Icon icon = System.Drawing.Icon.ExtractAssociatedIcon(filePath); | ||
if (icon != null) | ||
{ | ||
return Imaging.CreateBitmapSourceFromHIcon(icon.Handle, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions()); | ||
} | ||
} | ||
return null; | ||
} | ||
|
||
private void App_Delete(object sender, SelectionChangedEventArgs e) | ||
{ | ||
if (Apps_List.SelectedIndex != -1) | ||
{ | ||
var selectedItem = (ItemModel)Apps_List.SelectedItem; | ||
string message = $"Вы уверены, что хотите удалить ярлык для приложения '{selectedItem.Name}'?"; | ||
MessageBoxResult result = MessageBox.Show(message, "Подтвердите удаление", MessageBoxButton.YesNo, MessageBoxImage.Question); | ||
|
||
if (result == MessageBoxResult.Yes) | ||
{ | ||
try | ||
{ | ||
System.IO.File.Delete(selectedItem.Sourse); | ||
ItemsApp.Remove(selectedItem); | ||
} | ||
catch (Exception ex) | ||
{ | ||
MessageBox.Show($"Ошибка при удалении: {ex.Message}", "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error); | ||
} | ||
} | ||
} | ||
|
||
Apps_List.SelectedIndex = -1; | ||
ItemsApp.Clear(); | ||
UpdateList(); | ||
|
||
try | ||
{ | ||
MainWindow my = Application.Current.Windows.OfType<MainWindow>().FirstOrDefault(); | ||
my.QuickLaunchItems.Clear(); | ||
my.LauncherUpdate(); | ||
}catch { } | ||
} | ||
|
||
private void AddApp(object sender, RoutedEventArgs e) | ||
{ | ||
Microsoft.Win32.OpenFileDialog openFileDialog = new Microsoft.Win32.OpenFileDialog(); | ||
if (openFileDialog.ShowDialog() == true) | ||
{ | ||
string shortcutsFolderPath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "shortcuts"); | ||
if (!Directory.Exists(shortcutsFolderPath)) | ||
{ | ||
Directory.CreateDirectory(shortcutsFolderPath); | ||
} | ||
|
||
string appFilePath = openFileDialog.FileName; | ||
string shortcutFilePath = System.IO.Path.Combine(shortcutsFolderPath, System.IO.Path.GetFileNameWithoutExtension(appFilePath) + ".lnk"); | ||
|
||
WshShell wshShell = new WshShell(); | ||
IWshShortcut shortcut = (IWshShortcut)wshShell.CreateShortcut(shortcutFilePath); | ||
shortcut.TargetPath = appFilePath; | ||
shortcut.Save(); | ||
|
||
// Освобождаем ресурсы | ||
Marshal.ReleaseComObject(shortcut); | ||
Marshal.ReleaseComObject(wshShell); | ||
|
||
// Обновляем листбокс или выполните другие действия, если необходимо | ||
ItemsApp.Clear(); | ||
UpdateList(); | ||
|
||
MainWindow my = Application.Current.Windows.OfType<MainWindow>().FirstOrDefault(); | ||
my.QuickLaunchItems.Clear(); | ||
my.LauncherUpdate(); | ||
} | ||
} | ||
|
||
} | ||
|
||
public class ItemModel | ||
{ | ||
public ItemModel(string name, ImageSource image, string sourse) | ||
{ | ||
Name = name; | ||
Image = image; | ||
Sourse = sourse; | ||
} | ||
|
||
public string Name { get; set; } | ||
public string Sourse { get; set; } | ||
public ImageSource Image { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.