Esempio n. 1
0
        /// <summary>
        /// Create a new group in the application
        /// </summary>
        /// <param name="name">name of the group</param>
        /// <param name="description">description of the group</param>
        /// <param name="groupType">type of group</param>
        /// <returns>group in the current application</returns>
        public ApplicationGroup CreateGroup(string name, string description, GroupType groupType)
        {
            Groups.CheckName(name);

            ApplicationGroup g = Locator.Factory.CreateGroup(Key, name, description, groupType, false);

            g.Parent = this;
            Groups.AddValue(g);

            return(g);
        }
Esempio n. 2
0
        /// <summary>
        /// Adds a group to this group
        /// </summary>
        /// <param name="group">Group to add</param>
        public void AddGroup(ApplicationGroup group)
        {
            CheckGroupIsValid(group);
            if (Groups.ContainsKey(group.Key))
            {
                return;
            }

            Instance.AddGroup(group);
            Groups.AddValue(group);
        }
Esempio n. 3
0
        /// <summary>
        /// Add an application group to the store
        /// </summary>
        /// <param name="name">group name. Must not be null or empty</param>
        /// <param name="description">Group description</param>
        /// <param name="groupType">The type of group</param>
        public ApplicationGroup CreateGroup(string name, string description, GroupType groupType)
        {
            if (Instance == null)
            {
                throw new AzException("A store has not been opened.");
            }

            if (string.IsNullOrEmpty(name))
            {
                throw new ArgumentNullException("name", "Name cannot be blank when adding a group.");
            }
            Groups.CheckName(name);

            ApplicationGroup g = Locator.Factory.CreateGroup(Key, name, description, groupType, true);

            g.Store = this;
            Groups.AddValue(g);

            return(g);
        }