public static List <OrganizationInfo> GetParents(string id)
        {
            List <OrganizationInfo> ret    = new List <OrganizationInfo>();
            OrganizationInfo        parent = null;

            Parents.TryGetValue(id, out parent);
            while (parent != null)
            {
                ret.Add(parent);
                Parents.TryGetValue(parent.Id, out parent);
            }

            ret.Reverse();
            return(ret);
        }
        private static List <OrganizationInfo> Parse()
        {
            List <OrganizationInfo> ret = new List <OrganizationInfo>(360);

            string[] lines   = Raw.Split('\r', '\n');
            int[]    indexes = new int[4];
            foreach (string line in lines)
            {
                var copy = line.Trim();
                if (copy.Length == 0)
                {
                    continue;
                }

                int preSpaces = 0;
                foreach (var ch in line)
                {
                    if (ch != ' ')
                    {
                        break;
                    }
                    preSpaces++;
                }


                int level = -1;
                if (preSpaces == 0)
                {
                    level = 0;
                }
                else if (preSpaces == 2)
                {
                    level = 1;
                }
                else if (preSpaces == 4)
                {
                    level = 2;
                }
                else if (preSpaces == 8)
                {
                    level = 3;
                }
                else
                {
                    throw new InvalidOperationException("Raw Organizations tree is corrupted");
                }

                indexes[level]++;
                StringBuilder id = new StringBuilder();
                for (int i = 0; i <= level; i++)
                {
                    id.Append(Counter2Id(indexes[i]));
                }

                StringBuilder idParent = new StringBuilder();
                for (int i = 0; i < level; i++)
                {
                    idParent.Append(Counter2Id(indexes[i]));
                }

                Debug.WriteLine(string.Format("{0} ({1}): {2}", id, level, copy));
                OrganizationInfo org = new OrganizationInfo();
                org.Id       = id.ToString();
                org.IdParent = idParent.Length == 0 ? null : idParent.ToString();
                org.Name     = copy.TrimEnd(';');
                ret.Add(org);
            }

            // IsLeaf & IsGroup
            Parents = new Dictionary <string, OrganizationInfo>();
            foreach (var org in ret)
            {
                org.IsLeaf = true;
                string prefix = org.Id + "/";
                foreach (var other in ret)
                {
                    if (other.Id.StartsWith(prefix))
                    {
                        org.IsLeaf    = false;
                        other.IsGroup = true;
                        break;
                    }
                }

                foreach (var other in ret)
                {
                    if (other.Id == org.IdParent)
                    {
                        Parents[org.Id] = other;
                        break;
                    }
                }
            }

            return(ret);
        }