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.ComponentModel; | |
using System.Linq; | |
using Metasequoia; | |
using Metasequoia.Sharp; | |
namespace YourNameSpace | |
{ | |
[DisplayName("StationSample\tCopyright (C) 2016, your name")] // プラグイン一覧に表示する情報 | |
[StationPlugin(0xAB86CB1E, 0x0E94E0BC, "Station サンプル")] // 作者 ID, プラグイン ID, 項目名 |
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.ComponentModel; | |
using System.Runtime.InteropServices; | |
using System.Security; | |
namespace Linearstar.Lavis.Interop | |
{ | |
public class XInput | |
{ | |
const string XInputLibrary = "XINPUT9_1_0"; |
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
// usage: | |
// | |
// Model のコレクションの変化を自動的に反映する ViewModel コレクションを作成 | |
// ObservableCollectionWrapper.Create(modelCollection, (Model m) => new ViewModel(m)) | |
// | |
// 任意の ViewModel 側コレクションを Model コレクションに同期させる | |
// ViewModel コレクションへの操作を Model 側に反映させることもできる (Caliburn.Micro での Conductor の Items に使用するなど) | |
// ObservableCollectionWrapper.Create(modelCollection, viewModelCollection, (Model m) => new ViewModel(m), vm => vm.Model) | |
using System; | |
using System.Collections; |
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.ComponentModel; | |
using System.Diagnostics; | |
using System.Linq; | |
namespace Sudo | |
{ | |
class Program | |
{ | |
static void Main(string[] args) |
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.Collections.Generic; | |
using System.IO; | |
using System.IO.Pipes; | |
using System.Linq; | |
using System.Runtime.InteropServices; | |
using System.Security; | |
using System.Text; | |
using System.Threading; |
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
see https://github.com/mfakane/Megalopolis/wiki/API |
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
Megalith API | |
読み込みに関すること | |
文字コードは Shift_JIS | |
各種 txt や dat ファイルはローカルにキャッシュを持ち HTTP の If-Modified-Since を利用することを推奨。 | |
/settings.ini | |
設定である。 | |
PHP コードではあるが用いられている構文は多くないので、各自適当にパース。 |
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.Collections.Generic; | |
using System.Text; | |
using System.Net; | |
using System.Collections.Specialized; | |
using System.IO; | |
using System.Text.RegularExpressions; | |
using System.Threading; | |
namespace Royal.Selena |
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
1. C# を組み込みスクリプトにできるのか | |
場合による。 | |
基本的にホストが .NET 上で動くものであればそれほど難しくはないが、ネイティブから呼び出すにはいくらか変則的な手法を用いる必要がある。これについては後述。 | |
C# の実行時コンパイルにより動的にコードを実行する手法はよく見られ、.NET のライブラリにそのための機能は存在する。 | |
コンパイルして生成された dll (.NET アセンブリ, Assembly) を動的に読み込み呼び出すことで既存のコンテキストでコードを実行できる。 | |
また、最近では Microsoft の "Roslyn" や、Mono の Mono.CSharp.dll などコンパイラをサービスとして公開することでスクリプト的な使用方法をより簡単にする動きがある。 | |
ただし、C# はスクリプト言語ではない。 | |