# HG changeset patch # User cavaliet # Date 1258997787 -3600 # Node ID 90d2be5c3d39a3119517b74eb9a1de499e18661e # Parent 498d80458a0fe946621701a61fa3bf61a4497863 commit with changes for real table file management diff -r 498d80458a0f -r 90d2be5c3d39 src/FingersDance.Control.Screen/UserControlScreen.xaml.cs --- a/src/FingersDance.Control.Screen/UserControlScreen.xaml.cs Mon Nov 23 17:14:24 2009 +0100 +++ b/src/FingersDance.Control.Screen/UserControlScreen.xaml.cs Mon Nov 23 18:36:27 2009 +0100 @@ -120,10 +120,12 @@ { // We get all the ldt/project files from the current directory... List existingProjects = new List(); - foreach (String filename in Directory.GetFiles("./")) + String path = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); + String ext = ".ldt"; + foreach (String filename in Directory.GetFiles(path)) { - if (filename.Substring(filename.Length-4).ToLower()==".ldt") - existingProjects.Add(filename.Substring(2, filename.Length - 6)); + if (filename.Substring(filename.Length-4).ToLower()==ext) + existingProjects.Add(filename.Substring(path.Length + 1, filename.Length - ext.Length - path.Length - 1)); } // ... and display them the the select box UserControlListProject UserControlListProject listProject = new UserControlListProject(existingProjects, AnnotationOrSearchMode); @@ -155,7 +157,8 @@ { // ((UserControlListProject)sender).SelectedItem is the name of the selected project // Now we load the xml/ldt file to load all its datas (cuttings, annotations...) - XDocument loadedLdt = XDocument.Load(((UserControlListProject)sender).SelectedItem + ".ldt"); + String path = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "/" + ((UserControlListProject)sender).SelectedItem + ".ldt"; + XDocument loadedLdt = XDocument.Load(path); Project loadedProject = new Project(videoName, _mainViewModel.Project.VideoPath); // we use this video in the case an other panel was in search mode before annotation mode loadedProject.Name = loadedLdt.Root.Element("project").Attribute("title").Value; loadedProject.Description = loadedLdt.Root.Element("project").Attribute("abstract").Value; diff -r 498d80458a0f -r 90d2be5c3d39 src/FingersDance/MainSurfaceWindow.xaml.cs --- a/src/FingersDance/MainSurfaceWindow.xaml.cs Mon Nov 23 17:14:24 2009 +0100 +++ b/src/FingersDance/MainSurfaceWindow.xaml.cs Mon Nov 23 18:36:27 2009 +0100 @@ -598,7 +598,8 @@ d.Declaration = new XDeclaration("1.0", "utf-8", "true"); //Console.WriteLine(d); - d.Save(_mainviewmodel.Project.Name + ".ldt"); + String path = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "/" + _mainviewmodel.Project.Name + ".ldt"; + d.Save(path); }