DataContainer.cs

00001 using System;
00002 using System.Collections.Generic;
00003 using System.Text;
00004 using System.Data;
00005 
00006 namespace Server.Data
00007 {
00011     public class DataContainer
00012     {
00013         private Dictionary<int, Project> projectTable;
00014         private Dictionary<int, Literature> literatureTable;
00015         private Dictionary<int, Comment> commentTable;
00016         private Dictionary<string, Person> personTable;
00017         private DataTable tags = new DataTable();
00018 
00022         public DataContainer()
00023         {
00024             projectTable = new Dictionary<int, Project>();
00025             literatureTable = new Dictionary<int, Literature>();
00026             personTable = new Dictionary<string, Person>();
00027             commentTable = new Dictionary<int, Comment>();
00028             tags = CreateEmptyTagTable();
00029         }
00030 
00038         public DataContainer(Dictionary<int, Project> projectTable,
00039                     Dictionary<int, Literature> literatureTable,
00040                     Dictionary<int, Comment> commentTable,
00041                     Dictionary<string, Person> personTable, 
00042                     DataTable tags
00043                     )
00044         {
00045             this.projectTable = projectTable;
00046             this.literatureTable = literatureTable;
00047             this.personTable = personTable;
00048             this.commentTable = commentTable;
00049             this.tags = tags;
00050 
00051         }
00052 
00057         public static DataTable CreateEmptyTagTable()
00058         {
00059             DataTable tags = new DataTable();
00060             tags.Columns.Add("Tag", typeof(string));
00061             tags.Columns.Add("ID", typeof(int));
00062             tags.Columns.Add("UserName", typeof(string));
00063             tags.PrimaryKey = new DataColumn[] { tags.Columns[0], tags.Columns[1], tags.Columns[2] };
00064             return tags;
00065         }
00069         public Dictionary<int, Project> ProjectTable
00070         {
00071             get { return projectTable; }
00072         }
00073 
00077         public Dictionary<int, Literature> LiteratureTable
00078         {
00079             get { return literatureTable; }
00080         }
00081 
00085         public Dictionary<int, Comment> CommentTable
00086         {
00087             get { return commentTable; }
00088         }
00089 
00090 
00094         public Dictionary<string, Person> PersonTable
00095         {
00096             get { return personTable; }
00097         }
00098         
00102         public DataTable Tags
00103         {
00104             get { return tags; }
00105         }
00106 
00107         }
00108 }

Generated on Thu Dec 21 06:21:56 2006 for SCRAML by  doxygen 1.5.1-p1