Exemplo n.º 1
0
 public HeliosBinding(IBindingTrigger trigger, IBindingAction action)
 {
     Trigger = trigger;
     Action  = action;
 }
Exemplo n.º 2
0
 private void AddAction(IBindingAction action, string device)
 {
     action.Device = device;
     Actions.Add(action);
 }
Exemplo n.º 3
0
 public HeliosBinding(IBindingTrigger trigger, IBindingAction action)
 {
     Trigger = trigger;
     Action = action;
 }
Exemplo n.º 4
0
 private new void AddAction(IBindingAction action, string device)
 {
     action.Device = device;
     Actions.Add(action);
 }
Exemplo n.º 5
0
        public void AddAction(IBindingAction action, ProfileExplorerTreeItemType includeTypes)
        {
            ProfileExplorerTreeItem actionItem = new ProfileExplorerTreeItem(action, this, includeTypes);
            if (actionItem.HasChildren || includeTypes.HasFlag(ProfileExplorerTreeItemType.Action))
            {
                if (action.Device.Length > 0)
                {
                    if (!HasFolder(action.Device))
                    {
                        Children.Add(new ProfileExplorerTreeItem(action.Device, "", this, includeTypes));
                    }

                    ProfileExplorerTreeItem deviceItem = GetFolder(action.Device);
                    actionItem.Parent = deviceItem;
                    deviceItem.Children.Add(actionItem);
                }
                else
                {
                    Children.Add(actionItem);
                }
            }
        }
Exemplo n.º 6
0
        private ProfileExplorerTreeItem(IBindingAction item, ProfileExplorerTreeItem parent, ProfileExplorerTreeItemType includeTypes)
            : this(item.ActionName, item.ActionDescription, parent, includeTypes)
        {
            _item = item;
            _itemType = ProfileExplorerTreeItemType.Action;

            //SortName = item.Name + " " + item.ActionVerb;

            if (includeTypes.HasFlag(ProfileExplorerTreeItemType.Binding))
            {

                foreach (HeliosBinding binding in item.Owner.InputBindings)
                {
                    if (binding.Action == item)
                    {
                        Children.Add(new ProfileExplorerTreeItem(binding, this, includeTypes));
                    }
                }
                item.Target.InputBindings.CollectionChanged += Bindings_CollectionChanged;                
            }
        }
Exemplo n.º 7
0
 protected void AddAction(IBindingAction action, string device)
 {
     action.Device = device;
     Actions.Add(action);
 }
Exemplo n.º 8
0
        private void AddNewBinding(IBindingTrigger trigger, IBindingAction action)
        {
            HeliosBinding binding = new HeliosBinding(trigger, action);

            if (action.ActionRequiresValue && (ConfigManager.ModuleManager.CanConvertUnit(trigger.Unit, action.Unit)))
            {
                binding.ValueSource = BindingValueSources.TriggerValue;
            }
            else
            {
                binding.ValueSource = BindingValueSources.StaticValue;
            }

            BindingAddUndoEvent undoEvent = new BindingAddUndoEvent(binding);
            undoEvent.Do();
            ConfigManager.UndoManager.AddUndoItem(undoEvent);
        }
Exemplo n.º 9
0
 private HeliosBinding CreateNewBinding(IBindingTrigger trigger, IBindingAction action)
 {
     return(CreateNewBinding(trigger, action, new BindingValue(null)));
 }