public static IList<IVisio.Shape> GetSelectedShapes(IVisio.Selection selection)
 {
     if (selection.Count < 1)
     {
         return new List<IVisio.Shape>(0);
     }
     
     var sel_shapes = selection.AsEnumerable();
     var shapes = sel_shapes.ToList();
     return shapes;
 }
        public static IList<IVisio.Shape> GetSelectedShapesRecursive(IVisio.Selection selection)
        {
            if (selection.Count < 1)
            {
                return new List<IVisio.Shape>(0);
            }

            var shapes = new List<IVisio.Shape>();
            var sel_shapes = selection.AsEnumerable();
            foreach (var shape in Shapes.ShapeHelper.GetNestedShapes(sel_shapes))
            {
                if (shape.Type != (short)IVisio.VisShapeTypes.visTypeGroup)
                {
                    shapes.Add(shape);
                }
            }
            return shapes;
        }