public ProfileExplorerTreeItem(HeliosProfile profile, ProfileExplorerTreeItemType includeTypes) : this(profile.Name, "", null, includeTypes) { _item = profile; _itemType = ProfileExplorerTreeItemType.Profile; if (includeTypes.HasFlag(ProfileExplorerTreeItemType.Monitor)) { ProfileExplorerTreeItem monitors = new ProfileExplorerTreeItem("Monitors", profile.Monitors, this, includeTypes); if (monitors.HasChildren) { Children.Add(monitors); } } if (includeTypes.HasFlag(ProfileExplorerTreeItemType.Interface)) { ProfileExplorerTreeItem interfaces = new ProfileExplorerTreeItem("Interfaces", profile.Interfaces, this, includeTypes); if (interfaces.HasChildren) { Children.Add(interfaces); } profile.Interfaces.CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(Interfaces_CollectionChanged); } }
private ProfileExplorerTreeItem(HeliosVisual visual, ProfileExplorerTreeItem parent, ProfileExplorerTreeItemType includeTypes) : this(visual.Name, "", parent, includeTypes) { if (visual.GetType() == typeof(Monitor)) { _itemType = ProfileExplorerTreeItemType.Monitor; } else if (visual.GetType() == typeof(HeliosPanel)) { _itemType = ProfileExplorerTreeItemType.Panel; } else { _itemType = ProfileExplorerTreeItemType.Visual; } _item = visual; AddChild(visual, includeTypes); foreach (HeliosVisual child in visual.Children) { if ((child is HeliosPanel && _includeTypes.HasFlag(ProfileExplorerTreeItemType.Panel)) || (child is HeliosVisual && _includeTypes.HasFlag(ProfileExplorerTreeItemType.Visual))) { Children.Add(new ProfileExplorerTreeItem(child, this, _includeTypes)); } } visual.Children.CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(VisualChildren_CollectionChanged); }
public ProfileExplorerTreeItem(HeliosProfile profile, ProfileExplorerTreeItemType includeTypes) : this(profile.Name, "", null, includeTypes) { _item = profile; _itemType = ProfileExplorerTreeItemType.Profile; if (includeTypes.HasFlag(ProfileExplorerTreeItemType.Monitor)) { ProfileExplorerTreeItem monitors = new ProfileExplorerTreeItem("Monitors", profile.Monitors, this, includeTypes); if (monitors.HasChildren) { Children.Add(monitors); } } if (includeTypes.HasFlag(ProfileExplorerTreeItemType.Interface)) { ProfileExplorerTreeItem interfaces = new ProfileExplorerTreeItem("Interfaces", profile.Interfaces, this, includeTypes); if (interfaces.HasChildren) { Children.Add(interfaces); } profile.Interfaces.CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(Interfaces_CollectionChanged); } }
private ProfileExplorerTreeItem(HeliosBinding item, ProfileExplorerTreeItem parent, ProfileExplorerTreeItemType includeTypes) : this(item.Description, "", parent, includeTypes) { _item = item; _itemType = ProfileExplorerTreeItemType.Binding; item.PropertyChanged += Binding_PropertyChanged; }
public ProfileExplorerTreeItem(HeliosProfile profile, ProfileExplorerTreeItemType includeTypes) : this(profile.Name, "", null, includeTypes) { ContextItem = profile; ItemType = ProfileExplorerTreeItemType.Profile; if (includeTypes.HasFlag(ProfileExplorerTreeItemType.Monitor)) { ProfileExplorerTreeItem monitors = new ProfileExplorerTreeItem("Monitors", profile.Monitors, this, includeTypes); if (monitors.HasChildren) { Children.Add(monitors); } profile.Monitors.CollectionChanged += Monitors_CollectionChanged; } if (includeTypes.HasFlag(ProfileExplorerTreeItemType.Interface)) { ProfileExplorerTreeItem interfaces = new ProfileExplorerTreeItem("Interfaces", profile.Interfaces, this, includeTypes); if (interfaces.HasChildren) { Children.Add(interfaces); } profile.Interfaces.CollectionChanged += Interfaces_CollectionChanged; } }
public ProfileExplorerTreeItem(HeliosObject hobj, ProfileExplorerTreeItemType includeTypes) : this(hobj.Name, "", null, includeTypes) { _item = hobj; _itemType = ProfileExplorerTreeItemType.Visual; AddChild(hobj, includeTypes); }
private ProfileExplorerTreeItem(HeliosInterface heliosInterface, ProfileExplorerTreeItem parent, ProfileExplorerTreeItemType includeTypes) : this(heliosInterface.Name, "", parent, includeTypes) { _itemType = ProfileExplorerTreeItemType.Interface; _item = heliosInterface; AddChild(heliosInterface, includeTypes); }
private ProfileExplorerTreeItem(string name, string description, ProfileExplorerTreeItem parent, ProfileExplorerTreeItemType includeTypes) { _parent = new WeakReference(parent); _name = name; _description = description; _itemType = ProfileExplorerTreeItemType.Folder; _includeTypes = includeTypes; _children = new ProfileExplorerTreeItemCollection(); }
private ProfileExplorerTreeItem(string name, HeliosInterfaceCollection interfaces, ProfileExplorerTreeItem parent, ProfileExplorerTreeItemType includeTypes) : this(name, "", parent, includeTypes) { _itemType = ProfileExplorerTreeItemType.Folder; foreach (HeliosInterface heliosInterface in interfaces) { ProfileExplorerTreeItem item = new ProfileExplorerTreeItem(heliosInterface, this, includeTypes); Children.Add(item); } }
private ProfileExplorerTreeItem(string name, MonitorCollection monitors, ProfileExplorerTreeItem parent, ProfileExplorerTreeItemType includeTypes) : this(name, "", parent, includeTypes) { _itemType = ProfileExplorerTreeItemType.Folder; foreach (Monitor monitor in monitors) { ProfileExplorerTreeItem monitorItem = new ProfileExplorerTreeItem(monitor, this, includeTypes); Children.Add(monitorItem); } }
private void LoadItems() { ProfileExplorerItems.Disconnect(); ProfileExplorerItems.Clear(); if (Profile != null) { ProfileExplorerTreeItemType types = ProfileExplorerTreeItemType.Interface | ProfileExplorerTreeItemType.Monitor | ProfileExplorerTreeItemType.Panel; ProfileExplorerTreeItem item = new ProfileExplorerTreeItem(Profile, types); item.ExpandAll(); ProfileExplorerItems = item.Children; } }
private static void LoadSources(BindingsPanel p) { ProfileExplorerTreeItemType triggerTypes = ProfileExplorerTreeItemType.Interface | ProfileExplorerTreeItemType.Monitor | ProfileExplorerTreeItemType.Panel | ProfileExplorerTreeItemType.Visual | ProfileExplorerTreeItemType.Trigger; ProfileExplorerTreeItemType actionTypes = ProfileExplorerTreeItemType.Interface | ProfileExplorerTreeItemType.Monitor | ProfileExplorerTreeItemType.Panel | ProfileExplorerTreeItemType.Visual | ProfileExplorerTreeItemType.Action; if (p.BindingObject != null) { if (p.BindingObject.Profile != p._actionTriggerProfile) { HeliosProfile newProfile = p.BindingObject.Profile; if (p._actionsList != null) { p._actionsList.Disconnect(); } if (p._triggerList != null) { p._triggerList.Disconnect(); } p._actionsList = new ProfileExplorerTreeItem(newProfile, actionTypes); p._triggerList = new ProfileExplorerTreeItem(newProfile, triggerTypes); p._actionTriggerProfile = newProfile; } } if (p.BindingType == BindingPanelType.Input) { if (p._triggerList == null) { p.ProfileExplorerItems = null; } else { p.ProfileExplorerItems = p._triggerList.Children; } } else if (p.BindingType == BindingPanelType.Output) { if (p._actionsList == null) { p.ProfileExplorerItems = null; } else { p.ProfileExplorerItems = p._actionsList.Children; } } }
private ProfileExplorerTreeItem(IBindingTrigger item, ProfileExplorerTreeItem parent, ProfileExplorerTreeItemType includeTypes) : this(item.TriggerName, item.TriggerDescription, parent, includeTypes) { _item = item; _itemType = ProfileExplorerTreeItemType.Trigger; if (includeTypes.HasFlag(ProfileExplorerTreeItemType.Binding)) { foreach (HeliosBinding binding in item.Owner.OutputBindings) { if (binding.Trigger == item) { Children.Add(new ProfileExplorerTreeItem(binding, this, includeTypes)); } } item.Source.OutputBindings.CollectionChanged += Bindings_CollectionChanged; } }
private void LoadSources() { ProfileExplorerTreeItemType triggerTypes = ProfileExplorerTreeItemType.Interface | ProfileExplorerTreeItemType.Monitor | ProfileExplorerTreeItemType.Panel | ProfileExplorerTreeItemType.Visual | ProfileExplorerTreeItemType.Trigger; ProfileExplorerTreeItemType actionTypes = ProfileExplorerTreeItemType.Interface | ProfileExplorerTreeItemType.Monitor | ProfileExplorerTreeItemType.Panel | ProfileExplorerTreeItemType.Visual | ProfileExplorerTreeItemType.Action; if (BindingObject != null) { if (BindingObject.Profile != _actionTriggerProfile) { ClearSources(); HeliosProfile newProfile = BindingObject.Profile; if (newProfile != null) { _actionsList = new ProfileExplorerTreeItem(newProfile, actionTypes); _triggerList = new ProfileExplorerTreeItem(newProfile, triggerTypes); } _actionTriggerProfile = newProfile; } } if (BindingType == BindingPanelType.Input) { if (_triggerList == null) { ProfileExplorerItems = null; } else { ProfileExplorerItems = _triggerList.Children; } } else if (BindingType == BindingPanelType.Output) { if (_actionsList == null) { ProfileExplorerItems = null; } else { ProfileExplorerItems = _actionsList.Children; } } }
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; } }
private void AddChild(HeliosObject hobj, ProfileExplorerTreeItemType includeTypes) { hobj.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(hobj_PropertyChanged); if (includeTypes.HasFlag(ProfileExplorerTreeItemType.Trigger)) { foreach (IBindingTrigger trigger in hobj.Triggers) { AddTrigger(trigger, includeTypes); } hobj.Triggers.CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(Triggers_CollectionChanged); } if (includeTypes.HasFlag(ProfileExplorerTreeItemType.Action)) { foreach (IBindingAction action in hobj.Actions) { AddAction(action, includeTypes); } hobj.Actions.CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(Actions_CollectionChanged); } }
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); } } }
private void AddTrigger(IBindingTrigger trigger, ProfileExplorerTreeItemType includeTypes) { ProfileExplorerTreeItem triggerItem = new ProfileExplorerTreeItem(trigger, this, includeTypes); if (triggerItem.HasChildren || includeTypes.HasFlag(ProfileExplorerTreeItemType.Trigger)) { if (trigger.Device.Length > 0) { if (!HasFolder(trigger.Device)) { Children.Add(new ProfileExplorerTreeItem(trigger.Device, "", this, includeTypes)); } ProfileExplorerTreeItem deviceItem = GetFolder(trigger.Device); triggerItem.Parent = deviceItem; deviceItem.Children.Add(triggerItem); } else { Children.Add(triggerItem); } } }
private void AddTrigger(IBindingTrigger trigger, ProfileExplorerTreeItemType includeTypes) { ProfileExplorerTreeItem triggerItem = new ProfileExplorerTreeItem(trigger, this, includeTypes); if (triggerItem.HasChildren || includeTypes.HasFlag(ProfileExplorerTreeItemType.Trigger)) { if (trigger.Device.Length > 0) { if (!HasFolder(trigger.Device)) { Children.Add(new ProfileExplorerTreeItem(trigger.Device, "", this, includeTypes)); } ProfileExplorerTreeItem deviceItem = GetFolder(trigger.Device); triggerItem.Parent = deviceItem; deviceItem.Children.Add(triggerItem); } else { Children.Add(triggerItem); } } }
public ProfileExplorerTreeItem(HeliosObject hobj, ProfileExplorerTreeItemType includeTypes) : this(hobj.Name, "", null, includeTypes) { _item = hobj; _itemType = ProfileExplorerTreeItemType.Visual; AddChild(hobj, includeTypes); }
private ProfileExplorerTreeItem(string name, HeliosInterfaceCollection interfaces, ProfileExplorerTreeItem parent, ProfileExplorerTreeItemType includeTypes) : this(name, "", parent, includeTypes) { _itemType = ProfileExplorerTreeItemType.Folder; foreach (HeliosInterface heliosInterface in interfaces) { ProfileExplorerTreeItem item = new ProfileExplorerTreeItem(heliosInterface, this, includeTypes); Children.Add(item); } }
private ProfileExplorerTreeItem(string name, string description, ProfileExplorerTreeItem parent, ProfileExplorerTreeItemType includeTypes) { _parent = new WeakReference(parent); _name = name; _description = description; _itemType = ProfileExplorerTreeItemType.Folder; _includeTypes = includeTypes; _children = new ProfileExplorerTreeItemCollection(); }
private ProfileExplorerTreeItem(string name, MonitorCollection monitors, ProfileExplorerTreeItem parent, ProfileExplorerTreeItemType includeTypes) : this(name, "", parent, includeTypes) { _itemType = ProfileExplorerTreeItemType.Folder; foreach (Monitor monitor in monitors) { ProfileExplorerTreeItem monitorItem = new ProfileExplorerTreeItem(monitor, this, includeTypes); Children.Add(monitorItem); } }
private ProfileExplorerTreeItem(HeliosInterface heliosInterface, ProfileExplorerTreeItem parent, ProfileExplorerTreeItemType includeTypes) : this(heliosInterface.Name, "", parent, includeTypes) { _itemType = ProfileExplorerTreeItemType.Interface; _item = heliosInterface; AddChild(heliosInterface, includeTypes); }
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; } }
private ProfileExplorerTreeItem(HeliosVisual visual, ProfileExplorerTreeItem parent, ProfileExplorerTreeItemType includeTypes) : this(visual.Name, "", parent, includeTypes) { if (visual.GetType() == typeof(Monitor)) { _itemType = ProfileExplorerTreeItemType.Monitor; } else if (visual.GetType() == typeof(HeliosPanel)) { _itemType = ProfileExplorerTreeItemType.Panel; } else { _itemType = ProfileExplorerTreeItemType.Visual; } _item = visual; AddChild(visual, includeTypes); foreach (HeliosVisual child in visual.Children) { if ((child is HeliosPanel && _includeTypes.HasFlag(ProfileExplorerTreeItemType.Panel)) || (child is HeliosVisual && _includeTypes.HasFlag(ProfileExplorerTreeItemType.Visual))) { Children.Add(new ProfileExplorerTreeItem(child, this, _includeTypes)); } } visual.Children.CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(VisualChildren_CollectionChanged); }
private ProfileExplorerTreeItem(IBindingTrigger item, ProfileExplorerTreeItem parent, ProfileExplorerTreeItemType includeTypes) : this(item.TriggerName, item.TriggerDescription, parent, includeTypes) { _item = item; _itemType = ProfileExplorerTreeItemType.Trigger; if (includeTypes.HasFlag(ProfileExplorerTreeItemType.Binding)) { foreach (HeliosBinding binding in item.Owner.OutputBindings) { if (binding.Trigger == item) { Children.Add(new ProfileExplorerTreeItem(binding, this, includeTypes)); } } item.Source.OutputBindings.CollectionChanged += Bindings_CollectionChanged; } }
private ProfileExplorerTreeItem(HeliosBinding item, ProfileExplorerTreeItem parent, ProfileExplorerTreeItemType includeTypes) : this(item.Description, "", parent, includeTypes) { _item = item; _itemType = ProfileExplorerTreeItemType.Binding; item.PropertyChanged += Binding_PropertyChanged; }
private void AddChild(HeliosObject hobj, ProfileExplorerTreeItemType includeTypes) { hobj.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(hobj_PropertyChanged); if (includeTypes.HasFlag(ProfileExplorerTreeItemType.Trigger)) { foreach (IBindingTrigger trigger in hobj.Triggers) { AddTrigger(trigger, includeTypes); } hobj.Triggers.CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(Triggers_CollectionChanged); } if (includeTypes.HasFlag(ProfileExplorerTreeItemType.Action)) { foreach (IBindingAction action in hobj.Actions) { AddAction(action, includeTypes); } hobj.Actions.CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(Actions_CollectionChanged); } }
private ProfileExplorerTreeItem(HeliosVisual visual, ProfileExplorerTreeItem parent, ProfileExplorerTreeItemType includeTypes) : this(visual.Name, "", parent, includeTypes) { if (visual.GetType() == typeof(Monitor)) { ItemType = ProfileExplorerTreeItemType.Monitor; } else if (visual.GetType() == typeof(HeliosPanel)) { ItemType = ProfileExplorerTreeItemType.Panel; } else { ItemType = ProfileExplorerTreeItemType.Visual; } ContextItem = visual; AddChild(visual, includeTypes); foreach (HeliosVisual child in visual.Children) { if ((child is HeliosPanel && _includeTypes.HasFlag(ProfileExplorerTreeItemType.Panel)) || (child != null && _includeTypes.HasFlag(ProfileExplorerTreeItemType.Visual))) { Children.Add(new ProfileExplorerTreeItem(child, this, _includeTypes)); } } visual.Children.CollectionChanged += VisualChildren_CollectionChanged; }
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); } } }