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);
            }
        }
Пример #2
0
        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);
        }
Пример #4
0
        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;
            }
        }
Пример #5
0
        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;
        }
        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(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(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;
            }
        }
        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);
                }
            }
        }
Пример #11
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);
                }
            }
        }
Пример #12
0
        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);
                }
            }
        }
Пример #13
0
        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);
            }
        }
Пример #14
0
        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;
            }
        }
Пример #15
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;                
            }
        }