From cffec66fc9eb4b1d5d89ca850e2c5504086e50bb Mon Sep 17 00:00:00 2001 From: Zihan Chen Date: Sun, 1 Jan 2017 11:38:01 -0800 Subject: [PATCH] Update TODO.md --- Import/TODO.md | 154 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 154 insertions(+) diff --git a/Import/TODO.md b/Import/TODO.md index 627b6fc9..0aa4fa27 100644 --- a/Import/TODO.md +++ b/Import/TODO.md @@ -27,6 +27,16 @@ * **TabTemplate**.(Header|Dropdown|Menu|MenuItem)Template * GacGen.exe * Add G4, Retire G2 [(reference)](http://www.gaclib.net/#~/Tutorial) + * Regenerate G2 tutorials using G4 + * **HelloWorlds**: CppXml, MVVM + * **Layout**: Alignment, Flow, Stack, Table, TableSplitter, RichTextEmbedding + * **Controls**: ContainersAndButtons, TextEditor, ColorPicker, AddressBook + * **ControlTemplates**: BlackSkin + * **Xml**: + * Binding_(Bind|Eval|Format|Uri|ViewModel) + * Event_(Cpp|Script|ViewModel) + * Instance_(Control|WIndow|MultipleWindows) + * Member_(Field|Parameter|Property) ## Wait For A Few Releases * GacUI Resource @@ -50,9 +60,153 @@ * InstanceStyle:Replace * Visual State, State Machine, Animation * ev.Event-(eval|async|delayed) + * ``, ``, ``, `` + * Non-standard event handler name: `arg1`, `arg2`, ... + * Instead of `1`, `2`, ... * GacUI * Make ItemSource from constructor argument to property * Embedded Languages: Colorizer, AutoComplete * Abstract Graphics API * Chart, Ribbon, Dock Container * GacStudio.exe + +## Proposal (Workflow State Machine) + +### Goal +To implement +* Async operations +* Delayed operations +* State machine (visual state, animation) + +### State Machine Interface +``` +namespace system +{ + interface IStateMachine + { + func Start() : void; /* Call to restart, will raise exception during execution */ + func Stop(ex : string) : void; /* Call to stop, will raise exception if not started. */ + + func GetIsExecuting() : bool; + event IsExecutingChanged(); + prop IsExecuting : bool {GetIsExecuting : IsExecutingChanged} + + event OnError(Exception^); /* The current step goes wrong and continue to wait for more inputs */ + event OnFatal(Exception^); /* The whole state machine goes wrong and has to stop */ + event OnStart(); + event OnExit(); + } +} +``` + +### Syntax +``` +stateinput (, ...); +raise statefatal "exception"; /* stop the state machine with a fatal error */ +raise stateerror "exception"; /* redo the current stateinput statement with an error, only available in stateinput statement */ +return; /* stop the state machine normally */ + +/* wait until received expected input */ +stateinput +{ + case (, ...): + { + + } + default: + { + ... + } +} +``` + +### Sample (Workflow Script) +``` +module test; +using system::*; +using presentation::controls::Gui*; + +interface ICountDown : IStateMachine +{ + stateinput BeginCountDown(); + /* Equivalent to */ + func BeginCountDown() : void; + func GetBeginCountDownEnabled() : bool; + event BeginCountDownEnabledChanged() : bool; + prop BeginCountDownEnabled : bool {GetBeginCountDownEnabled : BeginCountDownEnabledChanged} + + stateinput CountDown(); + stateinput DoNotCall(); + + event OnRemains(int); +} +``` + +### Sample (Xml) +```xml + + + + + + + + + + + + + + + + 0) + { + stateinput + { + case CountDown(): + { + remains = remains - 1; + } + /* + Automatically updated before waiting: + BeginCountDownEnabled = false; + CountDownEnabled = true; + DoNotCallEnabled = false; + */ + } + } + } + } + ]]> + + +```