Opc.Ua.Com.Server.ComDaGroupManager.SetGroupName C# (CSharp) Method

SetGroupName() public method

Sets the name.
public SetGroupName ( ComDaGroup group, string groupName ) : void
group ComDaGroup The group.
groupName string Name of the group.
return void
        public void SetGroupName(ComDaGroup group, string groupName)
        {
            TraceState("SetGroupName", group.Name, groupName);

            if (String.IsNullOrEmpty(groupName))
            {
                throw ComUtils.CreateComException(ResultIds.E_INVALIDARG);
            }

            lock (m_lock)
            {
                for (int ii = 0; ii < m_groups.Count; ii++)
                {
                    ComDaGroup target = m_groups[ii];

                    if (target.ServerHandle != group.ServerHandle && target.Name == groupName)
                    {
                        throw ComUtils.CreateComException(ResultIds.E_DUPLICATENAME);
                    }

                    group.Name = groupName;
                }
            }
        }