Skip to content

Instantly share code, notes, and snippets.

@KatsuYuzu
KatsuYuzu / webapi-client.ts
Last active April 23, 2016 07:37
ASP.NET WebAPI 体験記 #clrh99 で話した割り切り WebAPI に対応したクライアント自動生成 T4
/* tslint:disable */
namespace App.WebApi {
"use strict";
//#region infrastructure
angular.module("webApiClient", [])
.provider("webApiClientHandler", [function () {
@KatsuYuzu
KatsuYuzu / tslint.json
Last active January 19, 2016 07:04
好みの tslint.json(Web Essentials 2.5.4時点のすべての rules)
// added and custom from Web Essentials 2.5.4 default
{
"rules": {
"ban": [
true,
[ "_", "extend" ],
[ "_", "isNull" ],
[ "_", "isDefined" ]
],
"class-name": true,
@KatsuYuzu
KatsuYuzu / MyTriggerBehavior.cs
Last active January 1, 2016 11:09
Windows ストアアプリの独自のTriggerBehaviorサンプル。
using Microsoft.Xaml.Interactivity;
using System;
using Windows.ApplicationModel;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Markup;
namespace App1
{
[ContentProperty(Name = "Actions")]
@KatsuYuzu
KatsuYuzu / BindToApplicationBarIconButtonBehavior.cs
Created December 17, 2013 17:29
Windows PhoneのApplication Barのバインディングサンプル。長くなるのでコマンドは省略。コマンドはprismのソースを参照するとよいです。
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;
using System.Windows.Interactivity;
@KatsuYuzu
KatsuYuzu / CounterViewModel.vb
Created December 7, 2013 05:43
C#からの変換依頼
Imports System.Windows.Input
Imports System.ComponentModel
Namespace CounterApp_CS
Public NotInheritable Class CounterViewModel
Implements INotifyPropertyChanged
Public Sub New()
counter_ = New CounterComponent.Counter()
@KatsuYuzu
KatsuYuzu / log4netSample.cs
Last active December 17, 2015 23:38
logn4etの動作サンプル
// AssemblyInfo.cs
// [assembly: log4net.Config.XmlConfigurator(Watch = true)]
// App.config
// <configSections>
// <section name="log4net"
// type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
// </configSections>
// <log4net>
// <appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender">
# アプリケーションのプライバシーポリシー
このアプリケーションは、個人情報を収集したり公開しません。
--------------------------------------------------------------------------
# Application privacy policy
This application does not collect or publish any personal information.
@KatsuYuzu
KatsuYuzu / Global.asax.cs
Last active December 16, 2015 17:20
ASP.NET MVC カスタムモデルバインダー
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
using WebApplication.Common;
namespace WebApplication
{
public class MvcApplication : System.Web.HttpApplication
{
protected void Application_Start()
using Microsoft.Expression.Interactivity;
using Microsoft.Phone.Controls;
using System.Windows;
using System.Windows.Interactivity;
namespace KatsuYuzu.Interactivity
{
/// <summary>
/// ページの向きを基に状態を切り替えます。
/// </summary>
@KatsuYuzu
KatsuYuzu / jQuery.Validation.Unobtrusive.d.ts
Created February 28, 2015 16:43
Type definitions for jQuery.Validation.Unobtrusive
// Type definitions for jQuery.Validation.Unobtrusive
interface UnobtrusiveValidator {
options: any;
}
interface Validator {
unobtrusive: UnobtrusiveValidator;
}