Permalink
Browse files

updated exhibitors to be serialized as part of conference.

  • Loading branch information...
Brian Kim
Brian Kim committed Jan 26, 2012
1 parent d735a38 commit 314276dc52fbdc941611de18d36ea8b1150b05d7
@@ -12,15 +12,14 @@ public Conference()
{
Speakers = new List<Speaker>();
Sessions = new List<Session>();
- //Exhibitors = new List<Exhibitor>();
+ Exhibitors = new List<Exhibitor>();
}
[XmlElement("se")]
public List<Session> Sessions { get; set; }
[XmlElement("sp")]
public List<Speaker> Speakers { get; set; }
- //[XmlElement("ex")]
- //[XmlIgnore]
- //public List<Exhibitor> Exhibitors { get; set; }
+ [XmlElement("ex")]
+ public List<Exhibitor> Exhibitors { get; set; }
}
}
@@ -42,7 +42,6 @@
<ItemGroup>
<Compile Include="BL\Conference.cs" />
<Compile Include="BL\Exhibitor.cs" />
- <Compile Include="BL\Exhibitors.cs" />
<Compile Include="BL\Session.cs" />
<Compile Include="BL\Speaker.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
@@ -17,14 +17,9 @@ public class ParserApp
public void WriteConferenceXML(string path)
{
if(parseItems == "sessions" || parseItems == "both")
- {
- DoSessions(path);
- }
+ { DoSessions(path); }
if(parseItems == "exhibitors" || parseItems == "both")
- {
- DoExhibitors(path);
- }
-
+ { DoExhibitors(path); }
}
private void DoSessions(string path)
@@ -54,14 +49,14 @@ private void DoExhibitors(string path)
bool doPartial = parseMode == "partial";
Console.WriteLine("Getting exhibitors");
- Exhibitors exhibitors = new Exhibitors();
- exhibitors.Items = ExhibitorManager.GetExhibitorList(doPartial);
- Console.WriteLine(string.Concat(exhibitors.Items.Count, " exhibitors"));
+ Conference conf = new Conference();
+ conf.Exhibitors = ExhibitorManager.GetExhibitorList(doPartial);
+ Console.WriteLine(string.Concat(conf.Exhibitors.Count, " exhibitors"));
Console.WriteLine("Writing output");
using(TextWriter tw = File.CreateText(Path.Combine(path, "Exhibitors.xml")))
{
- XmlSerializer serializer = new XmlSerializer(typeof(Exhibitors));
- serializer.Serialize(tw, exhibitors);
+ XmlSerializer serializer = new XmlSerializer(typeof(Conference));
+ serializer.Serialize(tw, conf);
}
using(TextWriter tw = File.CreateText(Path.Combine(path, "Exhibitors.html")))
@@ -2,7 +2,7 @@
<configuration>
<appSettings>
<add key="outputPath" value="c:\temp\parser"/>
- <add key="parseMode" value="full"/><!--"partial" or "full"-->
- <add key="parseItems" value="exhibitors"/><!--"sessions" or "exhibitors" or "both"-->
+ <add key="parseMode" value="partial"/><!--"partial" or "full"-->
+ <add key="parseItems" value="both"/><!--"sessions" or "exhibitors" or "both"-->
</appSettings>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>

0 comments on commit 314276d

Please sign in to comment.