This file contains hidden or 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
| using System; | |
| using System.Collections.Generic; | |
| using System.Diagnostics.CodeAnalysis; | |
| using System.Linq; | |
| using System.Runtime.InteropServices; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| // ReSharper disable InconsistentNaming | |
| namespace RestartManager |
This file contains hidden or 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
| public static class ProcessExtensions | |
| { | |
| /// <summary> | |
| /// Get the child processes for a given process | |
| /// </summary> | |
| /// <param name="process"></param> | |
| /// <returns></returns> | |
| public static List<Process> GetChildProcesses(this Process process) | |
| { | |
| var results = new List<Process>(); |
This file contains hidden or 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
| using System.Collections.Generic; | |
| using System.IO; | |
| using System.Linq; | |
| using System.Runtime.CompilerServices; | |
| using System.Runtime.InteropServices; | |
| using System.Runtime.InteropServices.ComTypes; | |
| static class ShowSelectedInExplorer | |
| { | |
| [Flags] |
This file contains hidden or 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
| /// From https://www.codeproject.com/Tips/1231324/How-to-Get-a-Files-Encoding-with-Csharp | |
| /// <summary | |
| /// Get File's Encoding | |
| /// </summary> | |
| /// <param name="filename">The path to the file | |
| private static Encoding GetEncoding(string filename) | |
| { | |
| // This is a direct quote from MSDN: | |
| // The CurrentEncoding value can be different after the first |
This file contains hidden or 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
| using System.Runtime.InteropServices; | |
| public class FileOperationAPIWrapper | |
| { | |
| /// <summary> | |
| /// Possible flags for the SHFileOperation method. | |
| /// </summary> | |
| [Flags] | |
| public enum FileOperationFlags : ushort | |
| { |
This file contains hidden or 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
| public class AwaitableQueue<T> | |
| { | |
| private readonly ConcurrentQueue<T> _queue = new ConcurrentQueue<T>(); | |
| private long _count = 0; | |
| private readonly ConcurrentQueue<TaskCompletionSource<T>> _pending = new ConcurrentQueue<TaskCompletionSource<T>>(); | |
| /// <summary> | |
| /// Enqueue the specified item. Blocking operation. | |
| /// </summary> | |
| /// <param name="item">Item.</param> |
This file contains hidden or 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
| <Application x:Class="HelloAutofac.App" | |
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
| xmlns:local="clr-namespace:HelloAutofac"> | |
| <Application.Resources> | |
| <ResourceDictionary> | |
| <ResourceDictionary.MergedDictionaries> | |
| <ResourceDictionary> | |
| <local:MyBootStrapper x:Key="bootstrapper" /> | |
| </ResourceDictionary> |
This file contains hidden or 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
| using System; | |
| using System.Linq; | |
| using System.Diagnostics; | |
| using System.Management; | |
| namespace GetProcessList | |
| { | |
| public static class Program | |
| { | |
| static void Main(string[] args) |
This file contains hidden or 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
| public class AlignableWrapPanel : Panel | |
| { | |
| public HorizontalAlignment HorizontalContentAlignment | |
| { | |
| get { return (HorizontalAlignment)GetValue(HorizontalContentAlignmentProperty); } | |
| set { SetValue(HorizontalContentAlignmentProperty, value); } | |
| } | |
| public static readonly DependencyProperty HorizontalContentAlignmentProperty = | |
| DependencyProperty.Register("HorizontalContentAlignment", typeof(HorizontalAlignment), typeof(AlignableWrapPanel), new FrameworkPropertyMetadata(HorizontalAlignment.Left, FrameworkPropertyMetadataOptions.AffectsArrange)); |
This file contains hidden or 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
| #requires -Version 1.0 | |
| <# | |
| .SYNOPSIS | |
| Disable Office Telemetry Agent and other data collection | |
| .DESCRIPTION | |
| Disable Office Telemetry Agent and other data collection and Block Macros in files downloaded from the Internet. | |
| Makes Office less spying on us... | |
OlderNewer