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
using System; | |
namespace Ufcpp | |
{ | |
public struct Ufcpp | |
{ | |
private readonly DateTimeOffset _dateTime; | |
public Ufcpp(DateTimeOffset dateTime) | |
{ |
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
void Main() | |
{ | |
var sourcePath = Environment.ExpandEnvironmentVariables(@"%LOCALAPPDATA%\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets"); | |
var destinationPath = @"*** Your wallpaper folder ***"; | |
var sourceDirectory = new DirectoryInfo(sourcePath); | |
if (!sourceDirectory.Exists) | |
{ | |
$"Directory not found.".Dump(); | |
return; |
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
using (var client = new HttpClient()) | |
{ | |
var url = new Uri("https://api.github.com/repos/Grabacr07/KanColleViewer/releases"); | |
client.DefaultRequestHeaders.UserAgent.Add(new ProductInfoHeaderValue("Grabacr07-LINQPad", "1.0")); | |
var result = Util.Cache(() => client.GetAsync(url).Result); | |
var json = await result.Content.ReadAsStringAsync(); | |
var start = new DateTime(2015, 02, 01); | |
var end = start.AddYears(1).AddMilliseconds(-1.0); |
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
public class MainWindowViewModel : ViewModel | |
{ | |
private double _metricValue, _imperialValue; | |
public ICommand ImperialUnitToMetric { get; private set; } | |
public ICommand MetricToImperialUnit { get; private set; } | |
public MetricUnit CurrentMetricUnit { get; set; } | |
public ImperialUnit CurrentImperialUnit { 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
<Window x:Class="WpfApplication38.MainWindow" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
Width="200" | |
Height="100"> | |
<TextBox Text="{Binding SampleText}" /> | |
</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
<Window x:Class="ThumbsScrollViewer.MainWindow" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
Title="MainWindow" | |
Width="1200" | |
Height="600"> | |
<Grid> | |
<Grid.ColumnDefinitions> | |
<ColumnDefinition Width="Auto" /> | |
<ColumnDefinition Width="*" /> |
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
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var controller = new BlyncLightController(); | |
var numberOfDevices = controller.InitBlyncDevices(); | |
if (numberOfDevices == 0) return; | |
try |
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
/// <summary> | |
/// Viewbox 内に配置された要素について、実際に描画されているサイズを計算します。 | |
/// </summary> | |
public static Size GetRealSize(FrameworkElement target) | |
{ | |
var min = target.TranslatePoint(new Point(0, 0), Window.GetWindow(target)); | |
var max = target.TranslatePoint(new Point(target.ActualWidth, target.ActualHeight), Window.GetWindow(target)); | |
return (Size)(max - min); | |
} |
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
static class Extensions | |
{ | |
public static IEnumerable<T[]> ふぁぼツバめそっど<T>(this IEnumerable<T> source, Func<T, bool> predicate) | |
{ | |
var buffer = new List<T>(); | |
foreach (var value in source) | |
{ | |
if (predicate(value)) | |
{ |
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
<Grid x:Name="Bg" | |
SnapsToDevicePixels="true"> | |
<Grid.ColumnDefinitions> | |
<ColumnDefinition MaxWidth="{DynamicResource {x:Static SystemParameters.HorizontalScrollBarButtonWidthKey}}" /> | |
<ColumnDefinition Width="0.00001*" /> | |
<ColumnDefinition MaxWidth="{DynamicResource {x:Static SystemParameters.HorizontalScrollBarButtonWidthKey}}" /> | |
</Grid.ColumnDefinitions> | |
<Border BorderBrush="{TemplateBinding BorderBrush}" | |
BorderThickness="{TemplateBinding BorderThickness}" | |
Background="{TemplateBinding Background}" |
NewerOlder