csImb.csImb.JoinGroup C# (CSharp) Method

JoinGroup() public method

public JoinGroup ( csGroup ng ) : void
ng csGroup
return void
        public void JoinGroup(csGroup ng) {
            if (ng == null) return;
            if ((ActiveGroup != null) && (ActiveGroup.Name == ng.Name)) return; // Already member of group
            foreach (var g in Groups.Where(k => k.IsMemberOfGroup && k.Name != ng.Name)) 
            {
                LeaveGroup(g, false);
            }
            ActiveGroup = ng;
            if (!ng.IsMemberOfGroup)
            {
                ng.InitImb();
                LogCs.LogMessage("Joined IMB group '{0}'", ng.Name);
                AppState.TriggerNotification("You joined " + ng.Name, pathData: MenuHelpers.GroupIcon);
            }
        }