Skip to content

Instantly share code, notes, and snippets.

View rmcdongit's full-sized avatar

Richard McDonald rmcdongit

View GitHub Profile
@rmcdongit
rmcdongit / MainWindow.xaml
Created May 6, 2022 01:28
Adding Sound to WPF (.NET Framework)
<Window x:Class="SoundDemo.MainWindow"
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:MiddleEarth"
mc:Ignorable="d"
Title="MainWindow" Height="500" Width="800">
<Grid>
<Button Content="Play Sound" HorizontalAlignment="Left" Margin="343,225,0,0" VerticalAlignment="Top" Height="49" Width="131" Background="#FF3D7D95" Foreground="#FFF9F9F9" Click="PlayMusic"/>
@rmcdongit
rmcdongit / Factory.xaml
Created December 11, 2020 01:24
WPF Custom Classes
<Page x:Class="WpfApp2.Factory"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:WpfApp2"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"
Title="Factory">
@rmcdongit
rmcdongit / Construct.xaml.cs
Last active December 4, 2020 02:30
SampleWPF
using System;
using System.Collections.Generic;
using System.Linq;
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;
@rmcdongit
rmcdongit / macOS_SytemPrefs.md
Last active April 24, 2024 23:31
Apple System Preferences URL Schemes

macOS 10.15 System Preference Panes

Below are a list of System Preference pane URLs and paths that can be accessed with scripting to assist users with enabling macOS security settings without having to walk them through launching System Preferences, finding panes, and scrolling to settings. Not all panes have an accessible anchor and some are OS specific.

To find the Pane ID of a specific pane, open the System Preferences app and select the desired Preference Pane. With the pane selected, open the ScriptEditor.app and run the following script to copy the current Pane ID to your clipboard and display any available anchors:

tell application "System Preferences"
	set CurrentPane to the id of the current pane
	set the clipboard to CurrentPane