/// <summary> /// Gets the tag group with the specified name /// </summary> /// <param name="GroupName">Name of the group to get. This is case sensitive.</param> /// <returns>LogixTagGroup reference</returns> /// <exception cref="GroupNotFoundException">Thrown when the requested group is not found.</exception> public LogixTagGroup GetTagGroup(string GroupName) { LogixTagGroup retGroup = null; if (!_tagGroups.TryGetValue(GroupName, out retGroup)) { throw new GroupNotFoundException(Resources.ErrorStrings.GroupNotFound); } return(retGroup); }
/// <summary> /// Creates a LogixTagGroup on this processor /// </summary> /// <param name="GroupName">Name of the group to create</param> /// <returns><see cref="LogixTagGroup"/> with the specified group name</returns> /// <exception cref="GroupAlreadyExistsException">Raised when trying to add a group that already exists</exception> public LogixTagGroup CreateTagGroup(string GroupName) { //First verify that the group doesn't exist if (_tagGroups.ContainsKey(GroupName)) { throw new GroupAlreadyExistsException(Resources.ErrorStrings.GroupExists); } LogixTagGroup newGroup = new LogixTagGroup(this, GroupName); _tagGroups.Add(GroupName, newGroup); return(newGroup); }