This commit is contained in:
Zihan Chen
2020-07-31 17:16:39 -07:00
parent 1e8616e5eb
commit 3bdb00fa7c
3 changed files with 17 additions and 5 deletions
@@ -12,7 +12,7 @@ using namespace vl::workflow::runtime;
namespace myapi
{
class App : public Object, public Description<Console>
class App : public Object, public Description<App>
{
public:
static WString Get()
@@ -12,7 +12,7 @@ using namespace vl::workflow::runtime;
namespace myapi
{
class App : public Object, public Description<Console>
class App : public Object, public Description<App>
{
public:
static WString Get()
@@ -12,7 +12,7 @@ using namespace vl::workflow::runtime;
namespace myapi
{
class App : public Object, public Description<Console>
class App : public Object, public AggregatableDescription<App>
{
private:
WString name;
@@ -43,6 +43,7 @@ namespace myapi
{
sub->Close();
}
FinalizeAggregation();
}
Event<void()> NameChanged;
@@ -127,15 +128,24 @@ namespace myscript
{
Name = name;
value subscription = bind($"Hello, $(this.Name)");
subscription.Open();
/* "this" is not allowed in binding, copy it to a variable */
var self = this;
var subscription = bind($"Hello, $(self.Name)");
attach(subscription.ValueChanged,
func (value: object): void
{
Print(cast string value);
});
subscription.Open();
Subscriptions.Add(subscription);
}
delete
{
Print("Destructing myscript::MyApp");
}
}
}
@@ -171,6 +181,8 @@ int main()
(
Value_xs(), WString(L"vczh")
)));
myapp->SetName(L"Vczh Libraries++");
myapp->SetName(L"Workflow");
myapp->SetName(L"Gaclib");
}