/// <summary>
		/// Remove a <see cref="ConfigurationUICommand"/> for a particular <see cref="Type"/>.
		/// </summary>
		/// <param name="type">The <see cref="Type"/> the command applies.</param>
		/// <param name="command">The <see cref="ConfigurationUICommand"/> to Remove.</param>
		public void RemoveCommand(Type type, ConfigurationUICommand command)
		{
            HierarchyAndType hierarchyAndType = new HierarchyAndType(hierarchyService.SelectedHierarchy, type);
            if (!list.ContainsKey(hierarchyAndType)) return;
            List<ConfigurationUICommand> commands = list[hierarchyAndType];
			commands.Remove(command);
		}
		/// <summary>
		/// Add a <see cref="ConfigurationUICommand"/> for a particular <see cref="Type"/>.
		/// </summary>
		/// <param name="type">The <see cref="Type"/> the command applies.</param>
		/// <param name="command">The <see cref="ConfigurationUICommand"/> to add.</param>
		public void AddCommand(Type type, ConfigurationUICommand command)
		{
            HierarchyAndType hierarchyAndType = new HierarchyAndType(hierarchyService.SelectedHierarchy, type);
            if (!list.ContainsKey(hierarchyAndType)) list.Add(hierarchyAndType, new List<ConfigurationUICommand>());
            List<ConfigurationUICommand> commands = list[hierarchyAndType];
			commands.Add(command);
		}
Example #3
0
 /// <summary>
 /// Performs the specified action on each item.
 /// </summary>		
 /// <param name="type">The <see cref="Type"/> the command applies.</param>
 /// <param name="action">The Action to perform on each element.</param>
 public void ForEach(Type type, Action<ConfigurationUICommand> action)
 {
     HierarchyAndType hierarchyAndType = new HierarchyAndType(hierarchyService.SelectedHierarchy, type);
     if (!list.ContainsKey(hierarchyAndType)) return;
     List<ConfigurationUICommand> commands = list[hierarchyAndType];
     for (int index = 0; index < commands.Count; index++)
     {
         action(commands[index]);
     }
 }
        /// <summary>
        /// Remove a <see cref="ConfigurationUICommand"/> for a particular <see cref="Type"/>.
        /// </summary>
        /// <param name="type">The <see cref="Type"/> the command applies.</param>
        /// <param name="command">The <see cref="ConfigurationUICommand"/> to Remove.</param>
        public void RemoveCommand(Type type, ConfigurationUICommand command)
        {
            HierarchyAndType hierarchyAndType = new HierarchyAndType(hierarchyService.SelectedHierarchy, type);

            if (!list.ContainsKey(hierarchyAndType))
            {
                return;
            }
            List <ConfigurationUICommand> commands = list[hierarchyAndType];

            commands.Remove(command);
        }
        /// <summary>
        /// Add a <see cref="ConfigurationUICommand"/> for a particular <see cref="Type"/>.
        /// </summary>
        /// <param name="type">The <see cref="Type"/> the command applies.</param>
        /// <param name="command">The <see cref="ConfigurationUICommand"/> to add.</param>
        public void AddCommand(Type type, ConfigurationUICommand command)
        {
            HierarchyAndType hierarchyAndType = new HierarchyAndType(hierarchyService.SelectedHierarchy, type);

            if (!list.ContainsKey(hierarchyAndType))
            {
                list.Add(hierarchyAndType, new List <ConfigurationUICommand>());
            }
            List <ConfigurationUICommand> commands = list[hierarchyAndType];

            commands.Add(command);
        }
        /// <summary>
        /// Performs the specified action on each item.
        /// </summary>
        /// <param name="type">The <see cref="Type"/> the command applies.</param>
        /// <param name="action">The Action to perform on each element.</param>
        public void ForEach(Type type, Action <ConfigurationUICommand> action)
        {
            HierarchyAndType hierarchyAndType = new HierarchyAndType(hierarchyService.SelectedHierarchy, type);

            if (!list.ContainsKey(hierarchyAndType))
            {
                return;
            }
            List <ConfigurationUICommand> commands = list[hierarchyAndType];

            for (int index = 0; index < commands.Count; index++)
            {
                action(commands[index]);
            }
        }