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 partial class WindowEx : Window | |
{ | |
[StructLayout(LayoutKind.Sequential)] | |
public struct RECT | |
{ | |
public int left; | |
public int top; | |
public int right; | |
public int bottom; |
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 static byte[] ToByteArray<T>(this T structure) where T : struct | |
{ | |
byte[] bb = new byte[Marshal.SizeOf(typeof(T))]; | |
GCHandle gch = GCHandle.Alloc(bb, GCHandleType.Pinned); | |
Marshal.StructureToPtr(structure, gch.AddrOfPinnedObject(), false); | |
gch.Free(); | |
return bb; | |
} |
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 MainVM : BindableBase | |
{ | |
private string _Title; | |
public string Titile | |
{ | |
get { return _Title; } | |
set { SetProperty(ref _Title, value); } | |
} | |
private bool _IsVisible; |
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
var monitorfield = typeof(System.Windows.Forms.Screen).GetTypeInfo().DeclaredFields.Single(x => x.Name == "hmonitor"); | |
var Screens = System.Windows.Forms.Screen.AllScreens.Select(x => new { | |
Screen = x, | |
hmonitor = (IntPtr)monitorfield.GetValue(x) }); |
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 TransactionDispatchObservableCollection<T> : ObservableCollection<T> | |
{ | |
/// <summary> | |
/// コレクションディスパッチャー | |
/// </summary> | |
public Dispatcher Dispatch { get; set; } | |
public DispatcherPriority Priority { get; set; } = DispatcherPriority.Background; |
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
var sql = PetaPoco.Sql.Builder | |
.Select("HG.*") | |
.From("HOGE HG"); | |
.Where("HG.id = @0", 5) | |
.Where("HG.name = @Name" new { Name = "hogehoge" } ); | |
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
<Button Command="{x:Static wpf:DialogHost.OpenDialogCommand}" HorizontalAlignment="Right" Margin="5,5,30,5" DockPanel.Dock="Bottom" Style="{StaticResource MaterialDesignFloatingActionAccentButton}"> | |
<Button.CommandParameter> | |
<StackPanel Margin="16"> | |
<TextBlock>保存しますか?</TextBlock> | |
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" > | |
<Button Style="{StaticResource MaterialDesignFlatButton}" | |
IsDefault="True" | |
Margin="0 8 8 0" | |
Command="{Binding SaveCommand}" CommandParameter="{Binding Model}"> | |
保存 |
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
namespace BitConverterExtention | |
{ | |
public static class BitConverterExtention | |
{ | |
public static byte[] ToBytes(this char value) | |
{ | |
return BitConverter.GetBytes(value); | |
} | |
public static byte[] ToBytes(this bool 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
public class TimeService | |
{ | |
/// <summary> | |
// 現在時刻を取得します。 | |
/// </summary> | |
/// <returns></returns> | |
public async Task<DateTime> GetNow() | |
{ | |
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
using System; | |
using System.Linq; | |
using System.Reactive.Concurrency; | |
using System.Reactive.Linq; | |
namespace Zundoko | |
{ | |
internal class Program | |
{ | |
private const string Zun = "ズン"; |
OlderNewer