10.07.2015 Views

pdf - 395 K - Ecole des mines de Nantes

pdf - 395 K - Ecole des mines de Nantes

pdf - 395 K - Ecole des mines de Nantes

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

public static readonly string TABLE_NAME = "UPNo<strong>de</strong>";private static DataTable table;// SqlDataAdapterprivate static SqlDataAdapter adapter;// Column namesinternal static readonly string ID = "i<strong>de</strong>ntifier";internal static readonly string RESOURCE = "resourceId";internal static readonly string UP = "UP";// Relationprivate static DataRelation ToLinks;public static void Cleanup(SqlConnection connection){UPLink.Cleanup(connection);DataUtilities.CleanupTable(connection, TABLE_NAME);}resource)/// /// Creates new No<strong>de</strong> data./// /// internal static UPNo<strong>de</strong> CreateNo<strong>de</strong>(UP profile, ResourceId{}Debug.Assert(profile != null && resource != null);// No<strong>de</strong> should not exist alreadyGuid _id = Guid.NewGuid();DataRow row = Data.NewRow();row[ID] = _id;row[RESOURCE] = resource.Name;row[UP] = profile.User.IPAddress;lock(Data) {Data.Rows.Add(row);}return new UPNo<strong>de</strong>(_id);internal static DataTable Data{get{return table;}}public static void Initialize(DataSet dataSet, SqlConnectionconnection){UPLink.Initialize(dataSet, connection);adapter = DataUtilities.InitializeTable(dataSet,connection, TABLE_NAME);table = dataSet.Tables[TABLE_NAME];// Create relationToLinks =table.DataSet.Relations.Add("UpNo<strong>de</strong>_To_UpLinks",table.Columns[ID],UPLink.Data.Columns[UPLink.ORIGIN],false);}public static void Update(){UPLink.Update();MSc EMOOSE Thesis – http://www.emn.fr/EMOOSE 118

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!