Today I found a few minutes to work on it. I have the XML serializing now and layout pretty much done.
While I've done this trick countless times, I always seem to forget it with CSS and floating images. So on my blog, I have images I float to the right in blog posts. By having an overflow: auto on the wrapper div that the image is busting out of, it automatically resizes it to the proper height.
Here is one of the CS files along with the updated XML. I'm not sure if I like the Portfolio File Varient structure though.
using System;
using System.IO;
using System.Xml.Serialization;
namespace CodePortfolio
{
[Serializable]
public class PortfolioFileVarient
{
[XmlAttribute("language")]
public string Language { get; set; }
[XmlAttribute("fileName")]
public string FileName { get; set; }
[XmlAttribute("imageUrl")]
public string ImageUrl { get; set; }
internal void prepFilesPaths(string RootPath, string RelativeFilePath, string ParentPath, string SubPath)
{
string tempPath = string.Empty;
if (!string.IsNullOrEmpty(SubPath))
tempPath = SubPath;
if (!string.IsNullOrEmpty(ParentPath))
tempPath = Path.Combine(ParentPath, tempPath);
if (!string.IsNullOrEmpty(RelativeFilePath))
tempPath = Path.Combine(RelativeFilePath, tempPath);
if (!string.IsNullOrEmpty(RootPath))
{
_serverFilePath = Path.Combine(RootPath, Path.Combine(tempPath, FileName));
_fileExists = File.Exists(_serverFilePath);
}
if (!string.IsNullOrEmpty(ImageUrl))
ImageUrl = Path.Combine(tempPath, ImageUrl);
_url = Path.Combine(tempPath, FileName);
}
public bool FileExists { get { return _fileExists; } }
private bool _fileExists;
public string URL { get { return _url; } }
private string _url;
public string ServerFilePath { get { return _serverFilePath; } }
private string _serverFilePath;
}
}
And the XML file I'm using for the data source.
<?xml version="1.0" encoding="utf-8" ?>
<portfolio rootFilePath="code" useServerMapPath="true">
<items>
<item relativeSubFilePath="test1">
<title>test 1</title>
<description>ipod</description>
<imageUrl>test.jpg</imageUrl>
<files>
<file major="1" minor="2" build="3" revision="4" relativeFinalSubFilePath="version1">
<varients>
<varient language="vb" fileName="vbFile1.zip" />
<varient language="c#" fileName="cSharpFile1.zip" />
</varients>
</file>
</files>
</item>
<item>
<title>Test 2</title>
<description>ipod</description>
<imageUrl>test.jpg</imageUrl>
<files>
<file major="2" minor="3" build="4" revision="5" imageUrl="test.jpg">
<varients>
<varient language="vb" fileName="vbFile2.zip" />
<varient language="c#" fileName="cSharpFile2.zip" />
</varients>
</file>
<file major="1" minor="2" build="3" revision="4">
<varients>
<varient language="vb" fileName="vbFile3.zip" />
<varient language="c#" fileName="cSharpFile3.zip" />
</varients>
</file>
</files>
</item>
</items>
</portfolio>