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.Diagnostics; | |
using System.Windows.Forms; | |
using Run.OvO.Code.CommandBroker.Input.Win32; | |
namespace Run.OvO.Code.CommandBroker.Input | |
{ | |
partial class MainForm : Form | |
{ | |
private WinEventHook WinEventHook; |
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
param ( $TemplateFile, $Destination, $Styles, $Values ) | |
$ErrorActionPreference = 'Stop' | |
$TemplateFile = 'C:\Users\Administrator\Desktop\Source.xlsx' | |
$Destination = 'C:\Users\Administrator\Desktop\Output.xlsx' | |
$Styles = ' | |
{ | |
"マイ シート": { | |
"MyArea1": "Variable1", |
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; | |
namespace kuchikios.Qiita | |
{ | |
public static class EnumerableEx | |
{ | |
public static IEnumerable<TValue[ ]> Split<TValue>( this IEnumerable<TValue> source, int blockCount, bool includeLastFractionBlock = false ) | |
{ | |
if ( default( IEnumerable<TValue> ) == source ) throw new ArgumentNullException( "source", "参照がありません" ); |
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; | |
namespace Samples | |
{ | |
public static class GenericsExtensions | |
{ | |
public static TValue MinMax<TValue>( TValue arg, TValue min, TValue max ) | |
where TValue : IComparable<TValue> | |
{ | |
return Min( min, Max( max, arg ) ); |
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
/// <summary> | |
/// <paramref name="value"/>を<paramref name="min"/>以上<paramref name="max"/>以下に修正した値を返します | |
/// </summary> | |
/// <typeparam name="TValue"><paramref name="value"/>の比較に使用される、<see cref="IComparable"/>を継承する型</typeparam> | |
/// <param name="value">比較値</param> | |
/// <param name="min">下限値</param> | |
/// <param name="max">上限値</param> | |
/// <returns><paramref name="value"/>が<paramref name="min"/>より小さい場合は<paramref name="min"/>、<paramref name="value"/>が<paramref name="max"/>より大きい場合は<paramref name="max"/>、それ以外の場合は<paramref name="value"/></returns> | |
/// <exception cref="ArgumentOutOfRangeException"><paramref name="max"/>は<paramref name="min"/>よりも大きい必要があります</exception> | |
public static TValue Clamp<TValue>( this TValue value, TValue min, TValue max ) |
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
/// <summary> | |
/// <paramref name="value"/>が<paramref name="min"/>と同じ又は大きく、<paramref name="max"/>と同じ又は小さいかどうかを示す値を返します | |
/// </summary> | |
/// <typeparam name="TValue">比較に使用される型</typeparam> | |
/// <param name="value">比較値</param> | |
/// <param name="min">下限値</param> | |
/// <param name="max">上限値</param> | |
/// <returns><paramref name="value"/>が<paramref name="min"/>と同じ又は大きく、<paramref name="max"/>と同じ又は小さい場合はtrue、それ以外の場合はfalse</returns> | |
/// <exception cref="ArgumentOutOfRangeException"><paramref name="max"/>は<paramref name="min"/>よりも大きい必要があります</exception> | |
public static bool Between<TValue>( this TValue value, TValue min, TValue max ) |
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
static void Swap<TValue>( ref TValue a, ref TValue b ) | |
{ | |
var c = a; a = b; b = c; | |
} |