Esempio n. 1
0
        void itemAddFile_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            InputBox dialog = new InputBox();
            if ((bool)dialog.ShowDialog())
            {
                Source file = new Source(this) { Name = dialog.Content, Path = "/" + dialog.Content + ".snl" };
                System.IO.File.Create(Path + file.Path).Close();
                Items.Add(file);

                Save();
                ProjectManager.GetManager().ProjectUpdated();
            }
        }
Esempio n. 2
0
        private FileItem ParseProject(XElement elem, Project project)
        {
            if (elem.Name == "Folder")
            {
                Folder folder = new Folder(project)
                {
                    Name = elem.Attribute("Name").Value,
                    Path = elem.Attribute("Path").Value,
                    UUID = Guid.Parse(elem.Attribute("UUID").Value)
                };

                foreach (var u in elem.Elements())
                {
                    folder.Items.Add(ParseProject(u, project));
                }

                return folder;
            }
            else if (elem.Name == "File")
            {
                Source source = new Source(project)
                {
                    Name = elem.Attribute("Name").Value,
                    Path = elem.Attribute("Path").Value,
                    UUID = Guid.Parse(elem.Attribute("UUID").Value)
                };
                return source;
            }
            else
            {
                throw new Exception("Illegal Node");
            }
        }
Esempio n. 3
0
 public void Close(Source file)
 {
     lstOpenedFiles.Remove(file);
     _UpdateOpenedFiles();
 }
Esempio n. 4
0
 public void Open(Source file)
 {
     lstOpenedFiles.Add(file);
     _UpdateOpenedFiles();
 }