From 0f7d6f3d2e3eb47b03943ceb1633932708dd3be9 Mon Sep 17 00:00:00 2001 From: Andy Svintsitsky Date: Wed, 1 Dec 2021 17:04:26 -0500 Subject: [PATCH] Add external help file --- src/Legislator-help.xml | 520 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 520 insertions(+) create mode 100644 src/Legislator-help.xml diff --git a/src/Legislator-help.xml b/src/Legislator-help.xml new file mode 100644 index 0000000..b848472 --- /dev/null +++ b/src/Legislator-help.xml @@ -0,0 +1,520 @@ + + + + + event + event + + + event declaration in Legislator. + + + + The following event declaration in Legislator: + +interface ICar { + event EventHandler[EventArgs] EngineStarted +} + + + + + + event + + TypeName + String + + String + + + None + + + EventName + String + + String + + + None + + + Option + String + + String + + + None + + + + + + EventName + String + + String + + + None + + + Option + String + + String + + + None + + + TypeName + String + + String + + + None + + + + + + None + + + + + + + + + + System.Object + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + PS C:\> interface ICar { + event EventHandler[EventArgs] EngineStarted +} + + is equivalent of C#: + +interface ICar +{ + event EventHandler<EventArgs> EngineStarted; +} + + + + + + + + interface + interface + + + A Legislator-generated interface starts with the interface command. It takes two positional mandatory parameters - a name and a scriptblock containing the interface declaration. + + + + A Legislator-generated interface starts with the interface command. It takes two positional mandatory parameters - a name and a scriptblock containing the interface declaration: + + interface IName { + + } + + + + + + interface + + Name + + {{ Fill Name Description }} + + String + + String + + + None + + + Definition + + {{ Fill Definition Description }} + + ScriptBlock + + ScriptBlock + + + None + + + Implements + + {{ Fill Implements Description }} + + Type[] + + Type[] + + + None + + + PassThru + + {{ Fill PassThru Description }} + + + SwitchParameter + + + False + + + + + + Definition + ScriptBlock + + ScriptBlock + + + None + + + Implements + Type[] + + Type[] + + + None + + + Name + String + + String + + + None + + + PassThru + SwitchParameter + + SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.Object + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + PS C:\> interface "ITest$((New-Guid) -replace '\W')" { + method int IsEmpty ([string]) + } + + + + + + method + method + + + This example: + +interface IWell { + method void DropCoin([Coin]) +} + + + + This example: + +interface IWell { + method void DropCoin([Coin]) +} + + + + method + + TypeName + String + + String + + + None + + + MethodName + String + + String + + + None + + + ParameterTypes + Type[] + + Type[] + + + None + + + + + + MethodName + String + + String + + + None + + + ParameterTypes + Type[] + + Type[] + + + None + + + TypeName + String + + String + + + None + + + + + + None + + + + + + + + + + System.Object + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + PS C:\> interface IWell { + method void DropCoin([Coin]) +} + +is equivalent to the following in C#: + +interface IWell +{ + void DropCoin(Coin c); +} + + + + + + + property + property + + + Property declarations in Legislator look like implicit properties in C#, prefixed with keyword property. + + + + Property declarations in Legislator look like implicit properties in C#, prefixed with keyword property. + + + + property + + TypeName + String + + String + + + None + + + PropertyName + String + + String + + + None + + + Option + + ReadOnly + + String + + String + + + None + + + + + + Option + String + + String + + + None + + + PropertyName + String + + String + + + None + + + TypeName + String + + String + + + None + + + + + + None + + + + + + + + + + System.Object + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + PS C:\> interface IPoint { + property int X + property int Y +} + + is equivalent to the following interface definition in C#: + +interface IPoint +{ + int X + { + get; + set; + } + int Y + { + get; + set; + } +} + + + + + + + \ No newline at end of file