Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
MicroThreadEnumerator.cs
Go to the documentation of this file.
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5 
6 using SiliconStudio.Paradox;
7 using SiliconStudio.Paradox.Games.MicroThreading;
8 
9 using SiliconStudio.Paradox.Games.ViewModel;
10 
11 namespace ScriptTest
12 {
14  {
15  private ViewModelContext selectedEntitiesContext;
16 
17  public MicroThreadEnumerator(ViewModelContext selectedEntitiesContext)
18  {
19  this.selectedEntitiesContext = selectedEntitiesContext;
20  }
21 
22  public void GenerateChildren(ViewModelContext context, IViewModelNode viewModelNode, ref bool handled)
23  {
24  if (viewModelNode.NodeValue is MicroThread)
25  {
26  viewModelNode.Children.Add(new ViewModelNode("Id", new PropertyInfoViewModelContent(new ParentNodeValueViewModelContent(), typeof(MicroThread).GetProperty("Id"))));
27  viewModelNode.Children.Add(new ViewModelNode("Name", new PropertyInfoViewModelContent(new ParentNodeValueViewModelContent(), typeof(MicroThread).GetProperty("Name"))));
28  viewModelNode.Children.Add(new ViewModelNode("ScriptName",
29  LambdaViewModelContent<string>.FromParent<MicroThread>(x => x.Get(ScriptManager.ScriptEntryProperty).TypeName)));
30 
31  viewModelNode.Children.Add(new ViewModelNode("EventOpen", new RootViewModelContent((ExecuteCommand)((viewModel2, parameter) =>
32  {
33  selectedEntitiesContext.ViewModelByGuid.Clear();
34  selectedEntitiesContext.Root = selectedEntitiesContext.GetModelView(viewModel2.Parent.NodeValue);
35  }))));
36  handled = true;
37  }
38  }
39  }
40 }
void GenerateChildren(ViewModelContext context, IViewModelNode viewModelNode, ref bool handled)
MicroThreadEnumerator(ViewModelContext selectedEntitiesContext)