private void AddAction(FPAction action) { TreeViewItem item = new TreeViewItem(); item.Margin = new Thickness(0, 5, 0, 0); item.Header = GetActionButton(action.Name, action.HexColor, action.Icon, action.Click); tree_actions.Items.Add(item); //TalkTo person = new TalkTo(new Person() { Name = "a" }, new Person() { Name = "b" }); //person.Name = "Test"; //object instance = Activator.CreateInstance(person.GetType(), new object[] { new Person() { Name = "c" }, new Person() { Name = "d" } }); //Console.WriteLine(":" + person.Name); //Console.WriteLine(":" + ((TalkTo)instance).First.Name); }
//- Actions private void LoadTabActions() { img_action_header.Source = Images.IconQuestionmark; tree_actions.Items.Clear(); SortList <FPAction> legit = new SortList <FPAction>(); foreach (Type action_type in Engine.Game.EveryAction) { object[] args = new object[] { Engine.CurrentPerson, Person }; FPAction fp_action = Engine.CreateClass <FPAction>(action_type, args); if (fp_action.Condition()) { legit.Add(fp_action, fp_action.IndexPosition); } } foreach (FPAction action in legit.Get()) { AddAction(action); } }