private IEnumerable <IOguObject> groupControl_GetChildren(UserOUGraphControl treeControl, IOguObject parent)
        {
            IEnumerable <IOguObject> result = null;

            if (parent is IOrganization)
            {
                result = ((IOrganization)parent).Children;
            }
            else
            {
                List <IOguObject> resultList = new List <IOguObject>();

                if (parent is IGroup)
                {
                    foreach (IUser user in ((IGroup)parent).Members)
                    {
                        resultList.Add(OguBase.CreateWrapperObject(user));
                    }

                    result = resultList;
                }

                result = resultList;
            }

            return(result);
        }
 protected void InnerOuUserGraphControl_TargetControlLoaded(Control targetControl)
 {
     if (targetControl is UserOUGraphControl && targetControl.ID.IndexOf(this.ClientID) > 0)
     {
         UserOUGraphControl userOUGraph = (UserOUGraphControl)targetControl;
         userOUGraph.ObjectsLoaded += new OuUserObjectsLoadedHandler(OnObjectsLoaded);
     }
 }
        private void groupControl_LoadingObjectToTreeNode(UserOUGraphControl treeControl, IOguObject oguObj, DeluxeTreeNode newTreeNode, ref bool cancel)
        {
            if ((oguObj is IUser) == false)
            {
                newTreeNode.ChildNodesLoadingType = ChildNodesLoadingTypeDefine.LazyLoading;

                if (oguObj is IGroup)
                {
                    IGroup group = (IGroup)oguObj;

                    int count = GroupMemberSelectedCount(group, treeControl.SelectedOuUserData);

                    if (count > 0 && group.Members.Count == count)
                    {
                        newTreeNode.Checked = true;
                        treeControl.SelectedOuUserData.Add(group);
                    }
                }
            }
            else
            {
                OguUser user = (OguUser)oguObj;

                StringBuilder strB = new StringBuilder();

                foreach (IGroup group in user.MemberOf)
                {
                    if (strB.Length > 0)
                    {
                        strB.Append(",");
                    }

                    strB.Append(group.ID);
                }

                user.Tag = strB.ToString();
            }

            newTreeNode.ShowCheckBox = true;
        }