or flat pipes (photo B) (sounds strange, but some do!)
you can attach your foam board to either.
If you are not getting too fancy (ie: putting up shelving or hanging anything that is heavy to the foam board) the quickest way to attach your foamboard to the pipes is using heavy duty sticky velcro tape.
I love this stuff! But remember, it is STICKY! You won't be able to re-stick it on your foam board once you have stuck it, you get one chance for this only!
You can buy this at hardware stores or even some office supply stores, I go to http://www.homedepot.com/ or http://www.lowes.com/ usually. It has 2 parts to it that "Velcro" together, one strip will stick to the other, and both strips have sticky outsides. Simply take a good sized piece of it, stick it to the back of your foam board up close to the top edge (but not over the edge, still on the back), peel off the other side and stick it right to the pole/drape/curtain...whatever it is. Presto, your wall is up! I know right? so simple!...