More Related Content Similar to Visual studio 2015 update1 ctpとcsi
Similar to Visual studio 2015 update1 ctpとcsi (20) More from Tadahiro Ishisaka
More from Tadahiro Ishisaka (20) Visual studio 2015 update1 ctpとcsi3. VisualStudio 2015 Update1
CTP
10/9(JPT)にリリースされました
バグ修正&機能追加
Windows Store向けコンパイルオプション(/BigObj)の追加
C# Interactive Window
C#のREPL環境
VSOでのプルリクエストがTeam Explorerで作成可能に
など
3
4. C# Interactive Window
VisualStudio 2015内のサブウインドウ
C#のREPL(Read–eval–print loop)環境
C#のコードをスクリプトとして実行できる
C#のコードを対話的に実行できる
外部のアセンブリを参照可能
外部のスクリプトを読み込むことも可能
インテリセンスが使える
Windowの中でawaitをちゃんと待つ
IEnumerableの中身は表示してくれる
イミディエイトウインドウのようにすぐにIDEやデバッ
ガの操作ができる訳ではなさそう
基本的にコードの確認用か?
4
6. 対話環境のコマンド
C#のディレクティブを使って実現している
#help
ヘルプ
#r
アセンブリへのリファレンスの追加
#r "path/MyAssembly.dll“
#r "System.Collections.Generic“
#load
スクリプト(.csx)の読込
#clear or #cls
画面消去
#reset
対話環境のリセット
•#r "path/MyAssembly.dll"
6
10. Linq
> using System.Collections.Generic;
> List<int> mylist = new List<int> { 4, 7, 2, 5, 0, 6 };
mylist List<int>(6) { 4, 7, 2, 5, 0, 6 }
> mylist.Where(x => x % 2 == 0)
Enumerable.WhereListIterator<int> { 4, 2, 0, 6 }
> mylist.Average()
4
>
10
11. async/await
> using System.Threading.Tasks;
> async Task<DateTime> CountToAsync(int num = 10)
. {
. for (int i = 0; i < num; i++)
. {
. await Task.Delay(TimeSpan.FromSeconds(1));
. }
.
. return DateTime.Now;
. }
> await CountToAsync()
[10/7/2015 2:38:24 PM]
>
11