├── .github
├── FUNDING.yml
└── ISSUE_TEMPLATE
│ ├── ask-a-question.md
│ ├── report-a-bug.md
│ └── request-a-feature.md
├── docs
├── Privacy.md
├── img
│ ├── Main.webp
│ ├── Menu.jpg
│ ├── mpvnet.ico
│ ├── mpvnet.pdn
│ ├── mpvnet.png
│ ├── Playlist.png
│ ├── Terminal.png
│ ├── ConfEditor.png
│ ├── InputEditor.webp
│ ├── mpvnet-santa.png
│ └── CommandPalette.webp
└── Universal Remote
│ ├── icon.png
│ ├── icon_hires.png
│ ├── meta.prop
│ ├── layout.xml
│ └── remote.lua
├── src
├── mpvnet.ico
├── Resources
│ ├── mpvnet.ico
│ ├── mpvnet.png
│ ├── mpvnet-santa.png
│ └── theme.txt
├── Package
│ ├── Images
│ │ ├── StoreLogo.png
│ │ ├── SplashScreen.scale-200.png
│ │ ├── LockScreenLogo.scale-200.png
│ │ ├── Square44x44Logo.scale-200.png
│ │ ├── Wide310x150Logo.scale-200.png
│ │ ├── Square150x150Logo.scale-200.png
│ │ └── Square44x44Logo.targetsize-24_altform-unplated.png
│ ├── Package.appxmanifest
│ └── mpv.net.package.wapproj
├── packages.config
├── Properties
│ ├── Settings.settings
│ ├── Settings.Designer.cs
│ ├── AssemblyInfo.cs
│ └── Resources.Designer.cs
├── App.config
├── Misc
│ ├── Global.cs
│ ├── Extension.cs
│ ├── Terminal.cs
│ ├── Msg.cs
│ ├── Common.cs
│ ├── Settings.cs
│ ├── CSharpScriptHost.cs
│ ├── MainForm.Designer.cs
│ ├── ExtensionMethods.cs
│ ├── Program.cs
│ ├── Theme.cs
│ ├── FolderBrowser.cs
│ └── Conf.cs
├── Scripts
│ ├── PowerShell
│ │ ├── show-in-file-explorer.ps1
│ │ ├── open-file-dialog.ps1
│ │ └── pause-when-minimize.ps1
│ ├── C-Sharp
│ │ ├── observe-property-and-draw-text.cs
│ │ ├── key-binding.cs
│ │ ├── pause-when-minimize.cs
│ │ ├── switch-profile-context-menu.cs
│ │ ├── delete-current-file.cs
│ │ └── rate-file.cs
│ ├── JavaScript
│ │ ├── show-playlist.js
│ │ └── seek-show-position.js
│ └── Lua
│ │ ├── pause-when-minimize.lua
│ │ └── delete-current-file.lua
├── WPF
│ ├── MsgBox
│ │ ├── MsgBoxUrl.cs
│ │ ├── MsgBoxExDelegate.cs
│ │ ├── MsgEnumerators.cs
│ │ ├── MsgBoxExtendedFunctionality.cs
│ │ └── MsgBoxExCheckBoxData.cs
│ ├── HandyControl
│ │ ├── Tools
│ │ │ ├── Interop
│ │ │ │ └── Handle
│ │ │ │ │ ├── CommonHandles.cs
│ │ │ │ │ ├── WpfSafeHandle.cs
│ │ │ │ │ ├── BitmapHandle.cs
│ │ │ │ │ └── HandleCollector.cs
│ │ │ ├── Extension
│ │ │ │ └── StringExtension.cs
│ │ │ ├── Converter
│ │ │ │ └── BorderCircularConverter.cs
│ │ │ ├── AnimationHelper.cs
│ │ │ ├── Helper
│ │ │ │ ├── VisualHelper.cs
│ │ │ │ └── ScreenHelper.cs
│ │ │ └── RegexPatterns.cs
│ │ ├── Controls
│ │ │ ├── Attach
│ │ │ │ ├── ScrollViewerAttach.cs
│ │ │ │ ├── IconElement.cs
│ │ │ │ ├── BorderElement.cs
│ │ │ │ └── MenuTopLineAttach.cs
│ │ │ └── SimplePanel.cs
│ │ └── Data
│ │ │ └── ValueBoxes.cs
│ ├── WPF.cs
│ ├── AboutWindow.xaml.cs
│ ├── RelayCommand.cs
│ ├── AboutWindow.xaml
│ ├── SearchTextBoxUserControl.xaml.cs
│ ├── OptionSettingControl.xaml.cs
│ ├── MenuHelp.cs
│ ├── LearnWindow.xaml
│ ├── StringSettingControl.xaml
│ ├── OptionSettingControl.xaml
│ ├── SearchTextBoxUserControl.xaml
│ ├── ConfWindow.xaml
│ ├── StringSettingControl.xaml.cs
│ ├── CommandPaletteControl.xaml.cs
│ ├── InputWindow.xaml
│ └── InputWindow.xaml.cs
├── .editorconfig
├── Extensions
│ └── RatingExtension
│ │ ├── ScriptDevelopment.cs
│ │ ├── Properties
│ │ └── AssemblyInfo.cs
│ │ ├── RatingExtension.csproj
│ │ └── RatingExtension.cs
├── Native
│ ├── Taskbar.cs
│ ├── MediaInfo.cs
│ ├── StockIcon.cs
│ └── Native.cs
├── Release.ps1
└── app.manifest
├── .gitattributes
├── README.md
└── .gitignore
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | github: stax76
2 | patreon: stax76
3 | ko_fi: stax76
4 |
--------------------------------------------------------------------------------
/docs/Privacy.md:
--------------------------------------------------------------------------------
1 |
2 | mpv.net does not collect any personal information.
3 |
--------------------------------------------------------------------------------
/src/mpvnet.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/mpv.net/master/src/mpvnet.ico
--------------------------------------------------------------------------------
/docs/img/Main.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/mpv.net/master/docs/img/Main.webp
--------------------------------------------------------------------------------
/docs/img/Menu.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/mpv.net/master/docs/img/Menu.jpg
--------------------------------------------------------------------------------
/docs/img/mpvnet.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/mpv.net/master/docs/img/mpvnet.ico
--------------------------------------------------------------------------------
/docs/img/mpvnet.pdn:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/mpv.net/master/docs/img/mpvnet.pdn
--------------------------------------------------------------------------------
/docs/img/mpvnet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/mpv.net/master/docs/img/mpvnet.png
--------------------------------------------------------------------------------
/docs/img/Playlist.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/mpv.net/master/docs/img/Playlist.png
--------------------------------------------------------------------------------
/docs/img/Terminal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/mpv.net/master/docs/img/Terminal.png
--------------------------------------------------------------------------------
/docs/img/ConfEditor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/mpv.net/master/docs/img/ConfEditor.png
--------------------------------------------------------------------------------
/src/Resources/mpvnet.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/mpv.net/master/src/Resources/mpvnet.ico
--------------------------------------------------------------------------------
/src/Resources/mpvnet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/mpv.net/master/src/Resources/mpvnet.png
--------------------------------------------------------------------------------
/docs/img/InputEditor.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/mpv.net/master/docs/img/InputEditor.webp
--------------------------------------------------------------------------------
/docs/img/mpvnet-santa.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/mpv.net/master/docs/img/mpvnet-santa.png
--------------------------------------------------------------------------------
/docs/img/CommandPalette.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/mpv.net/master/docs/img/CommandPalette.webp
--------------------------------------------------------------------------------
/docs/Universal Remote/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/mpv.net/master/docs/Universal Remote/icon.png
--------------------------------------------------------------------------------
/src/Resources/mpvnet-santa.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/mpv.net/master/src/Resources/mpvnet-santa.png
--------------------------------------------------------------------------------
/src/Package/Images/StoreLogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/mpv.net/master/src/Package/Images/StoreLogo.png
--------------------------------------------------------------------------------
/docs/Universal Remote/icon_hires.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/mpv.net/master/docs/Universal Remote/icon_hires.png
--------------------------------------------------------------------------------
/docs/Universal Remote/meta.prop:
--------------------------------------------------------------------------------
1 |
2 | meta.name: custom keys
3 | meta.author: stax76
4 | meta.description: custom keys
5 | meta.tags: mpv
6 |
--------------------------------------------------------------------------------
/src/Package/Images/SplashScreen.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/mpv.net/master/src/Package/Images/SplashScreen.scale-200.png
--------------------------------------------------------------------------------
/src/Package/Images/LockScreenLogo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/mpv.net/master/src/Package/Images/LockScreenLogo.scale-200.png
--------------------------------------------------------------------------------
/src/Package/Images/Square44x44Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/mpv.net/master/src/Package/Images/Square44x44Logo.scale-200.png
--------------------------------------------------------------------------------
/src/Package/Images/Wide310x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/mpv.net/master/src/Package/Images/Wide310x150Logo.scale-200.png
--------------------------------------------------------------------------------
/src/Package/Images/Square150x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/mpv.net/master/src/Package/Images/Square150x150Logo.scale-200.png
--------------------------------------------------------------------------------
/src/Package/Images/Square44x44Logo.targetsize-24_altform-unplated.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/mpv.net/master/src/Package/Images/Square44x44Logo.targetsize-24_altform-unplated.png
--------------------------------------------------------------------------------
/src/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/src/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/ask-a-question.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Ask a question
3 | about: Ask a question about mpv.net
4 | title: ''
5 | labels: question
6 | assignees: stax76
7 |
8 | ---
9 |
10 | This template is meant for usage questions of mpv.net.
11 |
--------------------------------------------------------------------------------
/src/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/Misc/Global.cs:
--------------------------------------------------------------------------------
1 |
2 | using System;
3 |
4 | namespace mpvnet
5 | {
6 | public class Global
7 | {
8 | public static string BR = Environment.NewLine;
9 | public static string BR2 = Environment.NewLine + Environment.NewLine;
10 |
11 | public static CorePlayer Core { get; } = new CorePlayer();
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Scripts/PowerShell/show-in-file-explorer.ps1:
--------------------------------------------------------------------------------
1 |
2 | # Shows the current file in File Explorer
3 |
4 | # In input.conf add: script-message show-in-file-explorer
5 |
6 | $code = {
7 | if ($args[0] -eq 'show-in-file-explorer')
8 | {
9 | Start-Process explorer.exe '/n,','/select,',"$($mp.GetPropertyString('path'))"
10 | }
11 | }
12 |
13 | $mp.RegisterEvent("client-message", $code)
14 |
--------------------------------------------------------------------------------
/src/WPF/MsgBox/MsgBoxUrl.cs:
--------------------------------------------------------------------------------
1 |
2 | using System;
3 | using System.Windows.Media;
4 |
5 | namespace MsgBoxEx
6 | {
7 | public class MsgBoxUrl
8 | {
9 | public Uri URL { get; set; }
10 | public string DisplayName { get; set; }
11 | public Color Foreground { get; set; }
12 |
13 | public MsgBoxUrl()
14 | {
15 | Foreground = MessageBoxEx.DefaultUrlForegroundColor;
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
4 | # Custom for Visual Studio
5 | *.cs diff=csharp
6 |
7 | # Standard to msysgit
8 | *.doc diff=astextplain
9 | *.DOC diff=astextplain
10 | *.docx diff=astextplain
11 | *.DOCX diff=astextplain
12 | *.dot diff=astextplain
13 | *.DOT diff=astextplain
14 | *.pdf diff=astextplain
15 | *.PDF diff=astextplain
16 | *.rtf diff=astextplain
17 | *.RTF diff=astextplain
18 |
--------------------------------------------------------------------------------
/src/WPF/MsgBox/MsgBoxExDelegate.cs:
--------------------------------------------------------------------------------
1 |
2 | using System;
3 | using System.Windows;
4 |
5 | namespace MsgBoxEx
6 | {
7 | public abstract class MsgBoxExDelegate
8 | {
9 | public string Message { get; set; }
10 | public string Details { get; set; }
11 | public DateTime MessageDate { get; set; }
12 |
13 | public virtual MessageBoxResult PerformAction(string message, string details = null)
14 | {
15 | throw new NotImplementedException();
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/Resources/theme.txt:
--------------------------------------------------------------------------------
1 |
2 | [dark]
3 |
4 | heading = #3C8CC8
5 | foreground = #DDDDDD
6 | foreground2 = #AAAAAA
7 | background = #323232
8 | highlight = #404040
9 |
10 | menu-foreground = #DDDDDD
11 | menu-background = #323232
12 | menu-highlight = #505050
13 |
14 |
15 | [light]
16 |
17 | heading = #0068B2
18 | foreground = #000000
19 | foreground2 = #4C4C4C
20 | background = #F7F7F7
21 | highlight = #DFDFDF
22 |
23 | menu-foreground = #000000
24 | menu-background = #DFDFDF
25 | menu-highlight = #BFBFBF
26 |
--------------------------------------------------------------------------------
/src/Scripts/C-Sharp/observe-property-and-draw-text.cs:
--------------------------------------------------------------------------------
1 |
2 | // This script observes the fullscreen property and
3 | // draws text on screen when the property changes.
4 |
5 | using mpvnet;
6 |
7 | class Script
8 | {
9 | CorePlayer Core;
10 |
11 | public Script()
12 | {
13 | Core = Global.Core;
14 | Core.ObservePropertyBool("fullscreen", FullscreenChange);
15 | }
16 |
17 | void FullscreenChange(bool value)
18 | {
19 | Core.CommandV("show-text", "fullscreen: " + value);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/WPF/HandyControl/Tools/Interop/Handle/CommonHandles.cs:
--------------------------------------------------------------------------------
1 |
2 | namespace HandyControl.Tools.Interop
3 | {
4 | internal static class CommonHandles
5 | {
6 | public static readonly int Icon = HandleCollector.RegisterType(nameof(Icon), 20, 500);
7 |
8 | public static readonly int HDC = HandleCollector.RegisterType(nameof(HDC), 100, 2);
9 |
10 | public static readonly int GDI = HandleCollector.RegisterType(nameof(GDI), 50, 500);
11 |
12 | public static readonly int Kernel = HandleCollector.RegisterType(nameof(Kernel), 0, 1000);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/WPF/WPF.cs:
--------------------------------------------------------------------------------
1 |
2 | using System;
3 | using System.Windows;
4 |
5 | namespace mpvnet
6 | {
7 | public class WPF
8 | {
9 | public static void Init()
10 | {
11 | if (Application.Current == null)
12 | {
13 | new Application();
14 |
15 | Application.Current.Resources.MergedDictionaries.Add(
16 | Application.LoadComponent(new Uri("mpvnet;component/WPF/Resources.xaml",
17 | UriKind.Relative)) as ResourceDictionary);
18 | }
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/Scripts/PowerShell/open-file-dialog.ps1:
--------------------------------------------------------------------------------
1 |
2 | # Shows the Open File dialog to open a file without loading its folder into the playlist.
3 |
4 | # In input.conf add: script-message load-without-folder
5 |
6 | $code = {
7 | if ($args[0] -eq 'load-without-folder')
8 | {
9 | $dialog = New-Object Windows.Forms.OpenFileDialog
10 |
11 | if ($dialog.ShowDialog() -eq 'OK')
12 | {
13 | $core.LoadFiles($dialog.FileNames, $false, $false);
14 | }
15 |
16 | $dialog.Dispose()
17 | }
18 | }
19 |
20 | $mp.RegisterEvent("client-message", $code)
21 |
--------------------------------------------------------------------------------
/src/WPF/AboutWindow.xaml.cs:
--------------------------------------------------------------------------------
1 |
2 | using System.Windows;
3 | using System.Windows.Input;
4 |
5 | namespace mpvnet
6 | {
7 | public partial class AboutWindow : Window
8 | {
9 | public AboutWindow()
10 | {
11 | InitializeComponent();
12 | DataContext = this;
13 | ContentBlock.Text = App.Version;
14 | }
15 |
16 | protected override void OnPreviewKeyDown(KeyEventArgs e) => Close();
17 | protected override void OnMouseDown(MouseButtonEventArgs e) => Close();
18 |
19 | public Theme Theme => Theme.Current;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/Scripts/PowerShell/pause-when-minimize.ps1:
--------------------------------------------------------------------------------
1 |
2 | $code = {
3 | $isMinimized = $args[0]
4 | $isPaused = $mp.GetPropertyBool('pause')
5 |
6 | if ($isMinimized)
7 | {
8 | if (-not $isPaused)
9 | {
10 | $mp.SetPropertyBool('pause', $true)
11 | $script:wasPaused = $true
12 | }
13 | }
14 | else
15 | {
16 | if ($script:wasPaused -and $isPaused)
17 | {
18 | $mp.SetPropertyBool('pause', $false)
19 | }
20 |
21 | $script:wasPaused = $false
22 | }
23 | }
24 |
25 | $mp.ObserveProperty('window-minimized', 'bool', $code)
26 |
--------------------------------------------------------------------------------
/src/.editorconfig:
--------------------------------------------------------------------------------
1 | [*.cs]
2 |
3 | # IDE0058: Expression value is never used
4 | dotnet_diagnostic.IDE0058.severity = none
5 |
6 | # IDE0055: Fix formatting
7 | dotnet_diagnostic.IDE0055.severity = none
8 |
9 | # IDE0022: Use block body for methods
10 | dotnet_diagnostic.IDE0022.severity = none
11 |
12 | # IDE0040: Add accessibility modifiers
13 | dotnet_diagnostic.IDE0040.severity = none
14 |
15 | # IDE0011: Add braces
16 | dotnet_diagnostic.IDE0011.severity = none
17 |
18 | # IDE0010: Add missing cases
19 | dotnet_diagnostic.IDE0010.severity = none
20 |
21 | # IDE0044: Add readonly modifier
22 | dotnet_diagnostic.IDE0044.severity = silent
23 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/report-a-bug.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Report a bug
3 | about: Create a report to help us improve
4 | title: ''
5 | labels: bug
6 | assignees: stax76
7 |
8 | ---
9 |
10 | **Describe the bug**
11 | A clear and concise description of what the bug is.
12 |
13 | **To Reproduce**
14 | Steps to reproduce the behavior:
15 | 1. Go to '...'
16 | 2. Click on '....'
17 | 3. Scroll down to '....'
18 | 4. See error
19 |
20 | **Expected behavior**
21 | A clear and concise description of what you expected to happen.
22 |
23 | **Screenshots**
24 | If applicable, add screenshots to help explain your problem.
25 |
26 | **Additional context**
27 | Add any other context about the problem here.
28 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/request-a-feature.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Request a feature
3 | about: Suggest an idea for this project
4 | title: ''
5 | labels: feature request
6 | assignees: stax76
7 |
8 | ---
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12 |
13 | **Describe the solution you'd like**
14 | A clear and concise description of what you want to happen.
15 |
16 | **Describe alternatives you've considered**
17 | A clear and concise description of any alternative solutions or features you've considered.
18 |
19 | **Additional context**
20 | Add any other context or screenshots about the feature request here.
21 |
--------------------------------------------------------------------------------
/src/Scripts/JavaScript/show-playlist.js:
--------------------------------------------------------------------------------
1 |
2 | // This script shows the playlist.
3 |
4 | function showPlaylist()
5 | {
6 | // set font size
7 | mp.set_property_number("osd-font-size", 40);
8 |
9 | // show playlist for 5 seconds
10 | mp.command("show-text ${playlist} 5000");
11 |
12 | // restore original font size in 6 seconds
13 | setTimeout(resetFontSize, 6000);
14 | }
15 |
16 | // restore original font size
17 | function resetFontSize()
18 | {
19 | mp.set_property_number("osd-font-size", size);
20 | }
21 |
22 | // save original font size
23 | var size = mp.get_property_number("osd-font-size");
24 |
25 | // input.conf: key script-binding show-playlist
26 | mp.add_key_binding(null, "show-playlist", showPlaylist);
27 |
--------------------------------------------------------------------------------
/src/WPF/MsgBox/MsgEnumerators.cs:
--------------------------------------------------------------------------------
1 |
2 | namespace MsgBoxEx
3 | {
4 | public enum MessageBoxButtonEx { OK = 0, OKCancel, AbortRetryIgnore, YesNoCancel, YesNo, RetryCancel }
5 |
6 | public enum MessageBoxResultEx { None = 0, OK, Cancel, Abort, Retry, Ignore, Yes, No }
7 |
8 | public enum MessageBoxButtonDefault
9 | {
10 | OK, Cancel, Yes, No, Abort, Retry, Ignore, // specific button
11 | Button1, Button2, Button3, // button by ordinal left-to-right position
12 | MostPositive, LeastPositive, // button by positivity
13 | Forms, // button according to the Windows.Forms standard messagebox
14 | None // no default button
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/WPF/HandyControl/Controls/Attach/ScrollViewerAttach.cs:
--------------------------------------------------------------------------------
1 |
2 | using System.Windows;
3 |
4 | using HandyControl.Data;
5 |
6 | namespace HandyControl.Controls
7 | {
8 | public class ScrollViewerAttach
9 | {
10 | public static readonly DependencyProperty AutoHideProperty = DependencyProperty.RegisterAttached(
11 | "AutoHide", typeof(bool), typeof(ScrollViewerAttach), new FrameworkPropertyMetadata(ValueBoxes.TrueBox, FrameworkPropertyMetadataOptions.Inherits));
12 |
13 | public static void SetAutoHide(DependencyObject element, bool value)
14 | => element.SetValue(AutoHideProperty, value);
15 |
16 | public static bool GetAutoHide(DependencyObject element)
17 | => (bool) element.GetValue(AutoHideProperty);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/WPF/HandyControl/Tools/Interop/Handle/WpfSafeHandle.cs:
--------------------------------------------------------------------------------
1 | using System.Security;
2 | using Microsoft.Win32.SafeHandles;
3 |
4 | namespace HandyControl.Tools.Interop
5 | {
6 | internal abstract class WpfSafeHandle : SafeHandleZeroOrMinusOneIsInvalid
7 | {
8 | private readonly int _collectorId;
9 |
10 | [SecurityCritical]
11 | protected WpfSafeHandle(bool ownsHandle, int collectorId) : base(ownsHandle)
12 | {
13 | HandleCollector.Add(collectorId);
14 | _collectorId = collectorId;
15 | }
16 |
17 | [SecurityCritical, SecuritySafeCritical]
18 | protected override void Dispose(bool disposing)
19 | {
20 | HandleCollector.Remove(_collectorId);
21 | base.Dispose(disposing);
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/Scripts/C-Sharp/key-binding.cs:
--------------------------------------------------------------------------------
1 |
2 | // This script adds a key binding.
3 |
4 | using System.Reflection;
5 |
6 | using mpvnet;
7 |
8 | class Script
9 | {
10 | public Script()
11 | {
12 | string content = "ctrl+w script-message my-message-1 my-argument-1";
13 | string sectionName = Assembly.GetExecutingAssembly().GetName().Name;
14 | CorePlayer core = Global.Core;
15 | core.CommandV("define-section", sectionName, content, "force");
16 | core.CommandV("enable-section", sectionName);
17 | core.ClientMessage += ClientMessage;
18 | }
19 |
20 | void ClientMessage(string[] args)
21 | {
22 | switch (args[0])
23 | {
24 | case "my-message-1":
25 | Msg.ShowInfo(args[1]);
26 | break;
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/WPF/RelayCommand.cs:
--------------------------------------------------------------------------------
1 |
2 | using System;
3 | using System.Windows.Input;
4 |
5 | namespace mpvnet
6 | {
7 | public class RelayCommand : ICommand
8 | {
9 | public event EventHandler CanExecuteChanged;
10 |
11 | Action