Skip to content

Instantly share code, notes, and snippets.

View tor4kichi's full-sized avatar

tor4kichi tor4kichi

View GitHub Profile
@tor4kichi
tor4kichi / SquereSizer
Last active March 24, 2025 00:19
矩形を変形するためのコントロールの試作【UWP】
## SquereSizerコントロール
矩形の変形操作をサポートしたコントロールです。
MinMaxサイズ、MinMaxエリアの中で変形します
角の部分をThumb、上下左右の線をLine、移動操作をPositionとしています。
PositionBehaviorを移動可能範囲を制御できます。Area内(InsideArea)、Areaに接地(IntersectArea)、無制限(Free)。
FrameworkElementのプロパティを使って制御する部分
* Width/Height
@tor4kichi
tor4kichi / i18nPortable GAS script.md
Created August 30, 2024 08:21
翻訳用スクリプト for i18nPortable【Google App Script】

使い方

  1. Google スプレッドシートのApp Scriptを開いて translate.gs のコードを貼り付ける
  2. スプレッドシートの先頭行に以下のような形で言語名を記述する
key👇 lang👉 ja-JP zh-CHS en-US

スプレッドシートの2行目以降に翻訳テキストを追加していく

<UserControl x:Class="Starryboard.Views.Controls.ScreenCapturePlayer"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Starryboard.Views.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignHeight="300"
d:DesignWidth="400"
xmlns:canvas="using:Microsoft.Graphics.Canvas.UI.Xaml">
@tor4kichi
tor4kichi / VirtualAnalogPad.xaml
Last active March 6, 2024 13:24
UWPで仮想アナログパッド、バーチャルスティックを実装
<UserControl
x:Class="Starryboard.Views.Controls.VirtualAnalogPad"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Starryboard.Views.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignHeight="300"
d:DesignWidth="400">
@tor4kichi
tor4kichi / ListViewExtensions_RealizedCollection.cs
Created December 16, 2023 00:55
ListView/GridViewで表示範囲のItemVMのみを列挙する
#nullable enable
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
@tor4kichi
tor4kichi / CustomPaneBackgroundColorResourceDictionary.xaml
Last active October 1, 2022 09:46
[UWP] How to set NavigationView pane background color.
<ResourceDictionary>
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Light">
<SolidColorBrush x:Key="NavigationViewTopPaneBackground" Color="{ThemeResource SystemChromeMediumColor}" />
<SolidColorBrush x:Key="NavigationViewExpandedPaneBackground" Color="{ThemeResource SystemChromeMediumColor}" />
<SolidColorBrush x:Key="ApplicationContentBackgroundBrush" Color="{ThemeResource SystemChromeMediumLowColor}" />
</ResourceDictionary>
<ResourceDictionary x:Key="Dark">
<SolidColorBrush x:Key="NavigationViewTopPaneBackground" Color="{ThemeResource SystemChromeMediumColor}" />
@tor4kichi
tor4kichi / DataContextPropagationToFlyoutChild.cs
Created August 1, 2021 09:04
【UWP】フライアウトの子要素のDataContextにクリックした位置のUI要素のContent/DataContextを突っ込むカスタム添付プロパティ
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
namespace NicoVideoSnapshotSearchAssistanceTools.Presentation.Views.Interactions
@tor4kichi
tor4kichi / support-i18n.js
Created August 17, 2020 01:36
Googleスプレッドシート向けの翻訳作業補助スクリプト
const OUTPUT_FOLDER_ID = "PUT_HERE_YOUR_GOOGLE_DRIVE_FOLDER_ID";
function onOpen() {
const ui = SpreadsheetApp.getUi(); // Uiクラスを取得する
const menu = ui.createMenu('Translation Tools'); // Uiクラスからメニューを作成する
menu.addItem('全ての言語コードをkvpテキストとして出力', 'ExportCurrentLocalizeSheet'); // メニューにアイテムを追加する
menu.addItem('現在の行の未翻訳列を仮翻訳(ja-JPを参照)', 'KariTranslationCurrentColumn'); // メニューにアイテムを追加する
menu.addItem('選択中セル全てを仮翻訳(ja-JPを参照)', 'KariTranslationSelectedCells'); // メニューにアイテムを追加する
menu.addToUi(); // メニューをUiクラスに追加する
@tor4kichi
tor4kichi / 2020-06-07.md
Last active March 13, 2023 09:53
ニコ生 配信情報WebSocketの雑なまとめ

配信の基本情報の取得

送信: {"type":"startWatching","data":{"stream":{"quality":"high","protocol":"hls","latency":"low","chasePlay":false},"room":{"protocol":"webSocket","commentable":true},"reconnect":false}}

受信: {"type":"statistics","data":{"viewers":4,"comments":0,"adPoints":0,"giftPoints":0}}

受信:

@tor4kichi
tor4kichi / BindableBase.cs
Last active January 11, 2020 08:04
スレッドセーフなBindableBaseのつもり(UWPでシングルトンなModelのObservePropertyを複数ウィンドウにまたがって可能にしたかったやつ)
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Threading;
namespace NicoPlayerHohoema.FixPrism
{
/// <summary>
/// Implementation of <see cref="INotifyPropertyChanged"/> to simplify models.