ここでは単純な例を使用し、派生クラスからも発生させることができるように基底クラスでイベントを宣言する標準的な方法について説明します。 このパターンは、.NET クラス ライブラリの Windows フォーム クラスで広く使用されています。 他のクラスの基底クラスとして使用できるクラスを作成するときは、イベントは宣言元のクラス内からしか呼び出せない特別な種類のデリゲートであることを考慮する必要があります。 派生クラスは、基底クラスの中で宣言されたイベントを直接呼び出せません。 常に基底クラスからイベントを発生させるようにすると便利な場合もありますが、ほとんどの場合、派生クラスで基底クラス イベントを呼び出せるようにするべきです。 そのために、イベントをラップする基底クラスで、保護された呼び出しメソッドを作成できます。 この呼び出しメソッドを呼び出すかオーバーライドすることによって、派生クラス
async-awaitベースの非同期処理を制御する方法をまとめました。コードはわざと冗長に書いています。 概要: Taskベースのワーカースレッド生成 他の非同期I/Oと連携してタスクを制御する方法 TaskとLINQを応用して、多量の計算を安全に並列実行させる方法 Taskを使っていない非同期処理をTask化する方法 非同期処理のキャンセルの実現方法 WinRT・ユニバーサルWindowsアプリケーション(UWP)での非同期処理とTaskの連携方法 読む前に補足 C#でTaskやasync-awaitを使った非同期処理の書き方を探しているのであれば、ポイントに絞って書いた、こちらの記事をお勧めします: 「できる!C#で非同期処理(Taskとasync-await)」 Taskクラスの使用例として、ワーカースレッドを起動するという例が良く挙げられます。本記事も最初にTask.Runによるワ
1.1 Hello Qt!¶ 最初は画面にHello Qt!と表示するプログラムを作ることにします。 まずは何も考えず次のソースコードを入力し、実行できるかどうかのテストをしてみてください。 #include <QApplication> #include <QLabel> int main(int argc, char** argv) { QApplication app(argc, argv); QLabel* label = new QLabel("Hello Qt!"); label->show(); return app.exec(); }
using SQLite with Entity Framework 6 and the Repository Pattern In this post, a Data access layer is implemented using the repository pattern together with entity Framework 6 and SQLite as a database. The post continues on from Getting started, using SQLite with .NET UPDATE 02.03.2014: Using the new SQLite version 1.0.91.3 now with the SQLite provider. The xml app configuration needs to be changed
System.Data.SQLite を導入する SQLite の ADO.NET アダプタである、System.Data.SQLite。 単なるラッパではなく、SQLite 自体もパッケージに持っているので、別途 SQLite をパッケージに含めなくても良いのが利点。 しかも、ライセンスが Public Domain であるのが、非常に使い勝手が良い。 詳しくは System.Data.SQLite の 著作権表記 を読んでほしいが、"System.Data.SQLite.Linq" と "System.Data.SQLite.EF6" については、ソースコードの一部が Ms-PL ライセンスとなっている。 Ms-PL ライセンスとなっている SQL Generation ディレクトリ のソースは、public domain と明示されているものをのぞくと、すべて copyright (
The WPF code sample below demonstrates how to write applications that use SQLite as a database with Entity Framework 6 using code first approach. Introduction SQLite is the compact database system used by client applications to manage local data. SQLite is lightweight and easy to use. Why SQLite In SQLite, the database engine and the interface are combined into a single library and SQLite DB store
C#とEntity FrameworkでSQLiteを使う(Entity Framework実践編) 2012/6/29 2012/7/2 .NET ADO.NET Entity Frameworkを使って、SQLiteにアクセスできるよう設定する手順を紹介します。 .NETからSQLiteのアクセスに必要なライブラリであるSystem.Data.SQLiteのインストールは C#とEntity FrameworkでSQLiteを使う(System.Data.SQLiteインストール編) をご覧ください。 これによって、O/Rマッピングが行なわれ、SQL文を一切記述することなくSQLiteの読み書きができるようになります。
Select OK to create the project. Set up the site style A few simple changes will set up the site menu, layout, and home page. Open Views\Shared\_Layout.cshtml, and make the following changes: Change each occurrence of "My ASP.NET Application" and "Application name" to "Contoso University". Add menu entries for Students, Courses, Instructors, and Departments, and delete the Contact entry. The chang
by Rick Anderson This tutorial shows you how to build an ASP.NET MVC 5 web application that enables users to log in using OAuth 2.0 with credentials from an external authentication provider, such as Facebook, Twitter, LinkedIn, Microsoft, or Google. For simplicity, this tutorial focuses on working with credentials from Facebook and Google. Enabling these credentials in your web sites provides a si
連載最終回、いよいよAzureにデプロイして定期的にPVをつぶやくよう設定します。 連載目次 はじめに 第1回 Google Analytics APIの利用準備 第2回 Google AnalyticsからPVを取得する 第3回 Twitter APIの利用準備 第4回 Twitterに投稿する 第5回 Webアプリケーションにまとめる 最終回 Azureへのデプロイ Azureポータルにログイン 新しいAzureポータルにログインします。 Microsoft Azure 新しいWeb Appの作成と設定 画面左上の「新規」ボタンを押すと、作成する機能の一覧が表示されますので「Web + モバイル」-「Web App」を選択します。 Web Appの作成画面では適当にURLを指定します。 App Serviceプラン、リソースプランも適当に、価格レベルは一番安いB1 Basicを選択しま
C# の WPF を利用して、タスクトレイに常駐するアプリケーションのひな形を開発してみます。 チュートリアルに近い形で順を追って作成できるようにしてみました。 概要 ここでは、タスクトレイ常駐アプリとして最低限と思われる以下の機能を実装します。 実装機能 タスクトレイに「常駐アプリのアイコン」を表示する 「常駐アプリアイコン」を右クリックでコンテキストメニューを表示する コンテキストメニューには以下の項目が表示される 表示 終了 コンテキストメニュー「表示」をクリックでウィンドウが立ち上がる コンテキストメニュー「終了」で常駐アプリを終了する 実行イメージ プロジェクト の 作成 プロジェクト自体は特に気にすることはなく、ウィザードに従って "WPFアプリケーション" のプロジェクトを作成します。
管理者のブラウザーで連絡先を作成します。 管理者の連絡先から、削除と編集の URL をコピーします。 これらのリンクをテスト ユーザーのブラウザーに貼り付け、テスト ユーザーがこれらの操作を行えないことを確認します。 スターター アプリを作成する "ContactManager" という Razor Pages アプリを作成します。 [個人のユーザー アカウント] を使ってアプリを作成します。 名前空間がサンプルで使われている名前空間と一致するように、"ContactManager" という名前を付けます。 -uld により、SQLite ではなく LocalDB が指定されています。 dotnet new webapp -o ContactManager -au Individual -uld Models/Contact.cs: secure-data\samples\starter6
Removal of "Learn Python in Y Minutes" from free-programming-books.md and addition to free-programming-cheatsheets.md Co-authored-by: Eric Hellman <eric@hellman.net> Index ABAP Ada Agda Alef Android APL Arduino ASP.NET Assembly Language Non-X86 AutoHotkey Autotools Awk Bash Basic BETA Blazor C C# C++ Chapel Cilk Clojure COBOL CoffeeScript ColdFusion Component Pascal Cool Coq Crystal CUDA D Dart DB
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く