Example #1
0
        public EditWidgetBehaviorSet()
        {
            InitializeComponent();

            EnabledBehaviorsListBox.ItemCheck += (e, args) =>
            {
                RefreshTimer.Enabled = true;
                if (EditingSet != null)
                {
                    var  behavior    = EnabledBehaviorsListBox.Items[args.Index] as Behavior;
                    bool enabled     = EditingSet.EnabledBehaviors.Contains(behavior);
                    bool makeEnabled = (args.NewValue == CheckState.Checked);

                    if (makeEnabled)
                    {
                        EditingSet.EnabledBehaviors.Add(behavior);
                    }
                    else
                    {
                        EditingSet.EnabledBehaviors.Remove(behavior);
                    }


                    if (enabled != makeEnabled)
                    {
                        EditingProject.MarkDirty();
                    }
                }
            };

            BehaviorScoresListView.MouseDoubleClick += (e, args) =>
            {
                var item = BehaviorScoresListView.GetItemAt(args.Location.X, args.Location.Y);
                if (item == null)
                {
                    return;
                }

                AutoNavigationRequested?.Invoke(item.Tag as Behavior);
            };
        }
 internal void AutoNavigationRequestedFromChild(Behavior behavior)
 {
     AutoNavigationRequested?.Invoke(behavior);
 }