Exemplo n.º 1
0
        /// <summary>
        /// Creates the cell path for the given cell. The cell path is a
        /// concatenation of the indices of all cells on the (finite) path to
        /// the root, eg. "0.0.0.1".
        /// </summary>
        /// <param name="cell">Cell whose path should be returned.</param>
        /// <returns>Returns the string that represents the path.</returns>
        public static string Create(mxICell cell)
        {
            string  result = "";
            mxICell parent = cell.Parent;

            while (parent != null)
            {
                int index = parent.GetIndex(cell);
                result = index.ToString() + mxCellPath.PATH_SEPARATOR + result;

                cell   = parent;
                parent = cell.Parent;
            }

            return((result.Length > 1) ? result.Substring(0, result.Length - 1)
                    : "");
        }